Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions chains/txmgr/txmgr.go
Original file line number Diff line number Diff line change
Expand Up @@ -741,18 +741,20 @@ func (b *Txm[CID, HEAD, ADDR, THASH, BHASH, R, SEQ, FEE]) GetTransactionFee(ctx
return nil, err
}

r := *receipt

txFee := b.CalculateFee(FeeParts{
GasUsed: receipt.GetFeeUsed(),
EffectiveGasPrice: receipt.GetEffectiveGasPrice(),
L1Fee: receipt.GetL1Fee(),
GasUsed: r.GetFeeUsed(),
EffectiveGasPrice: r.GetEffectiveGasPrice(),
L1Fee: r.GetL1Fee(),
})

return &evmtypes.TransactionFee{
TransactionFee: txFee,
}, nil
}

func (b *Txm[CID, HEAD, ADDR, THASH, BHASH, R, SEQ, FEE]) GetTransactionReceipt(ctx context.Context, transactionID string) (receipt txmgrtypes.ChainReceipt[THASH, BHASH], err error) {
func (b *Txm[CID, HEAD, ADDR, THASH, BHASH, R, SEQ, FEE]) GetTransactionReceipt(ctx context.Context, transactionID string) (receipt *txmgrtypes.ChainReceipt[THASH, BHASH], err error) {
foundReceipt, err := b.txStore.FindReceiptWithIdempotencyKey(ctx, transactionID, b.chainID)
if err != nil {
return nil, fmt.Errorf("failed to find receipt with IdempotencyKey %q: %w", transactionID, err)
Expand All @@ -761,7 +763,7 @@ func (b *Txm[CID, HEAD, ADDR, THASH, BHASH, R, SEQ, FEE]) GetTransactionReceipt(
if foundReceipt == nil {
return nil, fmt.Errorf("failed to find receipt with IdempotencyKey %q", transactionID)
}
return foundReceipt, nil
return &foundReceipt, nil
}

type FeeParts struct {
Expand Down
Loading