Skip to content

Commit

Permalink
added back in dirtycontracts
Browse files Browse the repository at this point in the history
  • Loading branch information
silaslenihan committed Aug 26, 2024
1 parent b7ca674 commit c006719
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ type EVMChainComponentsInterfaceTester[T TestingT[T]] struct {
senderAuth *bind.TransactOpts
cr evm.ChainReaderService
cw evm.ChainWriterService
dirtyContracts bool
txm evmtxmgr.TxManager
gasEstimator gas.EvmFeeEstimator
}
Expand All @@ -82,12 +83,14 @@ func (it *EVMChainComponentsInterfaceTester[T]) Setup(t T) {
}
it.cr = nil

if it.dirtyContracts {
it.contractTesters = nil
}

if it.cw != nil {
_ = it.cw.Close()
}
it.cw = nil

it.contractTesters = nil
})

// can re-use the same chain for tests, just make new contract for each test
Expand Down Expand Up @@ -346,6 +349,10 @@ func (it *EVMChainComponentsInterfaceTester[T]) GetBindings(_ T) []clcommontypes
}
}

func (it *EVMChainComponentsInterfaceTester[T]) DirtyContracts() {
it.dirtyContracts = true
}

func (it *EVMChainComponentsInterfaceTester[T]) GetAuthWithGasSet(t T) *bind.TransactOpts {
gasPrice, err := it.client.SuggestGasPrice(it.Helper.Context(t))
require.NoError(t, err)
Expand Down Expand Up @@ -379,6 +386,7 @@ func (it *EVMChainComponentsInterfaceTester[T]) deployNewContracts(t T) {
it.address, it.address2 = address, address2
it.contractTesters[it.address] = ts1
it.contractTesters[it.address2] = ts2
it.dirtyContracts = false
}
}

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ require (
github.com/smartcontractkit/chain-selectors v1.0.21
github.com/smartcontractkit/chainlink-automation v1.0.4
github.com/smartcontractkit/chainlink-ccip v0.0.0-20240806144315-04ac101e9c95
github.com/smartcontractkit/chainlink-common v0.2.2-0.20240826134201-4773bee7226c
github.com/smartcontractkit/chainlink-common v0.2.2-0.20240826183228-0aa4381116f7
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240710121324-3ed288aa9b45
github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240820130645-cf4b159fbba2
github.com/smartcontractkit/chainlink-feeds v0.0.0-20240710170203-5b41615da827
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1143,6 +1143,8 @@ github.com/smartcontractkit/chainlink-ccip v0.0.0-20240806144315-04ac101e9c95 h1
github.com/smartcontractkit/chainlink-ccip v0.0.0-20240806144315-04ac101e9c95/go.mod h1:/ZWraCBaDDgaIN1prixYcbVvIk/6HeED9+8zbWQ+TMo=
github.com/smartcontractkit/chainlink-common v0.2.2-0.20240826134201-4773bee7226c h1:zxls+EeiPH3thnxhcIrIc9LiPgfTbf3VdiNejv0JEYo=
github.com/smartcontractkit/chainlink-common v0.2.2-0.20240826134201-4773bee7226c/go.mod h1:5rmU5YKBkIOwWkuNZi26sMXlBUBm6weBFXh+8BEEp2s=
github.com/smartcontractkit/chainlink-common v0.2.2-0.20240826183228-0aa4381116f7 h1:yaa51+DlPFjmtj0zbwiPthsBL9UxGVx4IxAjlJNhm3M=
github.com/smartcontractkit/chainlink-common v0.2.2-0.20240826183228-0aa4381116f7/go.mod h1:5rmU5YKBkIOwWkuNZi26sMXlBUBm6weBFXh+8BEEp2s=
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240710121324-3ed288aa9b45 h1:NBQLtqk8zsyY4qTJs+NElI3aDFTcAo83JHvqD04EvB0=
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240710121324-3ed288aa9b45/go.mod h1:LV0h7QBQUpoC2UUi6TcUvcIFm1xjP/DtEcqV8+qeLUs=
github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240820130645-cf4b159fbba2 h1:KH6tpCw5hu8u6UTtgll7a8mE4sIbHCbmtzHJdKuRwBw=
Expand Down

0 comments on commit c006719

Please sign in to comment.