Get receipt CID and block data for logs.

This commit is contained in:
Ashwin Phatak
2021-06-28 12:04:46 +05:30
committed by Arijit Das
parent 42f066772b
commit 18266c4f9d
3 changed files with 21 additions and 4 deletions
+10
View File
@@ -91,6 +91,8 @@ type Log struct {
backend *eth.Backend
transaction *Transaction
log *types.Log
cid string
ipldBlock []byte
}
func (l *Log) Transaction(ctx context.Context) *Transaction {
@@ -117,6 +119,14 @@ func (l *Log) Data(ctx context.Context) hexutil.Bytes {
return hexutil.Bytes(l.log.Data)
}
func (l *Log) Cid(ctx context.Context) string {
return l.cid
}
func (l *Log) IpldBlock(ctx context.Context) hexutil.Bytes {
return hexutil.Bytes(l.ipldBlock)
}
// Transaction represents an Ethereum transaction.
// backend and hash are mandatory; all others will be fetched when required.
type Transaction struct {
+6
View File
@@ -66,6 +66,12 @@ const schema string = `
data: Bytes!
# Transaction is the transaction that generated this log entry.
transaction: Transaction!
# CID for the Receipt IPLD block this Log exists in.
cid: String!
# IPLD block data for the Receipt this Log exists in.
ipldBlock: Bytes!
}
# Transaction is an Ethereum transaction.