Skip to content

Commit

Permalink
fix: signTransaction should return Promise<SignedTransaction>
Browse files Browse the repository at this point in the history
  • Loading branch information
joshstevens19 committed Jan 26, 2019
1 parent 2cfa2ea commit 2d8c551
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/web3-eth-accounts/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class Accounts extends AbstractWeb3Module {

privateKeyToAccount(privateKey: string): Account;

signTransaction(tx: Transaction, privateKey: string, callback?: () => void): SignedTransaction;
signTransaction(tx: Transaction, privateKey: string, callback?: () => void): Promise<SignedTransaction>;

recoverTransaction(signature: string): string;

Expand Down
4 changes: 2 additions & 2 deletions packages/web3-eth-accounts/types/tests/accounts-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ accounts.create('2435@#@#@±±±±!!!!678543213456764321§3456754321345678543213
// $ExpectType Account
accounts.privateKeyToAccount('0x348ce564d427a3311b6536bbcff9390d69395b06ed6c486954e971d960fe8709');

// $ExpectType SignedTransaction
// $ExpectType Promise<SignedTransaction>
accounts.signTransaction({
to: '0xF0109fC8DF283027b6285cc889F5aA624EaC1F55',
value: '1000000000',
gas: 2000000
}, '0x4c0883a69102937d6231471b5dbb6204fe5129617082792ae468d01a3f362318');

// $ExpectType SignedTransaction
// $ExpectType Promise<SignedTransaction>
accounts.signTransaction({
to: '0xF0109fC8DF283027b6285cc889F5aA624EaC1F55',
value: '1000000000',
Expand Down

0 comments on commit 2d8c551

Please sign in to comment.