This repository has been archived by the owner on Sep 13, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from nervosnetwork/patch/multisig
feat: supported autonomy in MultiSigService
- Loading branch information
Showing
3 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
packages/muta-service/src/builtins/MultiSignatureService.e2e.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { Client } from '@mutadev/client'; | ||
import { Account } from '@mutadev/account'; | ||
import { MultiSignatureService } from './MultiSignatureService'; | ||
|
||
const client = new Client(); | ||
|
||
const account1 = new Account( | ||
'0x0000000000000000000000000000000000000000000000000000000000000001', | ||
); | ||
const account2 = new Account( | ||
'0x0000000000000000000000000000000000000000000000000000000000000002', | ||
); | ||
const account3 = new Account( | ||
'0x0000000000000000000000000000000000000000000000000000000000000003', | ||
); | ||
|
||
test('test MultiSignatureService', async () => { | ||
const service = new MultiSignatureService(client, account1); | ||
const receipt = await service.write.generate_account({ | ||
autonomy: false, | ||
addr_with_weight: [ | ||
{ address: account1.address, weight: 1 }, | ||
{ address: account2.address, weight: 1 }, | ||
{ address: account3.address, weight: 1 }, | ||
], | ||
memo: 'hello world', | ||
owner: account1.address, | ||
threshold: 2, | ||
}); | ||
|
||
expect(Number(receipt.response.response.code)).toBe(0); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters