public static NeoCounter 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);

            NeoCounter e;

            byte[] bsta = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, Helper.Concat(_bkeyTag, _bSTA));
            NeoTrace.Trace("Get(bkey).bsta", bsta.Length, bsta);
            if (bsta.Length == 0)
            {
                e = NeoCounter.Missing();
            }
            else // not MISSING
            {
                byte[] bext = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, Helper.Concat(_bkeyTag, _bEXT));
                int    ista = (int)bsta.AsBigInteger();
                NeoEntityModel.EntityState sta = (NeoEntityModel.EntityState)ista;
                e = new NeoCounter();

                BigInteger CurrentNumber = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, Helper.Concat(_bkeyTag, _bCurrentNumber)).AsBigInteger(); //NPCLevel2GGet_cs.txt
                e._currentNumber = CurrentNumber;                                                                                                              // Template: NPCLevel2HGet_cs.txt
                e._state         = sta;
                e._state         = NeoEntityModel.EntityState.GETTED;                                                                                          /* OVERRIDE */
            }
            LogExt("Get(bkey).NeoCounter", e);
            return(e);
        }
        public static UserPoint 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;

            UserPoint e;

            byte[] bsta = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, _skeyTag + _sSTA);
            NeoTrace.Trace("Get(skey).UserPoint.bsta", bsta.Length, bsta);
            if (bsta.Length == 0)
            {
                e = UserPoint.Missing();
            }
            else // not MISSING
            {
                byte[] bext = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, _skeyTag + _sEXT);
                int    ista = (int)bsta.AsBigInteger();
                NeoEntityModel.EntityState sta = (NeoEntityModel.EntityState)ista;
                e = new UserPoint();

                BigInteger X = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, _skeyTag + _sX).AsBigInteger(); //NPCLevel2IGet_cs.txt
                BigInteger Y = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, _skeyTag + _sY).AsBigInteger(); //NPCLevel2IGet_cs.txt
                NeoTrace.Trace("Get(skey).e._x, e._y", e._x, e._y);                                                      // Template: NPCLevel2Part2_cs.txt
                e._x     = X; e._y = Y;
                e._state = sta;
                e._state = NeoEntityModel.EntityState.GETTED; /* OVERRIDE */
            }
            LogExt("Get(skey).UserPoint", e);
            return(e);
        }
Esempio n. 3
0
        public static Line 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;

            Line e;

            byte[] bsta = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, _skeyTag + _sSTA);
            NeoTrace.Trace("Get(skey).Line.bsta", bsta.Length, bsta);
            if (bsta.Length == 0)
            {
                e = Line.Missing();
            }
            else // not MISSING
            {
                byte[] bext = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, _skeyTag + _sEXT);
                int    ista = (int)bsta.AsBigInteger();
                NeoEntityModel.EntityState sta = (NeoEntityModel.EntityState)ista;
                e = new Line();

                byte[] BKeyP1 = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, _skeyTag + _sBKeyP1); //NPCLevel2IGet_cs.txt
                byte[] BKeyP2 = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, _skeyTag + _sBKeyP2); //NPCLevel2IGet_cs.txt
                NeoTrace.Trace("Get(skey).e._bKeyP1, e._bKeyP2", e._bKeyP1, e._bKeyP2);                         // Template: NPCLevel2Part2_cs.txt
                e._bKeyP1 = BKeyP1; e._bKeyP2 = BKeyP2;
                e._state  = sta;
                e._state  = NeoEntityModel.EntityState.GETTED; /* OVERRIDE */
            }
            LogExt("Get(skey).Line", e);
            return(e);
        }
        public static NeoCounter 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;

            NeoCounter e;

            byte[] bsta = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, _skeyTag + _sSTA);
            NeoTrace.Trace("Get(skey).NeoCounter.bsta", bsta.Length, bsta);
            if (bsta.Length == 0)
            {
                e = NeoCounter.Missing();
            }
            else // not MISSING
            {
                byte[] bext = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, _skeyTag + _sEXT);
                int    ista = (int)bsta.AsBigInteger();
                NeoEntityModel.EntityState sta = (NeoEntityModel.EntityState)ista;
                e = new NeoCounter();

                BigInteger CurrentNumber = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, _skeyTag + _sCurrentNumber).AsBigInteger(); //NPCLevel2IGet_cs.txt
                NeoTrace.Trace("Get(skey).e._currentNumber", e._currentNumber);                                                                  // Template: NPCLevel2Part2_cs.txt
                e._currentNumber = CurrentNumber;
                e._state         = sta;
                e._state         = NeoEntityModel.EntityState.GETTED; /* OVERRIDE */
            }
            LogExt("Get(skey).NeoCounter", e);
            return(e);
        }
Esempio n. 5
0
        public static UserCredentials 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);

            UserCredentials e;

            byte[] bsta = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, Helper.Concat(_bkeyTag, _bSTA));
            NeoTrace.Trace("Get(bkey).bsta", bsta.Length, bsta);
            if (bsta.Length == 0)
            {
                e = UserCredentials.Missing();
            }
            else // not MISSING
            {
                byte[] bext = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, Helper.Concat(_bkeyTag, _bEXT));
                int    ista = (int)bsta.AsBigInteger();
                NeoEntityModel.EntityState sta = (NeoEntityModel.EntityState)ista;
                e = new UserCredentials();

                byte[] EncodedUsername = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, Helper.Concat(_bkeyTag, _bEncodedUsername)); //NPCLevel2GGet_cs.txt
                byte[] EncodedPassword = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, Helper.Concat(_bkeyTag, _bEncodedPassword)); //NPCLevel2GGet_cs.txt
                e._encodedUsername = EncodedUsername; e._encodedPassword = EncodedPassword;                                                     // Template: NPCLevel2HGet_cs.txt
                e._state           = sta;
                e._state           = NeoEntityModel.EntityState.GETTED;                                                                         /* OVERRIDE */
            }
            LogExt("Get(bkey).UserCredentials", e);
            return(e);
        }
