@@ -549,11 +549,12 @@ type TxWithMinerFee struct {
549
549
tx * Transaction
550
550
minerFee * big.Int // in CELO
551
551
}
552
+ type ToCELOFn func (amount * big.Int , feeCurrency * common.Address ) * big.Int
552
553
553
554
// NewTxWithMinerFee creates a wrapped transaction, calculating the effective
554
555
// miner gasTipCap if a base fee is provided. The MinerFee is converted to CELO.
555
556
// Returns error in case of a negative effective miner gasTipCap.
556
- func NewTxWithMinerFee (tx * Transaction , baseFeeFn func (feeCurrency * common.Address ) * big.Int , toCELO func ( amount * big. Int , feeCurrency * common. Address ) * big. Int ) (* TxWithMinerFee , error ) {
557
+ func NewTxWithMinerFee (tx * Transaction , baseFeeFn func (feeCurrency * common.Address ) * big.Int , toCELO ToCELOFn ) (* TxWithMinerFee , error ) {
557
558
minerFee , err := tx .EffectiveGasTip (baseFeeFn (tx .FeeCurrency ()))
558
559
if err != nil {
559
560
return nil , err
@@ -596,11 +597,11 @@ func (s *TxByPriceAndTime) Pop() interface{} {
596
597
// transactions in a profit-maximizing sorted order, while supporting removing
597
598
// entire batches of transactions for non-executable accounts.
598
599
type TransactionsByPriceAndNonce struct {
599
- txs map [common.Address ]Transactions // Per account nonce-sorted list of transactions
600
- heads TxByPriceAndTime // Next transaction for each unique account (price heap)
601
- signer Signer // Signer for the set of transactions
602
- baseFeeFn func (feeCurrency * common.Address ) * big.Int // Function to get the basefee for the specified feecurrency.
603
- toCELO func ( amount * big. Int , feeCurrency * common. Address ) * big. Int // Current exchange rate to CELO
600
+ txs map [common.Address ]Transactions // Per account nonce-sorted list of transactions
601
+ heads TxByPriceAndTime // Next transaction for each unique account (price heap)
602
+ signer Signer // Signer for the set of transactions
603
+ baseFeeFn func (feeCurrency * common.Address ) * big.Int // Function to get the basefee for the specified feecurrency.
604
+ toCELO ToCELOFn // Current exchange rate to CELO
604
605
}
605
606
606
607
// NewTransactionsByPriceAndNonce creates a transaction set that can retrieve
@@ -609,7 +610,7 @@ type TransactionsByPriceAndNonce struct {
609
610
// Note, the input map is reowned so the caller should not interact any more with
610
611
// if after providing it to the constructor.
611
612
// Note: txCmpFunc should handle the basefee
612
- func NewTransactionsByPriceAndNonce (signer Signer , txs map [common.Address ]Transactions , baseFeeFn func (feeCurrency * common.Address ) * big.Int , toCELO func ( amount * big. Int , feeCurrency * common. Address ) * big. Int ) * TransactionsByPriceAndNonce {
613
+ func NewTransactionsByPriceAndNonce (signer Signer , txs map [common.Address ]Transactions , baseFeeFn func (feeCurrency * common.Address ) * big.Int , toCELO ToCELOFn ) * TransactionsByPriceAndNonce {
613
614
// Initialize a price and received time based heap with the head transactions
614
615
heads := make (TxByPriceAndTime , 0 , len (txs ))
615
616
for from , accTxs := range txs {
0 commit comments