decode method Null safety

XdrContractAuth decode(
  1. XdrDataInputStream stream
)

Implementation

static XdrContractAuth decode(XdrDataInputStream stream) {
  XdrAddressWithNonce? addressWithNonce;
  int addressWithNoncePresent = stream.readInt();
  if (addressWithNoncePresent != 0) {
    addressWithNonce = XdrAddressWithNonce.decode(stream);
  }

  XdrAuthorizedInvocation rootInvocation =
      XdrAuthorizedInvocation.decode(stream);

  int signatureArgsSize = stream.readInt();
  List<XdrSCVal> signatureArgs = List<XdrSCVal>.empty(growable: true);
  for (int i = 0; i < signatureArgsSize; i++) {
    signatureArgs.add(XdrSCVal.decode(stream));
  }

  return XdrContractAuth(addressWithNonce, rootInvocation, signatureArgs);
}