Skip to content

Commit

Permalink
Revert "Add to interface"
Browse files Browse the repository at this point in the history
This reverts commit c9e0a05.
  • Loading branch information
sklppy88 committed May 17, 2024
1 parent b206b7c commit c602171
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 47 deletions.
22 changes: 1 addition & 21 deletions yarn-project/aztec.js/src/account/interface.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { type AuthWitness, type CompleteAddress, type FunctionCall } from '@aztec/circuit-types';
import { type AztecAddress } from '@aztec/circuits.js';
import { type Fq, type Fr, type Point } from '@aztec/foundation/fields';
import { type Fr } from '@aztec/foundation/fields';

import { type ContractFunctionInteraction } from '../contract/contract_function_interaction.js';
import { type EntrypointInterface } from '../entrypoint/entrypoint.js';
Expand Down Expand Up @@ -51,24 +51,4 @@ export interface AccountInterface extends AuthWitnessProvider, EntrypointInterfa
/** Returns the rollup version for this account */
getVersion(): Fr;
}

/**
* Handler for interfacing with an account's ability to rotate its keys.
*/
export interface AccountKeyRotationInterface {
/**
* Returns a function interaction to rotate our master nullifer public key in the canonical key registry.
* @param newNpkM - The new master nullifier public key we want to use.
* @remarks - This does not hinder our ability to spend notes tied to a previous master nullifier public key.
* @returns - A function interaction.
*/
rotateNpkM(newNpkM: Point): ContractFunctionInteraction;

/**
* Rotates the account master nullifier secret key in our pxe / keystore
* @param newNskM - The new master nullifier secret key we want to use.
* @remarks - This does not hinder our ability to spend notes tied to a previous master nullifier public key.
*/
rotateNskM(newNskM: Fq): Promise<void>;
}
// docs:end:account-interface
4 changes: 2 additions & 2 deletions yarn-project/aztec.js/src/account/wallet.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { type PXE } from '@aztec/circuit-types';

import { type AccountInterface, type AccountKeyRotationInterface } from './interface.js';
import { type AccountInterface } from './interface.js';

/**
* The wallet interface.
*/
export type Wallet = AccountInterface & PXE & AccountKeyRotationInterface;
export type Wallet = AccountInterface & PXE;
13 changes: 1 addition & 12 deletions yarn-project/aztec.js/src/wallet/base_wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,7 @@ import {
type TxHash,
type TxReceipt,
} from '@aztec/circuit-types';
import {
type AztecAddress,
type CompleteAddress,
type Fq,
type Fr,
type PartialAddress,
type Point,
} from '@aztec/circuits.js';
import { type AztecAddress, type CompleteAddress, type Fq, type Fr, type PartialAddress } from '@aztec/circuits.js';
import { type ContractArtifact } from '@aztec/foundation/abi';
import { type ContractClassWithId, type ContractInstanceWithAddress } from '@aztec/types/contracts';
import { type NodeInfo } from '@aztec/types/interfaces';
Expand All @@ -45,10 +38,6 @@ export abstract class BaseWallet implements Wallet {

abstract createTxExecutionRequest(exec: ExecutionRequestInit): Promise<TxExecutionRequest>;

abstract rotateNpkM(newNpkM: Point): ContractFunctionInteraction;

abstract rotateNskM(newNskM: Fq): Promise<void>;

abstract createAuthWit(
messageHashOrIntent:
| Fr
Expand Down
11 changes: 1 addition & 10 deletions yarn-project/aztec.js/src/wallet/signerless_wallet.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { type AuthWitness, type PXE, type TxExecutionRequest } from '@aztec/circuit-types';
import { type CompleteAddress, type Fq, type Fr, type Point } from '@aztec/circuits.js';
import { type CompleteAddress, type Fr } from '@aztec/circuits.js';

import { type ContractFunctionInteraction } from '../contract/contract_function_interaction.js';
import { DefaultEntrypoint } from '../entrypoint/default_entrypoint.js';
import { type EntrypointInterface, type ExecutionRequestInit } from '../entrypoint/entrypoint.js';
import { BaseWallet } from './base_wallet.js';
Expand Down Expand Up @@ -43,12 +42,4 @@ export class SignerlessWallet extends BaseWallet {
createAuthWit(_messageHash: Fr): Promise<AuthWitness> {
throw new Error('Method not implemented.');
}

rotateNpkM(_newNpkM: Point): ContractFunctionInteraction {
throw new Error('Method not implemented.');
}

rotateNskM(_newNskM: Fq): Promise<void> {
throw new Error('Method not implemented.');
}
}
5 changes: 3 additions & 2 deletions yarn-project/end-to-end/src/e2e_key_rotation.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { createAccounts } from '@aztec/accounts/testing';
import {
type AccountWallet,
type AztecAddress,
type AztecNode,
type DebugLogger,
Expand Down Expand Up @@ -30,8 +31,8 @@ describe('e2e_key_rotation', () => {
let aztecNode: AztecNode;
let pxeA: PXE;
let pxeB: PXE;
let walletA: Wallet;
let walletB: Wallet;
let walletA: AccountWallet;
let walletB: AccountWallet;
let logger: DebugLogger;
let teardownA: () => Promise<void>;
let teardownB: () => Promise<void>;
Expand Down

0 comments on commit c602171

Please sign in to comment.