From ec48c3b35adf2477813c1bcc4f709a2768d8a781 Mon Sep 17 00:00:00 2001 From: tilacog Date: Mon, 21 Mar 2022 17:56:47 -0300 Subject: [PATCH 1/4] chain/ethereum: Added `TransactionReceipt` and `Log` new classes Also, the `Event` class now has a `receipt` nullable field. --- chain/ethereum.ts | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/chain/ethereum.ts b/chain/ethereum.ts index 9effc73..51957a5 100644 --- a/chain/ethereum.ts +++ b/chain/ethereum.ts @@ -360,6 +360,44 @@ export namespace ethereum { ) {} } + /** + * An Ethereum transaction receipt. + */ + export class TransactionReceipt { + constructor( + public transactionHash: Bytes, + public transactionIndex: BigInt, + public blockHash: Bytes, + public blockNumber: BigInt, + public cumulativeGasUsed: BigInt, + public gasUsed: BigInt, + public contractAddress: Address, + public logs: Array, + public status: BigInt, + public root: Bytes, + public logsBloom: Bytes, + ) {} + } + + /** + * An Ethereum event log. + */ + export class Log { + constructor( + public address: Address, + public topics: Array, + public data: Bytes, + public blockHash: Bytes, + public blockNumber: Bytes, + public transactionHash: Bytes, + public transactionIndex: BigInt, + public logIndex: BigInt, + public transactionLogIndex: BigInt, + public logType: string, + public removed: boolean, + ) {} + } + /** * Common representation for Ethereum smart contract calls. */ @@ -386,6 +424,7 @@ export namespace ethereum { public block: Block, public transaction: Transaction, public parameters: Array, + public receipt: TransactionReceipt | null, ) {} } From 4025ccbe18d4af41aa08cbc9aea335cfbe907401 Mon Sep 17 00:00:00 2001 From: tilacog Date: Tue, 29 Mar 2022 17:57:31 -0300 Subject: [PATCH 2/4] global: Extend `TypeId` variants --- global/global.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/global/global.ts b/global/global.ts index 2c92773..e0d29a6 100644 --- a/global/global.ts +++ b/global/global.ts @@ -65,6 +65,7 @@ export enum TypeId { ArrayF32 = 49, ArrayF64 = 50, ArrayBigDecimal = 51, + // Near types NearArrayDataReceiver = 52, NearArrayCryptoHash = 53, NearArrayActionValue = 54, @@ -100,6 +101,7 @@ export enum TypeId { NearChunkHeader = 84, NearBlock = 85, NearReceiptWithOutcome = 86, + // Tendermint types TendermintArrayEventTx = 87, TendermintArrayEvent = 88, TendermintArrayCommitSig = 89, @@ -147,6 +149,11 @@ export enum TypeId { TendermintDuration = 131, TendermintTimestamp = 132, TendermintEventData = 133, + // More ethereum types + TransactionReceipt = 134, + Log = 135, + ArrayH256 = 136, + ArrayLog = 137, } export function id_of_type(typeId: TypeId): usize { @@ -420,6 +427,14 @@ export function id_of_type(typeId: TypeId): usize { return idof() case TypeId.TendermintEventData: return idof() + case TypeId.TransactionReceipt: + return idof() + case TypeId.Log: + return idof() + case TypeId.ArrayH256: + return idof>() + case TypeId.ArrayLog: + return idof>() default: return 0 } From b1be084196ad270f6e5ef1a6c825c9ce9e42de99 Mon Sep 17 00:00:00 2001 From: tilacog Date: Wed, 30 Mar 2022 20:26:13 -0300 Subject: [PATCH 3/4] 0.27.0-alpha.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 913d7aa..cd83000 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@graphprotocol/graph-ts", "description": "TypeScript/AssemblyScript library for writing subgraph mappings for The Graph", - "version": "0.26.0", + "version": "0.27.0-alpha.0", "module": "index.ts", "types": "index.ts", "main": "index.ts", From e286328663c8391c555b1c5170ff353eb976af6d Mon Sep 17 00:00:00 2001 From: tilacog Date: Wed, 30 Mar 2022 20:28:55 -0300 Subject: [PATCH 4/4] chain/ethereum: Wrap boolean field --- chain/ethereum.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chain/ethereum.ts b/chain/ethereum.ts index 51957a5..3532382 100644 --- a/chain/ethereum.ts +++ b/chain/ethereum.ts @@ -394,7 +394,7 @@ export namespace ethereum { public logIndex: BigInt, public transactionLogIndex: BigInt, public logType: string, - public removed: boolean, + public removed: Wrapped | null, ) {} }