find static method

TransactionType find(
  1. dynamic v
)

Implementation

static TransactionType find(dynamic v) {
  if (v == null) return TransactionType.legacy;
  if (v is int && v == 0) return TransactionType.v0;
  if (v is String) {
    if (v.toLowerCase() == legacy.name) {
      return legacy;
    } else if (v.toLowerCase() == v0.name.toLowerCase()) {
      return v0;
    }
  }
  throw MessageException("Invalid Versioned transaction type",
      details: {"value": v});
}