Skip to content

Commit

Permalink
Merge pull request hyperledger#33 from lightclient/fix-block-getters
Browse files Browse the repository at this point in the history
Fix block getters
  • Loading branch information
lightclient authored Jul 30, 2021
2 parents 0185ee7 + 09e8e1d commit 1788b41
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 26 deletions.
2 changes: 1 addition & 1 deletion scripts/build.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import fs from "fs";

console.log("Loading files...");
console.log("Loading files...\n");

let methods = [];
let methodsBase = "src/methods/";
Expand Down
16 changes: 16 additions & 0 deletions src/methods/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@
"schema": {
"$ref": "#/components/schemas/hash32"
}
},
{
"name": "Full transactions",
"required": true,
"schema": {
"title": "fullTx",
"type": "boolean"
}
}
],
"result": {
Expand All @@ -28,6 +36,14 @@
"schema": {
"$ref": "#/components/schemas/uint"
}
},
{
"name": "Full transactions",
"required": true,
"schema": {
"title": "fullTx",
"type": "boolean"
}
}
],
"result": {
Expand Down
64 changes: 39 additions & 25 deletions src/schemas/block.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"Header": {
"title": "Header object",
"Block": {
"title": "Block object",
"type": "object",
"required": [
"parentHash",
Expand All @@ -17,7 +17,10 @@
"timestamp",
"extraData",
"mixHash",
"nonce"
"nonce",
"size",
"transactions",
"uncles"
],
"properties": {
"parentHash": {
Expand All @@ -40,15 +43,15 @@
"title": "Transactions root",
"$ref": "#/components/schemas/hash32"
},
"receiptRoot": {
"receiptsRoot": {
"title": "Receipts root",
"$ref": "#/components/schemas/hash32"
},
"bloom": {
"logsBloom": {
"title": "Bloom filter",
"$ref": "#/components/schemas/bytes256"
},
"totalDifficulty": {
"difficulty": {
"title": "Difficulty",
"$ref": "#/components/schemas/bytes"
},
Expand Down Expand Up @@ -77,36 +80,47 @@
"$ref": "#/components/schemas/hash32"
},
"nonce": {
"title": "nonce",
"title": "Nonce",
"$ref": "#/components/schemas/bytes"
},
"totalDifficulty": {
"title": "Total difficult",
"$ref": "#/components/schemas/uint"
},
"baseFeePerGas": {
"title": "Base fee per gas",
"$ref": "#/components/schemas/uint"
}
}
},
"Block": {
"title": "Block object",
"type": "object",
"required": ["transactions", "uncles"],
"allOf": [
{ "$ref": "#/components/schemas/Header" },
{
"title": "transactions",
"type": "array",
"items": {
"$ref": "#/components/schemas/hash32"
}
},
{
"title": "uncles",
"size": {
"title": "Block size",
"$ref": "#/components/schemas/uint"
},
"transactions": {
"oneOf": [
{
"title": "Transaction hashes",
"type": "array",
"items": {
"$ref": "#/components/schemas/hash32"
}
},
{
"title": "Full transactions",
"type": "array",
"items": {
"$ref": "#/components/schemas/SignedTransaction"
}
}
]
},
"uncles": {
"title": "Uncles",
"type": "array",
"items": {
"$ref": "#/components/schemas/hash32"
}
}
]
}
},
"BlockTag": {
"title": "Block tag",
Expand Down

0 comments on commit 1788b41

Please sign in to comment.