Skip to content
This repository was archived by the owner on Jun 17, 2021. It is now read-only.

Commit 4d4d442

Browse files
committed
Mv constants to own file
Rename constant to constants
1 parent 1650eb4 commit 4d4d442

File tree

2 files changed

+52
-46
lines changed

2 files changed

+52
-46
lines changed

src/constants.ts

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import BN = require('bn.js')
2+
3+
/**
4+
* The max integer that this VM can handle
5+
*/
6+
export const MAX_INTEGER: BN = new BN(
7+
'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff',
8+
16,
9+
)
10+
11+
/**
12+
* 2^256
13+
*/
14+
export const TWO_POW256: BN = new BN(
15+
'10000000000000000000000000000000000000000000000000000000000000000',
16+
16,
17+
)
18+
19+
/**
20+
* Keccak-256 hash of null
21+
*/
22+
export const KECCAK256_NULL_S: string =
23+
'c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470'
24+
25+
/**
26+
* Keccak-256 hash of null
27+
*/
28+
export const KECCAK256_NULL: Buffer = Buffer.from(KECCAK256_NULL_S, 'hex')
29+
30+
/**
31+
* Keccak-256 of an RLP of an empty array
32+
*/
33+
export const KECCAK256_RLP_ARRAY_S: string =
34+
'1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347'
35+
36+
/**
37+
* Keccak-256 of an RLP of an empty array
38+
*/
39+
export const KECCAK256_RLP_ARRAY: Buffer = Buffer.from(KECCAK256_RLP_ARRAY_S, 'hex')
40+
41+
/**
42+
* Keccak-256 hash of the RLP of null
43+
*/
44+
export const KECCAK256_RLP_S: string =
45+
'56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421'
46+
47+
/**
48+
* Keccak-256 hash of the RLP of null
49+
*/
50+
export const KECCAK256_RLP: Buffer = Buffer.from(KECCAK256_RLP_S, 'hex')

src/index.ts

Lines changed: 2 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -15,53 +15,9 @@ export interface ECDSASignature {
1515
}
1616

1717
/**
18-
* The max integer that this VM can handle
18+
* Constants
1919
*/
20-
export const MAX_INTEGER: BN = new BN(
21-
'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff',
22-
16,
23-
)
24-
25-
/**
26-
* 2^256
27-
*/
28-
export const TWO_POW256: BN = new BN(
29-
'10000000000000000000000000000000000000000000000000000000000000000',
30-
16,
31-
)
32-
33-
/**
34-
* Keccak-256 hash of null
35-
*/
36-
export const KECCAK256_NULL_S: string =
37-
'c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470'
38-
39-
/**
40-
* Keccak-256 hash of null
41-
*/
42-
export const KECCAK256_NULL: Buffer = Buffer.from(KECCAK256_NULL_S, 'hex')
43-
44-
/**
45-
* Keccak-256 of an RLP of an empty array
46-
*/
47-
export const KECCAK256_RLP_ARRAY_S: string =
48-
'1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347'
49-
50-
/**
51-
* Keccak-256 of an RLP of an empty array
52-
*/
53-
export const KECCAK256_RLP_ARRAY: Buffer = Buffer.from(KECCAK256_RLP_ARRAY_S, 'hex')
54-
55-
/**
56-
* Keccak-256 hash of the RLP of null
57-
*/
58-
export const KECCAK256_RLP_S: string =
59-
'56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421'
60-
61-
/**
62-
* Keccak-256 hash of the RLP of null
63-
*/
64-
export const KECCAK256_RLP: Buffer = Buffer.from(KECCAK256_RLP_S, 'hex')
20+
export * from './constants'
6521

6622
/**
6723
* [`BN`](https://github.com/indutny/bn.js)

0 commit comments

Comments
 (0)