Functions that can be used to control testrpc behaviour. Can ONLY (!) be used with testrpc.
See https://github.com/ethereumjs/testrpc for more information.
Functions that can be used to control testrpc behaviour. Can ONLY (!) be used with testrpc. See https://github.com/ethereumjs/testrpc for more information.
(increase-time! web3 args & [callback])
Jump forward in time in the EVM.
Parameters: web3 - web3 instance args - The amount of time to increase in seconds. callback - callback with two parameters, error and result.
Results is the total time adjustment, in seconds.
Example:
user> (web3-evm/increase-time! web3 [1000] callback)
Jump forward in time in the EVM. Parameters: web3 - web3 instance args - The amount of time to increase in seconds. callback - callback with two parameters, error and result. Results is the total time adjustment, in seconds. Example: user> `(web3-evm/increase-time! web3 [1000] callback)`
(mine-block! web3 & [callback])
Force a block to be mined. Mines a block independent of whether or not mining is started or stopped.
Parameters: web3 - web3 instance callback - callback with two parameters, error and result.
Example:
user> (web3-evm/mine! web3 callback)
Force a block to be mined. Mines a block independent of whether or not mining is started or stopped. Parameters: web3 - web3 instance callback - callback with two parameters, error and result. Example: user> `(web3-evm/mine! web3 callback)`
(revert! web3 args & [callback])
Revert the state of the blockchain to a previous snapshot.
Takes a single parameter, which is the snapshot id to revert to. If no snapshot id is passed it will revert to the latest snapshot. Returns true.
Parameters: web3 - web3 instance args - snapshot id to revert to, if no snapshot id is passed, it will revert to the latest snapshot callback - callback with two parameters, error and result.
Result is true.
Example:
user> (web3-evm/revert! web3 [0] callback)
Revert the state of the blockchain to a previous snapshot. Takes a single parameter, which is the snapshot id to revert to. If no snapshot id is passed it will revert to the latest snapshot. Returns true. Parameters: web3 - web3 instance args - snapshot id to revert to, if no snapshot id is passed, it will revert to the latest snapshot callback - callback with two parameters, error and result. Result is true. Example: user> `(web3-evm/revert! web3 [0] callback)`
(send-jsonrpc web3 jsonrpc & [callback])
Sends a jsonrpc message to the currentProvider.
Parameter: web3 - web3 instance
Example:
user> (send-async-fn web3)
#object...
Sends a jsonrpc message to the currentProvider. Parameter: web3 - web3 instance Example: user> `(send-async-fn web3)` #object...
(snapshot! web3 & [callback])
Snapshot the state of the blockchain at the current block.
Parameters: web3 - web3 instance callback - callback with two parameters, error and result.
Result is the id of the snapshot created.
Example:
user> (web3-evm/snapshot! web3 callback)
Snapshot the state of the blockchain at the current block. Parameters: web3 - web3 instance callback - callback with two parameters, error and result. Result is the id of the snapshot created. Example: user> `(web3-evm/snapshot! web3 callback)`
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close