Skip to content

Commit 11bf972

Browse files
committed
more test fixes
1 parent bbbe1f2 commit 11bf972

2 files changed

Lines changed: 50 additions & 20 deletions

File tree

deployment/ccip/changeset/testhelpers/test_helpers_solana_v0_1_0.go

Lines changed: 48 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -983,6 +983,20 @@ func AddLane(
983983
return err
984984
}
985985

986+
if fromFamily == chainsel.FamilyEVM && toFamily == chainsel.FamilyAptos {
987+
evmTokenPrices := make(map[common.Address]*big.Int, len(tokenPrices))
988+
for address, price := range tokenPrices {
989+
evmTokenPrices[common.HexToAddress(address)] = price
990+
}
991+
fqChangesets := addEVMFeeQuoterDestAndPricesChangesets(
992+
from, to, gasPrices, evmTokenPrices, fqCfg, nil,
993+
)
994+
e.Env, _, err = commoncs.ApplyChangesets(t, e.Env, fqChangesets)
995+
if err != nil {
996+
return err
997+
}
998+
}
999+
9861000
if fromFamily == chainsel.FamilyAptos || toFamily == chainsel.FamilyAptos {
9871001
if err := ensureEVMRouterLaneConfig(t, e, state, from, to, fromFamily, toFamily, isTestRouter, gasPrices, tokenPrices, fqCfg); err != nil {
9881002
return err
@@ -1167,43 +1181,59 @@ func AddLaneSolanaChangesetsV0_1_0(e *DeployedEnv, solChainSelector, remoteChain
11671181
return solanaChangesets
11681182
}
11691183

1170-
func AddEVMSrcChangesets(from, to uint64, isTestRouter bool, gasprice map[uint64]*big.Int, tokenPrices map[common.Address]*big.Int, fqCfg fee_quoter.FeeQuoterDestChainConfig) []commoncs.ConfiguredChangeSet {
1171-
evmSrcChangesets := []commoncs.ConfiguredChangeSet{
1172-
commoncs.Configure(
1173-
cldf.CreateLegacyChangeSet(v1_6.UpdateOnRampsDestsChangeset),
1174-
v1_6.UpdateOnRampDestsConfig{
1175-
UpdatesByChain: map[uint64]map[uint64]v1_6.OnRampDestinationUpdate{
1176-
from: {
1177-
to: {
1178-
IsEnabled: true,
1179-
TestRouter: isTestRouter,
1180-
AllowListEnabled: false,
1181-
},
1182-
},
1183-
},
1184-
},
1185-
),
1184+
func addEVMFeeQuoterDestAndPricesChangesets(
1185+
from, to uint64,
1186+
gasPrices map[uint64]*big.Int,
1187+
tokenPrices map[common.Address]*big.Int,
1188+
fqCfg fee_quoter.FeeQuoterDestChainConfig,
1189+
mcms *cldfproposalutils.TimelockConfig,
1190+
) []commoncs.ConfiguredChangeSet {
1191+
return []commoncs.ConfiguredChangeSet{
11861192
commoncs.Configure(
11871193
cldf.CreateLegacyChangeSet(v1_6.UpdateFeeQuoterPricesChangeset),
11881194
v1_6.UpdateFeeQuoterPricesConfig{
1195+
MCMS: mcms,
11891196
PricesByChain: map[uint64]v1_6.FeeQuoterPriceUpdatePerSource{
11901197
from: {
11911198
TokenPrices: tokenPrices,
1192-
GasPrices: gasprice,
1199+
GasPrices: gasPrices,
11931200
},
11941201
},
11951202
},
11961203
),
11971204
commoncs.Configure(
11981205
cldf.CreateLegacyChangeSet(v1_6.UpdateFeeQuoterDestsChangeset),
11991206
v1_6.UpdateFeeQuoterDestsConfig{
1207+
MCMS: mcms,
12001208
UpdatesByChain: map[uint64]map[uint64]fee_quoter.FeeQuoterDestChainConfig{
12011209
from: {
12021210
to: fqCfg,
12031211
},
12041212
},
12051213
},
12061214
),
1215+
}
1216+
}
1217+
1218+
func AddEVMSrcChangesets(from, to uint64, isTestRouter bool, gasprice map[uint64]*big.Int, tokenPrices map[common.Address]*big.Int, fqCfg fee_quoter.FeeQuoterDestChainConfig) []commoncs.ConfiguredChangeSet {
1219+
evmSrcChangesets := []commoncs.ConfiguredChangeSet{
1220+
commoncs.Configure(
1221+
cldf.CreateLegacyChangeSet(v1_6.UpdateOnRampsDestsChangeset),
1222+
v1_6.UpdateOnRampDestsConfig{
1223+
UpdatesByChain: map[uint64]map[uint64]v1_6.OnRampDestinationUpdate{
1224+
from: {
1225+
to: {
1226+
IsEnabled: true,
1227+
TestRouter: isTestRouter,
1228+
AllowListEnabled: false,
1229+
},
1230+
},
1231+
},
1232+
},
1233+
),
1234+
}
1235+
evmSrcChangesets = append(evmSrcChangesets, addEVMFeeQuoterDestAndPricesChangesets(from, to, gasprice, tokenPrices, fqCfg, nil)...)
1236+
evmSrcChangesets = append(evmSrcChangesets,
12071237
commoncs.Configure(
12081238
cldf.CreateLegacyChangeSet(v1_6.UpdateRouterRampsChangeset),
12091239
v1_6.UpdateRouterRampsConfig{
@@ -1218,7 +1248,7 @@ func AddEVMSrcChangesets(from, to uint64, isTestRouter bool, gasprice map[uint64
12181248
},
12191249
},
12201250
),
1221-
}
1251+
)
12221252

12231253
return evmSrcChangesets
12241254
}

integration-tests/smoke/ccip/ccip_aptos_messaging_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ func Test_CCIP_Messaging_EVM2Aptos(t *testing.T) {
5454

5555
lggr.Debug("Source chain (EVM): ", sourceChain, "Dest chain (Aptos): ", destChain)
5656

57-
testhelpers.AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &e, state, sourceChain, destChain, false)
57+
require.NoError(t, testhelpers.AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &e, state, sourceChain, destChain, false))
5858

5959
var (
6060
nonce uint64
@@ -416,7 +416,7 @@ func Test_CCIP_Messaging_Aptos2EVM(t *testing.T) {
416416

417417
lggr.Debug("Source chain (Aptos): ", sourceChain, "Dest chain (EVM): ", destChain)
418418

419-
testhelpers.AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &e, state, sourceChain, destChain, false)
419+
require.NoError(t, testhelpers.AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &e, state, sourceChain, destChain, false))
420420

421421
aptosCallOpts := &aptos_call_opts.CallOpts{}
422422

0 commit comments

Comments
 (0)