Skip to content

Commit 9b0907e

Browse files
committed
chore: add multisig test case
1 parent 2569ad8 commit 9b0907e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/utils/addressMap.test.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,9 @@ describe('matchOwners', () => {
248248
const owner1 = address();
249249
const owner2 = Address.fromHex('7db97c7cece249c2b98bdc0226cc4c2a57bf52fc');
250250
const ownerAddresses: Uint8Array[] = [owner1.toBytes(), owner2.toBytes()];
251+
// NOTE: the ownerAddresses will be sorted in the OutputOwners -- owner2 is at index 0.
251252
const goodOwner = OutputOwners.fromNative(ownerAddresses, 0n, 1);
253+
const goodOwnerMultisig = OutputOwners.fromNative(ownerAddresses, 0n, 2);
252254
const threasholdTooHigh = OutputOwners.fromNative(ownerAddresses, 0n, 5);
253255
const wrongOwner = OutputOwners.fromNative(
254256
[hexToBuffer('0x12345123451234512345')],
@@ -288,6 +290,15 @@ describe('matchOwners', () => {
288290
expectedSigIndices: [1],
289291
expectedAddressMap: new AddressMap([[owner1, 1]]),
290292
},
293+
{
294+
testCase: goodOwnerMultisig,
295+
sigindices: [0, 1],
296+
expectedSigIndices: [0, 1],
297+
expectedAddressMap: new AddressMap([
298+
[owner2, 0],
299+
[owner1, 1],
300+
]),
301+
},
291302
{
292303
testCase: goodOwner,
293304
sigindices: [2],

0 commit comments

Comments
 (0)