Example #1
0
    def Deserialize(self, reader):
        super(AssetState, self).Deserialize(reader)
        self.AssetId = reader.ReadUInt256()
        self.AssetType = reader.ReadByte()
        self.Name = reader.ReadVarString()

        position = reader.stream.tell()

        try:
            self.Amount = reader.ReadFixed8(unsigned=True)
        except Exception as e:
            reader.stream.seek(position)
            self.Amount = reader.ReadFixed8()

        self.Available = reader.ReadFixed8(unsigned=True)
        self.Precision = reader.ReadByte()

        #fee mode
        reader.ReadByte()

        self.Fee = reader.ReadFixed8()
        self.FeeAddress = reader.ReadUInt160()
        self.Owner = ECDSA.Deserialize_Secp256r1(reader)
        self.Admin = reader.ReadUInt160()
        self.Issuer = reader.ReadUInt160()
        self.Expiration = reader.ReadUInt32()
        self.IsFrozen = reader.ReadBool()
Example #2
0
 def DeserializeExclusiveData(self, reader):
     self.Type = TransactionType.RegisterTransaction
     self.AssetType = reader.ReadByte()
     self.Name = reader.ReadVarString()
     self.Amount = reader.ReadFixed8()
     self.Precision = reader.ReadByte()
     self.Owner = ECDSA.Deserialize_Secp256r1(reader)
     #        self.Owner = ecdsa.G
     self.Admin = reader.ReadUInt160()
Example #3
0
    def Deserialize(self, reader):
        super(AssetState, self).Deserialize(reader)
        self.AssetId = reader.ReadUInt256()
        self.AssetType = reader.ReadByte()
        self.Name = reader.ReadVarString()
        self.Amount = reader.ReadFixed8()
        self.Available = reader.ReadFixed8()
        self.Precision = reader.ReadByte()
        #fee mode
        reader.ReadByte()

        self.Fee = reader.ReadFixed8()
        self.FeeAddress = reader.ReadUInt160()
        self.Owner = ECDSA.Deserialize_Secp256r1(reader)
        self.Admin = reader.ReadUInt160()
        self.Issuer = reader.ReadUInt160()
        self.Expiration = reader.ReadUInt32()
        self.IsFrozen = reader.ReadBool()
    def DeserializeExclusiveData(self, reader):
        if self.Version is not 0:
            raise Exception('Invalid format')

        self.PublicKey = ECDSA.Deserialize_Secp256r1(reader)
Example #5
0
 def Deserialize(self, reader):
     super(ValidatorState, self).Deserialize(reader)
     self.PublicKey = ECDSA.Deserialize_Secp256r1(reader)