openethereum/rpc/src/v1/helpers
Niklas Adolfsson 6e7d8f90b5 [light] Validate account balance before importing transactions (#9417)
* `light::verify_transaction` basic tx validation

* update wasm tests

* Provide `cached_nonce` in `parity_next_nonce` RPC

* nits

* Improve error handeling

Two separate errors for distinguishing between `account not found` and
`insufficient balance`. However, when `next_nonce()` is called and the
account is not found then provide `local_best_next_nonce`!

* Ensure only one n/w request is performed

Refactored to code again:
* Removed `fn cached_next_nonce`
* Removed extra n/w request in `sign` to check balance
* Refactored `fill_optional_field` to request nonce and check account balance

* nits

* grumbles needless clone

* Prevent integer overflow with saturating add & mul

* Call `sign_transaction()` directly from `sign()`

Because the change in `fill_optional_fields` always fill the nonce it is
now possible to call `sign_transaction` directly instead of creating a
`ProspectiveSigner` "object".
2018-09-11 19:20:59 +02:00
..
accounts.rs Update license header and scripts (#8666) 2018-06-04 10:19:50 +02:00
block_import.rs rpc: fix is_major_importing sync state condition (#9112) 2018-07-23 15:42:08 +02:00
dispatch.rs [light] Validate account balance before importing transactions (#9417) 2018-09-11 19:20:59 +02:00
errors.rs Better support for eth_getLogs in light mode (#9186) 2018-08-25 23:06:01 +02:00
fake_sign.rs Fetch parity-common crates from crates.io (#9410) 2018-09-04 20:13:51 +02:00
ipfs.rs Update license header and scripts (#8666) 2018-06-04 10:19:50 +02:00
light_fetch.rs Better support for eth_getLogs in light mode (#9186) 2018-08-25 23:06:01 +02:00
mod.rs Completely remove all dapps struct from rpc (#9107) 2018-07-16 13:42:59 +02:00
network_settings.rs Update license header and scripts (#8666) 2018-06-04 10:19:50 +02:00
nonce.rs Fetch parity-common crates from crates.io (#9410) 2018-09-04 20:13:51 +02:00
oneshot.rs Update license header and scripts (#8666) 2018-06-04 10:19:50 +02:00
poll_filter.rs Implement EIP234 block_hash for eth_getLogs (#9256) 2018-08-13 15:47:10 +08:00
poll_manager.rs Allow Poll Lifetime to be configured via CLI (#8885) 2018-06-18 13:42:54 +02:00
requests.rs Update license header and scripts (#8666) 2018-06-04 10:19:50 +02:00
secretstore.rs Update license header and scripts (#8666) 2018-06-04 10:19:50 +02:00
signer.rs Update license header and scripts (#8666) 2018-06-04 10:19:50 +02:00
signing_queue.rs Remove all dapp permissions related settings (#9120) 2018-08-07 20:52:23 +08:00
subscribers.rs Update license header and scripts (#8666) 2018-06-04 10:19:50 +02:00
subscription_manager.rs Update license header and scripts (#8666) 2018-06-04 10:19:50 +02:00