Skip to content

Commit

Permalink
Merge pull request Uniswap#12 from croco-finance/feat/gasinfo-in-tx
Browse files Browse the repository at this point in the history
feat: gasUsed and gasPrice in Transaction
  • Loading branch information
ianlapham authored May 23, 2021
2 parents 75afa07 + 2150d75 commit 3286d8c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,9 @@ type Transaction @entity {
blockNumber: BigInt!
# timestamp txn was confirmed
timestamp: BigInt!
# gas used during txn execution
gasUsed: BigInt!
gasPrice: BigInt!
# derived values
mints: [Mint]! @derivedFrom(field: "transaction")
burns: [Burn]! @derivedFrom(field: "transaction")
Expand Down
2 changes: 2 additions & 0 deletions src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ export function loadTransaction(event: ethereum.Event): Transaction {
}
transaction.blockNumber = event.block.number
transaction.timestamp = event.block.timestamp
transaction.gasUsed = event.transaction.gasUsed
transaction.gasPrice = event.transaction.gasPrice
transaction.save()
return transaction as Transaction
}

0 comments on commit 3286d8c

Please sign in to comment.