Skip to content

Commit

Permalink
chore: prettier + update name
Browse files Browse the repository at this point in the history
  • Loading branch information
LHerskind committed Jul 25, 2023
1 parent 876df6b commit 7aa3e02
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion yarn-project/acir-simulator/src/public/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ import {
import { MockProxy, mock } from 'jest-mock-extended';
import { type MemDown, default as memdown } from 'memdown';

import { DBOracle } from '../index.js';
import { buildL1ToL2Message } from '../test/utils.js';
import { computeSlotForMapping } from '../utils.js';
import { CommitmentsDB, PublicContractsDB, PublicStateDB } from './db.js';
import { PublicExecution } from './execution.js';
import { PublicExecutor } from './executor.js';
import { DBOracle } from '../index.js';

export const createMemDown = () => (memdown as any)() as MemDown<any, any>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import { AztecAddress, Contract, Fr, Wallet } from '@aztec/aztec.js';
import { CircuitsWasm } from '@aztec/circuits.js';
import { pedersenPlookupCommitInputs } from '@aztec/circuits.js/barretenberg';
import { DebugLogger } from '@aztec/foundation/log';
import { YoloContract } from '@aztec/noir-contracts/types';
import { LendingContract } from '@aztec/noir-contracts/types';
import { AztecRPC, TxStatus } from '@aztec/types';

import { calculateAztecStorageSlot, setup } from './utils.js';

describe('e2e_yolo_contract', () => {
describe('e2e_lending_contract', () => {
let aztecNode: AztecNodeService | undefined;
let aztecRpcServer: AztecRPC;
let wallet: Wallet;
Expand All @@ -20,11 +20,11 @@ describe('e2e_yolo_contract', () => {

const deployContract = async () => {
logger(`Deploying L2 public contract...`);
const tx = YoloContract.deploy(aztecRpcServer).send();
const tx = LendingContract.deploy(aztecRpcServer).send();

logger(`Tx sent with hash ${await tx.getTxHash()}`);
const receipt = await tx.getReceipt();
contract = new YoloContract(receipt.contractAddress!, wallet);
contract = new LendingContract(receipt.contractAddress!, wallet);
await tx.isMined(0, 0.1);
const txReceipt = await tx.getReceipt();
logger(`L2 contract deployed at ${receipt.contractAddress}`);
Expand Down
4 changes: 2 additions & 2 deletions yarn-project/noir-contracts/src/artifacts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { ContractAbi } from '@aztec/foundation/abi';
import ChildJson from './child_contract.json' assert { type: 'json' };
import EasyZkTokenContractJson from './easy_zk_token_contract.json' assert { type: 'json' };
import EcdsaAccountContractJson from './ecdsa_account_contract.json' assert { type: 'json' };
import LendingContractJson from './lending_contract.json' assert { type: 'json' };
import NonNativeTokenContractJson from './non_native_token_contract.json' assert { type: 'json' };
import ParentJson from './parent_contract.json' assert { type: 'json' };
import PendingCommitmentsContractJson from './pending_commitments_contract.json' assert { type: 'json' };
Expand All @@ -14,7 +15,6 @@ import SchnorrSingleKeyAccountContractJson from './schnorr_single_key_account_co
import TestContractJson from './test_contract.json' assert { type: 'json' };
import UniswapContractJson from './uniswap_contract.json' assert { type: 'json' };
import ZkTokenContractJson from './zk_token_contract.json' assert { type: 'json' };
import YoloContractJson from './yolo_contract.json' assert { type: 'json' };

export const TestContractAbi = TestContractJson as ContractAbi;
export const EasyZkTokenContractAbi = EasyZkTokenContractJson as ContractAbi;
Expand All @@ -29,4 +29,4 @@ export const SchnorrSingleKeyAccountContractAbi = SchnorrSingleKeyAccountContrac
export const UniswapContractAbi = UniswapContractJson as ContractAbi;
export const PendingCommitmentsContractAbi = PendingCommitmentsContractJson as ContractAbi;
export const PokeableTokenContractAbi = PokeableTokenContractJson as ContractAbi;
export const YoloContractAbi = YoloContractJson as ContractAbi;
export const LendingContractAbi = LendingContractJson as ContractAbi;
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "Yolo",
"name": "Lending",
"functions": [
{
"name": "_borrow",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
mod storage;

contract Yolo {
contract Lending {
use dep::aztec::{
abi,
abi::PrivateContextInputs,
Expand Down
Empty file.
2 changes: 1 addition & 1 deletion yarn-project/noir-contracts/src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ export * from './schnorr_single_key_account.js';
export * from './test.js';
export * from './uniswap.js';
export * from './zk_token.js';
export * from './yolo.js';
export * from './lending.js';
Original file line number Diff line number Diff line change
Expand Up @@ -13,40 +13,40 @@ import { ContractAbi } from '@aztec/foundation/abi';
import { Fr, Point } from '@aztec/foundation/fields';
import { AztecRPC, PublicKey } from '@aztec/types';

import { YoloContractAbi } from '../artifacts/index.js';
import { LendingContractAbi } from '../artifacts/index.js';

/**
* Type-safe interface for contract Yolo;
* Type-safe interface for contract Lending;
*/
export class YoloContract extends Contract {
export class LendingContract extends Contract {
constructor(
/** The deployed contract's address. */
address: AztecAddress,
/** The wallet. */
wallet: Wallet,
) {
super(address, YoloContractAbi, wallet);
super(address, LendingContractAbi, wallet);
}

/**
* Creates a tx to deploy a new instance of this contract.
*/
public static deploy(rpc: AztecRPC) {
return new DeployMethod(Point.ZERO, rpc, YoloContractAbi, Array.from(arguments).slice(1));
return new DeployMethod(Point.ZERO, rpc, LendingContractAbi, Array.from(arguments).slice(1));
}

/**
* Creates a tx to deploy a new instance of this contract using the specified public key to derive the address.
*/
public static deployWithPublicKey(rpc: AztecRPC, publicKey: PublicKey) {
return new DeployMethod(publicKey, rpc, YoloContractAbi, Array.from(arguments).slice(2));
return new DeployMethod(publicKey, rpc, LendingContractAbi, Array.from(arguments).slice(2));
}

/**
* Returns this contract's ABI.
*/
public static get abi(): ContractAbi {
return YoloContractAbi;
return LendingContractAbi;
}

/** Type-safe wrappers for the public methods exposed by the contract. */
Expand Down

0 comments on commit 7aa3e02

Please sign in to comment.