near / near-workspaces-js

Write tests once, run them both on NEAR TestNet and a controlled NEAR Sandbox local environment
https://near.github.io/near-workspaces-js/
GNU General Public License v3.0
42 stars 22 forks source link

Allow replaying all transactions from testnet/mainnet #40

Open chadoh opened 3 years ago

chadoh commented 3 years ago

Prerequisite: #39

See discussion: https://gov.near.org/t/discussion-smart-contract-upgrade-testing/4614

Example will be given current contract of Sputnik v2, to specify an accounts where this contract is deployed. Then script would spin up Sandbox, fork the state of the chain as of deployment of previous version of that contract and start applying all transactions again. For overall consistency all transactions from blockchain may need to be reapplied because there might be dependencies like sending NEAR or other tokens from another account to this accounts, etc.

Finally at the end state of the contract on MainNet and in the Sandbox is compared and shown to the developer in the diff. It’s possible there are expected differences, but majority of things should be the same.