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

Remove dead code & rename file #313

Merged
merged 2 commits into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
17 changes: 0 additions & 17 deletions ethereum/oracles/src/noir/oracles/oracles.test.ts

This file was deleted.

35 changes: 0 additions & 35 deletions ethereum/oracles/src/noir/oracles/oracles.ts

This file was deleted.

2 changes: 1 addition & 1 deletion ethereum/oracles/src/noir/oracles/rpc/accountOracle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { type Address } from 'viem';
import { assert } from '../../../util/assert.js';
import { encodeAccount, encodeStateProof } from './accountOracle/encode.js';
import { decodeAddress, decodeField } from '../common/decode.js';
import { NoirArguments } from '../oracles.js';
import { NoirArguments } from '../types.js';
import { MultiChainClient } from '../../../ethereum/client.js';
import { Enum } from '../../../util/enum.js';

Expand Down
2 changes: 1 addition & 1 deletion ethereum/oracles/src/noir/oracles/rpc/headerOracle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { type BlockHeader, blockToHeader } from '../../../ethereum/blockHeader.j
import { assert } from '../../../util/assert.js';
import { encodeBlockHeader } from './headerOracle/encode.js';
import { decodeField } from '../common/decode.js';
import { NoirArguments } from '../oracles.js';
import { NoirArguments } from '../types.js';
import { type Block } from '../../../ethereum/blockHeader.js';
import { AlchemyClient, MultiChainClient } from '../../../ethereum/client.js';
import { Enum } from '../../../util/enum.js';
Expand Down
2 changes: 1 addition & 1 deletion ethereum/oracles/src/noir/oracles/rpc/proofOracle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { type ForeignCallOutput } from '@noir-lang/noir_js';
import { assert } from '../../../util/assert.js';
import { encodeAccount, encodeStateProof, encodeStorageProof } from './accountOracle/encode.js';
import { decodeAddress, decodeBytes32, decodeField } from '../common/decode.js';
import { NoirArguments } from '../oracles.js';
import { NoirArguments } from '../types.js';
import { Hex } from 'viem';
import { MultiChainClient } from '../../../ethereum/client.js';
import { Enum } from '../../../util/enum.js';
Expand Down
2 changes: 1 addition & 1 deletion ethereum/oracles/src/noir/oracles/rpc/receiptOracle.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { type ForeignCallOutput } from '@noir-lang/noir_js';
import { assert } from '../../../util/assert.js';
import { decodeField } from '../common/decode.js';
import { NoirArguments } from '../oracles.js';
import { NoirArguments } from '../types.js';
import { MultiChainClient } from '../../../ethereum/client.js';
import { getReceiptProof } from '../../../ethereum/receiptProof.js';
import { encodeReceipt, encodeReceiptProof } from './receiptOracle/encode.js';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { describe, expect, it } from 'vitest';
import { createMockMultiChainClient } from '../../../ethereum/mockClient.js';
import { OFFSETS, getTransactionOracle } from './transactionOracle.js';
import { MAX_DATA_LEN_M } from './common/txConfig.js';
import { padArray } from '../../../util/array.js';
import { MAX_DATA_LEN_M } from './common/txConfig.js';
import { ZERO_PAD_VALUE } from '../common/const.js';
import { txProofConfigM } from './common/proofConfig/tx.js';
import { OFFSETS, getTransactionOracle } from './transactionOracle.js';

describe('getTransactionOracle', () => {
it('success', async () => {
Expand Down
2 changes: 1 addition & 1 deletion ethereum/oracles/src/noir/oracles/rpc/transactionOracle.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { type ForeignCallOutput } from '@noir-lang/noir_js';
import { NoirArguments } from '../oracles.js';
import { NoirArguments } from '../types.js';
import { MultiChainClient } from '../../../ethereum/client.js';
import { txTypeToHex } from '../../../ethereum/receipt.js';
import { getTxProof } from '../../../ethereum/txProof.js';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { Transaction } from 'viem';
import { MAX_DATA_LEN_M } from '../common/txConfig.js';
import { ForeignCallOutput } from '@noir-lang/noir_js';
import { padArray } from '../../../../util/array.js';
Expand All @@ -8,6 +7,7 @@ import { ZERO_PAD_VALUE, MAX_TRIE_NODE_LEN } from '../../common/const.js';
import { encodeField, encodeAddress, encodeU128, encodeHex, encodeBytes, encodeProof } from '../../common/encode.js';
import { txProofConfigM } from '../common/proofConfig/tx.js';
import { Proof } from '../../../../ethereum/proof.js';
import { Transaction } from 'viem';

export enum TX_OFFSETS {
NONCE,
Expand Down
2 changes: 1 addition & 1 deletion ethereum/oracles/src/noir/oracles/server/encode.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { describe, it, expect } from 'vitest';
import { decodeNoirArguments, encodeForeignCallResult } from './encode.js';
import { ForeignCallParams, ForeignCallResult } from './types.js';
import { NoirArguments } from '../oracles.js';
import { NoirArguments } from '../types.js';

describe('decodeNoirArguments', () => {
it('should decode a single foreign call param correctly', () => {
Expand Down
2 changes: 1 addition & 1 deletion ethereum/oracles/src/noir/oracles/server/encode.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ForeignCallOutput } from '@noir-lang/noir_js';
import { ForeignCallParam, ForeignCallParams, ForeignCallResult } from './types.js';
import { NoirArguments } from '../oracles.js';
import { NoirArguments } from '../types.js';

/// DECODE
export function decodeNoirArguments(params: ForeignCallParams): NoirArguments {
Expand Down
2 changes: 1 addition & 1 deletion ethereum/oracles/src/noir/oracles/server/handlers.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ForeignCallResult, ForeignCallParams } from './types.js';
import { decodeNoirArguments, encodeForeignCallResult } from './encode.js';
import { MultiChainClient } from '../../../ethereum/client.js';
import { Oracle } from '../oracles.js';
import { Oracle } from '../types.js';

/**
* The format that the Noir oracles server receives the arguments in is slightly different than the format that acvm.js uses.
Expand Down
7 changes: 7 additions & 0 deletions ethereum/oracles/src/noir/oracles/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { type ForeignCallOutput } from '@noir-lang/noir_js';
import { MultiChainClient } from '../../ethereum/client.js';

export type NoirArgument = string[];
export type NoirArguments = NoirArgument[];

export type Oracle = (multiChainClient: MultiChainClient, args: NoirArguments) => Promise<ForeignCallOutput[]>;
Loading