Skip to content

Commit

Permalink
Remove unused code
Browse files Browse the repository at this point in the history
Change DualTransmissionConfig to pointer
  • Loading branch information
george-dorin committed Nov 14, 2024
1 parent b039e3a commit e8c9963
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 31 deletions.
28 changes: 0 additions & 28 deletions core/services/relay/evm/contract_transmitter.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ import (
"github.com/ethereum/go-ethereum/common"
gethcommon "github.com/ethereum/go-ethereum/common"
"github.com/pkg/errors"
types2 "github.com/smartcontractkit/libocr/offchainreporting2/types"

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

Expand Down Expand Up @@ -247,29 +245,3 @@ func (oc *contractTransmitter) HealthReport() map[string]error {
return map[string]error{oc.Name(): nil}
}
func (oc *contractTransmitter) Name() string { return oc.lggr.Name() }

var _ types2.ContractTransmitter = (*dualContractTransmitter)(nil)

type dualContractTransmitter struct {
baseContractTransmitter contractTransmitter
}

func (d *dualContractTransmitter) secondaryTransmit(ctx context.Context, reportContext types2.ReportContext, report types2.Report, signatures []types2.AttributedOnchainSignature) error {
return nil
}

func (d *dualContractTransmitter) Transmit(ctx context.Context, reportContext types2.ReportContext, report types2.Report, signatures []types2.AttributedOnchainSignature) error {
err := d.secondaryTransmit(ctx, reportContext, report, signatures)
if err != nil {
d.baseContractTransmitter.lggr.Warnw("secondary transmission failed", "err", err)
}
return d.baseContractTransmitter.Transmit(ctx, reportContext, report, signatures)
}

func (d *dualContractTransmitter) LatestConfigDigestAndEpoch(ctx context.Context) (configDigest types2.ConfigDigest, epoch uint32, err error) {
return d.baseContractTransmitter.LatestConfigDigestAndEpoch(ctx)
}

func (d *dualContractTransmitter) FromAccount(ctx context.Context) (types2.Account, error) {
return d.baseContractTransmitter.FromAccount(ctx)
}
2 changes: 1 addition & 1 deletion core/services/relay/evm/evm.go
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,7 @@ func generateTransmitterFrom(ctx context.Context, rargs commontypes.RelayArgs, e
checker,
configWatcher.chain.ID(),
ethKeystore,
&relayConfig.DualTransmissionConfig,
relayConfig.DualTransmissionConfig,
)
case commontypes.CCIPExecution:
transmitter, err = cciptransmitter.NewTransmitterWithStatusChecker(
Expand Down
4 changes: 2 additions & 2 deletions core/services/relay/evm/types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,8 @@ type RelayConfig struct {
LLOConfigMode LLOConfigMode `json:"lloConfigMode" toml:"lloConfigMode"`

// DualTransmission specific
EnableDualTransmission bool `json:"enableDualTransmission" toml:"enableDualTransmission"`
DualTransmissionConfig DualTransmissionConfig `json:"dualTransmission" toml:"dualTransmission"`
EnableDualTransmission bool `json:"enableDualTransmission" toml:"enableDualTransmission"`
DualTransmissionConfig *DualTransmissionConfig `json:"dualTransmission" toml:"dualTransmission"`
}

var ErrBadRelayConfig = errors.New("bad relay config")
Expand Down

0 comments on commit e8c9963

Please sign in to comment.