Skip to content

Commit

Permalink
Remove dead code & rename file
Browse files Browse the repository at this point in the history
  • Loading branch information
LogvinovLeon committed May 28, 2024
1 parent b501845 commit 78200a7
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 60 deletions.
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
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
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[]>;

0 comments on commit 78200a7

Please sign in to comment.