Skip to content

Commit

Permalink
delete kubectl
Browse files Browse the repository at this point in the history
  • Loading branch information
just-mitch committed Aug 23, 2024
1 parent 23aacc5 commit dee698a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 11 deletions.
5 changes: 3 additions & 2 deletions yarn-project/aztec.js/src/contract/deploy_sent_tx.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { type PXE, type TxHash, type TxReceipt } from '@aztec/circuit-types';
import { type AztecAddress } from '@aztec/circuits.js';
import { createDebugLogger } from '@aztec/foundation/log';
import { type FieldsOf } from '@aztec/foundation/types';
import { type ContractInstanceWithAddress } from '@aztec/types/contracts';

Expand All @@ -24,6 +25,8 @@ export type DeployTxReceipt<TContract extends ContractBase = Contract> = FieldsO
* A contract deployment transaction sent to the network, extending SentTx with methods to create a contract instance.
*/
export class DeploySentTx<TContract extends Contract = Contract> extends SentTx {
private log = createDebugLogger('aztec:js:deploy_sent_tx');

constructor(
wallet: PXE | Wallet,
txHashPromise: Promise<TxHash>,
Expand Down Expand Up @@ -52,9 +55,7 @@ export class DeploySentTx<TContract extends Contract = Contract> extends SentTx
*/
public override async wait(opts?: DeployedWaitOpts): Promise<DeployTxReceipt<TContract>> {
const receipt = await super.wait(opts);
this.log.debug(`Returned from wait for ${await this.getTxHash()}: final status ${receipt.status}`);
const contract = await this.getContractObject(opts?.wallet);
this.log.debug(`Contract instance created for ${this.instance.address.toString()}`);
return { ...receipt, contract };
}

Expand Down
9 changes: 0 additions & 9 deletions yarn-project/aztec.js/src/contract/sent_tx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
type TxReceipt,
TxStatus,
} from '@aztec/circuit-types';
import { createDebugLogger } from '@aztec/foundation/log';
import { retryUntil } from '@aztec/foundation/retry';
import { type FieldsOf } from '@aztec/foundation/types';

Expand Down Expand Up @@ -44,7 +43,6 @@ export const DefaultWaitOpts: WaitOpts = {
* its hash, receipt, and mining status.
*/
export class SentTx {
protected log = createDebugLogger('aztec:js:sent_tx');
constructor(protected pxe: PXE, protected txHashPromise: Promise<TxHash>) {}

/**
Expand Down Expand Up @@ -86,7 +84,6 @@ export class SentTx {
);
}
if (opts?.proven && receipt.blockNumber !== undefined) {
this.log.info(`Waiting for tx ${await this.getTxHash()} to be proven`);
await this.waitForProven(receipt.blockNumber, opts);
}
if (opts?.debug) {
Expand Down Expand Up @@ -131,7 +128,6 @@ export class SentTx {
return await retryUntil(
async () => {
const txReceipt = await this.pxe.getTxReceipt(txHash);
this.log.debug(`Got receipt for tx ${txHash}: ${txReceipt.status}`);
// If receipt is not yet available, try again
if (txReceipt.status === TxStatus.PENDING) {
return undefined;
Expand All @@ -145,15 +141,10 @@ export class SentTx {
if (!waitForNotesSync) {
return txReceipt;
}
this.log.debug(`Waiting for notes to sync for tx ${txHash}`);
// Check if all sync blocks on the PXE Service are greater or equal than the block in which the tx was mined
const { blocks, notes } = await this.pxe.getSyncStatus();

this.log.debug(`Got sync status for tx ${txHash}: ${blocks} ${JSON.stringify(notes)}`);
const targetBlock = txReceipt.blockNumber!;
this.log.debug(`Target block for tx ${txHash}: ${targetBlock}`);
const areNotesSynced = blocks >= targetBlock && Object.values(notes).every(block => block >= targetBlock);
this.log.debug(`Are notes synced for tx ${txHash}: ${areNotesSynced}`);
return areNotesSynced ? txReceipt : undefined;
},
'isMined',
Expand Down
Binary file removed yarn-project/kubectl
Binary file not shown.

0 comments on commit dee698a

Please sign in to comment.