static InlinedPreendorsement UnforgeInlinedPreendorsement(ForgedReader reader) { return(new InlinedPreendorsement { Branch = reader.ReadBase58(Lengths.B.Decoded, Prefix.B), Operations = (PreendorsementContent)UnforgeOperation(reader), Signature = reader.ReadBase58(Lengths.sig.Decoded, Prefix.sig) }); }
static BlockHeader UnforgeBlockHeader(ForgedReader reader) { return(new BlockHeader { Level = reader.ReadInt32(), Proto = reader.ReadInt32(1), Predecessor = reader.ReadBase58(Lengths.B.Decoded, Prefix.B), Timestamp = DateTimeExtension.FromUnixTime(reader.ReadInt64()), ValidationPass = reader.ReadInt32(1), OperationsHash = reader.ReadBase58(Lengths.LLo.Decoded, Prefix.LLo), Fitness = reader.ReadEnumerable(r => r.ReadHexString()).ToList(), Context = reader.ReadBase58(Lengths.Co.Decoded, Prefix.Co), Priority = reader.ReadInt32(2), ProofOfWorkNonce = Hex.Convert(reader.ReadBytes(8)), SeedNonceHash = UnforgeSeedNonce(reader), Signature = reader.ReadBase58(Lengths.sig.Decoded, Prefix.sig), }); }
static BallotContent UnforgeBallot(ForgedReader reader) { return(new BallotContent { Source = reader.ReadTzAddress(), Period = reader.ReadInt32(), Proposal = reader.ReadBase58(Lengths.P.Decoded, Prefix.P), Ballot = (Ballot)reader.ReadByte() }); }
static PreendorsementContent UnforgePreendorsement(ForgedReader reader) { return(new PreendorsementContent { Slot = reader.ReadInt32(2), Level = reader.ReadInt32(), Round = reader.ReadInt32(), PayloadHash = reader.ReadBase58(32, Prefix.vh) }); }
public Task <(string, IEnumerable <OperationContent>)> UnforgeOperationAsync(byte[] bytes) { using (var reader = new ForgedReader(bytes)) { var branch = reader.ReadBase58(Lengths.B.Decoded, Prefix.B); var content = new List <OperationContent>(); while (!reader.EndOfStream) { content.Add(UnforgeOperation(reader)); } return(Task.FromResult((branch, (IEnumerable <OperationContent>)content))); } }
static string UnforgeSeedNonce(ForgedReader reader) { return(UnforgeConditional(reader, () => reader.ReadBase58(Lengths.nce.Decoded, Prefix.nce))); }