revokeAttribute method

Future<void> revokeAttribute(
  1. String privateKeyFrom,
  2. String identityDid,
  3. String name,
  4. String value,
)

Implementation

Future<void> revokeAttribute(String privateKeyFrom, String identityDid,
    String name, String value) async {
  if (!_matchesExpectedDid(identityDid)) {
    throw Exception(
        'Information about $identityDid do not belong to this network');
  }
  var revokeAttributeFunction = _erc1056contract.function('revokeAttribute');
  var nameList = _to32ByteUtf8(name);
  var valueList = Uint8List.fromList(_utf8.encode(value));

  Transaction tx = Transaction.callContract(
      contract: _erc1056contract,
      function: revokeAttributeFunction,
      parameters: [_didToAddress(identityDid), nameList, valueList]);

  await web3Client.sendTransaction(EthPrivateKey.fromHex(privateKeyFrom), tx,
      chainId: chainId);
}