From 182ec6fe2ac29f52684fca1656f983bdad86f824 Mon Sep 17 00:00:00 2001 From: andy-shi88 Date: Thu, 31 Oct 2019 13:52:33 +0800 Subject: [PATCH 1/3] zoobc/zoobc-core#305 add skipped blocksmith model --- documentation.swagger.json | 14 -------------- model/skippedBlocksmith.proto | 12 ++++++++++++ 2 files changed, 12 insertions(+), 14 deletions(-) create mode 100644 model/skippedBlocksmith.proto diff --git a/documentation.swagger.json b/documentation.swagger.json index bcdf208..99389cc 100644 --- a/documentation.swagger.json +++ b/documentation.swagger.json @@ -1618,19 +1618,5 @@ } } } - }, - "x-stream-definitions": { - "modelGetNodeHardwareResponse": { - "properties": { - "error": { - "$ref": "#/definitions/runtimeStreamError" - }, - "result": { - "$ref": "#/definitions/modelGetNodeHardwareResponse" - } - }, - "title": "Stream result of modelGetNodeHardwareResponse", - "type": "object" - } } } diff --git a/model/skippedBlocksmith.proto b/model/skippedBlocksmith.proto new file mode 100644 index 0000000..1f70838 --- /dev/null +++ b/model/skippedBlocksmith.proto @@ -0,0 +1,12 @@ +syntax="proto3"; + +package model; + +option go_package = "github.com/zoobc/zoobc-core/common/model"; + +message SkippedBlocksmith { + bytes BlocksmithPublicKey = 1; + int64 POPChange = 2 [jstype = JS_STRING]; + int64 BlockHeight = 3 [jstype = JS_STRING]; + int32 BlocksmithIndex = 4; +} From 9f0cba744ada06490a73e1b3c51078c18b531edb Mon Sep 17 00:00:00 2001 From: andy-shi88 Date: Thu, 31 Oct 2019 14:53:23 +0800 Subject: [PATCH 2/3] #395 update block height to use uint32 --- model/skippedBlocksmith.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model/skippedBlocksmith.proto b/model/skippedBlocksmith.proto index 1f70838..339fb4a 100644 --- a/model/skippedBlocksmith.proto +++ b/model/skippedBlocksmith.proto @@ -7,6 +7,6 @@ option go_package = "github.com/zoobc/zoobc-core/common/model"; message SkippedBlocksmith { bytes BlocksmithPublicKey = 1; int64 POPChange = 2 [jstype = JS_STRING]; - int64 BlockHeight = 3 [jstype = JS_STRING]; + uint32 BlockHeight = 3; int32 BlocksmithIndex = 4; } From 76e74405a7eeafc65858b1c48b4e85a4696562f1 Mon Sep 17 00:00:00 2001 From: andy-shi88 Date: Mon, 4 Nov 2019 09:47:49 +0800 Subject: [PATCH 3/3] zoobc/zoobc-core#395 add skipped blocksmith to block extended info --- documentation.swagger.json | 27 +++++++++++++++++++++++++++ model/block.proto | 2 ++ 2 files changed, 29 insertions(+) diff --git a/documentation.swagger.json b/documentation.swagger.json index 99389cc..8fa2d02 100644 --- a/documentation.swagger.json +++ b/documentation.swagger.json @@ -728,6 +728,12 @@ "type": "string", "format": "int64" }, + "SkippedBlocksmiths": { + "type": "array", + "items": { + "$ref": "#/definitions/modelSkippedBlocksmith" + } + }, "TotalReceipts": { "type": "string", "format": "int64" @@ -1452,6 +1458,27 @@ } } }, + "modelSkippedBlocksmith": { + "type": "object", + "properties": { + "BlockHeight": { + "type": "integer", + "format": "int64" + }, + "BlocksmithIndex": { + "type": "integer", + "format": "int32" + }, + "BlocksmithPublicKey": { + "type": "string", + "format": "byte" + }, + "POPChange": { + "type": "string", + "format": "int64" + } + } + }, "modelStorageInformation": { "type": "object", "properties": { diff --git a/model/block.proto b/model/block.proto index 9b73e43..d865b70 100644 --- a/model/block.proto +++ b/model/block.proto @@ -7,6 +7,7 @@ import "model/transaction.proto"; import "model/batchReceipt.proto"; import "model/receipt.proto"; import "model/publishedReceipt.proto"; +import "model/skippedBlocksmith.proto"; // Block represent the block data structure stored in the database message Block { @@ -36,6 +37,7 @@ message BlockExtendedInfo { int64 ReceiptValue = 3 [ jstype = JS_STRING ]; string BlocksmithAccountAddress = 4; int64 PopChange = 5 [ jstype = JS_STRING ]; + repeated SkippedBlocksmith SkippedBlocksmiths = 6; } // GetBlockRequest create request for single block