1
0
mirror of https://github.com/oceanprotocol/ocean.js.git synced 2024-11-26 20:39:05 +01:00

Merge branch 'issue-1367-fix-disableTokenTemplate-and-reactivateTokenTemplate-errors' into issue-1348-rewrite-nftfactory-test

This commit is contained in:
Miquel A. Cabot 2022-03-24 10:32:31 +01:00
commit b403471031

View File

@ -492,14 +492,14 @@ export class NftFactory {
if ((await this.getOwner()) !== address) { if ((await this.getOwner()) !== address) {
throw new Error(`Caller is not Factory Owner`) throw new Error(`Caller is not Factory Owner`)
} }
if (templateIndex > (await this.getCurrentNFTTemplateCount())) { if (templateIndex > (await this.getCurrentTokenTemplateCount())) {
throw new Error(`Template index doesnt exist`) throw new Error(`Template index doesnt exist`)
} }
if (templateIndex === 0) { if (templateIndex === 0) {
throw new Error(`Template index cannot be ZERO`) throw new Error(`Template index cannot be ZERO`)
} }
if ((await this.getNFTTemplate(templateIndex)).isActive === false) { if ((await this.getTokenTemplate(templateIndex)).isActive === false) {
throw new Error(`Template is already disabled`) throw new Error(`Template is already disabled`)
} }
const estGas = await this.estGasDisableTokenTemplate(address, templateIndex) const estGas = await this.estGasDisableTokenTemplate(address, templateIndex)
@ -551,7 +551,7 @@ export class NftFactory {
if ((await this.getOwner()) !== address) { if ((await this.getOwner()) !== address) {
throw new Error(`Caller is not Factory Owner`) throw new Error(`Caller is not Factory Owner`)
} }
if (templateIndex > (await this.getCurrentNFTTemplateCount())) { if (templateIndex > (await this.getCurrentTokenTemplateCount())) {
throw new Error(`Template index doesnt exist`) throw new Error(`Template index doesnt exist`)
} }