88 "github.com/NethermindEth/juno/core"
99 "github.com/NethermindEth/juno/core/crypto"
1010 "github.com/NethermindEth/juno/core/felt"
11+ "github.com/NethermindEth/juno/core/pending"
1112 "github.com/NethermindEth/juno/starknet"
1213 "github.com/NethermindEth/juno/utils"
1314 "github.com/ethereum/go-ethereum/common"
@@ -509,19 +510,21 @@ func IsCandidateTx(response *starknet.PreConfirmedBlock, id int) bool {
509510func AdaptPreConfirmedBlock (
510511 response * starknet.PreConfirmedBlock ,
511512 number uint64 ,
512- ) (core .PreConfirmed , error ) {
513+ ) (pending .PreConfirmed , error ) {
513514 if response == nil {
514- return core .PreConfirmed {}, errors .New ("nil preconfirmed block" )
515+ return pending .PreConfirmed {}, errors .New ("nil preconfirmed block" )
515516 }
516517
517518 if response .Status != "PRE_CONFIRMED" {
518- return core .PreConfirmed {}, errors .New ("invalid status for pre_confirmed block" )
519+ return pending .PreConfirmed {}, errors .New ("invalid status for pre_confirmed block" )
519520 }
520521
521522 isInvalidPayloadSizes := len (response .Transactions ) != len (response .TransactionStateDiffs ) ||
522523 len (response .Transactions ) != len (response .Receipts )
523524 if isInvalidPayloadSizes {
524- return core.PreConfirmed {}, errors .New ("invalid sizes of transactions, state diffs and receipts" )
525+ return pending.PreConfirmed {}, errors .New (
526+ "invalid sizes of transactions, state diffs and receipts" ,
527+ )
525528 }
526529
527530 preConfirmedTxCount := 0
@@ -545,12 +548,12 @@ func AdaptPreConfirmedBlock(
545548 if ! IsCandidateTx (response , i ) {
546549 txns [preIdx ], err = AdaptTransaction (& response .Transactions [i ])
547550 if err != nil {
548- return core .PreConfirmed {}, err
551+ return pending .PreConfirmed {}, err
549552 }
550553 var stateDiff core.StateDiff
551554 stateDiff , err = AdaptStateDiff (response .TransactionStateDiffs [i ])
552555 if err != nil {
553- return core .PreConfirmed {}, err
556+ return pending .PreConfirmed {}, err
554557 }
555558 txStateDiffs [preIdx ] = & stateDiff
556559 receipts [preIdx ] = AdaptTransactionReceipt (response .Receipts [i ])
@@ -559,7 +562,7 @@ func AdaptPreConfirmedBlock(
559562 } else {
560563 candidateTxs [candIdx ], err = AdaptTransaction (& response .Transactions [i ])
561564 if err != nil {
562- return core .PreConfirmed {}, err
565+ return pending .PreConfirmed {}, err
563566 }
564567 candIdx ++
565568 }
@@ -606,7 +609,7 @@ func AdaptPreConfirmedBlock(
606609 Transactions : txns ,
607610 Receipts : receipts ,
608611 }
609- return core .NewPreConfirmed (adaptedBlock , & stateUpdate , txStateDiffs , candidateTxs ), nil
612+ return pending .NewPreConfirmed (adaptedBlock , & stateUpdate , txStateDiffs , candidateTxs ), nil
610613}
611614
612615func safeFeltToUint64 (f * felt.Felt ) uint64 {
0 commit comments