perlin-network / wavelet

Write once, run forever. Deploy robust, scalable, decentralized WebAssembly applications on Wavelet.
https://wavelet.perlin.net
MIT License
259 stars 41 forks source link

Pre-validate transactions based on current state. #398

Closed AhmadMuzakkir closed 4 years ago

AhmadMuzakkir commented 4 years ago

This PR implements state pre-validations for transactions to make sure the transactions can be applied based on the current state.

The Send Transaction API handler will return the error if the pre-validation failed.

Some of the validations are:

  1. Sender must have enough balance for any movement of money. e.g. to place stake, to transfer money, to spawn contracts, etc.
  2. For contract transaction, check the recipient address is actually a contract address.

TODO