public static NEP5LedgerEntry Get(string key) { if (key.Length == 0) { return(Null()); } Neo.SmartContract.Framework.Services.Neo.StorageContext ctx = Neo.SmartContract.Framework.Services.Neo.Storage.CurrentContext; string _skeyTag = key + _classKeyTag; NEP5LedgerEntry e; byte[] bsta = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, _skeyTag + _sSTA); if (NeoTrace.RUNTIME) { TraceRuntime("Get(skey).NEP5LedgerEntry.bsta", bsta.Length, bsta); } if (bsta.Length == 0) { e = NEP5LedgerEntry.Missing(); } else // not MISSING { int ista = (int)bsta.AsBigInteger(); NeoEntityModel.EntityState sta = (NeoEntityModel.EntityState)ista; e = new NEP5LedgerEntry(); BigInteger Timestamp = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, _skeyTag + _sTimestamp).AsBigInteger(); //NPCLevel2IGet_cs.txt string Decription = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, _skeyTag + _sDecription).AsString(); //NPCLevel2IGet_cs.txt BigInteger DebitCreditAmount = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, _skeyTag + _sDebitCreditAmount).AsBigInteger(); //NPCLevel2IGet_cs.txt BigInteger Balance = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, _skeyTag + _sBalance).AsBigInteger(); //NPCLevel2IGet_cs.txt if (NeoTrace.RUNTIME) { TraceRuntime("Get(skey).e._timestamp, e._decription, e._debitCreditAmount, e._balance", e._timestamp, e._decription, e._debitCreditAmount, e._balance); // Template: NPCLevel2Part2_cs.txt } e._timestamp = Timestamp; e._decription = Decription; e._debitCreditAmount = DebitCreditAmount; e._balance = Balance; e._state = sta; e._state = NeoEntityModel.EntityState.GETTED; /* OVERRIDE */ } if (NeoTrace.RUNTIME) { LogExt("Get(skey).NEP5LedgerEntry", e); } return(e); }
public static NEP5LedgerEntry Get(byte[] key) { if (key.Length == 0) { return(Null()); } Neo.SmartContract.Framework.Services.Neo.StorageContext ctx = Neo.SmartContract.Framework.Services.Neo.Storage.CurrentContext; byte[] _bkeyTag = Helper.Concat(key, _bclassKeyTag); NEP5LedgerEntry e; byte[] bsta = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, Helper.Concat(_bkeyTag, _bSTA)); if (NeoTrace.RUNTIME) { TraceRuntime("Get(bkey).bsta", bsta.Length, bsta); } if (bsta.Length == 0) { e = NEP5LedgerEntry.Missing(); } else // not MISSING { int ista = (int)bsta.AsBigInteger(); NeoEntityModel.EntityState sta = (NeoEntityModel.EntityState)ista; e = new NEP5LedgerEntry(); BigInteger Timestamp = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, Helper.Concat(_bkeyTag, _bTimestamp)).AsBigInteger(); //NPCLevel2GGet_cs.txt string Decription = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, Helper.Concat(_bkeyTag, _bDecription)).AsString(); //NPCLevel2GGet_cs.txt BigInteger DebitCreditAmount = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, Helper.Concat(_bkeyTag, _bDebitCreditAmount)).AsBigInteger(); //NPCLevel2GGet_cs.txt BigInteger Balance = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, Helper.Concat(_bkeyTag, _bBalance)).AsBigInteger(); //NPCLevel2GGet_cs.txt e._timestamp = Timestamp; e._decription = Decription; e._debitCreditAmount = DebitCreditAmount; e._balance = Balance; // Template: NPCLevel2HGet_cs.txt e._state = sta; e._state = NeoEntityModel.EntityState.GETTED; /* OVERRIDE */ } if (NeoTrace.RUNTIME) { LogExt("Get(bkey).NEP5LedgerEntry", e); } return(e); }