Skip to content

Commit

Permalink
feat: typos, using Tx.clone functionality, better naming (#1976)
Browse files Browse the repository at this point in the history
  • Loading branch information
benesjan authored Sep 4, 2023
1 parent 31c0a02 commit 00bca67
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
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
* 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

0 comments on commit 00bca67

Please sign in to comment.