wip: prepare extrinsic revocation
This commit is contained in:
parent
f46acb23e4
commit
8663186a4a
|
@ -842,19 +842,24 @@ newKeySig: $newKeySig""");
|
||||||
|
|
||||||
Future revokeIdentity(String address, String password) async {
|
Future revokeIdentity(String address, String password) async {
|
||||||
final idtyIndex = await _getIdentityIndexOf(address);
|
final idtyIndex = await _getIdentityIndexOf(address);
|
||||||
|
|
||||||
final sender = await _setSender(address);
|
final sender = await _setSender(address);
|
||||||
|
|
||||||
TxInfoData txInfo;
|
final prefix = '?'.codeUnits;
|
||||||
|
final genesisHashString = await getGenesisHash();
|
||||||
|
final genesisHash = HEX.decode(genesisHashString.substring(2)) as Uint8List;
|
||||||
|
final idtyIndexBytes = _int32bytes(idtyIndex);
|
||||||
|
final oldPubkey = await addressToPubkey(address);
|
||||||
|
final messageToSign =
|
||||||
|
Uint8List.fromList(prefix + genesisHash + idtyIndexBytes + oldPubkey);
|
||||||
|
final revocationSig = await _signMessage(messageToSign, address, password);
|
||||||
|
|
||||||
txInfo = TxInfoData(
|
final txInfo = TxInfoData(
|
||||||
'identity',
|
'identity',
|
||||||
'revokeIdentity',
|
'revokeIdentity',
|
||||||
sender,
|
sender,
|
||||||
);
|
);
|
||||||
|
|
||||||
final txOptions = [idtyIndex];
|
final txOptions = [idtyIndex, address, revocationSig];
|
||||||
|
|
||||||
return await _executeCall(txInfo, txOptions, password);
|
return await _executeCall(txInfo, txOptions, password);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue