Files: 46f39d8aa42cae443b0c51d6740a51667aa77674 / deps / block.js
599 bytesRaw
1 | const Address = require('fixed-bn.js').Address |
2 | const U256 = require('fixed-bn.js').U256 |
3 | const ethUtil = require('ethereumjs-util') |
4 | const OldBlock = require('ethereumjs-block') |
5 | |
6 | module.exports = class Block extends OldBlock { |
7 | get number () { |
8 | return ethUtil.bufferToInt(this.header.number) |
9 | } |
10 | |
11 | get gasLimit () { |
12 | return ethUtil.bufferToInt(this.header.gasLimit) |
13 | } |
14 | |
15 | get difficulty () { |
16 | return new U256(this.header.difficulty) |
17 | } |
18 | |
19 | get timestamp () { |
20 | return ethUtil.bufferToInt(this.header.timestamp) |
21 | } |
22 | |
23 | get coinbase () { |
24 | return new Address(this.header.coinbase) |
25 | } |
26 | } |
27 |
Built with git-ssb-web