thor
thor copied to clipboard
Add testchain package
Description
-
Added
testchain
packagetestchain
package is meant to be used for testing. It simplifies the common uses for the thor chain in tests. Wraps most of the most used operations like mint a transaction. It has a chain builder that allows to create thor chain with a different subset of components (inmem vs realdb, etc..) -
Added
eventcontract
packageeventcontract
package is a precompiled contract It's meant to help trigger events on-chain and test these ( subscriptions and events tests ) -
Simplified the
initChain
logicinitChain
now returns atestchain
and can be easily manipulated in-test -
Removed (many but not all) global test vars
-
Added
thorclient/api_test.go
which allows to test requests and response payloads for several apis
Fixes # (issue)
Type of change
Please delete options that are not relevant.
- [x] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [x] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [x] This change requires a documentation update
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
- [x] Test A
- [x] Test B
Test Configuration:
- Go Version:
- Hardware:
- Docker Version:
Checklist:
- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my code
- [x] I have commented my code, particularly in hard-to-understand areas
- [x] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [x] I have added tests that prove my fix is effective or that my feature works
- [x] New and existing unit tests pass locally with my changes
- [x] New and existing E2E tests pass locally with my changes
- [x] Any dependent changes have been merged and published in downstream modules
- [x] I have not added any vulnerable dependencies to my code