Skip to content

Commit

Permalink
Removed SendStrategy from ChainWriter config (#14623)
Browse files Browse the repository at this point in the history
  • Loading branch information
silaslenihan authored Oct 1, 2024
1 parent 6515802 commit 585f7aa
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 19 deletions.
4 changes: 1 addition & 3 deletions core/capabilities/ccip/configs/evm/chain_writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"github.com/ethereum/go-ethereum/common"

"github.com/smartcontractkit/chainlink-ccip/pkg/consts"
"github.com/smartcontractkit/chainlink/v2/common/txmgr"

"github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets"
evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types"
Expand Down Expand Up @@ -60,8 +59,7 @@ func ChainWriterConfigRaw(
},
},
},
SendStrategy: txmgr.NewSendEveryStrategy(),
MaxGasPrice: maxGasPrice,
MaxGasPrice: maxGasPrice,
}
}

Expand Down
5 changes: 1 addition & 4 deletions core/capabilities/ccip/ocrimpls/contract_transmitter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ import (

"github.com/smartcontractkit/chainlink-common/pkg/utils/mailbox"

txmgrcommon "github.com/smartcontractkit/chainlink/v2/common/txmgr"

"github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets"
"github.com/smartcontractkit/chainlink/v2/core/chains/evm/client"
evmconfig "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config"
Expand Down Expand Up @@ -402,8 +400,7 @@ func chainWriterConfigRaw(fromAddress common.Address, maxGasPrice *assets.Wei) e
},
},
},
SendStrategy: txmgrcommon.NewSendEveryStrategy(),
MaxGasPrice: maxGasPrice,
MaxGasPrice: maxGasPrice,
}
}

Expand Down
8 changes: 1 addition & 7 deletions core/services/relay/evm/chain_writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,10 @@ func NewChainWriterService(logger logger.Logger, client evmclient.Client, txm ev
ge: estimator,
maxGasPrice: config.MaxGasPrice,

sendStrategy: txmgr.NewSendEveryStrategy(),
contracts: config.Contracts,
parsedContracts: &codec.ParsedTypes{EncoderDefs: map[string]types.CodecEntry{}, DecoderDefs: map[string]types.CodecEntry{}},
}

if config.SendStrategy != nil {
w.sendStrategy = config.SendStrategy
}

if err := w.parseContracts(); err != nil {
return nil, fmt.Errorf("%w: failed to parse contracts", err)
}
Expand All @@ -74,7 +69,6 @@ type chainWriter struct {
ge gas.EvmFeeEstimator
maxGasPrice *assets.Wei

sendStrategy txmgrtypes.TxStrategy
contracts map[string]*types.ContractConfig
parsedContracts *codec.ParsedTypes

Expand Down Expand Up @@ -135,7 +129,7 @@ func (w *chainWriter) SubmitTransaction(ctx context.Context, contract, method st
FeeLimit: gasLimit,
Meta: txMeta,
IdempotencyKey: &transactionID,
Strategy: w.sendStrategy,
Strategy: txmgr.NewSendEveryStrategy(),
Checker: checker,
Value: *v,
}
Expand Down
7 changes: 2 additions & 5 deletions core/services/relay/evm/types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ import (

ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types"

txmgrtypes "github.com/smartcontractkit/chainlink/v2/common/txmgr/types"

"github.com/smartcontractkit/chainlink-common/pkg/codec"
"github.com/smartcontractkit/chainlink-common/pkg/services"
"github.com/smartcontractkit/chainlink-common/pkg/types"
Expand All @@ -26,9 +24,8 @@ import (
)

type ChainWriterConfig struct {
Contracts map[string]*ContractConfig
SendStrategy txmgrtypes.TxStrategy
MaxGasPrice *assets.Wei
Contracts map[string]*ContractConfig
MaxGasPrice *assets.Wei
}

type ContractConfig struct {
Expand Down

0 comments on commit 585f7aa

Please sign in to comment.