@@ -443,7 +443,7 @@ func TestTransactionStatusLes2(t *testing.T) {
443443
444444 var reqID uint64
445445
446- test := func (tx * types.Transaction , send bool , expStatus txStatus ) {
446+ test := func (tx * types.Transaction , send bool , expStatus light. TxStatus ) {
447447 reqID ++
448448 if send {
449449 cost := peer .GetRequestCost (SendTxV2Msg , 1 )
@@ -452,7 +452,7 @@ func TestTransactionStatusLes2(t *testing.T) {
452452 cost := peer .GetRequestCost (GetTxStatusMsg , 1 )
453453 sendRequest (peer .app , GetTxStatusMsg , reqID , cost , []common.Hash {tx .Hash ()})
454454 }
455- if err := expectResponse (peer .app , TxStatusMsg , reqID , testBufLimit , []txStatus {expStatus }); err != nil {
455+ if err := expectResponse (peer .app , TxStatusMsg , reqID , testBufLimit , []light. TxStatus {expStatus }); err != nil {
456456 t .Errorf ("transaction status mismatch" )
457457 }
458458 }
@@ -461,20 +461,20 @@ func TestTransactionStatusLes2(t *testing.T) {
461461
462462 // test error status by sending an underpriced transaction
463463 tx0 , _ := types .SignTx (types .NewTransaction (0 , acc1Addr , big .NewInt (10000 ), params .TxGas , nil , nil ), signer , testBankKey )
464- test (tx0 , true , txStatus {Status : core .TxStatusUnknown , Error : core .ErrUnderpriced .Error ()})
464+ test (tx0 , true , light. TxStatus {Status : core .TxStatusUnknown , Error : core .ErrUnderpriced .Error ()})
465465
466466 tx1 , _ := types .SignTx (types .NewTransaction (0 , acc1Addr , big .NewInt (10000 ), params .TxGas , big .NewInt (100000000000 ), nil ), signer , testBankKey )
467- test (tx1 , false , txStatus {Status : core .TxStatusUnknown }) // query before sending, should be unknown
468- test (tx1 , true , txStatus {Status : core .TxStatusPending }) // send valid processable tx, should return pending
469- test (tx1 , true , txStatus {Status : core .TxStatusPending }) // adding it again should not return an error
467+ test (tx1 , false , light. TxStatus {Status : core .TxStatusUnknown }) // query before sending, should be unknown
468+ test (tx1 , true , light. TxStatus {Status : core .TxStatusPending }) // send valid processable tx, should return pending
469+ test (tx1 , true , light. TxStatus {Status : core .TxStatusPending }) // adding it again should not return an error
470470
471471 tx2 , _ := types .SignTx (types .NewTransaction (1 , acc1Addr , big .NewInt (10000 ), params .TxGas , big .NewInt (100000000000 ), nil ), signer , testBankKey )
472472 tx3 , _ := types .SignTx (types .NewTransaction (2 , acc1Addr , big .NewInt (10000 ), params .TxGas , big .NewInt (100000000000 ), nil ), signer , testBankKey )
473473 // send transactions in the wrong order, tx3 should be queued
474- test (tx3 , true , txStatus {Status : core .TxStatusQueued })
475- test (tx2 , true , txStatus {Status : core .TxStatusPending })
474+ test (tx3 , true , light. TxStatus {Status : core .TxStatusQueued })
475+ test (tx2 , true , light. TxStatus {Status : core .TxStatusPending })
476476 // query again, now tx3 should be pending too
477- test (tx3 , false , txStatus {Status : core .TxStatusPending })
477+ test (tx3 , false , light. TxStatus {Status : core .TxStatusPending })
478478
479479 // generate and add a block with tx1 and tx2 included
480480 gchain , _ := core .GenerateChain (params .TestChainConfig , chain .GetBlockByNumber (0 ), ethash .NewFaker (), db , 1 , func (i int , block * core.BlockGen ) {
@@ -497,8 +497,8 @@ func TestTransactionStatusLes2(t *testing.T) {
497497
498498 // check if their status is included now
499499 block1hash := rawdb .ReadCanonicalHash (db , 1 )
500- test (tx1 , false , txStatus {Status : core .TxStatusIncluded , Lookup : & rawdb.LegacyTxLookupEntry {BlockHash : block1hash , BlockIndex : 1 , Index : 0 }})
501- test (tx2 , false , txStatus {Status : core .TxStatusIncluded , Lookup : & rawdb.LegacyTxLookupEntry {BlockHash : block1hash , BlockIndex : 1 , Index : 1 }})
500+ test (tx1 , false , light. TxStatus {Status : core .TxStatusIncluded , Lookup : & rawdb.LegacyTxLookupEntry {BlockHash : block1hash , BlockIndex : 1 , Index : 0 }})
501+ test (tx2 , false , light. TxStatus {Status : core .TxStatusIncluded , Lookup : & rawdb.LegacyTxLookupEntry {BlockHash : block1hash , BlockIndex : 1 , Index : 1 }})
502502
503503 // create a reorg that rolls them back
504504 gchain , _ = core .GenerateChain (params .TestChainConfig , chain .GetBlockByNumber (0 ), ethash .NewFaker (), db , 2 , func (i int , block * core.BlockGen ) {})
@@ -516,6 +516,6 @@ func TestTransactionStatusLes2(t *testing.T) {
516516 t .Fatalf ("pending count mismatch: have %d, want 3" , pending )
517517 }
518518 // check if their status is pending again
519- test (tx1 , false , txStatus {Status : core .TxStatusPending })
520- test (tx2 , false , txStatus {Status : core .TxStatusPending })
519+ test (tx1 , false , light. TxStatus {Status : core .TxStatusPending })
520+ test (tx2 , false , light. TxStatus {Status : core .TxStatusPending })
521521}
0 commit comments