public Extrinsic(bool signed, Account account, CompactInteger nonce, Method method, Era era, CompactInteger tip) { Signed = signed; TransactionVersion = Constants.EXTRINSIC_VERSION; Account = account; Era = era; Nonce = nonce; Tip = tip; Method = method; }
public UnCheckedExtrinsic(bool signed, Account account, Method method, Era era, CompactInteger nonce, CompactInteger tip, Hash genesis, Hash startEra) : base(signed, account, nonce, method, era, tip) { _genesis = genesis; _startEra = startEra; }
internal Extrinsic(Memory <byte> memory) { int p = 0; int m; // length var length = CompactInteger.Decode(memory.ToArray(), ref p); // signature version m = 1; var _signatureVersion = memory.Slice(p, m).ToArray()[0]; Signed = _signatureVersion >= 0x80; TransactionVersion = (byte)(_signatureVersion - (Signed ? 0x80 : 0x00)); p += m; // sender public key m = 32; var _senderPublicKey = memory.Slice(p, m).ToArray(); p += m; // sender public key type m = 1; var _senderPublicKeyType = memory.Slice(p, m).ToArray()[0]; p += m; Account = new Account((KeyType)_senderPublicKeyType, _senderPublicKey); // signature m = 64; Signature = memory.Slice(p, m).ToArray(); p += m; // era m = 1; var era = memory.Slice(p, m).ToArray(); if (era[0] != 0) { m = 2; era = memory.Slice(p, m).ToArray(); } Era = Era.Decode(era); p += m; // nonce Nonce = CompactInteger.Decode(memory.ToArray(), ref p); // tip Tip = CompactInteger.Decode(memory.ToArray(), ref p); // method m = 2; var method = memory.Slice(p, m).ToArray(); p += m; // parameters var parameter = memory.Slice(p).ToArray(); Method = new Method(method[0], method[1], parameter); }
public SignedExtensions(uint specVersion, uint txVersion, Hash genesis, Hash startEra, Era mortality, CompactInteger nonce, CompactInteger chargeTransactionPayment) { _specVersion = specVersion; _txVersion = txVersion; _genesis = genesis; _startEra = startEra; _mortality = mortality; _nonce = nonce; _chargeTransactionPayment = chargeTransactionPayment; }