Skip to content

Commit

Permalink
fix(ant): default evaluation options for ant apis that do not take an… (
Browse files Browse the repository at this point in the history
  • Loading branch information
dtfiedler committed Mar 22, 2024
2 parents 7c910bb + 7c59033 commit 0c8b55d
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/common/ant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,10 @@ export class ANT implements ANTContract {
/**
* Returns the current state of the contract.
*/
async getState(params: EvaluationParameters): Promise<ANTState> {
const state = await this.contract.getContractState(params);
async getState({
evaluationOptions,
}: EvaluationParameters = {}): Promise<ANTState> {
const state = await this.contract.getContractState({ evaluationOptions });
return state;
}

Expand All @@ -60,7 +62,7 @@ export class ANT implements ANTContract {
evaluationOptions,
}: {
evaluationOptions?: EvaluationOptions | Record<string, never> | undefined;
}): Promise<Record<string, ANTRecord>> {
} = {}): Promise<Record<string, ANTRecord>> {
const state = await this.contract.getContractState({ evaluationOptions });
return state.records;
}
Expand All @@ -69,7 +71,7 @@ export class ANT implements ANTContract {
evaluationOptions,
}: {
evaluationOptions?: EvaluationOptions | Record<string, never> | undefined;
}): Promise<string> {
} = {}): Promise<string> {
const state = await this.contract.getContractState({ evaluationOptions });
return state.owner;
}
Expand All @@ -78,7 +80,7 @@ export class ANT implements ANTContract {
evaluationOptions,
}: {
evaluationOptions?: EvaluationOptions | Record<string, never> | undefined;
}): Promise<string[]> {
} = {}): Promise<string[]> {
const state = await this.contract.getContractState({ evaluationOptions });
return state.controllers;
}
Expand All @@ -87,7 +89,7 @@ export class ANT implements ANTContract {
evaluationOptions,
}: {
evaluationOptions?: EvaluationOptions | Record<string, never> | undefined;
}): Promise<string> {
} = {}): Promise<string> {
const state = await this.contract.getContractState({ evaluationOptions });
return state.name;
}
Expand All @@ -96,7 +98,7 @@ export class ANT implements ANTContract {
evaluationOptions,
}: {
evaluationOptions?: EvaluationOptions | Record<string, never> | undefined;
}): Promise<string> {
} = {}): Promise<string> {
const state = await this.contract.getContractState({ evaluationOptions });
return state.ticker;
}
Expand All @@ -105,7 +107,7 @@ export class ANT implements ANTContract {
evaluationOptions,
}: {
evaluationOptions?: EvaluationOptions | Record<string, never> | undefined;
}): Promise<Record<string, number>> {
} = {}): Promise<Record<string, number>> {
const state = await this.contract.getContractState({ evaluationOptions });
return state.balances;
}
Expand Down

0 comments on commit 0c8b55d

Please sign in to comment.