Skip to content

Commit

Permalink
fix tests, rename contracts to remove duplicates from tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Tofel committed Oct 31, 2024
1 parent c1cf82e commit ae8cbb4
Show file tree
Hide file tree
Showing 11 changed files with 26 additions and 26 deletions.
8 changes: 4 additions & 4 deletions seth/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
build:
solc --abi --overwrite -o contracts/abi contracts/NetworkDebugContract.sol
solc --bin --overwrite -o contracts/bin contracts/NetworkDebugContract.sol
abigen --bin=contracts/bin/NetworkDebugContract.bin --abi=contracts/abi/NetworkDebugContract.abi --pkg=network_debug_contract --out=contracts/bind/debug/NetworkDebugContract.go
abigen --bin=contracts/bin/NetworkDebugContract.bin --abi=contracts/abi/NetworkDebugContract.abi --pkg=network_debug_contract --out=contracts/bind/NetworkDebugContract/NetworkDebugContract.go
solc --abi --overwrite -o contracts/abi contracts/NetworkDebugSubContract.sol
solc --bin --overwrite -o contracts/bin contracts/NetworkDebugSubContract.sol
abigen --bin=contracts/bin/NetworkDebugSubContract.bin --abi=contracts/abi/NetworkDebugSubContract.abi --pkg=network_debug_sub_contract --out=contracts/bind/sub/NetworkDebugSubContract.go
abigen --bin=contracts/bin/NetworkDebugSubContract.bin --abi=contracts/abi/NetworkDebugSubContract.abi --pkg=network_debug_sub_contract --out=contracts/bind/NetworkDebugSubContract/NetworkDebugSubContract.go

solc --abi --overwrite -o contracts/abi contracts/TestContractOne.sol
solc --bin --overwrite -o contracts/bin contracts/TestContractOne.sol
abigen --bin=contracts/bin/TestContractOne.bin --abi=contracts/abi/TestContractOne.abi --pkg=unique_event_one --out=contracts/bind/unique_event_one/TestContractOne.go
abigen --bin=contracts/bin/TestContractOne.bin --abi=contracts/abi/TestContractOne.abi --pkg=unique_event_one --out=contracts/bind/TestContractOne/TestContractOne.go
solc --abi --overwrite -o contracts/abi contracts/TestContractTwo.sol
solc --bin --overwrite -o contracts/bin contracts/TestContractTwo.sol
abigen --bin=contracts/bin/TestContractTwo.bin --abi=contracts/abi/TestContractTwo.abi --pkg=unique_event_two --out=contracts/bind/unique_event_two/TestContractTwo.go
abigen --bin=contracts/bin/TestContractTwo.bin --abi=contracts/abi/TestContractTwo.abi --pkg=unique_event_two --out=contracts/bind/TestContractTwo/TestContractTwo.go

.PHONY: AnvilSync
AnvilSync:
Expand Down
4 changes: 2 additions & 2 deletions seth/client_main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (
"github.com/stretchr/testify/require"

"github.com/smartcontractkit/chainlink-testing-framework/seth"
network_debug_contract "github.com/smartcontractkit/chainlink-testing-framework/seth/contracts/bind/debug"
network_debug_contract "github.com/smartcontractkit/chainlink-testing-framework/seth/contracts/bind/NetworkDebugContract"
network_sub_contract "github.com/smartcontractkit/chainlink-testing-framework/seth/contracts/bind/NetworkDebugSubContract"
link_token "github.com/smartcontractkit/chainlink-testing-framework/seth/contracts/bind/link"
network_sub_contract "github.com/smartcontractkit/chainlink-testing-framework/seth/contracts/bind/sub"
)

