@@ -96,7 +96,7 @@ async fn test_get_complete_cctx() {
9696 "revert_address" : "tb1quegm9lg6nd0v2xncl8ldkvfkghhe8mns3ftvca" ,
9797 "call_on_revert" : false ,
9898 "abort_address" : "" ,
99- "revert_message" : null ,
99+ "revert_message" : "dummy revert message" ,
100100 "revert_gas_limit" : "0"
101101 }
102102 }
@@ -137,119 +137,15 @@ async fn test_get_complete_cctx() {
137137 assert_eq ! ( cctx. zeta_fees, "0" ) ;
138138 assert_eq ! ( cctx. relayed_message, "000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000076465706f73697400000000000000000000000000000000000000000000000000" ) ;
139139 assert_eq ! ( cctx. token_symbol, Some ( "sBTC.BTC" . to_string( ) ) ) ;
140+ assert ! ( cctx. revert_options. is_some( ) ) ;
141+ assert ! ( cctx
142+ . revert_options
143+ . clone( )
144+ . unwrap( )
145+ . revert_message
146+ . is_some( ) ) ;
147+ assert_eq ! (
148+ cctx. revert_options. clone( ) . unwrap( ) . revert_message. unwrap( ) ,
149+ "dummy revert message"
150+ ) ;
140151}
141-
142- #[ tokio:: test]
143- async fn test_revert_message_is_base64_encoded ( ) {
144- let db = crate :: helpers:: init_db ( "test" , "indexer_revert_message_is_base64_encoded" ) . await ;
145- let database = ZetachainCctxDatabase :: new ( db. client ( ) . clone ( ) , 7001 ) ;
146- database. setup_db ( ) . await . unwrap ( ) ;
147-
148- let cctx_response = json ! ( {
149- "CrossChainTx" : {
150- "creator" : "" ,
151- "index" : "0xa99eee254efce80d23caf1d4691c46b6e9965bd7b8923435fcc669fd3c032246" ,
152- "zeta_fees" : "0" ,
153- "relayed_message" : "00000000000000000000000050753ca349636ca8732762e8ccf057d3999891a0000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000005098e1b2e8ec00000000000000000000000050753ca349636ca8732762e8ccf057d3999891a0000000000000000000000000000000000000000000000000000000000000002868747470733a2f2f6170692e6578616d706c652e636f6d2f6d657461646174612f2f312e6a736f6e000000000000000000000000000000000000000000000000" ,
154- "cctx_status" : {
155- "status" : "Aborted" ,
156- "status_message" : "outbound failed and revert failed" ,
157- "error_message" : "{\" type\" :\" internal_error\" ,\" message\" :\" outbound tx failed to be executed on connected chain\" }" ,
158- "lastUpdate_timestamp" : "1756282428" ,
159- "isAbortRefunded" : false ,
160- "created_timestamp" : "1756282335" ,
161- "error_message_revert" : "{\" type\" :\" contract_call_error\" ,\" message\" :\" contract call failed when calling EVM with data\" ,\" error\" :\" revert transaction reverted:execution reverted: ret 0x7e2732890000000000000000000000000000000000000000000000000000000000000001: evm transaction execution failed\" ,\" method\" :\" depositAndRevert\" ,\" contract\" :\" 0x6c533f7fE93fAE114d0954697069Df33C9B74fD7\" ,\" args\" :\" [0x236b0DE675cC8F46AE186897fCCeFe3370C9eDeD 88617551849708 0xCf726D8D25aB1BEB67362cD42Bf57AE5f0941246 {0xCf726D8D25aB1BEB67362cD42Bf57AE5f0941246 0x236b0DE675cC8F46AE186897fCCeFe3370C9eDeD 88617551849708 [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 96 0 0 0 0 0 0 0 0 0 0 0 0 80 117 60 163 73 99 108 168 115 39 98 232 204 240 87 211 153 152 145 160 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 40 104 116 116 112 115 58 47 47 97 112 105 46 101 120 97 109 112 108 101 46 99 111 109 47 109 101 116 97 100 97 116 97 47 47 49 46 106 115 111 110 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]}]\" }" ,
162- "error_message_abort" : "failed to process abort: {\" type\" :\" contract_call_error\" ,\" message\" :\" contract call failed when calling EVM with data\" ,\" error\" :\" execution reverted: ret 0xd92e233d: evm transaction execution failed\" ,\" method\" :\" deposit\" ,\" contract\" :\" 0x236b0DE675cC8F46AE186897fCCeFe3370C9eDeD\" ,\" args\" :\" [0x0000000000000000000000000000000000000000 88617551849708]\" }"
163- } ,
164- "inbound_params" : {
165- "sender" : "0xCf726D8D25aB1BEB67362cD42Bf57AE5f0941246" ,
166- "sender_chain_id" : "7001" ,
167- "tx_origin" : "0x62dFD544f6f9bC3279D9762d7AeA4719a2559B0d" ,
168- "coin_type" : "Gas" ,
169- "asset" : "" ,
170- "amount" : "88617551849708" ,
171- "observed_hash" : "0x96304e7ff9c454ad19c61575dfcd512ed62c8187a57bbf2ac1635375701628d2" ,
172- "observed_external_height" : "12350146" ,
173- "ballot_index" : "0xa99eee254efce80d23caf1d4691c46b6e9965bd7b8923435fcc669fd3c032246" ,
174- "finalized_zeta_height" : "0" ,
175- "tx_finalization_status" : "NotFinalized" ,
176- "is_cross_chain_call" : true ,
177- "status" : "SUCCESS" ,
178- "confirmation_mode" : "SAFE"
179- } ,
180- "outbound_params" : [
181- {
182- "receiver" : "0x62dFD544f6f9bC3279D9762d7AeA4719a2559B0d" ,
183- "receiver_chainId" : "84532" ,
184- "coin_type" : "Gas" ,
185- "amount" : "88617551849708" ,
186- "tss_nonce" : "962" ,
187- "gas_limit" : "0" ,
188- "gas_price" : "1217762" ,
189- "gas_priority_fee" : "0" ,
190- "hash" : "0x05b3312c4d88d5c2976a865f8a1e43c34bfbdc25909a4db80f210931a3425699" ,
191- "ballot_index" : "0x7fbbf69dfbfc793cbe717a25746cb98505ffd9f02d70300d1b2d3c490c0d4eaa" ,
192- "observed_external_height" : "30257033" ,
193- "gas_used" : "74505" ,
194- "effective_gas_price" : "1217762" ,
195- "effective_gas_limit" : "1000000" ,
196- "tss_pubkey" : "zetapub1addwnpepq28c57cvcs0a2htsem5zxr6qnlvq9mzhmm76z3jncsnzz32rclangr2g35p" ,
197- "tx_finalization_status" : "Executed" ,
198- "call_options" : {
199- "gas_limit" : "1000000" ,
200- "is_arbitrary_call" : false
201- } ,
202- "confirmation_mode" : "SAFE"
203- } ,
204- {
205- "receiver" : "0xCf726D8D25aB1BEB67362cD42Bf57AE5f0941246" ,
206- "receiver_chainId" : "7001" ,
207- "coin_type" : "Gas" ,
208- "amount" : "88617551849708" ,
209- "tss_nonce" : "0" ,
210- "gas_limit" : "0" ,
211- "gas_price" : "" ,
212- "gas_priority_fee" : "" ,
213- "hash" : "" ,
214- "ballot_index" : "" ,
215- "observed_external_height" : "0" ,
216- "gas_used" : "0" ,
217- "effective_gas_price" : "0" ,
218- "effective_gas_limit" : "0" ,
219- "tss_pubkey" : "zetapub1addwnpepq28c57cvcs0a2htsem5zxr6qnlvq9mzhmm76z3jncsnzz32rclangr2g35p" ,
220- "tx_finalization_status" : "NotFinalized" ,
221- "call_options" : {
222- "gas_limit" : "1500000" ,
223- "is_arbitrary_call" : false
224- } ,
225- "confirmation_mode" : "SAFE"
226- }
227- ] ,
228- "protocol_contract_version" : "V2" ,
229- "revert_options" : {
230- "revert_address" : "0xCf726D8D25aB1BEB67362cD42Bf57AE5f0941246" ,
231- "call_on_revert" : true ,
232- "abort_address" : "0x0000000000000000000000000000000000000000" ,
233- "revert_message" : "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAAAAAAAAAAAAAAFB1PKNJY2yocydi6MzwV9OZmJGgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAChodHRwczovL2FwaS5leGFtcGxlLmNvbS9tZXRhZGF0YS8vMS5qc29uAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" ,
234- "revert_gas_limit" : "0"
235- }
236- }
237- } ) ;
238- let cctx = cctx_response. get ( "CrossChainTx" ) . unwrap ( ) ;
239- let cctx: CrossChainTx = serde_json:: from_value ( cctx. clone ( ) ) . unwrap ( ) ;
240- let tx = db. client ( ) . begin ( ) . await . unwrap ( ) ;
241- database
242- . batch_insert_transactions ( Uuid :: new_v4 ( ) , & vec ! [ cctx] , & tx, None )
243- . await
244- . unwrap ( ) ;
245- tx. commit ( ) . await . unwrap ( ) ;
246- let cctx = database
247- . get_complete_cctx (
248- "0xa99eee254efce80d23caf1d4691c46b6e9965bd7b8923435fcc669fd3c032246" . to_string ( ) ,
249- )
250- . await
251- . unwrap ( ) ;
252- assert ! ( cctx. is_some( ) ) ;
253- let cctx = cctx. unwrap ( ) ;
254- assert_eq ! ( cctx. revert_options. unwrap( ) . revert_message, Some ( "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAAAAAAAAAAAAAAFB1PKNJY2yocydi6MzwV9OZmJGgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAChodHRwczovL2FwaS5leGFtcGxlLmNvbS9tZXRhZGF0YS8vMS5qc29uAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" . to_string( ) ) ) ;
255- }
0 commit comments