diff --git a/seth/Makefile b/seth/Makefile index 5f46db9c4..bb9ab79d9 100644 --- a/seth/Makefile +++ b/seth/Makefile @@ -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: diff --git a/seth/client_main_test.go b/seth/client_main_test.go index 55063257c..269753dab 100644 --- a/seth/client_main_test.go +++ b/seth/client_main_test.go @@ -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" ) /* diff --git a/seth/client_trace_test.go b/seth/client_trace_test.go index 2bac4d315..fbb44d6e8 100644 --- a/seth/client_trace_test.go +++ b/seth/client_trace_test.go @@ -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" ) @@ -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") diff --git a/seth/contract_store_test.go b/seth/contract_store_test.go index 78248751a..f9436e971 100644 --- a/seth/contract_store_test.go +++ b/seth/contract_store_test.go @@ -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", diff --git a/seth/contracts/TestContractOne.sol b/seth/contracts/TestContractOne.sol index 42e9bca90..539b81b32 100644 --- a/seth/contracts/TestContractOne.sol +++ b/seth/contracts/TestContractOne.sol @@ -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; diff --git a/seth/contracts/bind/debug/NetworkDebugContract.go b/seth/contracts/bind/NetworkDebugContract/NetworkDebugContract.go similarity index 99% rename from seth/contracts/bind/debug/NetworkDebugContract.go rename to seth/contracts/bind/NetworkDebugContract/NetworkDebugContract.go index 562f0baf4..d765c380d 100644 --- a/seth/contracts/bind/debug/NetworkDebugContract.go +++ b/seth/contracts/bind/NetworkDebugContract/NetworkDebugContract.go @@ -1,7 +1,7 @@ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. -package network_debug_contract +package NetworkDebugContract import ( "errors" diff --git a/seth/contracts/bind/sub/NetworkDebugSubContract.go b/seth/contracts/bind/NetworkDebugSubContract/NetworkDebugSubContract.go similarity index 99% rename from seth/contracts/bind/sub/NetworkDebugSubContract.go rename to seth/contracts/bind/NetworkDebugSubContract/NetworkDebugSubContract.go index 50996771b..5fdff6837 100644 --- a/seth/contracts/bind/sub/NetworkDebugSubContract.go +++ b/seth/contracts/bind/NetworkDebugSubContract/NetworkDebugSubContract.go @@ -1,7 +1,7 @@ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. -package network_debug_sub_contract +package NetworkDebugSubContract import ( "errors" diff --git a/seth/contracts/bind/unique_event_one/TestContractOne.go b/seth/contracts/bind/TestContractOne/TestContractOne.go similarity index 99% rename from seth/contracts/bind/unique_event_one/TestContractOne.go rename to seth/contracts/bind/TestContractOne/TestContractOne.go index 342b17d57..4fa1b5bd9 100644 --- a/seth/contracts/bind/unique_event_one/TestContractOne.go +++ b/seth/contracts/bind/TestContractOne/TestContractOne.go @@ -1,7 +1,7 @@ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. -package unique_event_one +package TestContractOne import ( "errors" diff --git a/seth/contracts/bind/unique_event_two/TestContractTwo.go b/seth/contracts/bind/TestContractTwo/TestContractTwo.go similarity index 99% rename from seth/contracts/bind/unique_event_two/TestContractTwo.go rename to seth/contracts/bind/TestContractTwo/TestContractTwo.go index d0b4a7f13..8f46f96de 100644 --- a/seth/contracts/bind/unique_event_two/TestContractTwo.go +++ b/seth/contracts/bind/TestContractTwo/TestContractTwo.go @@ -1,7 +1,7 @@ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. -package unique_event_two +package TestContractTwo import ( "errors" diff --git a/seth/util.go b/seth/util.go index 0aa722838..e8e29a56f 100644 --- a/seth/util.go +++ b/seth/util.go @@ -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 ( diff --git a/seth/util_test.go b/seth/util_test.go index 5b48e6ae3..111c6c213 100644 --- a/seth/util_test.go +++ b/seth/util_test.go @@ -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) {