Esempio n. 6
0
        public static UserCredentials 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;

            UserCredentials e;

            byte[] bsta = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, _skeyTag + _sSTA);
            NeoTrace.Trace("Get(skey).UserCredentials.bsta", bsta.Length, bsta);
            if (bsta.Length == 0)
            {
                e = UserCredentials.Missing();
            }
            else // not MISSING
            {
                byte[] bext = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, _skeyTag + _sEXT);
                int    ista = (int)bsta.AsBigInteger();
                NeoEntityModel.EntityState sta = (NeoEntityModel.EntityState)ista;
                e = new UserCredentials();

                byte[] EncodedUsername = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, _skeyTag + _sEncodedUsername); //NPCLevel2IGet_cs.txt
                byte[] EncodedPassword = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, _skeyTag + _sEncodedPassword); //NPCLevel2IGet_cs.txt
                NeoTrace.Trace("Get(skey).e._encodedUsername, e._encodedPassword", e._encodedUsername, e._encodedPassword);       // Template: NPCLevel2Part2_cs.txt
                e._encodedUsername = EncodedUsername; e._encodedPassword = EncodedPassword;
                e._state           = sta;
                e._state           = NeoEntityModel.EntityState.GETTED; /* OVERRIDE */
            }
            LogExt("Get(skey).UserCredentials", e);
            return(e);
        }
Esempio n. 7
0
        public static Point 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);

            Point e;

            byte[] bsta = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, Helper.Concat(_bkeyTag, _bSTA));
            NeoTrace.Trace("Get(bkey).bs", bsta.Length, bsta);
            if (bsta.Length == 0)
            {
                e = Point.Missing();
            }
            else // not MISSING
            {
                byte[] bext = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, Helper.Concat(_bkeyTag, _bEXT));
                int    ista = (int)bsta.AsBigInteger();
                NeoEntityModel.EntityState sta = (NeoEntityModel.EntityState)ista;
                e = new Point();
                BigInteger x = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, Helper.Concat(_bkeyTag, _bX)).AsBigInteger();
                BigInteger y = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, Helper.Concat(_bkeyTag, _bY)).AsBigInteger();
                e._x     = x; e._y = y;
                e._state = sta;
                e._state = NeoEntityModel.EntityState.GETTED; /* OVERRIDE */
            }
            LogExt("Get(bkey).e", e);
            return(e);
        }
Esempio n. 8
0
        public static Point 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;

            Point e;

            byte[] bsta = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, _skeyTag + _sSTA);
            NeoTrace.Trace("Get(skey).bs", bsta.Length, bsta);
            if (bsta.Length == 0)
            {
                e = Point.Missing();
            }
            else // not MISSING
            {
                byte[] bext = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, _skeyTag + _sEXT);
                int    ista = (int)bsta.AsBigInteger();
                NeoEntityModel.EntityState sta = (NeoEntityModel.EntityState)ista;
                e = new Point();
                BigInteger x = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, _skeyTag + _sX).AsBigInteger();
                BigInteger y = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, _skeyTag + _sY).AsBigInteger();
                NeoTrace.Trace("Get(skey).x,y", x, y);
                e._x     = x; e._y = y;
                e._state = sta;
                e._state = NeoEntityModel.EntityState.GETTED; /* OVERRIDE */
            }
            LogExt("Get(skey).e", e);
            return(e);
        }
Esempio n. 9
0
        public static EntityState BytesToEntityState(byte[] bsta)
        {
            int ista = (int)bsta.AsBigInteger();

            NeoEntityModel.EntityState sta = (NeoEntityModel.EntityState)ista;
            return(sta);
        }
        /// <summary>
        /// Get an element of an array of entities from Storage based on a NeoStorageKey (NPC Level 4)
        /// </summary>
        /// <param name="vau">vau</param>
        /// <param name="index">index</param>
        /// <returns>MeetupAttendee</returns>
        public static MeetupAttendee GetElement(NeoVersionedAppUser vau, byte[] domain, int index)
        {
            if (NeoVersionedAppUser.IsNull(vau))
            {
                return(Null());
            }

            Neo.SmartContract.Framework.Services.Neo.StorageContext ctx = Neo.SmartContract.Framework.Services.Neo.Storage.CurrentContext;
            NeoStorageKey nsk = NeoStorageKey.New(vau, domain, _bClassName);

            MeetupAttendee e;

            //byte[] bkey;
            byte[] bsta = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, NeoStorageKey.StorageKey(nsk, index, _bSTA));
            if (NeoTrace.RUNTIME)
            {
                TraceRuntime("Get(bkey).MeetupAttendee.bsta", bsta.Length, bsta);
            }
            if (bsta.Length == 0)
            {
                e = MeetupAttendee.Missing();
            }
            else // not MISSING
            {
                int ista = (int)bsta.AsBigInteger();
                NeoEntityModel.EntityState sta = (NeoEntityModel.EntityState)ista;
                if (sta == NeoEntityModel.EntityState.TOMBSTONED)
                {
                    e = MeetupAttendee.Tombstone();
                }
                else // not MISSING && not TOMBSTONED
                {
                    e = new MeetupAttendee();
                    string AttendeeName = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, NeoStorageKey.StorageKey(nsk, index, _bAttendeeName)).AsString();                                                               // Template: NPCLevel4CGetElement_cs.txt

                    string AttendeeID = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, NeoStorageKey.StorageKey(nsk, index, _bAttendeeID)).AsString();                                                                   // Template: NPCLevel4CGetElement_cs.txt

                    string AttendeeUrl = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, NeoStorageKey.StorageKey(nsk, index, _bAttendeeUrl)).AsString();                                                                 // Template: NPCLevel4CGetElement_cs.txt

                    string AttendeePhotoUrl = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, NeoStorageKey.StorageKey(nsk, index, _bAttendeePhotoUrl)).AsString();                                                       // Template: NPCLevel4CGetElement_cs.txt

                    string MeetingID = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, NeoStorageKey.StorageKey(nsk, index, _bMeetingID)).AsString();                                                                     // Template: NPCLevel4CGetElement_cs.txt

                    string MeetingUrl = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, NeoStorageKey.StorageKey(nsk, index, _bMeetingUrl)).AsString();                                                                   // Template: NPCLevel4CGetElement_cs.txt

                    BigInteger Attended = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, NeoStorageKey.StorageKey(nsk, index, _bAttended)).AsBigInteger();                                                               // Template: NPCLevel4CGetElement_cs.txt

                    e._attendeeName = AttendeeName; e._attendeeID = AttendeeID; e._attendeeUrl = AttendeeUrl; e._attendeePhotoUrl = AttendeePhotoUrl; e._meetingID = MeetingID; e._meetingUrl = MeetingUrl; e._attended = Attended; // NPCLevel4DBuryElement_cs.txt
                    e._state        = sta;
                    e._state        = NeoEntityModel.EntityState.GETTED;                                                                                                                                                            /* OVERRIDE */
                }
            }
            if (NeoTrace.RUNTIME)
            {
                LogExt("Get(bkey).MeetupAttendee.e", e);
            }
            return(e);
        }
        /// <summary>
        /// Get an element of an array of entities from Storage based on a NeoStorageKey (NPC Level 4)
        /// </summary>
        /// <param name="vau">vau</param>
        /// <param name="index">index</param>
        /// <returns>NPCNEP5Requisition</returns>
        public static NPCNEP5Requisition GetElement(NeoVersionedAppUser vau, byte[] domain, byte[] bindex)
        {
            if (NeoVersionedAppUser.IsNull(vau))
            {
                return(Null());
            }

            Neo.SmartContract.Framework.Services.Neo.StorageContext ctx = Neo.SmartContract.Framework.Services.Neo.Storage.CurrentContext;
            NeoStorageKey nsk = NeoStorageKey.New(vau, domain, _bClassName);

            NPCNEP5Requisition e;

            //byte[] bkey;
            byte[] bsta = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, NeoStorageKey.StorageKey(nsk, bindex, _bSTA));
            if (NeoTrace.RUNTIME)
            {
                TraceRuntime("Get(bkey).NPCNEP5Requisition.bsta", bsta.Length, bsta);
            }
            if (bsta.Length == 0)
            {
                e = NPCNEP5Requisition.Missing();
            }
            else // not MISSING
            {
                int ista = (int)bsta.AsBigInteger();
                NeoEntityModel.EntityState sta = (NeoEntityModel.EntityState)ista;
                if (sta == NeoEntityModel.EntityState.TOMBSTONED)
                {
                    e = NPCNEP5Requisition.Tombstone();
                }
                else // not MISSING && not TOMBSTONED
                {
                    e = new NPCNEP5Requisition();
                    byte[] FromScriptHash = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, NeoStorageKey.StorageKey(nsk, bindex, _bFromScriptHash));                    // Template: NPCLevel4CGetElement_cs.txt

                    byte[] ToScriptHash = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, NeoStorageKey.StorageKey(nsk, bindex, _bToScriptHash));                        // Template: NPCLevel4CGetElement_cs.txt

                    string EncryptedBlobURI = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, NeoStorageKey.StorageKey(nsk, bindex, _bEncryptedBlobURI)).AsString();     // Template: NPCLevel4CGetElement_cs.txt

                    Int32 WorkflowState = (Int32)Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, NeoStorageKey.StorageKey(nsk, bindex, _bWorkflowState)).AsBigInteger(); // Template: NPCLevel4CGetElement_cs.txt

                    e._fromScriptHash = FromScriptHash; e._toScriptHash = ToScriptHash; e._encryptedBlobURI = EncryptedBlobURI; e._workflowState = WorkflowState;                  // NPCLevel4DBuryElement_cs.txt
                    e._state          = sta;
                    e._state          = NeoEntityModel.EntityState.GETTED;                                                                                                         /* OVERRIDE */
                }
            }
            if (NeoTrace.RUNTIME)
            {
                LogExt("Get(bkey).NPCNEP5Requisition.e", e);
            }
            return(e);
        }
