Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

importRawKey added #31

Merged
merged 1 commit into from
Dec 26, 2017
Merged

Conversation

jbaylina
Copy link
Contributor

I added support for personal.importRawKey.

This is needed when you want to create transactions from a specific account.

@@ -101,6 +101,7 @@ The RPC methods currently implemented are:
* `personal_listAccounts`
* `personal_lockAccount`
* `personal_newAccount`
* `personal_importRawAccount`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you meant personal_importRawKey here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for you to correct this - I'll do it on merge.

@@ -390,6 +390,14 @@ GethApiDouble.prototype.personal_newAccount = function(password, callback) {
callback(null, account.address);
};

GethApiDouble.prototype.personal_importRawKey = function(rawKey, password, callback) {
var account = this.state.createAccount({ secretKey: rawKey });
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably be updated to make use of options.defaultBalanceEther (see latest README.md in develop branch)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, scratch that - we likely want this account to be added with a zero balance.

@benjamincburns
Copy link
Contributor

Thanks for the contribution, @jbaylina! Merging this one now.

@benjamincburns benjamincburns merged commit 438e0ce into trufflesuite:develop Dec 26, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants