Skip to content

Commit

Permalink
test: correct fromBridge calls
Browse files Browse the repository at this point in the history
  • Loading branch information
turadg committed Jan 21, 2025
1 parent a9bb754 commit 42445e9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 2 additions & 0 deletions packages/inter-protocol/src/provisionPoolKit.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ export const prepareBridgeProvisionTool = zone =>
throw Fail`Unrecognized request ${obj.type}`;
trace('PLEASE_PROVISION', obj);
const { address, powerFlags } = obj;
// XXX expects powerFlags to be an array, but if it's a string then
// this allows a string that has 'SMART_WALLET' in it.
powerFlags.includes(PowerFlags.SMART_WALLET) ||
Fail`missing SMART_WALLET in powerFlags`;

Expand Down
10 changes: 8 additions & 2 deletions packages/inter-protocol/test/provisionPool.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -377,9 +377,12 @@ test('makeBridgeProvisionTool handles duplicate requests', async t => {
t.log('1st request to provision a SMART_WALLET for', address);
await handler.fromBridge({
type: 'PLEASE_PROVISION',
blockHeight: '123',
blockTime: '1737432662',
address,
autoProvision: true,
nickname: 'test',
powerFlags: PowerFlags.SMART_WALLET,
powerFlags: [PowerFlags.SMART_WALLET],
submitter: address,
});

Expand All @@ -396,9 +399,12 @@ test('makeBridgeProvisionTool handles duplicate requests', async t => {
t.log('2nd request to provision a SMART_WALLET for', address);
await handler.fromBridge({
type: 'PLEASE_PROVISION',
blockHeight: '123',
blockTime: '1737432662',
address,
autoProvision: true,
nickname: 'test',
powerFlags: PowerFlags.SMART_WALLET,
powerFlags: [PowerFlags.SMART_WALLET],
submitter: address,
});
t.is(
Expand Down

0 comments on commit 42445e9

Please sign in to comment.