Esempio n. 12
0
        /// <summary>
        /// Get an element of an array of entities from Storage based on a NeoStorageKey (NPC Level 4)
        /// </summary>
        /// <param name="vau">vau</param>
        /// <param name="index">index</param>
        /// <returns>NPCContributor</returns>
        public static NPCContributor GetElement(NeoVersionedAppUser vau, byte[] domain, byte[] bindex)
        {
            if (NeoVersionedAppUser.IsNull(vau))
            {
                return(Null());
            }

            Neo.SmartContract.Framework.Services.Neo.StorageContext ctx = Neo.SmartContract.Framework.Services.Neo.Storage.CurrentContext;
            NeoStorageKey nsk = NeoStorageKey.New(vau, domain, _bClassName);

            NPCContributor e;

            //byte[] bkey;
            byte[] bsta = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, NeoStorageKey.StorageKey(nsk, bindex, _bSTA));
            if (NeoTrace.RUNTIME)
            {
                TraceRuntime("Get(bkey).NPCContributor.bsta", bsta.Length, bsta);
            }
            if (bsta.Length == 0)
            {
                e = NPCContributor.Missing();
            }
            else // not MISSING
            {
                int ista = (int)bsta.AsBigInteger();
                NeoEntityModel.EntityState sta = (NeoEntityModel.EntityState)ista;
                if (sta == NeoEntityModel.EntityState.TOMBSTONED)
                {
                    e = NPCContributor.Tombstone();
                }
                else // not MISSING && not TOMBSTONED
                {
                    e = new NPCContributor();
                    string Name = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, NeoStorageKey.StorageKey(nsk, bindex, _bName)).AsString();                  // Template: NPCLevel4CGetElement_cs.txt

                    string Title = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, NeoStorageKey.StorageKey(nsk, bindex, _bTitle)).AsString();                // Template: NPCLevel4CGetElement_cs.txt

                    byte[] ApproverScriptHash = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, NeoStorageKey.StorageKey(nsk, bindex, _bApproverScriptHash)); // Template: NPCLevel4CGetElement_cs.txt

                    byte[] ReqPublicKey = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, NeoStorageKey.StorageKey(nsk, bindex, _bReqPublicKey));             // Template: NPCLevel4CGetElement_cs.txt

                    e._name  = Name; e._title = Title; e._approverScriptHash = ApproverScriptHash; e._reqPublicKey = ReqPublicKey;                                      // NPCLevel4DBuryElement_cs.txt
                    e._state = sta;
                    e._state = NeoEntityModel.EntityState.GETTED;                                                                                                       /* OVERRIDE */
                }
            }
            if (NeoTrace.RUNTIME)
            {
                LogExt("Get(bkey).NPCContributor.e", e);
            }
            return(e);
        }
        /// <summary>
        /// Get an element of an array of entities from Storage based on a NeoStorageKey (NPC Level 4)
        /// </summary>
        /// <param name="vau">vau</param>
        /// <param name="index">index</param>
        /// <returns>NFT</returns>
        public static NFT GetElement(NeoVersionedAppUser vau, byte[] domain, int index)
        {
            if (NeoVersionedAppUser.IsNull(vau))
            {
                return(Null());
            }

            Neo.SmartContract.Framework.Services.Neo.StorageContext ctx = Neo.SmartContract.Framework.Services.Neo.Storage.CurrentContext;
            NeoStorageKey nsk = NeoStorageKey.New(vau, domain, _bClassName);

            NFT e;

            //byte[] bkey;
            byte[] bsta = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, NeoStorageKey.StorageKey(nsk, index, _bSTA));
            if (NeoTrace.RUNTIME)
            {
                TraceRuntime("Get(bkey).NFT.bsta", bsta.Length, bsta);
            }
            if (bsta.Length == 0)
            {
                e = NFT.Missing();
            }
            else // not MISSING
            {
                int ista = (int)bsta.AsBigInteger();
                NeoEntityModel.EntityState sta = (NeoEntityModel.EntityState)ista;
                if (sta == NeoEntityModel.EntityState.TOMBSTONED)
                {
                    e = NFT.Tombstone();
                }
                else // not MISSING && not TOMBSTONED
                {
                    e = new NFT();
                    string Uri = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, NeoStorageKey.StorageKey(nsk, index, _bUri)).AsString();             // Template: NPCLevel4CGetElement_cs.txt

                    string FirstName = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, NeoStorageKey.StorageKey(nsk, index, _bFirstName)).AsString(); // Template: NPCLevel4CGetElement_cs.txt

                    string LastName = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, NeoStorageKey.StorageKey(nsk, index, _bLastName)).AsString();   // Template: NPCLevel4CGetElement_cs.txt

                    e._uri   = Uri; e._firstName = FirstName; e._lastName = LastName;                                                                           // NPCLevel4DBuryElement_cs.txt
                    e._state = sta;
                    e._state = NeoEntityModel.EntityState.GETTED;                                                                                               /* OVERRIDE */
                }
            }
            if (NeoTrace.RUNTIME)
            {
                LogExt("Get(bkey).NFT.e", e);
            }
            return(e);
        }
