コード例 #1
0
 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)
     });
 }
コード例 #2
0
 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),
     });
 }
コード例 #3
0
 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()
     });
 }
コード例 #4
0
 static PreendorsementContent UnforgePreendorsement(ForgedReader reader)
 {
     return(new PreendorsementContent
     {
         Slot = reader.ReadInt32(2),
         Level = reader.ReadInt32(),
         Round = reader.ReadInt32(),
         PayloadHash = reader.ReadBase58(32, Prefix.vh)
     });
 }
コード例 #5
0
        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)));
            }
        }
コード例 #6
0
 static string UnforgeSeedNonce(ForgedReader reader)
 {
     return(UnforgeConditional(reader, () => reader.ReadBase58(Lengths.nce.Decoded, Prefix.nce)));
 }