/*
Expand Down
16 changes: 8 additions & 8 deletions seth/client_trace_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ import (
"github.com/stretchr/testify/require"

"github.com/smartcontractkit/chainlink-testing-framework/seth"
network_debug_contract "github.com/smartcontractkit/chainlink-testing-framework/seth/contracts/bind/debug"
network_debug_contract "github.com/smartcontractkit/chainlink-testing-framework/seth/contracts/bind/NetworkDebugContract"
"github.com/smartcontractkit/chainlink-testing-framework/seth/contracts/bind/TestContractOne"
"github.com/smartcontractkit/chainlink-testing-framework/seth/contracts/bind/TestContractTwo"
link_token "github.com/smartcontractkit/chainlink-testing-framework/seth/contracts/bind/link"
"github.com/smartcontractkit/chainlink-testing-framework/seth/contracts/bind/link_token_interface"
"github.com/smartcontractkit/chainlink-testing-framework/seth/contracts/bind/unique_event_one"
"github.com/smartcontractkit/chainlink-testing-framework/seth/contracts/bind/unique_event_two"
"github.com/smartcontractkit/chainlink-testing-framework/seth/test_utils"
)

Expand Down Expand Up @@ -1825,17 +1825,17 @@ func TestSameEventTwoABIs(t *testing.T) {
c := newClientWithContractMapFromEnv(t)
SkipAnvil(t, c)

contractAbi, err := unique_event_one.UniqueEventOneMetaData.GetAbi()
contractAbi, err := TestContractOne.UniqueEventOneMetaData.GetAbi()
require.NoError(t, err, "failed to get contract ABI")
oneData, err := c.DeployContract(c.NewTXOpts(), "TestContractOne", *contractAbi, common.FromHex(unique_event_one.UniqueEventOneMetaData.Bin))
oneData, err := c.DeployContract(c.NewTXOpts(), "TestContractOne", *contractAbi, common.FromHex(TestContractOne.UniqueEventOneMetaData.Bin))
require.NoError(t, err, "failed to deploy contract")

contractAbi, err = unique_event_two.UniqueEventTwoMetaData.GetAbi()
contractAbi, err = TestContractTwo.UniqueEventTwoMetaData.GetAbi()
require.NoError(t, err, "failed to get contract ABI")
_, err = c.DeployContract(c.NewTXOpts(), "TestContractTwo", *contractAbi, common.FromHex(unique_event_two.UniqueEventTwoMetaData.Bin))
_, err = c.DeployContract(c.NewTXOpts(), "TestContractTwo", *contractAbi, common.FromHex(TestContractTwo.UniqueEventTwoMetaData.Bin))
require.NoError(t, err, "failed to deploy contract")

oneInstance, err := unique_event_one.NewUniqueEventOne(oneData.Address, c.Client)
oneInstance, err := TestContractOne.NewUniqueEventOne(oneData.Address, c.Client)
require.NoError(t, err, "failed to create contract instance")
decoded, txErr := c.Decode(oneInstance.ExecuteFirstOperation(c.NewTXOpts(), big.NewInt(1), big.NewInt(2)))
require.NoError(t, txErr, "transaction should have succeeded")
Expand Down
8 changes: 4 additions & 4 deletions seth/contract_store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,23 @@ func TestSmokeContractABIStore(t *testing.T) {
{
name: "can load the ABI only from ABI files",
abiPath: "./contracts/abi",
expectedABICount: 5,
expectedABICount: 8,
},
{
name: "can load the ABI from ABI files and from gethwrappers",
abiPath: "./contracts/abi",
gethWrappersPaths: []string{"./contracts/bind"},
expectedABICount: 10,
expectedABICount: 11,
},
{
name: "can load the ABI only from gethwrappers",
gethWrappersPaths: []string{"./contracts/bind"},
expectedABICount: 5,
expectedABICount: 7,
},
{
name: "can load the ABI from 2 gethwrappers folders",
gethWrappersPaths: []string{"./contracts/bind", "./contracts/bind2"},
expectedABICount: 6,
expectedABICount: 8,
},
{
name: "can't open the ABI path",
Expand Down
2 changes: 1 addition & 1 deletion seth/contracts/TestContractOne.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pragma solidity 0.8.19;

import "./AbstractContractWithEvent.sol";

contract TestContractOne is AbstractContractWithEvent {
contract unique_event_two is AbstractContractWithEvent {
function executeFirstOperation(int256 x, int256 y) public returns (int256) {
emit NonUniqueEvent(x, y);
return x + y;
Expand Down

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.

4 changes: 2 additions & 2 deletions seth/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import (
"github.com/ethereum/go-ethereum/params"
"github.com/pkg/errors"

network_debug_contract "github.com/smartcontractkit/chainlink-testing-framework/seth/contracts/bind/debug"
network_sub_debug_contract "github.com/smartcontractkit/chainlink-testing-framework/seth/contracts/bind/sub"
network_debug_contract "github.com/smartcontractkit/chainlink-testing-framework/seth/contracts/bind/NetworkDebugContract"
network_sub_debug_contract "github.com/smartcontractkit/chainlink-testing-framework/seth/contracts/bind/NetworkDebugSubContract"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion seth/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/stretchr/testify/require"

"github.com/smartcontractkit/chainlink-testing-framework/seth"
network_sub_contract "github.com/smartcontractkit/chainlink-testing-framework/seth/contracts/bind/sub"
network_sub_contract "github.com/smartcontractkit/chainlink-testing-framework/seth/contracts/bind/NetworkDebugSubContract"
)

func TestUtilDecodePragmaVersion(t *testing.T) {
Expand Down

0 comments on commit ae8cbb4

Please sign in to comment.