Skip to content

Commit 566935e

Browse files
author
Jason
authored
Merge pull request #136 from dfinity/gabor/assert
Add an `assert` verifying that the subaccount blob has 32 bytes
2 parents d6234de + 0e6f288 commit 566935e

File tree

1 file changed

+1
-0
lines changed
  • motoko/ledger-transfer/src/ledger_transfer

1 file changed

+1
-0
lines changed

motoko/ledger-transfer/src/ledger_transfer/Account.mo

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ module {
2929
hash.write([0x0A]);
3030
hash.write(Blob.toArray(Text.encodeUtf8("account-id")));
3131
hash.write(Blob.toArray(Principal.toBlob(principal)));
32+
assert subaccount.size() == 32;
3233
hash.write(Blob.toArray(subaccount));
3334
let hashSum = hash.sum();
3435
let crc32Bytes = beBytes(CRC32.ofArray(hashSum));

0 commit comments

Comments
 (0)