Skip to content

Commit

Permalink
[action] add BlobTx
Browse files Browse the repository at this point in the history
  • Loading branch information
dustinxie committed Apr 12, 2024
1 parent 5f3b2ca commit 148915c
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions action/blob_tx.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// Copyright (c) 2024 IoTeX Foundation
// This source code is provided 'as is' and no warranties are given as to title or non-infringement, merchantability
// or fitness for purpose and, to the extent permitted by law, all liability for your use of the code is disclaimed.
// This source code is governed by Apache License 2.0 that can be found in the LICENSE file.

package action

import (
"math/big"

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
)

// BlobTx represents an EIP-4844 transaction
type BlobTx struct {
types.BlobTx
}

func (tx *BlobTx) Nonce() uint64 {
return tx.BlobTx.Nonce
}

func (tx *BlobTx) Gas() uint64 {
return tx.BlobTx.Gas
}

func (tx *BlobTx) GasPrice() *big.Int {
return tx.BlobTx.GasFeeCap.ToBig()
}

func (tx *BlobTx) Value() *big.Int {
return tx.BlobTx.Value.ToBig()
}

func (tx *BlobTx) To() *common.Address {
tmp := tx.BlobTx.To
return &tmp
}

func (tx *BlobTx) Data() []byte {
return tx.BlobTx.Data
}

func (tx *BlobTx) AccessList() types.AccessList {
return tx.BlobTx.AccessList
}

0 comments on commit 148915c

Please sign in to comment.