Esempio n. 1
0
 protected override void DeserializeExclusiveData(BinaryReader reader)
 {
     ScriptHash     = reader.ReadSerializable <UInt160>();
     DetainState    = (DetainStatus)reader.ReadByte();
     DetainDuration = reader.ReadUInt32();
     Flag           = reader.ReadUInt32();
     Data           = reader.ReadVarBytes();
 }
Esempio n. 2
0
 void ICloneable <AccountState> .FromReplica(AccountState replica)
 {
     ScriptHash   = replica.ScriptHash;
     DetainState  = replica.DetainState;
     DetainExpire = replica.DetainExpire;
     Magic        = replica.Magic;
     Votes        = replica.Votes;
     Balances     = replica.Balances;
 }
Esempio n. 3
0
 public AccountState(UInt160 hash)
 {
     this.ScriptHash   = hash;
     this.DetainState  = DetainStatus.UnFreeze;
     this.DetainExpire = 0;
     this.Magic        = 0;
     this.Votes        = new ECPoint[0];
     this.Balances     = new Dictionary <UInt256, Fixed8>();
 }
Esempio n. 4
0
        public override void Deserialize(BinaryReader reader)
        {
            base.Deserialize(reader);
            ScriptHash   = reader.ReadSerializable <UInt160>();
            DetainState  = (DetainStatus)reader.ReadByte();
            DetainExpire = reader.ReadUInt32();
            Magic        = reader.ReadUInt32();
            Votes        = new ECPoint[reader.ReadVarInt()];
            for (int i = 0; i < Votes.Length; i++)
            {
                Votes[i] = ECPoint.DeserializeFrom(reader, ECCurve.Secp256r1);
            }
            int count = (int)reader.ReadVarInt();

            Balances = new Dictionary <UInt256, Fixed8>(count);
            for (int i = 0; i < count; i++)
            {
                UInt256 assetId = reader.ReadSerializable <UInt256>();
                Fixed8  value   = reader.ReadSerializable <Fixed8>();
                Balances.Add(assetId, value);
            }
        }