public void Add(BytesList bl) { foreach (var bytes in bl.RawList) { Add(bytes); } }
public string ToHex(TIn obj) { var to = new BytesList(); ToBytesSink(obj, to); return(to.BytesHex()); }
public void AddLengthEncoded(ISerializedType value) { var bytes = new BytesList(); value.ToBytesSink(bytes); AddLengthEncoded(bytes); }
public byte[] ToBytes(TIn obj) { var to = new BytesList(); ToBytesSink(obj, to); return(to.Bytes()); }
public void Prepare(IKeyPair keyPair, Amount fee, UInt32 sequence, UInt32 lastLedgerSequence) { // This won't always be specified if (lastLedgerSequence != null) { Txn.Add(UInt32.LastLedgerSequence, lastLedgerSequence); } Txn.Add(UInt32.Sequence, sequence); Txn.Add(Amount.Fee, fee); Txn.Add(VariableLength.SigningPubKey, keyPair.PubBytes()); if (Transaction.CanonicalFlagDeployed) { Txn.SetCanonicalSignatureFlag(); } SigningHash = Txn.SigningHash(); if (PreviousSigningHash != null && SigningHash.Equals(PreviousSigningHash)) { return; } try { byte[] signature = keyPair.Sign(SigningHash.Bytes); Txn.Add(VariableLength.TxnSignature, signature); var blob = new BytesList(); Hash256.HalfSha512 id = Hash256.Prefixed256(HashPrefix.TransactionId); Txn.ToBytesSink(new MultiSink(blob, id)); TxBlob = blob.BytesHex(); Hash = id.Finish(); } catch (Exception e) { // electric paranoia PreviousSigningHash = null; throw new ApplicationException("Something went wrong.", e); } PreviousSigningHash = SigningHash; }
public void AddLengthEncoded(BytesList bytes) { Add(EncodeVl(bytes.BytesLength)); Add(bytes); }
public BinaryWriter(BytesList list) { _list = list; }