deserialize static method

TransactionPayload deserialize(
  1. Deserializer deserializer
)

Implementation

static TransactionPayload deserialize(Deserializer deserializer) {
  int index = deserializer.deserializeUleb128AsU32();
  switch (index) {
    case 0:
      return TransactionPayloadScript.load(deserializer);
    // TODO: change to 1 once ModuleBundle has been removed from rust
    case 2:
      return TransactionPayloadEntryFunction.load(deserializer);
    case 3:
      return TransactionPayloadMultisig.load(deserializer);
    default:
      throw ArgumentError("Unknown variant index for TransactionPayload: $index");
  }
}