CardanoBlock.deserialize constructor

CardanoBlock.deserialize(
  1. CborListValue<CborObject<Object?>> cbor
)

Implementation

factory CardanoBlock.deserialize(CborListValue cbor) {
  return CardanoBlock(
    header: Header.deserialize(cbor.elementAt<CborListValue>(0)),
    transactionBodies: TransactionBodies.deserialize(
      cbor.elementAt<CborListValue>(1),
    ),
    transactionWitnessSets: TransactionWitnessSets.deserialize(
      cbor.elementAt<CborListValue>(2),
    ),
    auxiliaryDataSet: AuxiliaryDataSet.deserialize(
      cbor.elementAt<CborMapValue>(3),
    ),
    invalidTransactions:
        cbor
            .elementAt<CborListValue>(4)
            .valueAsListOf<CborIntValue>()
            .map((e) => e.value)
            .toList(),
  );
}