Ejemplo n.º 1
0
        public void OnAccount(HttpMessage httpMessage)
        {
            if (!GetParam(httpMessage, "1", "Address", out string address))
            {
                httpMessage.result = "command error! \nexample: account address";
                return;
            }

            using (DbSnapshot dbSnapshot = Entity.Root.GetComponent <LevelDBStore>().GetSnapshot(0))
            {
                Account account = dbSnapshot.Accounts.Get(address);
                if (account != null)
                {
                    httpMessage.result = $"          Account: {account.address}, amount:{BigInt.Div(account.amount , "10000")} , index:{account.index}";
                }
                else
                {
                    httpMessage.result = $"          Account: {address}, amount:0 , index:0";
                }
            }
        }