Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add new block type #247

Merged
merged 3 commits into from
Nov 20, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion spec/core/block/schemas/BlockInfoDTO.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ properties:
meta:
$ref: "./BlockMetaDTO.yml"
block:
$ref: "./BlockDTO.yml"
anyOf:
- $ref: "./BlockDTO.yml"
- $ref: "./ImportanceBlockDTO.yml"
23 changes: 23 additions & 0 deletions spec/core/block/schemas/ImportanceBlockDTO.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
type: object
allOf:
- $ref: "./BlockDTO.yml"
- type: object
required:
- votingEligibleAccountsCount
- harvestingEligibleAccountsCount
- totalVotingBalance
- previousImportanceBlockHash
properties:
votingEligibleAccountsCount:
$ref: ../../../schemas/UInt32.yml
description: Number of voting eligible accounts.
harvestingEligibleAccountsCount:
type: string # uint64
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can this be a reference to one of the schemas? Maybe create a UInt64.yml if not using Amount.yml?
This is for the java generation that automatically converts strings to BigInteger

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rg911 , pushed this change. PR approved

description: Number of harvesting eligible accounts.
example: "100"
totalVotingBalance:
$ref: "../../../schemas/Amount.yml"
description: Total balance eligible for voting.
previousImportanceBlockHash:
$ref: "../../../schemas/Hash256.yml"
description: Previous importance block hash.
2 changes: 2 additions & 0 deletions spec/schemas/_index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ BlockMetaDTO:
"$ref": "../core/block/schemas/BlockMetaDTO.yml"
BlockPage:
"$ref": "../core/block/schemas/BlockPage.yml"
ImportanceBlockDTO:
"$ref": "../core/block/schemas/ImportanceBlockDTO.yml"
MerklePathItemDTO:
"$ref": "../core/block/schemas/MerklePathItemDTO.yml"
MerkleProofInfoDTO:
Expand Down