EOSIO / eosjs

General purpose library for the EOSIO blockchain.
http://eosio.github.io/eosjs
MIT License
1.43k stars 462 forks source link

simplify default signing #17

Closed jcalfee closed 6 years ago

jcalfee commented 6 years ago

Add: if only 1 key is available it will simply sign the transaction without talking to the blockchain

Existing behavior will be kept when the user provides more than one private key to eosjs:

The default sign provider is designed to interact with the available public keys (maybe just one), the transaction and blockchain to figure out the minimum set of signing keys. Providing a custom signProvider skips that process.

Skipping this process when eosjs has 1 key changes the error message if the wrong key is used to sign a transaction. It will of course reject, just a bit later from eos. This overall improves efficiency and removes complexity, most transactions will pass.

I propose this as a patch..

jcalfee commented 6 years ago

actually, this should be a minor upgrade (major.minor.patch) because an error message will change..

minor means it "should not" break anything..