Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Returning default account as coinbase + allow altering sender in signer #4323

Merged
merged 3 commits into from Jan 30, 2017

Conversation

tomusdrw
Copy link
Collaborator

Coinbase will now return first account for particular dapp (so you can either use web3.eth.accounts[0] or web3.eth.coinbase) to get default account.
We agreed with @jacogr that the UI will always set default account as first on the list (either using parity_setDappsAddresses(dapp, [accounts]) or parity_setNewDappsWhitelist([accounts]))

Additionally signer RPC now allows to override transaction sender. PR allowing to omit from in TransactionRequest will follow.

Related: #3797

@tomusdrw tomusdrw added A0-pleasereview 🤓 Pull request needs code review. M4-core ⛓ Core client code / Rust. labels Jan 27, 2017
@gavofyork
Copy link
Contributor

web3.eth.coinbase doesn't really work for me as a standard API. it already means something else. i'm happy to support existing dapps which use it to mean "default user account" but i'd prefer not to crown it.

web3.eth.accounts[0] also doesn't fly especially well for me as it places a semantic onto the order of the list with is self-inconsistent. the first -> second item difference is crucial but then the second -> third (and all further next-door comparisons) are irrelevant. as my 2nd term university lecturer would have said, "it's a hack".

let's just have parity_defaultAccount (along with a change event to subscribe to) and be done with it.

@tomusdrw
Copy link
Collaborator Author

Added parity_defaultAccount RPC, subscriptions will come with #884

@gavofyork gavofyork added A8-looksgood 🦄 Pull request is reviewed well. and removed A0-pleasereview 🤓 Pull request needs code review. labels Jan 30, 2017
@gavofyork gavofyork merged commit bf1e7ec into master Jan 30, 2017
@gavofyork gavofyork deleted the default-account branch January 30, 2017 10:11
tomusdrw added a commit that referenced this pull request Feb 3, 2017
…er (#4323)

* Returning first address as coinbase

* Allowing sender alteration in signer

* Adding default account RPC
gavofyork pushed a commit that referenced this pull request Feb 4, 2017
…er (#4323) (#4431)

* Returning first address as coinbase

* Allowing sender alteration in signer

* Adding default account RPC
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A8-looksgood 🦄 Pull request is reviewed well. M4-core ⛓ Core client code / Rust.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants