Skip to content

Commit

Permalink
Fixing some build errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Pauan committed Aug 13, 2024
1 parent e766609 commit 72f9bbf
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions sdk/src/program-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ class ProgramManager {
if (typeof programSource == "string") {
throw (`Program ${programObject.id()} already exists on the network, please rename your program`);
}
} catch (e) {
} catch (e: any) {
logAndThrow(`Error validating program: ${e.message}`);
}

Expand All @@ -189,15 +189,15 @@ class ProgramManager {
// Get the fee record from the account if it is not provided in the parameters
try {
feeRecord = privateFee ? <RecordPlaintext>await this.getCreditsRecord(fee, [], feeRecord, recordSearchParams) : undefined;
} catch (e) {
} catch (e: any) {
logAndThrow(`Error finding fee record. Record finder response: '${e.message}'. Please ensure you're connected to a valid Aleo network and a record with enough balance exists.`);
}

// Get the proving and verifying keys from the key provider
let feeKeys;
try {
feeKeys = privateFee ? <FunctionKeyPair>await this.keyProvider.feePrivateKeys() : <FunctionKeyPair>await this.keyProvider.feePublicKeys();
} catch (e) {
} catch (e: any) {
logAndThrow(`Error finding fee keys. Key finder response: '${e.message}'. Please ensure your key provider is configured correctly.`);
}
const [feeProvingKey, feeVerifyingKey] = feeKeys;
Expand All @@ -206,7 +206,7 @@ class ProgramManager {
let imports;
try {
imports = await this.networkClient.getProgramImports(program);
} catch (e) {
} catch (e: any) {
logAndThrow(`Error finding program imports. Network response: '${e.message}'. Please ensure you're connected to a valid Aleo network and the program is deployed to the network.`);
}

Expand Down Expand Up @@ -266,7 +266,7 @@ class ProgramManager {
if (program === undefined) {
try {
program = <string>(await this.networkClient.getProgram(programName));
} catch (e) {
} catch (e: any) {
logAndThrow(`Error finding ${programName}. Network response: '${e.message}'. Please ensure you're connected to a valid Aleo network the program is deployed to the network.`);
}
} else if (program instanceof Program) {
Expand All @@ -286,15 +286,15 @@ class ProgramManager {
// Get the fee record from the account if it is not provided in the parameters
try {
feeRecord = privateFee ? <RecordPlaintext>await this.getCreditsRecord(fee, [], feeRecord, recordSearchParams) : undefined;
} catch (e) {
} catch (e: any) {
logAndThrow(`Error finding fee record. Record finder response: '${e.message}'. Please ensure you're connected to a valid Aleo network and a record with enough balance exists.`);
}

// Get the fee proving and verifying keys from the key provider
let feeKeys;
try {
feeKeys = privateFee ? <FunctionKeyPair>await this.keyProvider.feePrivateKeys() : <FunctionKeyPair>await this.keyProvider.feePublicKeys();
} catch (e) {
} catch (e: any) {
logAndThrow(`Error finding fee keys. Key finder response: '${e.message}'. Please ensure your key provider is configured correctly.`);
}
const [feeProvingKey, feeVerifyingKey] = feeKeys;
Expand All @@ -313,7 +313,7 @@ class ProgramManager {
if (numberOfImports > 0 && !imports) {
try {
imports = <ProgramImports>await this.networkClient.getProgramImports(programName);
} catch (e) {
} catch (e: any) {
logAndThrow(`Error finding program imports. Network response: '${e.message}'. Please ensure you're connected to a valid Aleo network and the program is deployed to the network.`);
}
}
Expand Down Expand Up @@ -465,7 +465,7 @@ class ProgramManager {
try {
feeKeys = privateFee ? <FunctionKeyPair>await this.keyProvider.feePrivateKeys() : <FunctionKeyPair>await this.keyProvider.feePublicKeys();
joinKeys = <FunctionKeyPair>await this.keyProvider.joinKeys();
} catch (e) {
} catch (e: any) {
logAndThrow(`Error finding fee keys. Key finder response: '${e.message}'. Please ensure your key provider is configured correctly.`);
}
const [feeProvingKey, feeVerifyingKey] = feeKeys;
Expand All @@ -474,15 +474,15 @@ class ProgramManager {
// Get the fee record from the account if it is not provided in the parameters
try {
feeRecord = privateFee ? <RecordPlaintext>await this.getCreditsRecord(fee, [], feeRecord, recordSearchParams) : undefined;
} catch (e) {
} catch (e: any) {
logAndThrow(`Error finding fee record. Record finder response: '${e.message}'. Please ensure you're connected to a valid Aleo network and a record with enough balance exists.`);
}

// Validate the records provided are valid plaintext records
try {
recordOne = recordOne instanceof RecordPlaintext ? recordOne : RecordPlaintext.fromString(recordOne);
recordTwo = recordTwo instanceof RecordPlaintext ? recordTwo : RecordPlaintext.fromString(recordTwo);
} catch (e) {
} catch (e: any) {
logAndThrow('Records provided are not valid. Please ensure they are valid plaintext records.')
}

Expand Down Expand Up @@ -528,15 +528,15 @@ class ProgramManager {
let splitKeys;
try {
splitKeys = <FunctionKeyPair>await this.keyProvider.splitKeys();
} catch (e) {
} catch (e: any) {
logAndThrow(`Error finding fee keys. Key finder response: '${e.message}'. Please ensure your key provider is configured correctly.`);
}
const [splitProvingKey, splitVerifyingKey] = splitKeys;

// Validate the record to be split
try {
amountRecord = amountRecord instanceof RecordPlaintext ? amountRecord : RecordPlaintext.fromString(amountRecord);
} catch (e) {
} catch (e: any) {
logAndThrow("Record provided is not valid. Please ensure it is a valid plaintext record.");
}

Expand Down Expand Up @@ -584,7 +584,7 @@ class ProgramManager {
imports
);
return [<ProvingKey>keyPair.provingKey(), <VerifyingKey>keyPair.verifyingKey()];
} catch (e) {
} catch (e: any) {
logAndThrow(`Could not synthesize keys - error ${e.message}. Please ensure the program is valid and the inputs are correct.`);
}
}
Expand Down Expand Up @@ -649,7 +649,7 @@ class ProgramManager {
try {
feeKeys = privateFee ? <FunctionKeyPair>await this.keyProvider.feePrivateKeys() : <FunctionKeyPair>await this.keyProvider.feePublicKeys();
transferKeys = <FunctionKeyPair>await this.keyProvider.transferKeys(transferType);
} catch (e) {
} catch (e: any) {
logAndThrow(`Error finding fee keys. Key finder response: '${e.message}'. Please ensure your key provider is configured correctly.`);
}
const [feeProvingKey, feeVerifyingKey] = feeKeys;
Expand All @@ -667,7 +667,7 @@ class ProgramManager {
amountRecord = undefined;
}
feeRecord = privateFee ? <RecordPlaintext>await this.getCreditsRecord(fee, nonces, feeRecord, recordSearchParams) : undefined;
} catch (e) {
} catch (e: any) {
logAndThrow(`Error finding fee record. Record finder response: '${e.message}'. Please ensure you're connected to a valid Aleo network and a record with enough balance exists.`);
}

Expand Down Expand Up @@ -1265,7 +1265,7 @@ class ProgramManager {
try {
const recordProvider = <RecordProvider>this.recordProvider;
return <RecordPlaintext>(await recordProvider.findCreditsRecord(amount, true, nonces, params))
} catch (e) {
} catch (e: any) {
logAndThrow(`Error finding fee record. Record finder response: '${e.message}'. Please ensure you're connected to a valid Aleo network and a record with enough balance exists.`);
}
}
Expand Down

0 comments on commit 72f9bbf

Please sign in to comment.