Skip to content

Commit

Permalink
chore: add multisig test case
Browse files Browse the repository at this point in the history
  • Loading branch information
rictorlome committed Nov 26, 2024
1 parent 2569ad8 commit 9b0907e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/utils/addressMap.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,9 @@ describe('matchOwners', () => {
const owner1 = address();
const owner2 = Address.fromHex('7db97c7cece249c2b98bdc0226cc4c2a57bf52fc');
const ownerAddresses: Uint8Array[] = [owner1.toBytes(), owner2.toBytes()];
// NOTE: the ownerAddresses will be sorted in the OutputOwners -- owner2 is at index 0.
const goodOwner = OutputOwners.fromNative(ownerAddresses, 0n, 1);
const goodOwnerMultisig = OutputOwners.fromNative(ownerAddresses, 0n, 2);
const threasholdTooHigh = OutputOwners.fromNative(ownerAddresses, 0n, 5);
const wrongOwner = OutputOwners.fromNative(
[hexToBuffer('0x12345123451234512345')],
Expand Down Expand Up @@ -288,6 +290,15 @@ describe('matchOwners', () => {
expectedSigIndices: [1],
expectedAddressMap: new AddressMap([[owner1, 1]]),
},
{
testCase: goodOwnerMultisig,
sigindices: [0, 1],
expectedSigIndices: [0, 1],
expectedAddressMap: new AddressMap([
[owner2, 0],
[owner1, 1],
]),
},
{
testCase: goodOwner,
sigindices: [2],
Expand Down

0 comments on commit 9b0907e

Please sign in to comment.