@@ -12,26 +12,12 @@ import (
1212 "github.com/smartcontractkit/chainlink-deployments-framework/deployment"
1313)
1414
15- const testAddress = "0xe86f0e5a8b9cb6ab31b656baa83a0d2eb761b32eb31b9a9c74abb7d0cffd26fa"
16-
17- // Helper function to create expected output strings in a readable format
18- func expectedOutput (method string , inputs [][]string ) string {
19- result := fmt .Sprintf ("**Address:** `%s` <sub><i>address of TestCCIP 1.0.0 from aptos-testnet</i></sub>\n **Method:** `%s`\n \n " , testAddress , method )
20-
21- if len (inputs ) > 0 {
22- result += "**Inputs:**\n \n | Name | Value | Annotation |\n |------|-------|------------|\n "
23- for _ , input := range inputs {
24- result += fmt .Sprintf ("| `%s` | `%s` | |\n " , input [0 ], input [1 ])
25- }
26- }
27- result += "\n "
28-
29- return result
30- }
15+ const aptosTestAddress = "0xe86f0e5a8b9cb6ab31b656baa83a0d2eb761b32eb31b9a9c74abb7d0cffd26fa"
16+ const aptosAddressTitle = "address of TestCCIP 1.0.0 from aptos-testnet"
3117
3218// Helper function for error cases where method contains an error message
3319func expectedErrorOutput (errorMessage string ) string {
34- return fmt .Sprintf ("**Address:** `%s` <sub><i>address of TestCCIP 1.0.0 from aptos-testnet</i></sub>\n **Method:** `%s`\n \n " , testAddress , errorMessage )
20+ return fmt .Sprintf ("**Address:** `%s` <sub><i>address of TestCCIP 1.0.0 from aptos-testnet</i></sub>\n **Method:** `%s`\n \n " , aptosTestAddress , errorMessage )
3521}
3622
3723func TestDescribeBatchOperations (t * testing.T ) {
@@ -40,7 +26,7 @@ func TestDescribeBatchOperations(t *testing.T) {
4026 defaultProposalCtx := & DefaultProposalContext {
4127 AddressesByChain : deployment.AddressesByChain {
4228 chainsel .APTOS_TESTNET .Selector : {
43- testAddress : deployment .MustTypeAndVersionFromString ("TestCCIP 1.0.0" ),
29+ aptosTestAddress : deployment .MustTypeAndVersionFromString ("TestCCIP 1.0.0" ),
4430 },
4531 },
4632 }
@@ -56,30 +42,30 @@ func TestDescribeBatchOperations(t *testing.T) {
5642 operations : getOperations (1 ),
5743 want : [][]string {
5844 {
59- expectedOutput ("ccip_onramp::onramp::initialize" , [][]string {
45+ expectedOutput ("ccip_onramp::onramp::initialize" , aptosTestAddress , aptosAddressTitle , [][]string {
6046 {"chain_selector" , "4457093679053095497" },
6147 {"fee_aggregator" , "0x13a9f1a109368730f2e355d831ba8fbf5942fb82321863d55de54cb4ebe5d18f" },
6248 {"allowlist_admin" , "0x13a9f1a109368730f2e355d831ba8fbf5942fb82321863d55de54cb4ebe5d18f" },
6349 {"dest_chain_selectors" , "[]" },
6450 {"dest_chain_routers" , "[]" },
6551 {"dest_chain_allowlist_enabled" , "[]" },
6652 }),
67- expectedOutput ("ccip_offramp::offramp::initialize" , [][]string {
53+ expectedOutput ("ccip_offramp::offramp::initialize" , aptosTestAddress , aptosAddressTitle , [][]string {
6854 {"chain_selector" , "4457093679053095497" },
6955 {"permissionless_execution_threshold_seconds" , "28800" },
7056 {"source_chains_selector" , "[11155111]" },
7157 {"source_chains_is_enabled" , "[true]" },
7258 {"source_chains_is_rmn_verification_disabled" , "[false]" },
7359 {"source_chains_on_ramp" , "[0x0bf3de8c5d3e8a2b34d2beeb17abfcebaf363a59]" },
7460 }),
75- expectedOutput ("ccip::rmn_remote::initialize" , [][]string {
61+ expectedOutput ("ccip::rmn_remote::initialize" , aptosTestAddress , aptosAddressTitle , [][]string {
7662 {"local_chain_selector" , "4457093679053095497" },
7763 }),
78- expectedOutput ("ccip_token_pool::token_pool::initialize" , [][]string {
64+ expectedOutput ("ccip_token_pool::token_pool::initialize" , aptosTestAddress , aptosAddressTitle , [][]string {
7965 {"local_token" , "0x0000000000000000000000000000000000000000000000000000000000000003" },
8066 {"allowlist" , "[0x0000000000000000000000000000000000000000000000000000000000000001,0x0000000000000000000000000000000000000000000000000000000000000002]" },
8167 }),
82- expectedOutput ("ccip_offramp::offramp::apply_source_chain_config_updates" , [][]string {
68+ expectedOutput ("ccip_offramp::offramp::apply_source_chain_config_updates" , aptosTestAddress , aptosAddressTitle , [][]string {
8369 {"source_chains_selector" , "[743186221051783445,16015286601757825753]" },
8470 {"source_chains_is_enabled" , "[true,false]" },
8571 {"source_chains_is_rmn_verification_disabled" , "[true,true]" },
@@ -94,15 +80,15 @@ func TestDescribeBatchOperations(t *testing.T) {
9480 operations : getOperations (2 ),
9581 want : [][]string {
9682 {
97- expectedOutput ("ccip_onramp::onramp::initialize" , [][]string {
83+ expectedOutput ("ccip_onramp::onramp::initialize" , aptosTestAddress , aptosAddressTitle , [][]string {
9884 {"chain_selector" , "4457093679053095497" },
9985 {"fee_aggregator" , "0x13a9f1a109368730f2e355d831ba8fbf5942fb82321863d55de54cb4ebe5d18f" },
10086 {"allowlist_admin" , "0x13a9f1a109368730f2e355d831ba8fbf5942fb82321863d55de54cb4ebe5d18f" },
10187 {"dest_chain_selectors" , "[]" },
10288 {"dest_chain_routers" , "[]" },
10389 {"dest_chain_allowlist_enabled" , "[]" },
10490 }),
105- expectedOutput ("ccip_offramp::offramp::initialize" , [][]string {
91+ expectedOutput ("ccip_offramp::offramp::initialize" , aptosTestAddress , aptosAddressTitle , [][]string {
10692 {"chain_selector" , "4457093679053095497" },
10793 {"permissionless_execution_threshold_seconds" , "28800" },
10894 {"source_chains_selector" , "[11155111]" },
@@ -112,14 +98,14 @@ func TestDescribeBatchOperations(t *testing.T) {
11298 }),
11399 },
114100 {
115- expectedOutput ("ccip::rmn_remote::initialize" , [][]string {
101+ expectedOutput ("ccip::rmn_remote::initialize" , aptosTestAddress , aptosAddressTitle , [][]string {
116102 {"local_chain_selector" , "4457093679053095497" },
117103 }),
118- expectedOutput ("ccip_token_pool::token_pool::initialize" , [][]string {
104+ expectedOutput ("ccip_token_pool::token_pool::initialize" , aptosTestAddress , aptosAddressTitle , [][]string {
119105 {"local_token" , "0x0000000000000000000000000000000000000000000000000000000000000003" },
120106 {"allowlist" , "[0x0000000000000000000000000000000000000000000000000000000000000001,0x0000000000000000000000000000000000000000000000000000000000000002]" },
121107 }),
122- expectedOutput ("ccip_offramp::offramp::apply_source_chain_config_updates" , [][]string {
108+ expectedOutput ("ccip_offramp::offramp::apply_source_chain_config_updates" , aptosTestAddress , aptosAddressTitle , [][]string {
123109 {"source_chains_selector" , "[743186221051783445,16015286601757825753]" },
124110 {"source_chains_is_enabled" , "[true,false]" },
125111 {"source_chains_is_rmn_verification_disabled" , "[true,true]" },
@@ -136,7 +122,7 @@ func TestDescribeBatchOperations(t *testing.T) {
136122 {
137123 expectedErrorOutput (
138124 "failed to decode Aptos transaction: could not find function info for ccip_offramp::bad_module::initialize" ),
139- expectedOutput ("ccip::rmn_remote::initialize" , [][]string {
125+ expectedOutput ("ccip::rmn_remote::initialize" , aptosTestAddress , aptosAddressTitle , [][]string {
140126 {"local_chain_selector" , "4457093679053095497" },
141127 }),
142128 },
@@ -164,7 +150,7 @@ func getOperations(n int) []types.BatchOperation {
164150 mcmsTxs := []types.Transaction {
165151 {
166152 OperationMetadata : types.OperationMetadata {},
167- To : testAddress ,
153+ To : aptosTestAddress ,
168154 Data : []byte {
169155 0x49 , 0x42 , 0x99 , 0x1e , 0x16 , 0xc7 , 0xda , 0x3d , 0x13 , 0xa9 , 0xf1 , 0xa1 , 0x09 , 0x36 , 0x87 , 0x30 ,
170156 0xf2 , 0xe3 , 0x55 , 0xd8 , 0x31 , 0xba , 0x8f , 0xbf , 0x59 , 0x42 , 0xfb , 0x82 , 0x32 , 0x18 , 0x63 , 0xd5 ,
@@ -176,7 +162,7 @@ func getOperations(n int) []types.BatchOperation {
176162 },
177163 {
178164 OperationMetadata : types.OperationMetadata {},
179- To : testAddress ,
165+ To : aptosTestAddress ,
180166 Data : []byte {
181167 0x49 , 0x42 , 0x99 , 0x1e , 0x16 , 0xc7 , 0xda , 0x3d , 0x80 , 0x70 , 0x00 , 0x00 , 0x01 , 0xa7 , 0x36 , 0xaa ,
182168 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x01 , 0x01 , 0x01 , 0x00 , 0x01 , 0x14 , 0x0b , 0xf3 , 0xde , 0x8c , 0x5d ,
@@ -186,13 +172,13 @@ func getOperations(n int) []types.BatchOperation {
186172 },
187173 {
188174 OperationMetadata : types.OperationMetadata {},
189- To : testAddress ,
175+ To : aptosTestAddress ,
190176 Data : []byte {0x49 , 0x42 , 0x99 , 0x1e , 0x16 , 0xc7 , 0xda , 0x3d },
191177 AdditionalFields : json .RawMessage (`{"package_name":"ccip","module_name":"rmn_remote","function":"initialize"}` ),
192178 },
193179 {
194180 OperationMetadata : types.OperationMetadata {},
195- To : testAddress ,
181+ To : aptosTestAddress ,
196182 Data : []byte {
197183 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 ,
198184 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x03 ,
@@ -206,7 +192,7 @@ func getOperations(n int) []types.BatchOperation {
206192 },
207193 {
208194 OperationMetadata : types.OperationMetadata {},
209- To : testAddress ,
195+ To : aptosTestAddress ,
210196 Data : []byte {
211197 0x02 , 0x15 , 0xa9 , 0xc1 , 0x33 , 0xee , 0x53 , 0x50 , 0x0a , 0xd9 , 0x1a , 0xd9 , 0xc9 , 0x4f , 0xba , 0x41 ,
212198 0xde , 0x02 , 0x01 , 0x00 , 0x02 , 0x01 , 0x01 , 0x02 , 0x14 , 0xc2 , 0x30 , 0x71 , 0xa8 , 0xae , 0x83 , 0x67 ,
@@ -244,7 +230,7 @@ func getBadOperations() []types.BatchOperation {
244230 mcmsTxs := []types.Transaction {
245231 {
246232 OperationMetadata : types.OperationMetadata {},
247- To : testAddress ,
233+ To : aptosTestAddress ,
248234 Data : []byte {
249235 0x49 , 0x42 , 0x99 , 0x1e , 0x16 , 0xc7 , 0xda , 0x3d , 0x80 , 0x70 , 0x00 , 0x00 , 0x01 , 0xa7 , 0x36 , 0xaa ,
250236 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x01 , 0x01 , 0x01 , 0x00 , 0x01 , 0x14 , 0x0b , 0xf3 , 0xde , 0x8c , 0x5d ,
@@ -254,7 +240,7 @@ func getBadOperations() []types.BatchOperation {
254240 },
255241 {
256242 OperationMetadata : types.OperationMetadata {},
257- To : testAddress ,
243+ To : aptosTestAddress ,
258244 Data : []byte {0x49 , 0x42 , 0x99 , 0x1e , 0x16 , 0xc7 , 0xda , 0x3d },
259245 AdditionalFields : json .RawMessage (`{"package_name":"ccip","module_name":"rmn_remote","function":"initialize"}` ),
260246 },
0 commit comments