@@ -245,3 +245,63 @@ func TestRelayedTransactionIntraShard(t *testing.T) {
245245 string (genericResponse .Docs [0 ].Source ),
246246 )
247247}
248+
249+ func TestRelayedV2Disabled (t * testing.T ) {
250+ esClient , err := createESClient (esURL )
251+ require .Nil (t , err )
252+
253+ esProc , err := CreateElasticProcessor (esClient )
254+ require .Nil (t , err )
255+
256+ txHash := []byte ("relayedTxIntra" )
257+ header := & dataBlock.Header {
258+ Round : 50 ,
259+ TimeStamp : 5040 ,
260+ // Relayed v1 and v2 transactions are disabled starting from epoch 1
261+ Epoch : 10 ,
262+ }
263+
264+ body := & dataBlock.Body {
265+ MiniBlocks : dataBlock.MiniBlockSlice {
266+ {
267+ Type : dataBlock .TxBlock ,
268+ SenderShardID : 0 ,
269+ ReceiverShardID : 0 ,
270+ TxHashes : [][]byte {txHash },
271+ },
272+ },
273+ }
274+
275+ address1 := "erd1k7j6ewjsla4zsgv8v6f6fe3dvrkgv3d0d9jerczw45hzedhyed8sh2u34u"
276+ address2 := "erd14eyayfrvlrhzfrwg5zwleua25mkzgncggn35nvc6xhv5yxwml2es0f3dht"
277+ tx := & transaction.Transaction {
278+ Nonce : 1196665 ,
279+ SndAddr : decodeAddress (address1 ),
280+ RcvAddr : decodeAddress (address2 ),
281+ GasLimit : 15406000 ,
282+ GasPrice : 1000000000 ,
283+ Data : []byte ("relayedTxV2@a56f37f2356753eb2db8b8fe6dbf026261653973fc08785b69d0406162e16f9d@028e@4d756c7469455344544e46545472616e73666572403438386264303665386233643233626239386235303663643566323937363838316465323661306438333030303365336564643231373164366666353935646640323040353835303431343334383439343535363435326433353631333033353331333940306440303140343135333438326436313336333433323634333140403035366636303133626238343166656440353734353437346334343264363236343334363433373339404033363035363862306336616330634034643439346534333535326433333338363533393333363440403035366263373565326436333130303030304035373431353434353532326433393635363433343330333040403032326230656162356237336638396330303030403433353235343464343235343264333936323335333633393339403033403031403439353334353534326433383334363533353335363540403138313034626265403533343634393534326436313635363236333339333040403033633738343165323736666535653035664035383530343134333438343934353536343532643335363133303335333133394030314030314034383539353034353264333633313339333633363331404036633662393335623862626434303030303040356135303431353932643332333433373338333733354040303839633831363734383032653636643364403532343934343435326433373634333133383635333940403038343564366639366664666564613540353535333434343332643633333733363636333136364040303831663139403531353735343264333433363631363333303331404030653530636131334034313435353234663264333433353338363236323636404030373937383734356663383339326532613140343334373533326436363331333833363339363440403135326430326337653134616636383030303030403534346634643264363636313331333633343631404034633462343040343534363436346635323534326436313331333333353331333340403037393738373435666338333932653261314035333438343135323434326433393339363133313337333240406430326162343836636564633030303040346434353538326433343335333536333335333740403031306232356130353531303435313139326266403535353334343534326436363338363333303338363340403135363540353734353534343832643632333436333631333233394040393665656261366166304034393534343834353535346432643634363633363636333233364040326162663662323236656464643835323636403534343134633439346634653264333433393336363236313632404063333530403436346635383533353932643335363433353636333336354040303861323332343837623736613830304034363439353234353264363133393631333333323631404030323261616438363563386136346530303030304035353534346232643332363633383330363533394040303632356561633765303761396666633735403438353434643264363633353331363433353335404030666361633939343734343939394034333532353432643335333236343635363336364040303132613966653935666262666563634034333532353532643631333536363334363136314040306132313361316233653263646240353734323534343332643335333333343339363233334040303440343234383431353432643633333136363634363533334040386332626462353330666632396333386265@cf52df0a6c31738ff283b3dade4e18f1c3029a062eccc22fba5cda8510fc02931d7824abdf1bca7d8c24cc72ddc02af5e060dc99fbde1e531b857b63818ff20a" ),
284+ Value : big .NewInt (0 ),
285+ }
286+ txInfo := & outport.TxInfo {
287+ Transaction : tx ,
288+ }
289+
290+ pool := & outport.TransactionPool {
291+ Transactions : map [string ]* outport.TxInfo {
292+ hex .EncodeToString (txHash ): txInfo ,
293+ },
294+ }
295+ err = esProc .SaveTransactions (createOutportBlockWithHeader (body , header , pool , nil , testNumOfShards ))
296+ require .Nil (t , err )
297+
298+ ids := []string {hex .EncodeToString (txHash )}
299+ genericResponse := & GenericResponse {}
300+ err = esClient .DoMultiGet (context .Background (), ids , indexerdata .TransactionsIndex , true , genericResponse )
301+ require .Nil (t , err )
302+
303+ require .JSONEq (t ,
304+ readExpectedResult ("./testdata/relayedTx/relayed-tx-after-disable.json" ),
305+ string (genericResponse .Docs [0 ].Source ),
306+ )
307+ }
0 commit comments