Typeberry by Fluffy Labs - v0.4.0
    Preparing search index...

    Class TransitionHasher

    Helper function to create most used hashes in the block

    Implements

    Index

    Constructors

    Properties

    blake2b: Blake2b

    Methods

    • Parameters

      Returns WithHashAndBytes<
          OpaqueHash & pvm.WithOpaque<"ExtrinsicHash">,
          ViewOf<
              Extrinsic,
              {
                  assurances: Descriptor<
                      readonly AvailabilityAssurance[] & pvm.WithOpaque<
                          "[0 .. ValidatorsCount)",
                      >,
                      SequenceView<
                          AvailabilityAssurance,
                          ViewOf<
                              AvailabilityAssurance,
                              {
                                  anchor: Descriptor<
                                      Bytes<32> & pvm.WithOpaque<"HeaderHash">,
                                      Bytes<32>,
                                  >;
                                  bitfield: Descriptor<BitVec, BitVec>;
                                  signature: Descriptor<
                                      Bytes<64> & pvm.WithOpaque<"Ed25519Signature">,
                                      Bytes<64>,
                                  >;
                                  validatorIndex: Descriptor<
                                      number & WithBytesRepresentation<2> & pvm.WithOpaque<
                                          "ValidatorIndex[u16]",
                                      >,
                                      Bytes<2>,
                                  >;
                              },
                          >,
                      >,
                  >;
                  disputes: Descriptor<
                      DisputesExtrinsic,
                      ViewOf<
                          DisputesExtrinsic,
                          {
                              culprits: Descriptor<
                                  Culprit[],
                                  SequenceView<
                                      Culprit,
                                      ViewOf<
                                          Culprit,
                                          {
                                              key: Descriptor<(...), (...)>;
                                              signature: Descriptor<(...), (...)>;
                                              workReportHash: Descriptor<(...), (...)>;
                                          },
                                      >,
                                  >,
                              >;
                              faults: Descriptor<
                                  Fault[],
                                  SequenceView<
                                      Fault,
                                      ViewOf<
                                          Fault,
                                          {
                                              key: Descriptor<(...), (...)>;
                                              signature: Descriptor<(...), (...)>;
                                              wasConsideredValid: Descriptor<(...), (...)>;
                                              workReportHash: Descriptor<(...), (...)>;
                                          },
                                      >,
                                  >,
                              >;
                              verdicts: Descriptor<
                                  Verdict[],
                                  SequenceView<
                                      Verdict,
                                      ViewOf<
                                          Verdict,
                                          {
                                              votes: Descriptor<(...), (...)>;
                                              votesEpoch: Descriptor<(...), (...)>;
                                              workReportHash: Descriptor<(...), (...)>;
                                          },
                                      >,
                                  >,
                              >;
                          },
                      >,
                  >;
                  guarantees: Descriptor<
                      readonly ReportGuarantee[] & pvm.WithOpaque<"[0..CoresCount)">,
                      SequenceView<
                          ReportGuarantee,
                          ViewOf<
                              ReportGuarantee,
                              {
                                  credentials: Descriptor<
                                      | readonly (...)[] & pvm.WithOpaque<(...)>
                                      | readonly (...)[] & pvm.WithOpaque<(...)>,
                                      SequenceView<
                                          Credential,
                                          ViewOf<Credential, { signature: ...; validatorIndex: ... }>,
                                      >,
                                  >;
                                  report: Descriptor<
                                      WorkReportNoCodec,
                                      ViewOf<
                                          WorkReportNoCodec,
                                          {
                                              authorizationGasUsed: Descriptor<(...), (...)>;
                                              authorizationOutput: Descriptor<(...), (...)>;
                                              authorizerHash: Descriptor<(...), (...)>;
                                              context: Descriptor<(...), (...)>;
                                              coreIndex: Descriptor<(...), (...)>;
                                              results: Descriptor<(...), (...)>;
                                              segmentRootLookup: Descriptor<(...), (...)>;
                                              workPackageSpec: Descriptor<(...), (...)>;
                                          },
                                      >,
                                  >;
                                  slot: Descriptor<
                                      number & WithBytesRepresentation<4> & pvm.WithOpaque<
                                          "TimeSlot[u32]",
                                      >,
                                      Bytes<4>,
                                  >;
                              },
                          >,
                      >,
                  >;
                  preimages: Descriptor<
                      Preimage[],
                      SequenceView<
                          Preimage,
                          ViewOf<
                              Preimage,
                              {
                                  blob: Descriptor<BytesBlob, BytesBlob>;
                                  requester: Descriptor<
                                      number & WithBytesRepresentation<4> & pvm.WithOpaque<
                                          "ServiceId[u32]",
                                      >,
                                      Bytes<4>,
                                  >;
                              },
                          >,
                      >,
                  >;
                  tickets: Descriptor<
                      readonly SignedTicket[] & pvm.WithOpaque<
                          "Size: [0..chainSpec.maxTicketsPerExtrinsic)",
                      >,
                      SequenceView<
                          SignedTicket,
                          ViewOf<
                              SignedTicket,
                              {
                                  attempt: Descriptor<
                                      number & WithBytesRepresentation<1> & pvm.WithOpaque<
                                          "TicketAttempt[0|1|2]",
                                      >,
                                      U8,
                                  >;
                                  signature: Descriptor<
                                      Bytes<784> & pvm.WithOpaque<"BandersnatchRingSignature">,
                                      Bytes<784>,
                                  >;
                              },
                          >,
                      >,
                  >;
              },
          >,
      >

    • Creates hash from the block header view

      Parameters

      Returns WithHash<
          OpaqueHash & pvm.WithOpaque<"HeaderHash">,
          ViewOf<
              Header & CodecRecord<Header>,
              {
                  bandersnatchBlockAuthorIndex: Descriptor<
                      number & WithBytesRepresentation<2> & pvm.WithOpaque<
                          "ValidatorIndex[u16]",
                      >,
                      Bytes<2>,
                  >;
                  entropySource: Descriptor<
                      Bytes<96> & pvm.WithOpaque<"BandersnatchVrfSignature">,
                      Bytes<96>,
                  >;
                  epochMarker: Descriptor<
                      EpochMarker
                      | null,

                          | ViewOf<
                              EpochMarker,
                              {
                                  entropy: Descriptor<
                                      Bytes<32> & pvm.WithOpaque<"EntropyHash">,
                                      Bytes<32>,
                                  >;
                                  ticketsEntropy: Descriptor<
                                      Bytes<32> & pvm.WithOpaque<"EntropyHash">,
                                      Bytes<32>,
                                  >;
                                  validators: Descriptor<
                                      readonly ValidatorKeys[] & pvm.WithOpaque<"ValidatorsCount">,
                                      SequenceView<
                                          ValidatorKeys,
                                          ViewOf<ValidatorKeys, { bandersnatch: ...; ed25519: ... }>,
                                      >,
                                  >;
                              },
                          >
                          | null,
                  >;
                  extrinsicHash: Descriptor<
                      Bytes<32> & pvm.WithOpaque<"ExtrinsicHash">,
                      Bytes<32>,
                  >;
                  offendersMarker: Descriptor<
                      (Bytes<32> & pvm.WithOpaque<"Ed25519Key">)[],
                      SequenceView<Bytes<32> & pvm.WithOpaque<"Ed25519Key">, Bytes<32>>,
                  >;
                  parentHeaderHash: Descriptor<
                      Bytes<32> & pvm.WithOpaque<"HeaderHash">,
                      Bytes<32>,
                  >;
                  priorStateRoot: Descriptor<
                      Bytes<32> & pvm.WithOpaque<"StateRootHash">,
                      Bytes<32>,
                  >;
                  seal: Descriptor<
                      Bytes<96> & pvm.WithOpaque<"BandersnatchVrfSignature">,
                      Bytes<96>,
                  >;
                  ticketsMarker: Descriptor<
                      TicketsMarker
                      | null,

                          | ViewOf<
                              TicketsMarker,
                              {
                                  tickets: Descriptor<
                                      readonly Ticket[] & pvm.WithOpaque<"EpochLength">,
                                      SequenceView<Ticket, ViewOf<Ticket, { attempt: ...; id: ... }>>,
                                  >;
                              },
                          >
                          | null,
                  >;
                  timeSlotIndex: Descriptor<
                      number & WithBytesRepresentation<4> & pvm.WithOpaque<"TimeSlot[u32]">,
                      Bytes<4>,
                  >;
              },
          >,
      >