Skip to content
This repository has been archived by the owner on Jan 21, 2022. It is now read-only.

Block->ommers shows ommers of a given block. #104

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
31 changes: 31 additions & 0 deletions src/__tests__/core/block.ommers.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { testGraphql } from '../utils';

const { execQuery } = testGraphql();

test('block->ommer: successfully returns ommer account', async () => {
const query = `
{
block(number: 5771884) {
ommers {
hash
}
}
}`;

const expected = {
data: {
block: {
ommers: [
{
hash: '0x239a3ffee425204affbd8aca664ebb6c405c0fb2ccb2bbaf93d9e7c965bd03dc',
akhila-raju marked this conversation as resolved.
Show resolved Hide resolved
},
{
hash: '0xa2f9eb30b20ac5ce0341b4ef9398f19dab0540c8e59245a5b952d3423625b172',
},
],
},
},
};
const result = await execQuery(query);
expect(result).toEqual(expected);
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"jsonrpc": "2.0",
"id": 2,
"result": null
}
178 changes: 178 additions & 0 deletions src/__tests__/data/eth_getBlockByNumber_0x58126c__false.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"difficulty": "0xbee827c339f9f",
"extraData": "0x65746865726d696e652d65753134",
"gasLimit": "0x7a121d",
"gasUsed": "0x79ed05",
"hash": "0xa213a8559e0469b7f353e683526a447aca89f33b4b7392a47be0ca21d5295882",
"logsBloom": "0x00044081023a081600002000004c1a100010006000c30d01800630140019401254641102812c80101000002849c004010040880092040030800444aa4a440000018000400100c0081040182848d888482a0120a12806242888850840078000812b4105c14a4000100041414120440d00101240901205148ac00011d3902008c22802100c1004b8245208281004444448000300104605200881234065001020022c4108100085001200240888018240080000c08828003401020508062812180000a4510a00402044c43a503041040460004aa02d86080046860041470221e200fc00110205000188000300868900204d45442c80148022091602128048080070",
"miner": "0xea674fdde714fd979de3edf0f56aa9716b898ec8",
"mixHash": "0x020fa5109087d0c63961fdd262020642acaf8502adc9bbcc7349874a2bfeccc1",
"nonce": "0x1e2c31a008c7bbf1",
"number": "0x58126c",
"parentHash": "0x6f283ebc803afcfcbc85dbbf530121f609de7f6cfdee1ba5bf1d5427bd874609",
"receiptsRoot": "0x50971e6a6c08b6855089d1d8549f03385dce591b99f2bdc967eddc33e68679dd",
"sha3Uncles": "0x8cde8a5c74ae7b8a8dbc70835fc38af81f3c6ef16bd4f38f3742c492762e4880",
"size": "0x5693",
"stateRoot": "0x1b77a8e8e83d1fdb6cb86d2bcac2ee93d4ae0fa04ae016a2e8d78cdf0d15dc9a",
"timestamp": "0x5b1ecc54",
"totalDifficulty": "0xff11cb9b81fde72250",
"transactions": [
"0xc632f5de15c67f8e2b1387350a3a848d471e082a7fe4958f58564b3e8d7157cf",
"0x1e64c860abc27a618258ff36c66b645c84098a486d6a0c20975552916ac8d375",
"0x709892a76c54c079633eac6c7b34756f5a8ee1eaa45c18cb85bd4f42a72ece30",
"0x440ea14ba54bc5ed57a95158d043f9db7094fcb3aa76220a65d28b4b0d2c6e8b",
"0xe0636ec0e0c4ef3d1877d019e29304bc91933b625e0629dc485944e1affa1834",
"0x38aeb0b1ca390ed380c5982131dfa60cb31455ac6575e6fa25ab664e2cc7d302",
"0xa652b8d5539abb5cc5f43b1708aa6e9d36d2cbd9dae3630432ee02d4b4d8e547",
"0x3117f0926cbd42e128dd89b94c78ba9cacdebea69212f0cfa691605aa2a21d73",
"0xc151bb215debca40cac6d77de32222d539b207da5f4f88611c79f9d100e9a06f",
"0xed0c15f827da30db71c91e26c8c7ec4500772d2726fddf15e340f3b66f6cc8f0",
"0x6984e99ecdbdbeb3c462caa3423c14503aaef8e22fcb63749e5bc0139e8d283b",
"0xd36c9f612342464363b330062e5c25ba696669d2394859b233fb487ae7f245fb",
"0xed57d3f2a1a250b199cce759661035a1295b860e4ac0938075a49be172fef733",
"0x01d975535d6c23c74b1dcef22b10abdacd315772365a2b501ba1d193bcfc1c75",
"0xc333f3c7bed017cfe04ce6667e60c407575a0480a0e9c1e273c8ea1e78420c54",
"0x725245400d7aa90cc1443bafe3df14a184755b6317a61c277acfe2c01f490ce7",
"0x6966d2614ac833628bef3c3ef22e7dcd3e5331dc14a6f251cf4942bc3f97b00d",
"0xefde1e5d072b5b4531f43938e485870ded8d9bd1ff169be0aa0055ae6fe82426",
"0x3fc4415217a75f47ee1420c375fc8ee6d233cfbc4d8b09c51648ae27aa3c6202",
"0x87645d23293a754009abce16e773e87c097455d08edcc747b3499eed3d702666",
"0x1d42872bb0c8cc98f614e4ee136e6baad4b46c9f8896fdd1543dc1e71189c650",
"0xcc93e500b4957f15f96ca3b7e5127467de7b1f3b4197935b6a695204b266e47f",
"0xc32dd01d33535bfdf2507bba6523a4205c85b2d3bfa944f1f8199624dba0f15a",
"0x530253c35b56a4151985b84bec08f1c5460b842220b969709d7c2018e56ce08c",
"0x289e0f6c9ba5bd18cf4b29a0e7f5b958f6894c8c7d8ae28e061bf3e8d9e15e71",
"0x1893ed1473e7df31d1a28c32a62e28513b923f4f247351896ffc9a8ac73e3758",
"0x0e1e47438be8935376606b86810629e4b6b5e1df1bb86f5945afbd31c5f8e8b2",
"0x8145b397708d6d8bec7a5f02266e9c1efec74bdc866db483ccf6e468f5aa2c37",
"0x05828cd1abe8b429a2f3cca8bf1b427f688c878586dda3c8d2b6197afded6198",
"0x3ef88fae7604773721bcfb8052c2a34664b9601798fe25d1cc6316b13305357d",
"0x402dce8359612befeb1085655f71ff4cbe7a4012df8379f5f0c9d7a58d061aa7",
"0x477ac2ecd56985db2142ff32c0fdc78babc3e2ca7b8a55370c7e7c72a327b3a3",
"0xb4f282abe0053c2745097ec10a0e025389994c6c16933cffde49b36dbe6ff210",
"0xa256753ce928ae976726e7bcbdb393dc2196f01cb7c2e0bc072dcf622735c78b",
"0x79db65299b1cc58e344c6e23ac125e007dcf4f580f7b3765ecfa23c9dc4d620e",
"0x71a362364b08ae34f49860166dba6939bbb26f65f3c226e5d50b07298a8595df",
"0xa51f853a25aae0e6cc83e6dee69b5100ad803e5c5d4d04444b013c1e630e1034",
"0x109e2c37128be788964b20f94fee164d54c0176131fd9ac4df272aaa2e05cc2f",
"0x09361d5397339a5c4a478cae23fadaec69f322fbad975b094ad6966153639794",
"0x25860b38b6ef1e3f8e466532b58aef068f82a43672865804f2296702d49d0223",
"0xb0b466fbec3142e6bd1812db27f65a2520b627a84652fa0c596c121966b5de0a",
"0x14b83b73bc9466aefbd61945f064da750225c1d495fa56ca5b6262c36ae19107",
"0xca9e88d1427f1a17bc7e6597fe3c11d9aa66cf5e8a625b6b6b6f097e6364d490",
"0xe430f434f8aef6d934ae8be9f12527b73bba409b1893724d083ee245baaec2fa",
"0x05671c88dc2d71be9738341fbef0bfa9e6597c1f8ebf6cb2c40fc171d34155ee",
"0xcd91627b5438b5652d4a644f08d57f4f1fba9199f1f51be6746a8cba8da204e3",
"0xbc1a5a9a3cc59b362ca7a48431c8b9fc166efb38c1e225880325354ac717b862",
"0x2c1655530a2676cbafcb907a037441f56d941b2896e6efbd9cd528c10f299daa",
"0xac77bd2b13ff620d11eb7b244d31923f53cb3ec14526f8df00b8db0643e60140",
"0x20e1ab6fec18f80e4deb473d2fc759f0d396c11a6fb7288e1d9fb681bff16468",
"0x93ea61014741de924304a99b543ccf13cdbd8e1a25954d53d5fbd7ce774c9ceb",
"0x3a19b115374d825a366e097e3600cb76680bf18c25fd8421c3018ab4aa33421a",
"0xf77f8a3c12d70b3c71d8508ac52df355b7942e29c67bab7617b1ac1f505cfd02",
"0x77beab8b26553dd313db1d2c9fc49bbdd5e6d7502e2764ee98547daab4e04301",
"0xe2092d8b8f2e2ec51dde079ffff1c588f68331e9ca1b7065cdaa95ccefec7f4c",
"0x89f1b070c92a14497c848e47b90e92b0f65c3ad500b0dd81aeea5e08248b0894",
"0x38f7029b615b2a50b4159c6ef2c300b293ec0a55e2d2116838a03cf469bf87aa",
"0x2d3f169acad11c5d4ea72ed058b56302f8a7539a1c51f9d7f88b66a3fe69bca3",
"0x1d020559eea1a2a26584086a4b2d50eca229fc7fd4ce4ddfa43b16d49b3d2910",
"0x8828a8e57467b50fb2b65e1c16527af5c200923b1b2ad4cbdbd33d99891cc1ad",
"0xc8252a4b3c6813f960a21a79f080c965871fec1ada9aa149d3454f58bce530c8",
"0xd3f988ea3936766b85873ed29282e4445316286712f7cb229ff1b664684088a0",
"0x6c4d80ef0ae0df3a093c423d6b8fe3db19a2ee25ed065eb9602452eefa0384af",
"0x00bdc938eca31483e27f68c17726c60e559e07628793cc091e848897f37163e9",
"0x3c5a87d3ce06f9397bb0d8a04b818bb16731e130ced3948a8a4a580fae558b6b",
"0x6f70499857961b1446f50da77ea9d18f68a82f1539c663d1a5708de794c5ae95",
"0xa1beb676ae0061cb583a321f53caa7de120fc148b8919efc26bb2adcc873bb6d",
"0xbb75a72283f9881e5a90636e81cf34bbb62761af4874b74ecd18476451aff866",
"0x7f40499d923df23e6f10091696344903a380d1b7c869d7596b47e1a090d73b89",
"0x596512d3d50eccf107b3e38ac0b8e2aab4a07aa500f64b407a2ec676ddbd16b0",
"0x532e39654251c69bc3bfe1d2cab44ee8e6bff9e80ebeb54b8a570d89d387a6b1",
"0x8108774feafe8bdbf8fe4ff4030ab518397aff10d363d9584c8934a97a682b99",
"0xd5f72ad9235f840edbeb65504aa320c09e6c2d07a681f7b1537526f80ab31be0",
"0x12118e2b1b35ca9b371955150e5363b3eaf462026f395647051b373e7f074406",
"0x8651a9647dcf286c553f03abfb5e9fc87a2e2e47bcdbcd9daff3f66cc3282cc1",
"0xfc29aff7f86528fbf8c6dbc69214307ac622fc7f9b71ca9a1cf4c144a853f00e",
"0x9b58d970559581e552f672475db153c281b87a3fb8889615648ae463d4640511",
"0xc05e2cf733410c57167f6f32cae9ad3e7957bb3933ff04ffaa01e9c49d77e697",
"0x310322b284dd7189b90558bc81d2875b7b0956a34b64303fcf5f0a360e8cb5a5",
"0xf07c03b2dc587f1277f29a9f7daebbb7afc4cee0e053b80c7c737817c97b33e9",
"0xcb6b58163257bcc62f1c4870bff871ac6373c1b2eb1fc34252050de76a899eda",
"0x5e265a2c8ce3dd9dc73c052360da405bd20f7ed8a728c608537e0e9374302a82",
"0xb88ba8f4bdd6c4bd2291be042230b00ea5af62ec892f736912215bb78a41a2db",
"0x1d0987228cfc046a190525390b0fdcccc1df1b8b56ea969a93107591294ecea5",
"0xf204329d75dddc49053db709b1fd1082b06b3cc94872b7286a93ab6f1385abea",
"0x5d80965ede425a1f84b16e40f75684f98e4a0676d4f3cd4e9f8be5b908ba7b5f",
"0x6e775e6247403d5987aec94d6752ac8aafb2fb0a1ba7354f40bafb16a82985dc",
"0x4eb0c9fc15da18b529943c82ae13fe92bd9e0d01649502c7d83a73222ea757af",
"0x32cb7ed8519dca1790189214601e9696238f4c75c99f2666bda59875a77272b9",
"0x676bfaf80b392bedcbaa0d77420f0f581e0182683d395bc612cd64a674dd7ca1",
"0xd1087d3f6093558752eecbb3eb2c3d417feaa9b545a3fe1119164fa1e42b16a4",
"0xb99d593a8c046aee5a1ad6187045822d2d2f5ea0c49f4f684f43929bb17f8c46",
"0x56dccb2dad1a546b59438cc7d05194ea88d1b1020e220ea7dc57cf1fdef70a44",
"0x2fa8346bc434bbed824546a179f0d3753b33d3f0a291cf3431f420644f3166ed",
"0xbc88fef67aef0ead74de40f6f1b029eae0a09bc2476dc88c5e70f29244a81a86",
"0xde8eb0b9ea465c1d03903da9e6b0ecf38ea8e5c9221ccc9497c884dc312a1caf",
"0xefb46fcaf5a212be684b776e6d4c88c756d4c399dfea5737aa1563e7f4ebf995",
"0x141d20b3071bde24c38625c39687336a8ad541ff77a02abe777b6ef329501a06",
"0x17d89652dd054ae1b6eeaccf17943239f3c0928bee05a84460338ce8eae4351e",
"0x9833b34bf0054f13fda742e4faba2abf39954f34ee6fd536a6a43befd6bd5465",
"0xb46ac77f0d5f7fa87454e472e33bae80ce2c51c58b689484d164672ee7e6c59b",
"0xccbc7fe75a743a6be13551adce11559ae819e7c73570f89de2027b48c0c713d5",
"0x53c693b812f53a4810ab453459ad1a117025324927d129da822e0a5b4d4563ce",
"0x66e3930e4f147c4bf99863c23b0ac4a761c70a5279981de1a5e324bf1753edb0",
"0x2aaaf59add9ccbf31491b89d004c5e25c1ad9276a266b31df47521bceb64f5e7",
"0x7e630f397d60eaa5fdbea69ecb6522a5ce7f0bdd980501606b982c48c45a745f",
"0xa6dc81f2540c8ecafd635339d07f419f700e4a8223680a0f2d86b8e72e307241",
"0x4709d70e4a630465c8e6e0208e45d2e8148b88f2c854fa2a40da6c161e593600",
"0x360cd8f5d1f0f346c72b667737b8da4b34f83788df9248be3ed270cc77fca414",
"0x3d98e0a8241e7e8afcc2dc26630177509f2257e3948b2a751a8410ec831f982b",
"0x7d9874f4933f7894f8c70f403bc15e064d977fc1a302f59d968bd7637f3df929",
"0x6698cae24ff3287c4bccef6eccbb4fe59559c14ecf8cad1d6caec4cdfa3ce825",
"0x57ef69fb54b1a3c89a8179bcdb1210279ac5938afbbba16bc5397dd7ec024eb6",
"0x84001ce28dba1c9dca6433069b5b97db958f9150499dde26c8385c577e180e0c",
"0x32056427ef19743e343b4e8015c0f68fc2c8abf70c59cbc8902c230e408bdf4c",
"0x592b956ae83930961dbd3f9814058caf3695a7a691c8cda02214f756cb4860ef",
"0x748edf3b061b240ba97a57bb9a735d9a90c15e1abe95e0b19a27359b24546f92",
"0xdc791b2d35036b142be4ee2cc7a2f8c76a26a32d1ae3085c7b9880672847ad65",
"0xf05e51bd8374b37fafd382180b861654e46c417b9b46e0c79c8e117d1cf07d49",
"0xd68b15be370c40cbee892cb91b33d6389fd4450f39b395b93dad181c0792f6e2",
"0x91b323ebda41706d800f444c4cfca89649f6222c9950380ca381075f9b0e639e",
"0xcc97a4ca1edb01e33e2035480382c95810f0ad8b749ca85a3f1861528104d88f",
"0x70020b98b0e6d903239be8f37c9f23e37d4200e4fed174f555d4166b2fd0f1ab",
"0x5bbd027046172ec20d182e6881cd41a9fcbcec743aedb74b6d1e24edf1bfdd52",
"0xa671869f5e80f89aac789c4fd7c4c1c8ec926dfe228860c4787fe99de3c6d3e9",
"0x2edd8156244304c8b83941e13486d182dc7cf98c28c085f11adf4c615ee59fdd",
"0xb980ce2523c0af01f0100ebf0eddc6b36b693c3e21c55d1cf99b28bb6658d36f",
"0x50c1417cf940ef52988832f590665e65c6da752be8da7b231a0c20c522c1834f",
"0xb9cb21c3aae3517403f11a1fd78c95a0cebe7499b2db9aebdeeda17a7e22e1a2",
"0x95baee5e6d426a3103efb118dbe61a84be6412bc0ffd1e7e90fda31c1116299d",
"0x28aeecab6e6564c2ec1a8fad8494a53d803e3fc5dffccf98410639acbb0895ec",
"0x24e029907b25cf2c7cbff4c3f4d3ce222949bec1b2b64dae197c04667c4138cc",
"0x422200911bcb9ba81ad983e860c75eb249e2a192979fd73aeb8deabbe91d1b4f",
"0x01a7aa67916d87478b13819df7d305b4f55ea5ecdb4e91eb4fee536b03d1716d",
"0xcb92d9e492a0ff69fd7b63d887c513eac21f49d5d1c5c31a2fab95ca8a5a49d2",
"0xd1862017b9c7e877c6433f670f0986919972f3d23675c10e8d9a151a74b2696a",
"0x8125254f31c3348f395178fe5715602cf522dc4ae1ffc4f1c85334ce256b85e5",
"0x178a570df51f01b250eb2cff36f2d1525c664c25008c5f4a34a2af10a2200720",
"0xdf0380632737dcdaf7f1d89a34a18b1f86024fb3ee6b5b257ac3883bf4ce41c7",
"0xd8c93675e948616231d2697d73dfab8a5a4390d2320a74e7db20fe4df8c718fc",
"0x7a5bb47b68647cc3040c442e25d1c9235e42aadfc3c8741d9bb35468218fdc2f",
"0x100c954d0aa98842f9f2a36e71e1c53e8c1e3a04dbaaa5b4e86fb9338fabfb68",
"0xf320729f2d025373ec5d66a05245ecec98dc416f79317fff4865777ce57f86c0",
"0x2402d322f53f393601a11ca1a131cd99822f5f010c086f67f087d00272adf936",
"0xc9f0cd4a83c42c0085244e6fa434b5308082c455bb82ee6e17fa8467b8b04ebe",
"0x3868ac7d410c77cd780b768002ef0d906552e956ad238bdabcdf43d3471ecf25",
"0x8f92d267cf88d94f1277d1d75c81cdb6dc6c92c15af487a07f0ce09d0523077a",
"0x262a9fa4ea4840acaa1b70fc0ef6c22bb6dbda2fcdf72246d8521ca76e0a07b1"
],
"transactionsRoot": "0xe1c0d93ec583a5437b49af2bf2d5b03a76e727d5b6faa767886c7a55b5e7b656",
"uncles": [
"0x239a3ffee425204affbd8aca664ebb6c405c0fb2ccb2bbaf93d9e7c965bd03dc",
"0xa2f9eb30b20ac5ce0341b4ef9398f19dab0540c8e59245a5b952d3423625b172"
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"jsonrpc": "2.0",
"id": 2,
"result": {
"difficulty": "0xbe4171dfaba5a",
"extraData": "0x6e616e6f706f6f6c2e6f7267",
"gasLimit": "0x7a121d",
"gasUsed": "0x4045d2",
"hash": "0x65ba5b3da12a19d60365b1c233b8d0a5b7ee28a5652a36be4602f89e0d96bc21",
"logsBloom": "0x000000000000000000020000002000020000010000010000041001000000000000000000000000000000000001400000000800000000800000002000000000000100000000004000010000080000000000000000000000400000080000000000000000000000000007004048000000000001000000000000000000100000008200000200000000000000240000c2000000000000000000000000000000000100000000000040000000000020000001000000000000000000000000002000000000000042000000000000000000000000000020010000080020000000000000000200000200000000000000000000000000010000600200080000000000000000",
"miner": "0x52bc44d5378309ee2abf1539bf71de1b7d7be3b5",
"mixHash": "0x59c676792e4e2a3a3ae5bca3819783346644e8f6f2deaf9166370ca01751cbdc",
"nonce": "0x40718da8182f3ecf",
"number": "0x581263",
"parentHash": "0xc71f11cfbcbeda130454ce8f39c132bfcdeb8688bdfba8fa1b66e4b2b871fc64",
"receiptsRoot": "0xb7ac8e19b8cefedf1ef1bfe4f98b0e2ad0e6b9470a34987e3ccd58b04d20b523",
"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"size": "0x215",
"stateRoot": "0xa9e3fc7ef96a3371d012e7c8db79a9e8068410ec1315812afce8f2de58fe6285",
"timestamp": "0x5b1ecc0a",
"totalDifficulty": "0xff116056b7ccaca4d2",
"transactionsRoot": "0xd3c61efbbd35009c6242198c25cd1384f1fd350954edea41e355ec5abecbbbb2",
"uncles": []
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"jsonrpc": "2.0",
"id": 2,
"result": null
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"jsonrpc": "2.0",
"id": 2,
"result": {
"difficulty": "0xbed04d7986c92",
"extraData": "0x73696e6734",
"gasLimit": "0x7a121d",
"gasUsed": "0x79d314",
"hash": "0x239a3ffee425204affbd8aca664ebb6c405c0fb2ccb2bbaf93d9e7c965bd03dc",
"logsBloom": "0x2a24028a400a4884142b17408190d5900862691801e50005260242b04004022860c69481c008b0208082940a81c8820114280a2400a1880004554808c66400910988100120b940110902040851280c2100c289916006200800610140f30348053a2009080ea400008424200c00540d3c200740c2100cc2886001a89210041982230214a05002001c8816211040434050001050a072008410e080000d09800102de01ac080b4184300042a8a400a080e02105001a04208108063101c63068002010000882054443e180104123439005248800a0252409c90130005117c100600404300104a1c210c80116c282000441c0d449951001004b8104469020524102b0",
"miner": "0xb2930b35844a230f00e51431acae96fe543a0347",
"mixHash": "0x2c847555580ca065f0e023eae63b8cb024148fa5d7948ad502acc7ade60bc785",
"nonce": "0x7be1a2341c331ea3",
"number": "0x58126a",
"parentHash": "0xdc74c4fc40f93a69b07e4d85557373f0f4ec8872d61d9c547176302a4c9f9e68",
"receiptsRoot": "0x81638b0ddfce78f58aceafeaf2ca42fd46fb81daf939fce559a2aa6b023a815c",
"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"size": "0x20e",
"stateRoot": "0x3eace22e91493d0be58f5ab924df003690c15a48ac00cbeb975cfe3942cb033a",
"timestamp": "0x5b1ecc3c",
"totalDifficulty": "0xff11b3bffaa81b161f",
"transactionsRoot": "0xc5a4dd5552cd2e30d17cc09462384e59d06d28a64df4aadd3096a496a233b4d8",
"uncles": []
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"jsonrpc": "2.0",
"id": 3,
"result": {
"difficulty": "0xbeb8762ac1710",
"extraData": "0x",
"gasLimit": "0x79f39e",
"gasUsed": "0x79d659",
"hash": "0xa2f9eb30b20ac5ce0341b4ef9398f19dab0540c8e59245a5b952d3423625b172",
"logsBloom": "0x2a670dcec40a089204421541821073110502bd4a008358c0162a43104019217844a6b180a008a40218881202838c442994080c0004a1b240c115013a4465401001c4d0740eb263118112a82c508080032c030800200224204b01c6518209428028b001200e0008430646610810461f2004614ce00c046080a222009194080082261a498320018812000020504246104a0100a14462200014a00c047b892221823b8c88238d492a0002020db48494c0209100001a0861916c020108866408433804a004830744226002712b08420000a44262647f2c0a2e0120115355430522043059010c89001388320e82821112e25d85498c82a080620c04c698b052184188",
"miner": "0xcc16e3c00dbbe76603fa833ec20a48f786dfe610",
"mixHash": "0xc5bf990b896c6ce0ff08f8425ab5ed49a259208d3cb2bf1928f933149bd5a75d",
"nonce": "0x7b0a9114010413ae",
"number": "0x581268",
"parentHash": "0xc26b773b83e4cd7159224761ae1e09628bfcc257a8425e57b975c7e410dd13c2",
"receiptsRoot": "0x5d07813944de78d6795f4d2b0838c167685ca0cdff050e1ac3b42ca890d158f0",
"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"size": "0x209",
"stateRoot": "0x9c4a589b386b46c6c36f0120e7e03ca7f943f676f47a81e235dc9902af9e2c63",
"timestamp": "0x5b1ecc32",
"totalDifficulty": null,
"transactionsRoot": "0xf11147e17bec164a776f94c1283aaccee531e48cbf6c77b66df37d5c94d2a93b",
"uncles": []
}
}
17 changes: 17 additions & 0 deletions src/core/model/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,23 @@ export class EthqlBlock implements EthqlBlock {
}
}

export interface EthqlOmmerBlock
Copy link
Contributor

@raulk raulk Aug 9, 2018

Choose a reason for hiding this comment

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

@akhila-raju – maybe you could elaborate on why it was necessary to introduce a separate class for ommer blocks?

Also why overwrite the miner property in this PR and not in #102?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure - the reasons why I introduced a separate class for ommers is because ommers don't contain transactions:

  • transactions shouldn't be a property on ommers if they don't exist
  • transactionsCount will always return null for ommers

Rather than carry down a check for whether the block is an ommer block, I decided to create a new class to simplify things.

The miner property was already EthqlAccount, it wasn't overwritten - just copied and pasted for EthqlOmmerBlock :)

extends Overwrite<
Block,
{
miner: EthqlAccount;
}
> {}

export class EthqlOmmerBlock implements EthqlOmmerBlock {
constructor(block: Block, logs?: Log[]) {
const { miner, ...rest } = block;
Object.assign(this, rest);

this.miner = new EthqlAccount(block.miner);
}
}

export enum StorageObjectType {
MAP_ADDRESS_KEY,
MAP_NUMBER_KEY,
Expand Down
Loading