Skip to content

Commit

Permalink
make computeFee return BNS
Browse files Browse the repository at this point in the history
  • Loading branch information
lucas-sdl committed Apr 18, 2024
1 parent 84f1872 commit 4271946
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -439,13 +439,18 @@ export class ConsentFactoryContract

public computeFee(
slot: BigNumberString,
): ResultAsync<bigint, ConsentFactoryContractError | BlockchainCommonErrors> {
): ResultAsync<
BigNumberString,
ConsentFactoryContractError | BlockchainCommonErrors
> {
return ResultAsync.fromPromise(
this.contract.computeFee(slot) as Promise<bigint>,
(e) => {
return this.generateError(e, "Unable to call computeFee()");
},
);
).map((fee) => {
return BigNumberString(fee.toString());
});
}

// External function meant to be called by anyone to boot an expired listing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export interface IContentFactoryContract<T> extends IBaseContract {

computeFee(
slot: BigNumberString,
): ResultAsync<bigint, T | BlockchainCommonErrors>;
): ResultAsync<BigNumberString, T | BlockchainCommonErrors>;

// External function meant to be called by anyone to boot an expired listing
removeExpiredListings(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,10 @@ export class ConsentFactoryContractWrapper

public computeFee(
slot: BigNumberString,
): ResultAsync<bigint, ConsentFactoryContractError | BlockchainCommonErrors> {
): ResultAsync<
BigNumberString,
ConsentFactoryContractError | BlockchainCommonErrors
> {
return this.fallback(
() => this.primary.computeFee(slot),
() => this.secondary?.computeFee(slot),
Expand Down

0 comments on commit 4271946

Please sign in to comment.