Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Types back-port from 2.x with changes to match the 1.x logic #3132

Merged
merged 126 commits into from
Oct 16, 2019
Merged
Changes from 1 commit
Commits
Show all changes
126 commits
Select commit Hold shift + click to select a range
05ee451
docs: update readme to contain TS usage
joshstevens19 Oct 15, 2019
5e58e55
feat: learna dtslint
joshstevens19 Oct 15, 2019
9bf6bdd
feat: types for `web3` module
joshstevens19 Oct 15, 2019
e62daff
feat: `web3` module install dtslint
joshstevens19 Oct 15, 2019
321fc59
docs: readme web3 module types
joshstevens19 Oct 15, 2019
073d112
feat: `web3-core` types
joshstevens19 Oct 15, 2019
943fe29
docs: update readme for `web3-core` for types
joshstevens19 Oct 15, 2019
7cfd476
feat: install type dependencies for `web3-core`
joshstevens19 Oct 15, 2019
ba08495
feat: `web3-core-helper` types
joshstevens19 Oct 15, 2019
a49b021
feat: install type dependency for `web3-core-helpers`
joshstevens19 Oct 15, 2019
44dc1e9
docs: update readme for typings
joshstevens19 Oct 15, 2019
0229985
fix: remove @types/node from `web3-core-helpers`
joshstevens19 Oct 15, 2019
f6d7888
feat: `web3-core-method` types
joshstevens19 Oct 15, 2019
64b74ec
feat: install type dependencies for `web3-core-method`
joshstevens19 Oct 15, 2019
e1d37ac
docs: update types for `web3-core-method` in readme
joshstevens19 Oct 15, 2019
4ca1cf8
feat: `web3-eth` typings
joshstevens19 Oct 15, 2019
eb9b819
feat: install type dependencies for `web3-eth`
joshstevens19 Oct 15, 2019
6a34aaf
docs: update readme for `web3-eth`
joshstevens19 Oct 15, 2019
e4f085f
feat: `web3-eth-abi` typings
joshstevens19 Oct 15, 2019
7800a02
feat: install type dependencies for `web3-eth-abi`
joshstevens19 Oct 15, 2019
06245fa
docs: update readme for `web3-eth-abi`
joshstevens19 Oct 15, 2019
4af7781
feat: `web3-eth-accounts` typings
joshstevens19 Oct 15, 2019
27fe1d0
feat: install type dependencies for `web3-eth-accounts`
joshstevens19 Oct 15, 2019
704d7e2
docs: update readme for `web3-eth-accounts`
joshstevens19 Oct 15, 2019
c3b750f
feat: `web3-eth-contract` typings
joshstevens19 Oct 15, 2019
261dbd8
feat: `web3-eth-contract` tests
joshstevens19 Oct 15, 2019
136378a
feat: install types dependencies for `web3-eth-contract`
joshstevens19 Oct 15, 2019
c224ed3
docs: update readme for `web3-eth-contract`
joshstevens19 Oct 15, 2019
ff8fadb
feat: `web3-eth-ens` typings
joshstevens19 Oct 15, 2019
dc87499
test: `web3-eth-ens` tests
joshstevens19 Oct 15, 2019
44ed5b5
feat: install type dependencies for `web3-eth-ens`
joshstevens19 Oct 15, 2019
9e5b7dd
docs: update readme for `web3-eth-ens`
joshstevens19 Oct 15, 2019
7c29e8c
feat: `web3-eth-iban` typings
joshstevens19 Oct 15, 2019
be66042
test: `web3-eth-iban` typing tests
joshstevens19 Oct 15, 2019
6c4a5e7
feat: install `web3-eth-iban` typings dependencies
joshstevens19 Oct 15, 2019
9f582de
docs: update readme for `web3-eth-iban`
joshstevens19 Oct 15, 2019
d0eede1
feat: `web3-eth-personal` typings
joshstevens19 Oct 15, 2019
f994986
test: `web3-eth-personal` typings tests
joshstevens19 Oct 15, 2019
b8fca8e
feat: install dependencies for `web3-eth-personal`
joshstevens19 Oct 15, 2019
6465b13
docs: update readme `web3-eth-personal`
joshstevens19 Oct 15, 2019
fdc8f25
feat: `web3-net` typings
joshstevens19 Oct 15, 2019
578db9e
fix: remove dev dependencies which are not relavant
joshstevens19 Oct 15, 2019
025cf2b
test: `web3-net` typings tests
joshstevens19 Oct 15, 2019
83db6d7
docs: update readme for `web3-net`
joshstevens19 Oct 15, 2019
5d239fc
feat: install dev dependencies for `web3-net`
joshstevens19 Oct 15, 2019
03af50f
feat: `web3-shh` typings
joshstevens19 Oct 15, 2019
a7ac6a2
test: `web3-shh` typings tests
joshstevens19 Oct 15, 2019
ab79404
docs: update `web3-shh` readme
joshstevens19 Oct 15, 2019
0ddfc9d
feat: install dev dependencies in `web3-shh`
joshstevens19 Oct 15, 2019
e4bf89a
feat: web3-utils type config files
joshstevens19 Oct 15, 2019
ac81f79
feat: ascii to hex typings test
joshstevens19 Oct 15, 2019
f124871
feat: bytes to hex typings test
joshstevens19 Oct 15, 2019
95665de
feat: check address checksum typings test
joshstevens19 Oct 15, 2019
49f224c
feat: from ascii typings test
joshstevens19 Oct 15, 2019
1c8ae3b
feat: from decimal typings test
joshstevens19 Oct 15, 2019
d253427
feat: from utf8 typings test
joshstevens19 Oct 15, 2019
b4e61b8
feat: from wei typings test
joshstevens19 Oct 15, 2019
7330ea7
feat: get signature params typings test
joshstevens19 Oct 15, 2019
1baf6ca
feat: get unit value typings test
joshstevens19 Oct 15, 2019
ea4887b
feat: hex to ascii typings test
joshstevens19 Oct 15, 2019
2b9ccd6
feat: hex to bytes typings test
joshstevens19 Oct 15, 2019
176c71c
feat: hex to number string typings test
joshstevens19 Oct 15, 2019
77b24b3
feat: hex to number typings test
joshstevens19 Oct 15, 2019
99b4d5a
feat: hex to string typings test
joshstevens19 Oct 15, 2019
a7fb673
feat: hex to utf8 typings test
joshstevens19 Oct 15, 2019
a1b076d
feat: is address typings test
joshstevens19 Oct 15, 2019
f133c65
feat: is big number typings test
joshstevens19 Oct 15, 2019
f3b1669
feat: is bloom typings test
joshstevens19 Oct 15, 2019
e10127a
feat: is bn typings test
joshstevens19 Oct 15, 2019
be485db
feat: is hex strict typings test
joshstevens19 Oct 15, 2019
c31dabe
feat: is hex typings test
joshstevens19 Oct 15, 2019
47157b0
feat: is topic typings test
joshstevens19 Oct 15, 2019
ba3720d
feat: json interface method to string typings test
joshstevens19 Oct 15, 2019
a7f6dac
feat: keccak256 typings test
joshstevens19 Oct 15, 2019
4cddce2
feat: left pad typings test
joshstevens19 Oct 15, 2019
5b54cd0
feat: number to hex typings test
joshstevens19 Oct 15, 2019
235a586
feat: utils type tests
joshstevens19 Oct 15, 2019
1047a11
feat: add types in package.json
joshstevens19 Oct 15, 2019
549dc7c
feat: new lock files for all packages
joshstevens19 Oct 15, 2019
c64df7a
feat: new lock files for web3-eth-account
joshstevens19 Oct 15, 2019
83be2a4
feat: new lock file for web3-provider.ws
joshstevens19 Oct 15, 2019
147e1fb
feat: install new dev dependencies for typings on root
joshstevens19 Oct 15, 2019
1e97246
feat: export the typings in the package.json
joshstevens19 Oct 15, 2019
4787389
feat: web3 typings tests to reference web3-core
joshstevens19 Oct 15, 2019
217649a
feat: reference web3-core over web3-providers
joshstevens19 Oct 15, 2019
cd2468f
feat: typings moved around due to different approach in 2.x
joshstevens19 Oct 15, 2019
a6f20de
feat: web3-bzz types
joshstevens19 Oct 15, 2019
b46a13f
feat: web3-bzz dependencies
joshstevens19 Oct 15, 2019
adad8a1
test: web3 bzz types
joshstevens19 Oct 15, 2019
d384e91
fix: resolve dtslint typing tests fails
joshstevens19 Oct 15, 2019
e1eb225
feat: web3-provider-http types
joshstevens19 Oct 15, 2019
39c469e
test: web3-provider-http tests
joshstevens19 Oct 15, 2019
4d337cd
refactor: rename to `tests`
joshstevens19 Oct 15, 2019
efb3157
docs: add author to the http provider
joshstevens19 Oct 15, 2019
c68ae46
feat: install web3-provider-ipc new dev dependencies
joshstevens19 Oct 15, 2019
2e087c3
docs: update readme for web3-provider-ipc
joshstevens19 Oct 15, 2019
22d2b0d
feat: `web3-providers-ipc` typings
joshstevens19 Oct 15, 2019
1f770f3
test: web3-provider-ipc test typings
joshstevens19 Oct 15, 2019
68ecb15
feat: typings for web3-providers-ipc
joshstevens19 Oct 15, 2019
cf826c4
fix: remove file comment
joshstevens19 Oct 15, 2019
6637cf6
fix: resolve index.d.ts file
joshstevens19 Oct 15, 2019
72539d0
feat: install type dependencies for web3-provider-ws
joshstevens19 Oct 15, 2019
0d90928
feat: `web-providers-ws` typings
joshstevens19 Oct 15, 2019
5b76c0a
feat: web3-providers-ws ts files
joshstevens19 Oct 15, 2019
eaf43d3
test: web3-provider-ws-tests
joshstevens19 Oct 15, 2019
82e69d7
fix: remove batch request from web3-bzz
joshstevens19 Oct 15, 2019
68d46e7
feat: export errors from web3-core-helpers
joshstevens19 Oct 15, 2019
77c02bd
fix: remove options from `web3.shh`
joshstevens19 Oct 15, 2019
10b423e
fix: define callback in the filter methods
joshstevens19 Oct 15, 2019
4b97122
feat: remove `TransactionSigner`
joshstevens19 Oct 15, 2019
d792268
docs: add web3-eth-personal docs
joshstevens19 Oct 15, 2019
79e98c9
fix: resolve typings 1.0 from pr comments
joshstevens19 Oct 15, 2019
849f4e6
types updated
nivida Oct 16, 2019
a269880
Merge branch '1.x' into types/back-port-from-2.x
joshstevens19 Oct 16, 2019
f09a1c7
ci script updated
nivida Oct 16, 2019
cc77659
Merge branch 'types/back-port-from-2.x' of github.com:joshstevens19/w…
nivida Oct 16, 2019
747a00b
global install of typescript for CI added
nivida Oct 16, 2019
3712104
installation of typescript moved to before_script
nivida Oct 16, 2019
85e53fc
lerna-debug.log added to gitignore
nivida Oct 16, 2019
a983c12
lerna-debug removed
nivida Oct 16, 2019
b0e4c10
getNodeInfo added to types and documentation
nivida Oct 16, 2019
fa841bd
getChainId to types added
nivida Oct 16, 2019
30d1523
travis.yml fixed
nivida Oct 16, 2019
0234d69
global install of typescript removed and just added as dependency to …
nivida Oct 16, 2019
151a2b7
fix: dtslint to version `0.4.2`
joshstevens19 Oct 16, 2019
2468c71
fix: remove repeating typings
joshstevens19 Oct 16, 2019
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
Prev Previous commit
Next Next commit
feat: number to hex typings test
joshstevens19 committed Oct 15, 2019
commit 5b54cd0589e1cde793b3c7d542f576af62280291
46 changes: 46 additions & 0 deletions packages/web3-utils/types/tests/number-to-hex-test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
This file is part of web3.js.

web3.js is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

web3.js is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License
along with web3.js. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @file number-to-hex-test.ts
* @author Josh Stevens <joshstevens19@hotmail.co.uk>
* @date 2018
*/

import BN = require('bn.js');
import {numberToHex} from 'web3-utils';

// $ExpectType string
numberToHex('232');
// $ExpectType string
numberToHex(232);
// $ExpectType string
numberToHex(new BN(3));

// $ExpectError
numberToHex(['72']);
// $ExpectError
numberToHex([4]);
// $ExpectError
numberToHex([ 36 ]);
// $ExpectError
numberToHex({});
// $ExpectError
numberToHex(true);
// $ExpectError
numberToHex(null);
// $ExpectError
numberToHex(undefined);