Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
AnieeG committed Dec 18, 2024
1 parent 4032b96 commit 347a775
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 18 deletions.
16 changes: 8 additions & 8 deletions deployment/ccip/changeset/cs_prerequisites.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ func deployPrerequisiteContracts(e deployment.Environment, ab deployment.Address
chain.Client,
)
return deployment.ContractDeploy[*mock_rmn_contract.MockRMNContract]{
rmnAddress, rmnC, tx2, deployment.NewTypeAndVersion(MockRMN, deployment.Version1_0_0), err2,
Address: rmnAddress, Contract: rmnC, Tx: tx2, Tv: deployment.NewTypeAndVersion(MockRMN, deployment.Version1_0_0), Err: err2,
}
})
if err != nil {
Expand All @@ -210,7 +210,7 @@ func deployPrerequisiteContracts(e deployment.Environment, ab deployment.Address
rmnAddr,
)
return deployment.ContractDeploy[*rmn_proxy_contract.RMNProxyContract]{
rmnProxyAddr, rmnProxy, tx2, deployment.NewTypeAndVersion(ARMProxy, deployment.Version1_0_0), err2,
Address: rmnProxyAddr, Contract: rmnProxy, Tx: tx2, Tv: deployment.NewTypeAndVersion(ARMProxy, deployment.Version1_0_0), Err: err2,
}
})
if err != nil {
Expand Down Expand Up @@ -259,7 +259,7 @@ func deployPrerequisiteContracts(e deployment.Environment, ab deployment.Address
chain.DeployerKey,
chain.Client)
return deployment.ContractDeploy[*token_admin_registry.TokenAdminRegistry]{
tokenAdminRegistryAddr, tokenAdminRegistry, tx2, deployment.NewTypeAndVersion(TokenAdminRegistry, deployment.Version1_5_0), err2,
Address: tokenAdminRegistryAddr, Contract: tokenAdminRegistry, Tx: tx2, Tv: deployment.NewTypeAndVersion(TokenAdminRegistry, deployment.Version1_5_0), Err: err2,
}
})
if err != nil {
Expand All @@ -278,7 +278,7 @@ func deployPrerequisiteContracts(e deployment.Environment, ab deployment.Address
chain.Client,
tokenAdminReg.Address())
return deployment.ContractDeploy[*registry_module_owner_custom.RegistryModuleOwnerCustom]{
regModAddr, regMod, tx2, deployment.NewTypeAndVersion(RegistryModule, deployment.Version1_5_0), err2,
Address: regModAddr, Contract: regMod, Tx: tx2, Tv: deployment.NewTypeAndVersion(RegistryModule, deployment.Version1_5_0), Err: err2,
}
})
if err != nil {
Expand Down Expand Up @@ -316,7 +316,7 @@ func deployPrerequisiteContracts(e deployment.Environment, ab deployment.Address
chain.Client,
)
return deployment.ContractDeploy[*weth9.WETH9]{
weth9Addr, weth9c, tx2, deployment.NewTypeAndVersion(WETH9, deployment.Version1_0_0), err2,
Address: weth9Addr, Contract: weth9c, Tx: tx2, Tv: deployment.NewTypeAndVersion(WETH9, deployment.Version1_0_0), Err: err2,
}
})
if err != nil {
Expand All @@ -340,7 +340,7 @@ func deployPrerequisiteContracts(e deployment.Environment, ab deployment.Address
rmnProxy.Address(),
)
return deployment.ContractDeploy[*router.Router]{
routerAddr, routerC, tx2, deployment.NewTypeAndVersion(Router, deployment.Version1_2_0), err2,
Address: routerAddr, Contract: routerC, Tx: tx2, Tv: deployment.NewTypeAndVersion(Router, deployment.Version1_2_0), Err: err2,
}
})
if err != nil {
Expand All @@ -360,7 +360,7 @@ func deployPrerequisiteContracts(e deployment.Environment, ab deployment.Address
chain.Client,
)
return deployment.ContractDeploy[*multicall3.Multicall3]{
multicall3Addr, multicall3Wrapper, tx2, deployment.NewTypeAndVersion(Multicall3, deployment.Version1_0_0), err2,
Address: multicall3Addr, Contract: multicall3Wrapper, Tx: tx2, Tv: deployment.NewTypeAndVersion(Multicall3, deployment.Version1_0_0), Err: err2,
}
})
if err != nil {
Expand Down Expand Up @@ -394,7 +394,7 @@ func deployPrerequisiteContracts(e deployment.Environment, ab deployment.Address
false,
)
return deployment.ContractDeploy[*maybe_revert_message_receiver.MaybeRevertMessageReceiver]{
receiverAddr, receiver, tx, deployment.NewTypeAndVersion(CCIPReceiver, deployment.Version1_0_0), err2,
Address: receiverAddr, Contract: receiver, Tx: tx, Tv: deployment.NewTypeAndVersion(CCIPReceiver, deployment.Version1_0_0), Err: err2,
}
})
if err != nil {
Expand Down
12 changes: 6 additions & 6 deletions deployment/ccip/changeset/v1_5/cs_lane_contracts.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func deployLane(e deployment.Environment, state changeset.CCIPOnChainState, ab d
if !onRampExists {
onRampC, err := deployment.DeployContract(e.Logger, sourceChain, ab,
func(chain deployment.Chain) deployment.ContractDeploy[*evm_2_evm_onramp.EVM2EVMOnRamp] {
onRampAddress, tx, onRampC, err2 := evm_2_evm_onramp.DeployEVM2EVMOnRamp(
onRampAddress, tx2, onRampC, err2 := evm_2_evm_onramp.DeployEVM2EVMOnRamp(
sourceChain.DeployerKey,
sourceChain.Client,
cfg.OnRampStaticCfg,
Expand All @@ -141,7 +141,7 @@ func deployLane(e deployment.Environment, state changeset.CCIPOnChainState, ab d
cfg.OnRampNopsAndWeight,
)
return deployment.ContractDeploy[*evm_2_evm_onramp.EVM2EVMOnRamp]{
Address: onRampAddress, Contract: onRampC, Tx: tx,
Address: onRampAddress, Contract: onRampC, Tx: tx2,
Tv: deployment.NewTypeAndVersion(changeset.OnRamp, deployment.Version1_5_0), Err: err2,
}
})
Expand All @@ -161,7 +161,7 @@ func deployLane(e deployment.Environment, state changeset.CCIPOnChainState, ab d
if !commitStoreExists {
commitStoreC, err := deployment.DeployContract(e.Logger, destChain, ab,
func(chain deployment.Chain) deployment.ContractDeploy[*commit_store.CommitStore] {
commitStoreAddress, tx, commitStoreC, err2 := commit_store.DeployCommitStore(
commitStoreAddress, tx2, commitStoreC, err2 := commit_store.DeployCommitStore(
destChain.DeployerKey,
destChain.Client,
commit_store.CommitStoreStaticConfig{
Expand All @@ -172,7 +172,7 @@ func deployLane(e deployment.Environment, state changeset.CCIPOnChainState, ab d
},
)
return deployment.ContractDeploy[*commit_store.CommitStore]{
Address: commitStoreAddress, Contract: commitStoreC, Tx: tx,
Address: commitStoreAddress, Contract: commitStoreC, Tx: tx2,
Tv: deployment.NewTypeAndVersion(changeset.CommitStore, deployment.Version1_5_0), Err: err2,
}
})
Expand All @@ -192,7 +192,7 @@ func deployLane(e deployment.Environment, state changeset.CCIPOnChainState, ab d
if !offRampExists {
offRampC, err := deployment.DeployContract(e.Logger, destChain, ab,
func(chain deployment.Chain) deployment.ContractDeploy[*evm_2_evm_offramp.EVM2EVMOffRamp] {
offRampAddress, tx, offRampC, err2 := evm_2_evm_offramp.DeployEVM2EVMOffRamp(
offRampAddress, tx2, offRampC, err2 := evm_2_evm_offramp.DeployEVM2EVMOffRamp(
destChain.DeployerKey,
destChain.Client,
evm_2_evm_offramp.EVM2EVMOffRampStaticConfig{
Expand All @@ -207,7 +207,7 @@ func deployLane(e deployment.Environment, state changeset.CCIPOnChainState, ab d
cfg.OffRampRateLimiterCfg,
)
return deployment.ContractDeploy[*evm_2_evm_offramp.EVM2EVMOffRamp]{
Address: offRampAddress, Contract: offRampC, Tx: tx,
Address: offRampAddress, Contract: offRampC, Tx: tx2,
Tv: deployment.NewTypeAndVersion(changeset.OffRamp, deployment.Version1_5_0), Err: err2,
}
})
Expand Down
3 changes: 3 additions & 0 deletions deployment/ccip/changeset/v1_5/cs_ocr2_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,9 @@ func deriveOCR2Config(
int(nodes.DefaultF()),
ocrParams.OnchainConfig,
)
if err != nil {
return FinalOCR2Config{}, fmt.Errorf("failed to derive OCR2 config: %w", err)
}
var signersAddresses []common.Address
for _, signer := range signers {
if len(signer) != 20 {
Expand Down
4 changes: 1 addition & 3 deletions deployment/ccip/changeset/v1_5/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,8 @@ func NewEnvironment(t *testing.T, tc *changeset.TestConfigs, tEnv changeset.Test
}

func AddLanes(t *testing.T, e deployment.Environment, state changeset.CCIPOnChainState, pairs []changeset.SourceDestPair) deployment.Environment {
state, err := changeset.LoadOnchainState(e)
require.NoError(t, err)

addLanesCfg, commitOCR2Configs, execOCR2Configs, jobspecs := LaneConfigsForChains(t, e, state, pairs)
var err error
e, err = commonchangeset.ApplyChangesets(t, e, nil, []commonchangeset.ChangesetApplication{
{
Changeset: commonchangeset.WrapChangeSet(DeployLanes),
Expand Down
2 changes: 1 addition & 1 deletion deployment/environment/memory/environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func generateMemoryChain(t *testing.T, inputs map[uint64]EVMChain) map[uint64]de
return bind.WaitMined(ctx, backend, tx)
}()
if err != nil {
return 0, fmt.Errorf("tx %s failed to confirm: %v, chain %d", tx.Hash().Hex(), err, chainInfo.ChainSelector)
return 0, fmt.Errorf("tx %s failed to confirm: %w, chain %d", tx.Hash().Hex(), err, chainInfo.ChainSelector)
}
if receipt.Status == 0 {
errReason, err := deployment.GetErrorReasonFromTx(chain.Backend.Client(), chain.DeployerKey.From, tx, receipt)
Expand Down

0 comments on commit 347a775

Please sign in to comment.