Esempio n. 14
0
        /// <summary>
        /// Get an element of an array of entities from Storage based on a NeoStorageKey (NPC Level 4)
        /// </summary>
        /// <param name="vau">vau</param>
        /// <param name="index">index</param>
        /// <returns>UserLedgerEntry</returns>
        public static UserLedgerEntry GetElement(NeoVersionedAppUser vau, byte[] domain, byte[] bindex)
        {
            if (NeoVersionedAppUser.IsNull(vau))
            {
                return(Null());
            }

            Neo.SmartContract.Framework.Services.Neo.StorageContext ctx = Neo.SmartContract.Framework.Services.Neo.Storage.CurrentContext;
            NeoStorageKey nsk = NeoStorageKey.New(vau, domain, _bClassName);

            UserLedgerEntry e;

            //byte[] bkey;
            byte[] bsta = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, NeoStorageKey.StorageKey(nsk, bindex, _bSTA));
            if (NeoTrace.RUNTIME)
            {
                TraceRuntime("Get(bkey).UserLedgerEntry.bsta", bsta.Length, bsta);
            }
            if (bsta.Length == 0)
            {
                e = UserLedgerEntry.Missing();
            }
            else // not MISSING
            {
                int ista = (int)bsta.AsBigInteger();
                NeoEntityModel.EntityState sta = (NeoEntityModel.EntityState)ista;
                if (sta == NeoEntityModel.EntityState.TOMBSTONED)
                {
                    e = UserLedgerEntry.Tombstone();
                }
                else // not MISSING && not TOMBSTONED
                {
                    e = new UserLedgerEntry();
                    byte[] UserScriptHash = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, NeoStorageKey.StorageKey(nsk, bindex, _bUserScriptHash));             // Template: NPCLevel4CGetElement_cs.txt

                    byte[] PassphraseScriptHash = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, NeoStorageKey.StorageKey(nsk, bindex, _bPassphraseScriptHash)); // Template: NPCLevel4CGetElement_cs.txt

                    e._userScriptHash = UserScriptHash; e._passphraseScriptHash = PassphraseScriptHash;                                                                     // NPCLevel4DBuryElement_cs.txt
                    e._state          = sta;
                    e._state          = NeoEntityModel.EntityState.GETTED;                                                                                                  /* OVERRIDE */
                }
            }
            if (NeoTrace.RUNTIME)
            {
                LogExt("Get(bkey).UserLedgerEntry.e", e);
            }
            return(e);
        }
        /// <summary>
        /// Get an element of an array of entities from Storage based on a NeoStorageKey (NPC Level 4)
        /// </summary>
        /// <param name="vau">vau</param>
        /// <param name="index">index</param>
        /// <returns>Point</returns>
        public static Point GetElement(NeoVersionedAppUser vau, int index)
        {
            if (NeoVersionedAppUser.IsNull(vau))
            {
                return(Null());
            }

            Neo.SmartContract.Framework.Services.Neo.StorageContext ctx = Neo.SmartContract.Framework.Services.Neo.Storage.CurrentContext;
            NeoStorageKey nsk = NeoStorageKey.New(vau, "Point");

            Point p;

            byte[] bkey;
            /*STA*/
            byte[] bsta = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, bkey = NeoStorageKey.StorageKey(nsk, index, _bSTA));
            NeoTrace.Trace("Get(kb).bs", bsta.Length, bsta);
            if (bsta.Length == 0)
            {
                p = Point.Missing();
            }
            else // not MISSING
            {
                /*EXT*/
                byte[] bext = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, bkey = NeoStorageKey.StorageKey(nsk, index, _bEXT));
                int    ista = (int)bsta.AsBigInteger();
                NeoEntityModel.EntityState sta = (NeoEntityModel.EntityState)ista;
                if (sta == NeoEntityModel.EntityState.TOMBSTONED)
                {
                    p            = Point.Tombstone();
                    p._extension = bext; // TODO: does a Tomestone bury all of its extensions?
                }
                else // not MISSING && not TOMBSTONED
                {
                    p = new Point();
                    /*FIELD*/
                    BigInteger x = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, bkey = NeoStorageKey.StorageKey(nsk, index, _bX)).AsBigInteger();
                    /*FIELD*/
                    BigInteger y = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, bkey = NeoStorageKey.StorageKey(nsk, index, _bY)).AsBigInteger();
                    p._x         = x;
                    p._y         = y;
                    p._state     = sta;
                    p._state     = NeoEntityModel.EntityState.GETTED; /* OVERRIDE */
                    p._extension = bext;
                }
            }
            LogExt("Get(kb).p", p);
            return(p);
        }
