setSorobanAuth method Null safety

dynamic setSorobanAuth(
  1. List<SorobanAuthorizationEntry>? auth
)

sets soroban auth to the host function of the invoke contract operation if any.

Implementation

setSorobanAuth(List<SorobanAuthorizationEntry>? auth) {
  List<SorobanAuthorizationEntry> auth2Set =
      List<SorobanAuthorizationEntry>.empty(growable: true);
  if (auth != null) {
    auth2Set = auth;
  }
  for (Operation op in operations) {
    if (op is InvokeHostFunctionOperation) {
      op.auth = auth2Set;
    }
  }
}