-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
* Add missing fields to generated Deploy methods * Regenerate wrappers * Abigen test * Error handling * Test Address method returning the proper address * Update generated wrappers * Refactor method and check type assertion * Format
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package gethwrappers | ||
|
||
import ( | ||
"math/big" | ||
"testing" | ||
|
||
"github.com/ethereum/go-ethereum/accounts/abi/bind/backends" | ||
"github.com/ethereum/go-ethereum/common" | ||
"github.com/ethereum/go-ethereum/core" | ||
"github.com/ethereum/go-ethereum/core/rawdb" | ||
"github.com/stretchr/testify/require" | ||
|
||
"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/log_emitter" | ||
"github.com/smartcontractkit/chainlink/v2/core/internal/testutils" | ||
) | ||
|
||
// Test that the generated Deploy method fill all the required fields and returns the correct address. | ||
// We perform this test using the generated LogEmitter wrapper. | ||
func TestGeneratedDeployMethodAddressField(t *testing.T) { | ||
owner := testutils.MustNewSimTransactor(t) | ||
ec := backends.NewSimulatedBackendWithDatabase(rawdb.NewMemoryDatabase(), map[common.Address]core.GenesisAccount{ | ||
owner.From: { | ||
Balance: big.NewInt(0).Mul(big.NewInt(10), big.NewInt(1e18)), | ||
}, | ||
}, 10e6) | ||
emitterAddr, _, emitter, err := log_emitter.DeployLogEmitter(owner, ec) | ||
require.NoError(t, err) | ||
require.Equal(t, emitterAddr, emitter.Address()) | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.