Esempio n. 16
0
        /// <summary>
        /// Get an element of an array of entities from Storage based on a NeoStorageKey (NPC Level 4)
        /// </summary>
        /// <param name="vau">vau</param>
        /// <param name="index">index</param>
        /// <returns>UserCredentials</returns>
        public static UserCredentials GetElement(NeoVersionedAppUser vau, byte[] domain, int index)
        {
            if (NeoVersionedAppUser.IsNull(vau))
            {
                return(Null());
            }

            Neo.SmartContract.Framework.Services.Neo.StorageContext ctx = Neo.SmartContract.Framework.Services.Neo.Storage.CurrentContext;
            NeoStorageKey nsk = NeoStorageKey.New(vau, domain, _bClassName);

            UserCredentials e;

            //byte[] bkey;
            byte[] bsta = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, NeoStorageKey.StorageKey(nsk, index, _bSTA));
            if (NeoTrace.RUNTIME)
            {
                TraceRuntime("Get(bkey).UserCredentials.bsta", bsta.Length, bsta);
            }
            if (bsta.Length == 0)
            {
                e = UserCredentials.Missing();
            }
            else // not MISSING
            {
                int ista = (int)bsta.AsBigInteger();
                NeoEntityModel.EntityState sta = (NeoEntityModel.EntityState)ista;
                if (sta == NeoEntityModel.EntityState.TOMBSTONED)
                {
                    e = UserCredentials.Tombstone();
                }
                else // not MISSING && not TOMBSTONED
                {
                    e = new UserCredentials();
                    byte[] EncodedUsername = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, NeoStorageKey.StorageKey(nsk, index, _bEncodedUsername)); // Template: NPCLevel4CGetElement_cs.txt

                    byte[] EncodedPassword = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, NeoStorageKey.StorageKey(nsk, index, _bEncodedPassword)); // Template: NPCLevel4CGetElement_cs.txt

                    e._encodedUsername = EncodedUsername; e._encodedPassword = EncodedPassword;                                                                  // NPCLevel4DBuryElement_cs.txt
                    e._state           = sta;
                    e._state           = NeoEntityModel.EntityState.GETTED;                                                                                      /* OVERRIDE */
                }
            }
            if (NeoTrace.RUNTIME)
            {
                LogExt("Get(bkey).UserCredentials.e", e);
            }
            return(e);
        }
        /// <summary>
        /// Get an element of an array of entities from Storage based on a NeoStorageKey (NPC Level 4)
        /// </summary>
        /// <param name="vau">vau</param>
        /// <param name="index">index</param>
        /// <returns>Point</returns>
        public static Point GetElement(NeoVersionedAppUser vau, byte[] domain, byte[] bindex)
        {
            if (NeoVersionedAppUser.IsNull(vau))
            {
                return(Null());
            }

            Neo.SmartContract.Framework.Services.Neo.StorageContext ctx = Neo.SmartContract.Framework.Services.Neo.Storage.CurrentContext;
            NeoStorageKey nsk = NeoStorageKey.New(vau, domain, _bClassName);

            Point e;

            //byte[] bkey;
            byte[] bsta = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, NeoStorageKey.StorageKey(nsk, bindex, _bSTA));
            if (NeoTrace.RUNTIME)
            {
                TraceRuntime("Get(bkey).Point.bsta", bsta.Length, bsta);
            }
            if (bsta.Length == 0)
            {
                e = Point.Missing();
            }
            else // not MISSING
            {
                int ista = (int)bsta.AsBigInteger();
                NeoEntityModel.EntityState sta = (NeoEntityModel.EntityState)ista;
                if (sta == NeoEntityModel.EntityState.TOMBSTONED)
                {
                    e = Point.Tombstone();
                }
                else // not MISSING && not TOMBSTONED
                {
                    e = new Point();
                    BigInteger X = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, NeoStorageKey.StorageKey(nsk, bindex, _bX)).AsBigInteger(); // Template: NPCLevel4CGetElement_cs.txt

                    BigInteger Y = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, NeoStorageKey.StorageKey(nsk, bindex, _bY)).AsBigInteger(); // Template: NPCLevel4CGetElement_cs.txt

                    e._x     = X; e._y = Y;                                                                                                              // NPCLevel4DBuryElement_cs.txt
                    e._state = sta;
                    e._state = NeoEntityModel.EntityState.GETTED;                                                                                        /* OVERRIDE */
                }
            }
            if (NeoTrace.RUNTIME)
            {
                LogExt("Get(bkey).Point.e", e);
            }
            return(e);
        }
        /// <summary>
        /// Get an entity from Storage based on a string valued key (NPC Level 2)
        /// </summary>
        /// <param name="skey">skey</param>
        /// <returns>Point</returns>
        public static Point Get(string skey)
        {
            if (skey.Length == 0)
            {
                return(Null());
            }

            Neo.SmartContract.Framework.Services.Neo.StorageContext ctx = Neo.SmartContract.Framework.Services.Neo.Storage.CurrentContext;
            string _skeyTag = skey + _classKeyTag;

            Point p;

            /*STA*/
            byte[] bsta = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, _skeyTag + _sSTA);
            NeoTrace.Trace("Get(ks).bs", bsta.Length, bsta);
            if (bsta.Length == 0)
            {
                p = Point.Missing();
            }
            else // not MISSING
            {
                /*EXT*/
                byte[] bext = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, _skeyTag + _sEXT);
                int    ista = (int)bsta.AsBigInteger();
                NeoEntityModel.EntityState sta = (NeoEntityModel.EntityState)ista;
                if (sta == NeoEntityModel.EntityState.TOMBSTONED)
                {
                    p            = Point.Tombstone();
                    p._extension = bext; // TODO: does a Tomestone bury all of its extensions?
                }
                else // not MISSING && not TOMBSTONED
                {
                    p = new Point();
                    /*FIELD*/
                    BigInteger x = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, _skeyTag + _sX).AsBigInteger();
                    /*FIELD*/
                    BigInteger y = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, _skeyTag + _sY).AsBigInteger();
                    NeoTrace.Trace("Get(ks).x,y", x, y);
                    p._x         = x;
                    p._y         = y;
                    p._state     = sta;
                    p._state     = NeoEntityModel.EntityState.GETTED; /* OVERRIDE */
                    p._extension = bext;
                }
            }
            LogExt("Get(ks).p", p);
            return(p);
        }
        public static MeetupAttendee 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;

            MeetupAttendee e;

            byte[] bsta = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, _skeyTag + _sSTA);
            if (NeoTrace.RUNTIME)
            {
                TraceRuntime("Get(skey).MeetupAttendee.bsta", bsta.Length, bsta);
            }
            if (bsta.Length == 0)
            {
                e = MeetupAttendee.Missing();
            }
            else // not MISSING
            {
                int ista = (int)bsta.AsBigInteger();
                NeoEntityModel.EntityState sta = (NeoEntityModel.EntityState)ista;
                e = new MeetupAttendee();

                string     AttendeeName     = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, _skeyTag + _sAttendeeName).AsString();     //NPCLevel2IGet_cs.txt
                string     AttendeeID       = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, _skeyTag + _sAttendeeID).AsString();       //NPCLevel2IGet_cs.txt
                string     AttendeeUrl      = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, _skeyTag + _sAttendeeUrl).AsString();      //NPCLevel2IGet_cs.txt
                string     AttendeePhotoUrl = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, _skeyTag + _sAttendeePhotoUrl).AsString(); //NPCLevel2IGet_cs.txt
                string     MeetingID        = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, _skeyTag + _sMeetingID).AsString();        //NPCLevel2IGet_cs.txt
                string     MeetingUrl       = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, _skeyTag + _sMeetingUrl).AsString();       //NPCLevel2IGet_cs.txt
                BigInteger Attended         = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, _skeyTag + _sAttended).AsBigInteger();     //NPCLevel2IGet_cs.txt
                if (NeoTrace.RUNTIME)
                {
                    TraceRuntime("Get(skey).e._attendeeName, e._attendeeID, e._attendeeUrl, e._attendeePhotoUrl, e._meetingID, e._meetingUrl, e._attended", e._attendeeName, e._attendeeID, e._attendeeUrl, e._attendeePhotoUrl, e._meetingID, e._meetingUrl, e._attended);                   // Template: NPCLevel2Part2_cs.txt
                }
                e._attendeeName = AttendeeName; e._attendeeID = AttendeeID; e._attendeeUrl = AttendeeUrl; e._attendeePhotoUrl = AttendeePhotoUrl; e._meetingID = MeetingID; e._meetingUrl = MeetingUrl; e._attended = Attended;
                e._state        = sta;
                e._state        = NeoEntityModel.EntityState.GETTED; /* OVERRIDE */
            }
            if (NeoTrace.RUNTIME)
            {
                LogExt("Get(skey).MeetupAttendee", e);
            }
            return(e);
        }
        public static NPCNEP5Requisition 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;

            NPCNEP5Requisition e;

            byte[] bsta = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, _skeyTag + _sSTA);
            if (NeoTrace.RUNTIME)
            {
                TraceRuntime("Get(skey).NPCNEP5Requisition.bsta", bsta.Length, bsta);
            }
            if (bsta.Length == 0)
            {
                e = NPCNEP5Requisition.Missing();
            }
            else // not MISSING
            {
                int ista = (int)bsta.AsBigInteger();
                NeoEntityModel.EntityState sta = (NeoEntityModel.EntityState)ista;
                e = new NPCNEP5Requisition();

                byte[] FromScriptHash   = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, _skeyTag + _sFromScriptHash);                      //NPCLevel2IGet_cs.txt
                byte[] ToScriptHash     = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, _skeyTag + _sToScriptHash);                        //NPCLevel2IGet_cs.txt
                string EncryptedBlobURI = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, _skeyTag + _sEncryptedBlobURI).AsString();         //NPCLevel2IGet_cs.txt
                Int32  WorkflowState    = (Int32)Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, _skeyTag + _sWorkflowState).AsBigInteger(); //NPCLevel2IGet_cs.txt
                if (NeoTrace.RUNTIME)
                {
                    TraceRuntime("Get(skey).e._fromScriptHash, e._toScriptHash, e._encryptedBlobURI, e._workflowState", e._fromScriptHash, e._toScriptHash, e._encryptedBlobURI, e._workflowState);                   // Template: NPCLevel2Part2_cs.txt
                }
                e._fromScriptHash = FromScriptHash; e._toScriptHash = ToScriptHash; e._encryptedBlobURI = EncryptedBlobURI; e._workflowState = WorkflowState;
                e._state          = sta;
                e._state          = NeoEntityModel.EntityState.GETTED; /* OVERRIDE */
            }
            if (NeoTrace.RUNTIME)
            {
                LogExt("Get(skey).NPCNEP5Requisition", e);
            }
            return(e);
        }
        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 NPCContributor 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;

            NPCContributor e;

            byte[] bsta = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, _skeyTag + _sSTA);
            if (NeoTrace.RUNTIME)
            {
                TraceRuntime("Get(skey).NPCContributor.bsta", bsta.Length, bsta);
            }
            if (bsta.Length == 0)
            {
                e = NPCContributor.Missing();
            }
            else // not MISSING
            {
                int ista = (int)bsta.AsBigInteger();
                NeoEntityModel.EntityState sta = (NeoEntityModel.EntityState)ista;
                e = new NPCContributor();

                string Name  = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, _skeyTag + _sName).AsString();                 //NPCLevel2IGet_cs.txt
                string Title = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, _skeyTag + _sTitle).AsString();                //NPCLevel2IGet_cs.txt
                byte[] ApproverScriptHash = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, _skeyTag + _sApproverScriptHash); //NPCLevel2IGet_cs.txt
                byte[] ReqPublicKey       = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, _skeyTag + _sReqPublicKey);       //NPCLevel2IGet_cs.txt
                if (NeoTrace.RUNTIME)
                {
                    TraceRuntime("Get(skey).e._name, e._title, e._approverScriptHash, e._reqPublicKey", e._name, e._title, e._approverScriptHash, e._reqPublicKey);                   // Template: NPCLevel2Part2_cs.txt
                }
                e._name  = Name; e._title = Title; e._approverScriptHash = ApproverScriptHash; e._reqPublicKey = ReqPublicKey;
                e._state = sta;
                e._state = NeoEntityModel.EntityState.GETTED; /* OVERRIDE */
            }
            if (NeoTrace.RUNTIME)
            {
                LogExt("Get(skey).NPCContributor", e);
            }
            return(e);
        }
        public static MeetupAttendee 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);

            MeetupAttendee 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 = MeetupAttendee.Missing();
            }
            else // not MISSING
            {
                int ista = (int)bsta.AsBigInteger();
                NeoEntityModel.EntityState sta = (NeoEntityModel.EntityState)ista;
                e = new MeetupAttendee();

                string     AttendeeName     = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, Helper.Concat(_bkeyTag, _bAttendeeName)).AsString();                                                                    //NPCLevel2GGet_cs.txt
                string     AttendeeID       = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, Helper.Concat(_bkeyTag, _bAttendeeID)).AsString();                                                                      //NPCLevel2GGet_cs.txt
                string     AttendeeUrl      = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, Helper.Concat(_bkeyTag, _bAttendeeUrl)).AsString();                                                                     //NPCLevel2GGet_cs.txt
                string     AttendeePhotoUrl = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, Helper.Concat(_bkeyTag, _bAttendeePhotoUrl)).AsString();                                                                //NPCLevel2GGet_cs.txt
                string     MeetingID        = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, Helper.Concat(_bkeyTag, _bMeetingID)).AsString();                                                                       //NPCLevel2GGet_cs.txt
                string     MeetingUrl       = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, Helper.Concat(_bkeyTag, _bMeetingUrl)).AsString();                                                                      //NPCLevel2GGet_cs.txt
                BigInteger Attended         = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, Helper.Concat(_bkeyTag, _bAttended)).AsBigInteger();                                                                    //NPCLevel2GGet_cs.txt
                e._attendeeName = AttendeeName; e._attendeeID = AttendeeID; e._attendeeUrl = AttendeeUrl; e._attendeePhotoUrl = AttendeePhotoUrl; e._meetingID = MeetingID; e._meetingUrl = MeetingUrl; e._attended = Attended; // Template: NPCLevel2HGet_cs.txt
                e._state        = sta;
                e._state        = NeoEntityModel.EntityState.GETTED;                                                                                                                                                            /* OVERRIDE */
            }
            if (NeoTrace.RUNTIME)
            {
                LogExt("Get(bkey).MeetupAttendee", e);
            }
            return(e);
        }
        public static NFT 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;

            NFT e;

            byte[] bsta = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, _skeyTag + _sSTA);
            if (NeoTrace.RUNTIME)
            {
                TraceRuntime("Get(skey).NFT.bsta", bsta.Length, bsta);
            }
            if (bsta.Length == 0)
            {
                e = NFT.Missing();
            }
            else // not MISSING
            {
                int ista = (int)bsta.AsBigInteger();
                NeoEntityModel.EntityState sta = (NeoEntityModel.EntityState)ista;
                e = new NFT();

                string Uri       = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, _skeyTag + _sUri).AsString();       //NPCLevel2IGet_cs.txt
                string FirstName = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, _skeyTag + _sFirstName).AsString(); //NPCLevel2IGet_cs.txt
                string LastName  = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, _skeyTag + _sLastName).AsString();  //NPCLevel2IGet_cs.txt
                if (NeoTrace.RUNTIME)
                {
                    TraceRuntime("Get(skey).e._uri, e._firstName, e._lastName", e._uri, e._firstName, e._lastName);                   // Template: NPCLevel2Part2_cs.txt
                }
                e._uri   = Uri; e._firstName = FirstName; e._lastName = LastName;
                e._state = sta;
                e._state = NeoEntityModel.EntityState.GETTED; /* OVERRIDE */
            }
            if (NeoTrace.RUNTIME)
            {
                LogExt("Get(skey).NFT", e);
            }
            return(e);
        }
        public static NPCNEP5FundingRound 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;

            NPCNEP5FundingRound e;

            byte[] bsta = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, _skeyTag + _sSTA);
            if (NeoTrace.RUNTIME)
            {
                TraceRuntime("Get(skey).NPCNEP5FundingRound.bsta", bsta.Length, bsta);
            }
            if (bsta.Length == 0)
            {
                e = NPCNEP5FundingRound.Missing();
            }
            else // not MISSING
            {
                int ista = (int)bsta.AsBigInteger();
                NeoEntityModel.EntityState sta = (NeoEntityModel.EntityState)ista;
                e = new NPCNEP5FundingRound();

                BigInteger TotalSupply    = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, _skeyTag + _sTotalSupply).AsBigInteger();    //NPCLevel2IGet_cs.txt
                BigInteger StartTimestamp = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, _skeyTag + _sStartTimestamp).AsBigInteger(); //NPCLevel2IGet_cs.txt
                BigInteger EndTimestamp   = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, _skeyTag + _sEndTimestamp).AsBigInteger();   //NPCLevel2IGet_cs.txt
                if (NeoTrace.RUNTIME)
                {
                    TraceRuntime("Get(skey).e._totalSupply, e._startTimestamp, e._endTimestamp", e._totalSupply, e._startTimestamp, e._endTimestamp);                   // Template: NPCLevel2Part2_cs.txt
                }
                e._totalSupply = TotalSupply; e._startTimestamp = StartTimestamp; e._endTimestamp = EndTimestamp;
                e._state       = sta;
                e._state       = NeoEntityModel.EntityState.GETTED; /* OVERRIDE */
            }
            if (NeoTrace.RUNTIME)
            {
                LogExt("Get(skey).NPCNEP5FundingRound", e);
            }
            return(e);
        }
