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

feat: typos, using Tx.clone functionality, better naming #1976

Merged
merged 3 commits into from
Sep 4, 2023
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
4 changes: 2 additions & 2 deletions yarn-project/aztec-node/src/aztec-node/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ export class AztecNodeService implements AztecNode {
* @returns - The pending tx if it exists.
*/
public async getPendingTxByHash(txHash: TxHash) {
return await this.p2pClient!.getTxByhash(txHash);
return await this.p2pClient!.getTxByHash(txHash);
}

/**
Expand Down Expand Up @@ -388,7 +388,7 @@ export class AztecNodeService implements AztecNode {
const newGlobalVariables = await this.globalVariableBuilder.buildGlobalVariables(new Fr(blockNumber));
const prevGlobalVariables = (await this.blockSource.getL2Block(-1))?.globalVariables ?? GlobalVariables.empty();

// Instantiate merkle trees so uncommited updates by this simulation are local to it.
// Instantiate merkle trees so uncommitted updates by this simulation are local to it.
// TODO we should be able to remove this after https://github.com/AztecProtocol/aztec-packages/issues/1869
// So simulation of public functions doesn't affect the merkle trees.
const merkleTrees = new MerkleTrees(this.merkleTreesDb, this.log);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ export class CombinedAccumulatedData {
}

/**
* Specific accumululated data structure for the final ordering private kernel circuit. It is included
* Specific accumulated data structure for the final ordering private kernel circuit. It is included
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is "accumululated" such a funny word?

* in the final public inputs of private kernel circuit.
*/
export class FinalAccumulatedData {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use dep::value_note::{
};

struct EasyPrivateUint {
context: Option<&mut PrivateContext>,
maybe_context: Option<&mut PrivateContext>,
set: Set<ValueNote, VALUE_NOTE_LEN>,
storage_slot: Field,
}
Expand All @@ -32,7 +32,7 @@ impl EasyPrivateUint {
note_interface: ValueNoteMethods,
};
EasyPrivateUint {
context: private_context,
maybe_context: private_context,
set,
storage_slot,
}
Expand All @@ -48,10 +48,10 @@ impl EasyPrivateUint {

// Emit the newly created encrypted note preimages via oracle calls.
let owner_key = get_public_key(owner);
let _context = self.context.unwrap();
let context = self.maybe_context.unwrap();
emit_encrypted_log(
_context,
(*_context).this_address(),
context,
(*context).this_address(),
self.set.storage_slot,
owner_key,
addend_note.serialise(),
Expand Down Expand Up @@ -94,10 +94,10 @@ impl EasyPrivateUint {

let owner_key = get_public_key(owner);

let _context = self.context.unwrap();
let context = self.maybe_context.unwrap();
emit_encrypted_log(
_context,
(*_context).this_address(),
context,
(*context).this_address(),
self.set.storage_slot,
owner_key,
encrypted_data,
Expand Down
4 changes: 2 additions & 2 deletions yarn-project/p2p/src/client/p2p_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export interface P2P {
* @param txHash - Hash of tx to return.
* @returns A single tx or undefined.
*/
getTxByhash(txHash: TxHash): Promise<Tx | undefined>;
getTxByHash(txHash: TxHash): Promise<Tx | undefined>;

/**
* Starts the p2p client.
Expand Down Expand Up @@ -200,7 +200,7 @@ export class P2PClient implements P2P {
* @param txHash - Hash of the transaction to look for in the pool.
* @returns A single tx or undefined.
*/
getTxByhash(txHash: TxHash): Promise<Tx | undefined> {
getTxByHash(txHash: TxHash): Promise<Tx | undefined> {
return Promise.resolve(this.txPool.getTxByHash(txHash));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export class PublicProcessor {
*/
public async process(txs: Tx[]): Promise<[ProcessedTx[], FailedTx[]]> {
// The processor modifies the tx objects in place, so we need to clone them.
txs = txs.map(tx => Tx.fromJSON(tx.toJSON()));
txs = txs.map(tx => Tx.clone(tx));
const result: ProcessedTx[] = [];
const failed: FailedTx[] = [];

Expand Down