From c8156441844f617b877ab5732b7d054a62c751cb Mon Sep 17 00:00:00 2001 From: Sameer Kumar Subudhi Date: Sun, 29 Oct 2023 00:37:12 +0200 Subject: [PATCH] :bug: Include eventRoot in blocks response --- docs/api/version3.md | 2 ++ docs/api/websocket_subscribe_api.md | 2 ++ .../apis/http-version3/swagger/definitions/blocks.json | 6 ++++++ services/gateway/sources/version3/mappings/block.js | 1 + 4 files changed, 11 insertions(+) diff --git a/docs/api/version3.md b/docs/api/version3.md index 1b9b0da304..9ce55481df 100644 --- a/docs/api/version3.md +++ b/docs/api/version3.md @@ -169,6 +169,7 @@ _Supports pagination._ "transactionRoot": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "assetsRoot": "6e904b2f678eb3b6c3042acb188a607d903d441d61508d047fe36b3c982995c8", "stateRoot": "95d9b1773b78034b8df9ac741c903b881da761d8ba002a939de28a4b86982c04", + "eventRoot": "7dee8ae1899582aabb0c4b967ceda6874329dba57b5eb23d7c62890917a55cbd", "maxHeightGenerated": 559421, "maxHeightPrevoted": 559434, "validatorsHash": "ad0076aa444f6cda608bb163c3bd77d9bf172f1d2803d53095bc0f277db6bcb3", @@ -5826,6 +5827,7 @@ Proxy request to directly invoke application endpoint. Returns endpoint response "transactionRoot": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "assetsRoot": "6e904b2f678eb3b6c3042acb188a607d903d441d61508d047fe36b3c982995c8", "stateRoot": "95d9b1773b78034b8df9ac741c903b881da761d8ba002a939de28a4b86982c04", + "eventRoot": "7dee8ae1899582aabb0c4b967ceda6874329dba57b5eb23d7c62890917a55cbd", "maxHeightGenerated": 559421, "maxHeightPrevoted": 559434, "validatorsHash": "ad0076aa444f6cda608bb163c3bd77d9bf172f1d2803d53095bc0f277db6bcb3", diff --git a/docs/api/websocket_subscribe_api.md b/docs/api/websocket_subscribe_api.md index a4e89702c0..ee2c646848 100644 --- a/docs/api/websocket_subscribe_api.md +++ b/docs/api/websocket_subscribe_api.md @@ -96,6 +96,7 @@ Updates about a newly generated block. "transactionRoot": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "assetsRoot": "6e904b2f678eb3b6c3042acb188a607d903d441d61508d047fe36b3c982995c8", "stateRoot": "95d9b1773b78034b8df9ac741c903b881da761d8ba002a939de28a4b86982c04", + "eventRoot": "7dee8ae1899582aabb0c4b967ceda6874329dba57b5eb23d7c62890917a55cbd", "maxHeightGenerated": 559421, "maxHeightPrevoted": 559434, "validatorsHash": "ad0076aa444f6cda608bb163c3bd77d9bf172f1d2803d53095bc0f277db6bcb3", @@ -146,6 +147,7 @@ Updates about a deleted block. This usually happens when the chain switches fork "transactionRoot": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "assetsRoot": "6e904b2f678eb3b6c3042acb188a607d903d441d61508d047fe36b3c982995c8", "stateRoot": "95d9b1773b78034b8df9ac741c903b881da761d8ba002a939de28a4b86982c04", + "eventRoot": "7dee8ae1899582aabb0c4b967ceda6874329dba57b5eb23d7c62890917a55cbd", "maxHeightGenerated": 559421, "maxHeightPrevoted": 559434, "validatorsHash": "ad0076aa444f6cda608bb163c3bd77d9bf172f1d2803d53095bc0f277db6bcb3", diff --git a/services/gateway/apis/http-version3/swagger/definitions/blocks.json b/services/gateway/apis/http-version3/swagger/definitions/blocks.json index dcf50e588a..7edc57d9d2 100644 --- a/services/gateway/apis/http-version3/swagger/definitions/blocks.json +++ b/services/gateway/apis/http-version3/swagger/definitions/blocks.json @@ -10,6 +10,7 @@ "transactionRoot", "assetsRoot", "stateRoot", + "eventRoot", "maxHeightPrevoted", "maxHeightGenerated", "validatorsHash", @@ -86,6 +87,11 @@ "example": "95d9b1773b78034b8df9ac741c903b881da761d8ba002a939de28a4b86982c04", "description": "The root of the Sparse Merkle Tree that is computed from the state of the blockchain." }, + "eventRoot": { + "type": "string", + "example": "7dee8ae1899582aabb0c4b967ceda6874329dba57b5eb23d7c62890917a55cbd", + "description": "Merkle root of the events array." + }, "maxHeightGenerated": { "type": "integer", "example": 559421 diff --git a/services/gateway/sources/version3/mappings/block.js b/services/gateway/sources/version3/mappings/block.js index 23ff8cc542..7361a9bf72 100644 --- a/services/gateway/sources/version3/mappings/block.js +++ b/services/gateway/sources/version3/mappings/block.js @@ -27,6 +27,7 @@ module.exports = { transactionRoot: '=,string', assetRoot: '=,string', stateRoot: '=,string', + eventRoot: '=,string', maxHeightPrevoted: '=,number', maxHeightGenerated: '=,number', validatorsHash: '=,string',