mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 18:32:23 +00:00
Add transactionCount to block
This commit is contained in:
parent
c46a697c26
commit
ed02332148
1 changed files with 9 additions and 0 deletions
|
|
@ -606,6 +606,14 @@ func (b *Block) Coinbase(ctx context.Context, args BlockNumberArgs) (*Account, e
|
|||
}, nil
|
||||
}
|
||||
|
||||
func (b *Block) TransactionCount(ctx context.Context) (int32, error) {
|
||||
block, err := b.resolve(ctx)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return int32(len(block.Transactions())), nil
|
||||
}
|
||||
|
||||
func (b *Block) Transactions(ctx context.Context) ([]*Transaction, error) {
|
||||
block, err := b.resolve(ctx)
|
||||
if err != nil {
|
||||
|
|
@ -768,6 +776,7 @@ func NewHandler(n *node.Node) (http.Handler, error) {
|
|||
extra: HexBytes!
|
||||
totalDifficulty: BigNum!
|
||||
coinbase(block: Int): Account!
|
||||
transactionCount: Int!
|
||||
transactions: [Transaction]!
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue