Skip to content

Commit

Permalink
temp
Browse files Browse the repository at this point in the history
  • Loading branch information
AnieeG committed Aug 5, 2024
1 parent e8f60ed commit 5a269ef
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 95 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
package v1_2_0

import (
"fmt"
"testing"
"time"

"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/ethclient"
"github.com/stretchr/testify/require"

"github.com/smartcontractkit/chainlink-common/pkg/config"

"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_offramp"
ccipconfig "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/config"
)

Expand Down Expand Up @@ -171,3 +176,21 @@ func TestExecOffchainConfig120_ParseRawJson(t *testing.T) {
})
}
}

func TestDecode(t *testing.T) {
c, err := ethclient.Dial("wss://...")
require.NoError(t, err)
offRamp, err := evm_2_evm_offramp.NewEVM2EVMOffRamp(common.HexToAddress("0x16994C557aDb0E4228E6a9c71518E37662f734ee"), c)
require.NoError(t, err)
cfg, err := offRamp.FilterConfigSet0(&bind.FilterOpts{
Start: 35176585,
})
require.NoError(t, err)

cfg.Next()

fmt.Println(string(cfg.Event.OffchainConfig))
offchainConfigParsed, err := ccipconfig.DecodeOffchainConfig[ExecOnchainConfig](cfg.Event.OffchainConfig)
require.NoError(t, err)
fmt.Println(offchainConfigParsed)
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,71 +14,28 @@ Data = """
"Arbitrum Sepolia": {
"is_native_fee_token": true,
"fee_token": "0xb1D4538B4571d411F07960EF2838Ce337FE1E80E",
"bridge_tokens": [
"bridge_tokens": [
"0x13613fb95931D7cC2F1ae3E30e5090220f818032"
],
"bridge_tokens_pools": [
"0xbda804e7e4247d67A9801BfB6113840055aB50E8"
],
"price_aggregators": null,
"arm": "0x5EF7a726Fd21Fd9D77D34E3C56cfDD8691F7F0ac",
"router": "0x2a9C5afB0d0e4BAb2BCdaE109EC4b0c4Be15a165",
"price_registry": "0x89D5b13908b9063abCC6791dc724bF7B7c93634C",
"wrapped_native": "0xE591bf0A0CF924A0674d7792db046B23CEbF5f34",
"src_contracts": {
"Avalanche Fuji": {
"on_ramp": "0x1Cb56374296ED19E86F68fA437ee679FD7798DaA",
"deployed_at": 33999325
},
"Base Sepolia": {
"on_ramp": "0x7854E73C73e7F9bb5b0D5B4861E997f4C6E8dcC6",
"deployed_at": 9199926
},
"Gnosis Chiado": {
"on_ramp": "0x973CbE752258D32AE82b60CD1CB656Eebb588dF0",
"deployed_at": 42809650
},
"Optimism Sepolia": {
"on_ramp": "0x701Fe16916dd21EFE2f535CA59611D818B017877",
"deployed_at": 35180131
},
"Sepolia Testnet": {
"on_ramp": "0x4205E1Ca0202A248A5D42F5975A8FE56F3E302e9",
"deployed_at": 35180131
},
"WeMix Testnet": {
"on_ramp": "0xBD4106fBE4699FE212A34Cc21b10BFf22b02d959",
"deployed_at": 18816676
}
},
"dest_contracts": {
"Avalanche Fuji": {
"off_ramp": "0xcab0EF91Bee323d1A617c0a027eE753aFd6997E4",
"commit_store": "0x0d90b9b96cBFa0D01635ce12982ccE1b70827c7a",
"receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c"
},
"Base Sepolia": {
"off_ramp": "0xc1982985720B959E66c19b64F783361Eb9B60F26",
"commit_store": "0x28F66bB336f6db713d6ad2a3bd1B7a531282A159",
"receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c"
},
"Gnosis Chiado": {
"off_ramp": "0x935C26F9a9122E5F9a27f2d3803e74c75B94f5a3",
"commit_store": "0xEdb963Ec5c2E5AbdFdCF137eF44A445a7fa4787A",
"receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c"
},
"Optimism Sepolia": {
"off_ramp": "0xfD404A89e1d195F0c65be1A9042C77745197659e",
"commit_store": "0x84B7B012c95f8A152B44Ab3e952f2dEE424fA8e1",
"receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c"
},
"Sepolia Testnet": {
"off_ramp": "0x1c71f141b4630EBE52d6aF4894812960abE207eB",
"commit_store": "0xaB0c8Ba51E7Fa3E5693a4Fbb39473520FD85d173",
"receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c"
},
"WeMix Testnet": {
"off_ramp": "0x262e16C8D42aa07bE13e58F81e7D9F62F6DE2830",
"commit_store": "0xc132eFAf929299E5ee704Fa6D9796CFa23Bb8b2C",
"receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c"
"receiver_dapp": "0x83daa8A15f55DF551b15D8A7C62959dE5A0BE53e"
}
}
},
Expand Down Expand Up @@ -582,8 +539,10 @@ Data = """
"is_native_fee_token": true,
"fee_token": "0x779877A7B0D9E8603169DdbD7836e478b4624789",
"bridge_tokens": [
"0x13613fb95931D7cC2F1ae3E30e5090220f818032"
],
"bridge_tokens_pools": [
"0xEcc0EFa2C945022E5d8Cf0e7Bc94324834b987B8"
],
"price_aggregators": null,
"arm": "0xB4d360459F32Dd641Ef5A6985fFbAC5c4e5521aA",
Expand Down Expand Up @@ -644,7 +603,7 @@ Data = """
"Arbitrum Sepolia": {
"off_ramp": "0xF18896AB20a09A29e64fdEbA99FDb8EC328f43b1",
"commit_store": "0x93Ff9Dd39Dc01eac1fc4d2c9211D95Ee458CAB94",
"receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c"
"receiver_dapp": "0x83daa8A15f55DF551b15D8A7C62959dE5A0BE53e"
},
"Avalanche Fuji": {
"off_ramp": "0x000b26f604eAadC3D874a4404bde6D64a97d95ca",
Expand Down Expand Up @@ -906,59 +865,23 @@ TTL = '8h'
[CCIP.Env.Network]
selected_networks = [
'ARBITRUM_SEPOLIA',
'AVALANCHE_FUJI',
'OPTIMISM_SEPOLIA',
'BASE_SEPOLIA',
'BSC_TESTNET',
'WEMIX_TESTNET',
'SEPOLIA',
'POLYGON_AMOY',
'KROMA_SEPOLIA',
'BLAST_SEPOLIA'
]

[CCIP.Groups.load]
NetworkPairs = [
'AVALANCHE_FUJI,SEPOLIA',
'OPTIMISM_SEPOLIA,BASE_SEPOLIA'
]

BiDirectionalLane = true
[CCIP.Groups.smoke]
BiDirectionalLane = false
LocalCluster = false
PhaseTimeout = '45m'
ExistingDeployment = true

NoOfTokensPerChain = 1

[CCIP.Groups.load.LoadProfile]
RequestPerUnitTime = [1]
TimeUnit = '5s'
TestDuration = '1h'
TestRunName = 'v2.12.0-ccip1.4.16-load'

# to represent 20%, 60%, 15%, 5% of the total messages
[CCIP.Groups.load.LoadProfile.MsgProfile]
Frequencies = [4,12,3,1]

[[CCIP.Groups.load.LoadProfile.MsgProfile.MsgDetails]]
MsgType = 'Token'
DestGasLimit = 0
[CCIP.Groups.smoke.MsgDetails]
MsgType = 'Token' # type of message to be sent, either 'Token' or 'DataWithToken' Or 'Data'
DestGasLimit = 100000 # change this to 0 gas limit if you are doing ccip-send to an EOA
NoOfTokens = 1 # number of bridge tokens to be sent in ccip message if MsgType = 'Token'/'DataWithToken'
AmountPerToken = 1 # amount to be sent for each bridge token in ccip message if MsgType = 'Token'/'DataWithToken'
DataLength = 0
NoOfTokens = 5
AmountPerToken = 1

[[CCIP.Groups.load.LoadProfile.MsgProfile.MsgDetails]]
MsgType = 'DataWithToken'
DestGasLimit = 500000
DataLength = 5000
NoOfTokens = 5
AmountPerToken = 1

[[CCIP.Groups.load.LoadProfile.MsgProfile.MsgDetails]]
MsgType = 'Data'
DestGasLimit = 800000
DataLength = 10000

[[CCIP.Groups.load.LoadProfile.MsgProfile.MsgDetails]]
MsgType = 'Data'
DestGasLimit = 2500000
DataLength = 10000
[CCIP.Groups.smoke.TokenConfig]
NoOfTokensPerChain = 1 # number of bridge tokens to be deployed per network; if MsgType = 'Token'/'DataWithToken'
CCIPOwnerTokens = true # if true, the test will use deploy the tokens by the CCIPOwner, otherwise the tokens will be deployed by a non-owner account, only applicable for 1.5 pools and onwards

0 comments on commit 5a269ef

Please sign in to comment.