isDepositor method

bool isDepositor(
  1. String address
)

Check if this is the depositor (transaction initiator)

The depositor can cancel the transaction and gets the deposit back.

Parameters:

  • address: Address to check

Example:

if (storage.isDepositor(alice.address)) {
  print('Alice can cancel this transaction');
}

Implementation

bool isDepositor(final String address) {
  try {
    final pubkey = Address.decode(address).pubkey;
    return _bytesEqual(depositor, pubkey);
  } catch (_) {
    return false;
  }
}