This repository was archived by the owner on Apr 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 49
Typescript migration #72
Merged
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
781d864
Install new tooling
alcuadrado 4346a6e
Reformat everything with prettier
alcuadrado a8a9ee9
Move sources to /src
alcuadrado f230334
Move tests to test/
alcuadrado f87ab98
Rename sources to .ts
alcuadrado 1727cf6
Initial migration
alcuadrado c08fcba
Update .prettierignore
alcuadrado 58413c1
Fix travis config
alcuadrado dab891a
Remove callbacks in favor of async await
alcuadrado 66ea2d6
Fix .travis.yml
alcuadrado 5acf16e
Document missing uncle validation
alcuadrado 4769f90
Migrate RPC related functions
alcuadrado 1cf52de
Update docs
alcuadrado 8bcfdd7
Remove node 11 from travis config
alcuadrado 8e898fd
Update xvfb config in .travis.yml
alcuadrado e75f9eb
Rollback version bump
alcuadrado ae51571
Run browser tests on travis
alcuadrado 58f8ada
Remove blank line
alcuadrado db76a6a
Small doc fix
alcuadrado b3ccd5b
Specify and simplify a return type
alcuadrado eb1cdc8
Pass the Common object to the block headers
alcuadrado ab9078f
Add TOODs to document the limitations about Common and initializing the
alcuadrado 1723f9b
Trying new karma reporter
alcuadrado 6adbfae
Rename NetworkOptions to ChainOptions
alcuadrado d4d9691
Rebuild docs
alcuadrado File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| node_modules | ||
| .vscode | ||
| package.json | ||
| dist | ||
| test-build | ||
| .nyc_output |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,99 @@ | ||
| # ethereumjs-block | ||
|
|
||
| ## Index | ||
|
|
||
| ### Classes | ||
|
|
||
| - [Block](classes/block.md) | ||
| - [BlockHeader](classes/blockheader.md) | ||
|
|
||
| ### Interfaces | ||
|
|
||
| - [BlockData](interfaces/blockdata.md) | ||
| - [BlockHeaderData](interfaces/blockheaderdata.md) | ||
| - [Blockchain](interfaces/blockchain.md) | ||
| - [ChainOptions](interfaces/chainoptions.md) | ||
| - [TransformableToBuffer](interfaces/transformabletobuffer.md) | ||
|
|
||
| ### Type aliases | ||
|
|
||
| - [BufferLike](#bufferlike) | ||
| - [PrefixedHexString](#prefixedhexstring) | ||
|
|
||
| ### Functions | ||
|
|
||
| - [blockFromRpc](#blockfromrpc) | ||
| - [blockHeaderFromRpc](#blockheaderfromrpc) | ||
|
|
||
| --- | ||
|
|
||
| ## Type aliases | ||
|
|
||
| <a id="bufferlike"></a> | ||
|
|
||
| ### BufferLike | ||
|
|
||
| **Ƭ BufferLike**: _`Buffer` \| [TransformableToBuffer](interfaces/transformabletobuffer.md) \| [PrefixedHexString](#prefixedhexstring) \| `number`_ | ||
|
|
||
| _Defined in [types.ts:42](https://github.com/ethereumjs/ethereumjs-block/blob/6adbfae/src/types.ts#L42)_ | ||
|
|
||
| A Buffer, hex string prefixed with `0x`, Number, or an object with a toBuffer method such as BN. | ||
|
|
||
| --- | ||
|
|
||
| <a id="prefixedhexstring"></a> | ||
|
|
||
| ### PrefixedHexString | ||
|
|
||
| **Ƭ PrefixedHexString**: _`string`_ | ||
|
|
||
| _Defined in [types.ts:37](https://github.com/ethereumjs/ethereumjs-block/blob/6adbfae/src/types.ts#L37)_ | ||
|
|
||
| A hex string prefixed with `0x`. | ||
|
|
||
| --- | ||
|
|
||
| ## Functions | ||
|
|
||
| <a id="blockfromrpc"></a> | ||
|
|
||
| ### blockFromRpc | ||
|
|
||
| ▸ **blockFromRpc**(blockParams: _`any`_, uncles?: _`any`[]_, chainOptions?: _[ChainOptions](interfaces/chainoptions.md)_): [Block](classes/block.md) | ||
|
|
||
| _Defined in [from-rpc.ts:14](https://github.com/ethereumjs/ethereumjs-block/blob/6adbfae/src/from-rpc.ts#L14)_ | ||
|
|
||
| Creates a new block object from Ethereum JSON RPC. | ||
|
|
||
| **Parameters:** | ||
|
|
||
| | Name | Type | Description | | ||
| | ----------------------- | ------------------------------------------ | ------------------------------------------------------------------------------ | | ||
| | blockParams | `any` | Ethereum JSON RPC of block (eth_getBlockByNumber) | | ||
| | `Optional` uncles | `any`[] | Optional list of Ethereum JSON RPC of uncles (eth_getUncleByBlockHashAndIndex) | | ||
| | `Optional` chainOptions | [ChainOptions](interfaces/chainoptions.md) | An object describing the blockchain | | ||
|
|
||
| **Returns:** [Block](classes/block.md) | ||
|
|
||
| --- | ||
|
|
||
| <a id="blockheaderfromrpc"></a> | ||
|
|
||
| ### blockHeaderFromRpc | ||
|
|
||
| ▸ **blockHeaderFromRpc**(blockParams: _`any`_, chainOptions?: _[ChainOptions](interfaces/chainoptions.md)_): [BlockHeader](classes/blockheader.md) | ||
|
|
||
| _Defined in [header-from-rpc.ts:11](https://github.com/ethereumjs/ethereumjs-block/blob/6adbfae/src/header-from-rpc.ts#L11)_ | ||
|
|
||
| Creates a new block header object from Ethereum JSON RPC. | ||
|
|
||
| **Parameters:** | ||
|
|
||
| | Name | Type | Description | | ||
| | ----------------------- | ------------------------------------------ | ------------------------------------------------- | | ||
| | blockParams | `any` | Ethereum JSON RPC of block (eth_getBlockByNumber) | | ||
| | `Optional` chainOptions | [ChainOptions](interfaces/chainoptions.md) | An object describing the blockchain | | ||
|
|
||
| **Returns:** [BlockHeader](classes/blockheader.md) | ||
|
|
||
| --- |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.