Esempio n. 26
0
        public static UserLedgerEntry 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;

            UserLedgerEntry e;

            byte[] bsta = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, _skeyTag + _sSTA);
            if (NeoTrace.RUNTIME)
            {
                TraceRuntime("Get(skey).UserLedgerEntry.bsta", bsta.Length, bsta);
            }
            if (bsta.Length == 0)
            {
                e = UserLedgerEntry.Missing();
            }
            else // not MISSING
            {
                int ista = (int)bsta.AsBigInteger();
                NeoEntityModel.EntityState sta = (NeoEntityModel.EntityState)ista;
                e = new UserLedgerEntry();

                byte[] UserScriptHash       = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, _skeyTag + _sUserScriptHash);       //NPCLevel2IGet_cs.txt
                byte[] PassphraseScriptHash = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, _skeyTag + _sPassphraseScriptHash); //NPCLevel2IGet_cs.txt
                if (NeoTrace.RUNTIME)
                {
                    TraceRuntime("Get(skey).e._userScriptHash, e._passphraseScriptHash", e._userScriptHash, e._passphraseScriptHash);                   // Template: NPCLevel2Part2_cs.txt
                }
                e._userScriptHash = UserScriptHash; e._passphraseScriptHash = PassphraseScriptHash;
                e._state          = sta;
                e._state          = NeoEntityModel.EntityState.GETTED; /* OVERRIDE */
            }
            if (NeoTrace.RUNTIME)
            {
                LogExt("Get(skey).UserLedgerEntry", e);
            }
            return(e);
        }
        /// <summary>
        /// Get an element of an array of entities from Storage based on a NeoStorageKey (NPC Level 4)
        /// </summary>
        /// <param name="vau">vau</param>
        /// <param name="index">index</param>
        /// <returns>UserPoint</returns>
        public static UserPoint GetElement(NeoVersionedAppUser vau, string domain, string sindex)
        {
            if (NeoVersionedAppUser.IsNull(vau))
            {
                return(Null());
            }

            Neo.SmartContract.Framework.Services.Neo.StorageContext ctx = Neo.SmartContract.Framework.Services.Neo.Storage.CurrentContext;
            NeoStorageKey nsk = NeoStorageKey.New(vau, domain, "UserPoint");

            UserPoint e;

            byte[] bkey;
            byte[] bsta = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, bkey = NeoStorageKey.StorageKey(nsk, sindex, _bSTA));
            NeoTrace.Trace("Get(bkey).UserPoint.bsta", bsta.Length, bsta);
            if (bsta.Length == 0)
            {
                e = UserPoint.Missing();
            }
            else // not MISSING
            {
                /*EXT*/
                byte[] bext = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, bkey = NeoStorageKey.StorageKey(nsk, sindex, _bEXT));
                int    ista = (int)bsta.AsBigInteger();
                NeoEntityModel.EntityState sta = (NeoEntityModel.EntityState)ista;
                if (sta == NeoEntityModel.EntityState.TOMBSTONED)
                {
                    e = UserPoint.Tombstone();
                }
                else // not MISSING && not TOMBSTONED
                {
                    e = new UserPoint();
                    BigInteger X = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, bkey = NeoStorageKey.StorageKey(nsk, sindex, _bX)).AsBigInteger(); // Template: NPCLevel4CGetElement_cs.txt
                    BigInteger Y = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, bkey = NeoStorageKey.StorageKey(nsk, sindex, _bY)).AsBigInteger(); // Template: NPCLevel4CGetElement_cs.txt
                    e._x     = X; e._y = Y;                                                                                                                     // NPCLevel4DBuryElement_cs.txt
                    e._state = sta;
                    e._state = NeoEntityModel.EntityState.GETTED;                                                                                               /* OVERRIDE */
                }
            }
            LogExt("Get(bkey).UserPoint.e", e);
            return(e);
        }
