This repository has been archived by the owner on Nov 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[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".
- Loading branch information
Showing
1 changed file
with
52 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters