Skip to content

Commit c8f1ee6

Browse files
author
Fabrice Bascoulergue
authored
Add clean support for multiple transaction signatures (#11)
* Revamp all tools to allow tx multiple signatures * Update documentation
1 parent a2f0fae commit c8f1ee6

30 files changed

+370
-516
lines changed

CONTRIBUTING.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Contributing
22

33
When contributing to this repository, please first discuss the change you wish to make via issue,
4-
email, or any other method with the owners of this repository before making a change.
4+
email, or any other method with the owners of this repository before making a change.
55

66
Please note we have a code of conduct, please follow it in all your interactions with the project.
77

@@ -10,7 +10,7 @@ Please note we have a code of conduct, please follow it in all your interactions
1010
1. Ensure any install or build dependencies are removed before the end of the layer when doing a build.
1111
2. Update the README.md with details of changes to the interface, this includes new environment variables, exposed ports, useful file locations and container parameters.
1212
3. Increase the version numbers in any examples files and the README.md to the new version that this Pull Request would represent. The versioning scheme we use is [SemVer](http://semver.org/).
13-
4. You may merge the Pull Request in once you have the approval of one core team member, or if you do not have permission to do that, you may request a reviewer to merge it for you.
13+
4. You may merge the Pull Request in once you have the approval of one core team member, or if you do not have permission to do that, you may request a reviewer to merge it for you.
1414

1515
## Code of Conduct
1616

@@ -25,19 +25,19 @@ nationality, personal appearance, race, religion, or sexual identity and orienta
2525
Examples of behavior that contributes to creating a positive environment
2626
include:
2727

28-
* Using welcoming language
29-
* Being respectful of differing viewpoints and experiences
30-
* Gracefully accepting constructive criticism
31-
* Focusing on what is best for the community
32-
* Showing empathy towards other community members
28+
- Using welcoming language
29+
- Being respectful of differing viewpoints and experiences
30+
- Gracefully accepting constructive criticism
31+
- Focusing on what is best for the community
32+
- Showing empathy towards other community members
3333

3434
Examples of unacceptable behavior by participants include:
3535

36-
* The use of sexualized language or imagery and unwelcome sexual attention or advances
37-
* Trolling, insulting/derogatory comments, and personal or political attacks
38-
* Public or private harassment
39-
* Publishing others' private information, such as a physical or electronic address, without explicit permission
40-
* Other conduct which could reasonably be considered inappropriate in a professional setting
36+
- The use of sexualized language or imagery and unwelcome sexual attention or advances
37+
- Trolling, insulting/derogatory comments, and personal or political attacks
38+
- Public or private harassment
39+
- Publishing others' private information, such as a physical or electronic address, without explicit permission
40+
- Other conduct which could reasonably be considered inappropriate in a professional setting
4141

4242
### Our Responsibilities
4343

@@ -50,14 +50,14 @@ threatening, offensive, or harmful.
5050

5151
### Scope
5252

53-
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community.
53+
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community.
5454
Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed
55-
representative at an online or offline event.
55+
representative at an online or offline event.
5656
Representation of a project may be further defined and clarified by project maintainers.
5757

5858
### Enforcement
5959

60-
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at contact [ at ] lum.network.
60+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at contact [ at ] lum.network.
6161
All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances.
6262
The project team is obligated to maintain confidentiality with regard to the reporter of an incident.
6363
Further details of specific enforcement policies may be posted separately.
@@ -70,4 +70,4 @@ members of the project's leadership.
7070
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
7171

7272
[homepage]: http://contributor-covenant.org
73-
[version]: http://contributor-covenant.org/version/1/4/
73+
[version]: http://contributor-covenant.org/version/1/4/

docs/README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,12 +158,15 @@ const fee = {
158158
const account = await testnetClient.getAccount(wallet.getAddress());
159159
// Create the transaction document
160160
const doc = {
161-
accountNumber: account.accountNumber,
162161
chainId,
163162
fee: fee,
164163
memo: 'my transaction memo',
165164
messages: [sendMsg],
166-
sequence: account.sequence,
165+
signers: [{
166+
accountNumber: account.accountNumber,
167+
sequence: account.sequence,
168+
publicKey: wallet.getPublicKey(),
169+
}],
167170
};
168171
// Sign and broadcast the transaction using the client
169172
const broadcastResult = await clt.signAndBroadcastTx(w1, doc);

docs/lib/classes/lumclient.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -285,15 +285,15 @@ ___
285285

286286
### signAndBroadcastTx
287287

288-
**signAndBroadcastTx**(`wallet`: [*LumWallet*](lumwallet.md), `doc`: [*Doc*](../interfaces/lumtypes.doc.md)): *Promise*<BroadcastTxCommitResponse\>
288+
**signAndBroadcastTx**(`wallet`: [*LumWallet*](lumwallet.md) \| [*LumWallet*](lumwallet.md)[], `doc`: [*Doc*](../interfaces/lumtypes.doc.md)): *Promise*<BroadcastTxCommitResponse\>
289289

290290
Signs and broadcast the transaction using the specified wallet and messages
291291

292292
#### Parameters:
293293

294294
Name | Type | Description |
295295
:------ | :------ | :------ |
296-
`wallet` | [*LumWallet*](lumwallet.md) | signing wallet |
296+
`wallet` | [*LumWallet*](lumwallet.md) \| [*LumWallet*](lumwallet.md)[] | signing wallet or wallets for multi signature |
297297
`doc` | [*Doc*](../interfaces/lumtypes.doc.md) | document to sign and broadcast as a transaction |
298298

299299
**Returns:** *Promise*<BroadcastTxCommitResponse\>
@@ -302,15 +302,15 @@ ___
302302

303303
### signTx
304304

305-
**signTx**(`wallet`: [*LumWallet*](lumwallet.md), `doc`: [*Doc*](../interfaces/lumtypes.doc.md)): *Promise*<Uint8Array\>
305+
**signTx**(`wallet`: [*LumWallet*](lumwallet.md) \| [*LumWallet*](lumwallet.md)[], `doc`: [*Doc*](../interfaces/lumtypes.doc.md)): *Promise*<Uint8Array\>
306306

307307
Signs the messages using the provided wallet and builds the transaction
308308

309309
#### Parameters:
310310

311311
Name | Type | Description |
312312
:------ | :------ | :------ |
313-
`wallet` | [*LumWallet*](lumwallet.md) | signing wallet |
313+
`wallet` | [*LumWallet*](lumwallet.md) \| [*LumWallet*](lumwallet.md)[] | signing wallet or wallets for multi signature |
314314
`doc` | [*Doc*](../interfaces/lumtypes.doc.md) | document to sign |
315315

316316
**Returns:** *Promise*<Uint8Array\>

docs/lib/classes/lumpaperwallet.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ ___
6767

6868
### privateKey
6969

70-
`Private` `Optional` **privateKey**: *undefined* \| *Uint8Array*
70+
`Optional` **privateKey**: *undefined* \| *Uint8Array*
7171

7272
___
7373

docs/lib/interfaces/lummessages.msgbeginredelegate.md

Lines changed: 0 additions & 39 deletions
This file was deleted.

docs/lib/interfaces/lummessages.msgcreatevalidator.md

Lines changed: 0 additions & 59 deletions
This file was deleted.

docs/lib/interfaces/lummessages.msgdelegate.md

Lines changed: 0 additions & 32 deletions
This file was deleted.

docs/lib/interfaces/lummessages.msgeditvalidator.md

Lines changed: 0 additions & 43 deletions
This file was deleted.

docs/lib/interfaces/lummessages.msgfundcommunitypool.md

Lines changed: 0 additions & 25 deletions
This file was deleted.

docs/lib/interfaces/lummessages.msgmintandsend.md

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)