Skip to content

Commit

Permalink
add transaction to block
Browse files Browse the repository at this point in the history
  • Loading branch information
makemake-kbo committed Jan 3, 2024
1 parent 9633fe6 commit 552df92
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions hrotti/methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class block_info:
balance: str


def return_block(HEAD):
def return_block(head, transaction):
return {
"difficulty": "0x4ea3f27bc",
"extraData": "0x476574682f4c5649562f76312e302e302f6c696e75782f676f312e342e32",
Expand All @@ -29,15 +29,15 @@ def return_block(HEAD):
"miner": "0xbb7b8287f3f0a933474a79eae42cbca977791171",
"mixHash": "0x4fffe9ae21f1c9e15207b1f472d5bbdd68c9595d461666602f2be20daf5e7843",
"nonce": "0x689056015818adbe",
"number": HEAD,
"number": head,
"parentHash": "0xe99e022112df268087ea7eafaf4790497fd21dbeeb6bd7a1721df161a6657a54",
"receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"size": "0x220",
"stateRoot": "0xddc8b0234c2e0cad087c8b389aa7ef01f7d79b2570bccb77ce48648aa61c904d",
"timestamp": "0x55ba467c",
"totalDifficulty": "0x78ed983323d",
"transactions": [],
"transactions": [transaction],
"transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"uncles": [],
}
Expand Down Expand Up @@ -99,13 +99,13 @@ def handle_request(request: RPCRequest, info: block_info):
return {
"jsonrpc": "2.0",
"id": request.id,
"result": return_block(info.head),
"result": return_block(info.head, transaction),
}
case "eth_getBlockByNumber":
return {
"jsonrpc": "2.0",
"id": request.id,
"result": return_block(info.head),
"result": return_block(info.head, transaction),
}
case "eth_getBlockTransactionCountByHash":
return {"jsonrpc": "2.0", "id": request.id, "result": "0x1"}
Expand Down Expand Up @@ -139,13 +139,13 @@ def handle_request(request: RPCRequest, info: block_info):
return {
"jsonrpc": "2.0",
"id": request.id,
"result": return_block(info.head),
"result": return_block(info.head, transaction),
}
case "eth_getUncleByBlockNumberAndIndex":
return {
"jsonrpc": "2.0",
"id": request.id,
"result": return_block(info.head),
"result": return_block(info.head, transaction),
}
case "eth_getUncleCountByBlockHash":
return {"jsonrpc": "2.0", "id": request.id, "result": "0x0"}
Expand Down

0 comments on commit 552df92

Please sign in to comment.