isUsedAsReceiving method

bool isUsedAsReceiving(
  1. TransactionBlockDataBuilder transactionData,
  2. int index
)

Implementation

bool isUsedAsReceiving(TransactionBlockDataBuilder transactionData, int index) {
  var usedAsReceiving = false;

  transactionData.getInputUses(index, (arg, tx) {
    if (tx["MoveCall"]?["_argumentTypes"] != null) {
      final arguments = tx["MoveCall"]["arguments"].toList();
      final argIndex = arguments.indexWhere((element) =>
        DeepCollectionEquality().equals(element, arg)
      );
      if (argIndex != -1) {
        usedAsReceiving = isReceivingType(tx["MoveCall"]["_argumentTypes"][argIndex]) || usedAsReceiving;
      }
    }
  });

  return usedAsReceiving;
}