Skip to content

Commit

Permalink
fix: remove unprecise price calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
H34D committed Nov 7, 2023
1 parent 939a561 commit 08981b8
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 22 deletions.
2 changes: 1 addition & 1 deletion src/contracts/contract-modules/identity.ts
Expand Up @@ -146,7 +146,7 @@ export class Identity extends MasaSBTModuleBase {
}

// execute tx
return await purchaseIdentityAndName(...purchaseIdentityAndNameParameters, {
return purchaseIdentityAndName(...purchaseIdentityAndNameParameters, {
...purchaseIdentityAndNameOverrides,
gasLimit,
});
Expand Down
6 changes: 2 additions & 4 deletions src/contracts/contract-modules/soul-name.ts
Expand Up @@ -60,7 +60,7 @@ export class SoulName extends MasaModuleBase {
authorityAddress: string,
signature: string,
receiver?: string,
): Promise<ContractTransaction & { price: BigNumber }> => {
): Promise<ContractTransaction> => {
const to = receiver || (await this.masa.config.signer.getAddress());

const domain: TypedDataDomain = await generateSignatureDomain(
Expand Down Expand Up @@ -154,12 +154,10 @@ export class SoulName extends MasaModuleBase {
}

// execute
const execution = await purchaseName(...purchaseNameParameters, {
return purchaseName(...purchaseNameParameters, {
...purchaseNameOverrides,
gasLimit,
});

return { ...execution, price };
};

/**
Expand Down
8 changes: 1 addition & 7 deletions src/interface/token/soul-name.ts
@@ -1,8 +1,7 @@
import type { BigNumber, ContractTransaction } from "ethers";
import type { BigNumber } from "ethers";

import { SoulNameErrorCodes } from "../../collections";
import type { BaseResult } from "../base-result";
import { PaymentMethod } from "../tokens";

export interface Attribute {
display_type?: string;
Expand Down Expand Up @@ -48,11 +47,6 @@ export interface SoulNameResultBase extends BaseResult {

export interface CreateSoulNameResult extends SoulNameResultBase {
soulName?: string;
// todo, remove this. It does not belong here
metadata?: ContractTransaction & {
price?: BigNumber;
paymentMethod: PaymentMethod;
};
}

export interface SoulNameMetadataStoreResult extends SoulNameResultBase {
Expand Down
5 changes: 0 additions & 5 deletions src/modules/identity/create.ts
Expand Up @@ -183,18 +183,13 @@ export const purchaseIdentityWithSoulName = async (
}

if (identityId && tokenId) {
const metadata = {
...purchaseInformation,
paymentMethod,
};
return {
success: true,
errorCode: SoulNameErrorCodes.NoError,
message: "",
tokenId,
identityId,
soulName,
metadata,
};
}
}
Expand Down
5 changes: 0 additions & 5 deletions src/modules/soul-name/create.ts
Expand Up @@ -92,17 +92,12 @@ const purchaseSoulName = async (
}

if (tokenId) {
const metadata = {
...purchaseInformation,
paymentMethod,
};
return {
success: true,
message: "",
errorCode: SoulNameErrorCodes.NoError,
tokenId,
soulName,
metadata,
};
}
}
Expand Down

0 comments on commit 08981b8

Please sign in to comment.