Skip to content

Commit 3e2adea

Browse files
committed
fix typescript compile errors
1 parent aae5836 commit 3e2adea

File tree

8 files changed

+15
-15
lines changed

8 files changed

+15
-15
lines changed

ethereum/oracles/src/noir/oracles/common/const.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
export const MODULUS = 21888242871839275222246405745257275088696311157297823662689037894645226208583n;
22
export const BITS_IN_BYTE = 8n;
3-
export const U1_LEN: u32 = 1;
4-
export const BYTES32_LEN: u32 = 32;
5-
export const ADDRESS_LEN: u32 = 20;
6-
export const U64_LEN: u32 = 8;
3+
export const U1_LEN = 1;
4+
export const BYTES32_LEN = 32;
5+
export const ADDRESS_LEN = 20;
6+
export const U64_LEN = 8;
77
// eslint-disable-next-line no-magic-numbers
88
export const U64_MAX = max_n_bit_value(64n);
99
export const MAX_U8 = 255;
10-
export const MAX_TRIE_NODE_LEN: u32 = 532;
10+
export const MAX_TRIE_NODE_LEN = 532;
1111
export const ZERO_PAD_VALUE = '0x00';
1212
// eslint-disable-next-line no-magic-numbers
1313
export const U128_MAX = max_n_bit_value(128n);

ethereum/oracles/src/noir/oracles/rpc/common/proofConfig/account.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ import { BYTES32_LEN, U64_LEN } from '../../../common/const.js';
22
import { getProofConfig } from '../proofConfig.js';
33
import { getMaxRlpEncodedSize } from '../util.js';
44

5-
const KEY_LEN: u32 = BYTES32_LEN; // Key is a hash of Ethereum address.
5+
const KEY_LEN: number = BYTES32_LEN; // Key is a hash of Ethereum address.
66
const MAX_VALUE_CONTENT_LEN =
77
getMaxRlpEncodedSize(U64_LEN) /* Nonce */ +
88
getMaxRlpEncodedSize(BYTES32_LEN) /* Balance */ +
99
getMaxRlpEncodedSize(BYTES32_LEN) /* Storage root */ +
1010
getMaxRlpEncodedSize(BYTES32_LEN); /* Code hash */
11-
const MAX_VALUE_LEN: u32 = getMaxRlpEncodedSize(MAX_VALUE_CONTENT_LEN);
11+
const MAX_VALUE_LEN: number = getMaxRlpEncodedSize(MAX_VALUE_CONTENT_LEN);
1212
const MAX_PROOF_LEVELS = 11; // Empirically correct values to be determined after we scan ethereum state trie.
1313

1414
export const accountProofConfig = getProofConfig(KEY_LEN, MAX_VALUE_LEN, MAX_PROOF_LEVELS);

ethereum/oracles/src/noir/oracles/rpc/common/proofConfig/receipt.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import { getProofConfig } from '../proofConfig.js';
44
export const MAX_RECEIPT_ENCODED_LEN_M = 1000;
55
export const MAX_RECEIPT_RLP_LEN_M = MAX_RECEIPT_ENCODED_LEN_M - 1;
66

7-
const MAX_KEY_LEN: u32 = 3;
8-
const MAX_VALUE_LEN: u32 = 1000;
7+
const MAX_KEY_LEN = 3;
8+
const MAX_VALUE_LEN = 1000;
99
const MAX_PROOF_LEVELS = MAX_KEY_LEN * BYTE_HEX_LEN + 1; // Path with N nibbles has N + 1 levels
1010

1111
export const receiptProofConfigM = getProofConfig(MAX_KEY_LEN, MAX_VALUE_LEN, MAX_PROOF_LEVELS);
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { BYTES32_LEN } from '../../../common/const.js';
22
import { getProofConfig } from '../proofConfig.js';
33

4-
const KEY_LEN: u32 = BYTES32_LEN;
5-
const VALUE_LEN: u32 = BYTES32_LEN;
4+
const KEY_LEN: number = BYTES32_LEN;
5+
const VALUE_LEN: number = BYTES32_LEN;
66
const MAX_PROOF_LEVELS = 7; // Empirically correct values to be determined after we scan ethereum state trie.
77

88
export const storageProofConfig = getProofConfig(KEY_LEN, VALUE_LEN, MAX_PROOF_LEVELS);

ethereum/oracles/src/noir/oracles/rpc/common/proofConfig/tx.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { getProofConfig } from '../proofConfig.js';
55
export const MAX_TX_ENCODED_LEN_M = 1000;
66
export const MAX_TX_RLP_LEN_M = MAX_TX_ENCODED_LEN_M - 1;
77

8-
const MAX_KEY_LEN: u32 = 3;
8+
const MAX_KEY_LEN = 3;
99
const MAX_PROOF_LEVELS = MAX_KEY_LEN * BYTE_HEX_LEN + 1; // Path with N nibbles has N + 1 levels
1010

1111
export const txProofConfigM = getProofConfig(MAX_KEY_LEN, MAX_TX_ENCODED_LEN_M, MAX_PROOF_LEVELS);

ethereum/oracles/src/noir/oracles/rpc/common/util.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { BYTE_HEX_LEN } from '../../../../util/const.js';
22

3-
export const RLP_SHORT_ENTITY_MAX_LEN: u32 = 55;
3+
export const RLP_SHORT_ENTITY_MAX_LEN = 55;
44

55
export function getMaxRlpHeaderSize(len: number): number {
66
if (len <= RLP_SHORT_ENTITY_MAX_LEN) {

ethereum/oracles/src/noir/oracles/rpc/headerOracle/encode.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { BlockHeader, headerToRlp } from '../../../../ethereum/blockHeader.js';
44
import { padArray } from '../../../../util/array.js';
55
import { encodeField, encodeHex } from '../../common/encode.js';
66

7-
export const MAX_HEADER_RLP_LEN: u32 = 708;
7+
export const MAX_HEADER_RLP_LEN = 708;
88

99
export function encodeBlockHeader(header: BlockHeader): ForeignCallOutput[] {
1010
return [...encodeBlockHeaderPartial(header), ...encodeBlockHeaderRlp(header)];

ethereum/oracles/src/util/const.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
export const BYTE_HEX_LEN: u32 = 2;
1+
export const BYTE_HEX_LEN = 2;
22
export const U1_ZERO = '0x00';
33
export const BYTES_32_ZERO = '0x0000000000000000000000000000000000000000000000000000000000000000';

0 commit comments

Comments
 (0)