Esempio n. 28
0
        /// <summary>
        /// Get an element of an array of entities from Storage based on a NeoStorageKey (NPC Level 4)
        /// </summary>
        /// <param name="vau">vau</param>
        /// <param name="index">index</param>
        /// <returns>Line</returns>
        public static Line GetElement(NeoVersionedAppUser vau, string domain, int index)
        {
            if (NeoVersionedAppUser.IsNull(vau))
            {
                return(Null());
            }

            Neo.SmartContract.Framework.Services.Neo.StorageContext ctx = Neo.SmartContract.Framework.Services.Neo.Storage.CurrentContext;
            NeoStorageKey nsk = NeoStorageKey.New(vau, domain, "Line");

            Line e;

            byte[] bkey;
            byte[] bsta = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, bkey = NeoStorageKey.StorageKey(nsk, index, _bSTA));
            NeoTrace.Trace("Get(bkey).Line.bsta", bsta.Length, bsta);
            if (bsta.Length == 0)
            {
                e = Line.Missing();
            }
            else // not MISSING
            {
                /*EXT*/
                byte[] bext = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, bkey = NeoStorageKey.StorageKey(nsk, index, _bEXT));
                int    ista = (int)bsta.AsBigInteger();
                NeoEntityModel.EntityState sta = (NeoEntityModel.EntityState)ista;
                if (sta == NeoEntityModel.EntityState.TOMBSTONED)
                {
                    e = Line.Tombstone();
                }
                else // not MISSING && not TOMBSTONED
                {
                    e = new Line();
                    byte[] BKeyP1 = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, bkey = NeoStorageKey.StorageKey(nsk, index, _bBKeyP1)); // Template: NPCLevel4CGetElement_cs.txt
                    byte[] BKeyP2 = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, bkey = NeoStorageKey.StorageKey(nsk, index, _bBKeyP2)); // Template: NPCLevel4CGetElement_cs.txt
                    e._bKeyP1 = BKeyP1; e._bKeyP2 = BKeyP2;                                                                                           // NPCLevel4DBuryElement_cs.txt
                    e._state  = sta;
                    e._state  = NeoEntityModel.EntityState.GETTED;                                                                                    /* OVERRIDE */
                }
            }
            LogExt("Get(bkey).Line.e", e);
            return(e);
        }
        public static REL_Contrib_Req 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;

            REL_Contrib_Req e;

            byte[] bsta = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, _skeyTag + _sSTA);
            if (NeoTrace.RUNTIME)
            {
                TraceRuntime("Get(skey).REL_Contrib_Req.bsta", bsta.Length, bsta);
            }
            if (bsta.Length == 0)
            {
                e = REL_Contrib_Req.Missing();
            }
            else // not MISSING
            {
                int ista = (int)bsta.AsBigInteger();
                NeoEntityModel.EntityState sta = (NeoEntityModel.EntityState)ista;
                e = new REL_Contrib_Req();

                BigInteger ReqIndex = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, _skeyTag + _sReqIndex).AsBigInteger(); //NPCLevel2IGet_cs.txt
                if (NeoTrace.RUNTIME)
                {
                    TraceRuntime("Get(skey).e._reqIndex", e._reqIndex);                   // Template: NPCLevel2Part2_cs.txt
                }
                e._reqIndex = ReqIndex;
                e._state    = sta;
                e._state    = NeoEntityModel.EntityState.GETTED; /* OVERRIDE */
            }
            if (NeoTrace.RUNTIME)
            {
                LogExt("Get(skey).REL_Contrib_Req", e);
            }
            return(e);
        }
        public static NPCContributor 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);

            NPCContributor 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 = NPCContributor.Missing();
            }
            else // not MISSING
            {
                int ista = (int)bsta.AsBigInteger();
                NeoEntityModel.EntityState sta = (NeoEntityModel.EntityState)ista;
                e = new NPCContributor();

                string Name  = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, Helper.Concat(_bkeyTag, _bName)).AsString();                 //NPCLevel2GGet_cs.txt
                string Title = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, Helper.Concat(_bkeyTag, _bTitle)).AsString();                //NPCLevel2GGet_cs.txt
                byte[] ApproverScriptHash = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, Helper.Concat(_bkeyTag, _bApproverScriptHash)); //NPCLevel2GGet_cs.txt
                byte[] ReqPublicKey       = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, Helper.Concat(_bkeyTag, _bReqPublicKey));       //NPCLevel2GGet_cs.txt
                e._name  = Name; e._title = Title; e._approverScriptHash = ApproverScriptHash; e._reqPublicKey = ReqPublicKey;                        // Template: NPCLevel2HGet_cs.txt
                e._state = sta;
                e._state = NeoEntityModel.EntityState.GETTED;                                                                                         /* OVERRIDE */
            }
            if (NeoTrace.RUNTIME)
            {
                LogExt("Get(bkey).NPCContributor", e);
            }
            return(e);
        }