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

revert rename deployERC20 to deployDatatoken

This commit is contained in:
Miquel A. Cabot 2022-06-10 13:24:45 +02:00
parent ba8ea90a20
commit 429cce838e
4 changed files with 6 additions and 6 deletions

View File

@ -14,7 +14,7 @@ export interface MetadataAndTokenURI {
export interface NftRoles {
manager: boolean
deployDatatoken: boolean
deployERC20: boolean
updateMetadata: boolean
store: boolean
}

View File

@ -621,7 +621,7 @@ export class Datatoken extends SmartContract {
const isNftOwner = nftAddress && (await this.nft.getNftOwner(nftAddress)) === address
const nftPermissions =
nftAddress && !isNftOwner && (await this.nft.getNftPermissions(nftAddress, address))
const isDatatokenDeployer = nftPermissions?.deployDatatoken
const isDatatokenDeployer = nftPermissions?.deployERC20
if (!isPaymentManager && !isNftOwner && !isDatatokenDeployer) {
throw new Error(`Caller is not Fee Manager, owner or Datatoken Deployer`)
}
@ -1129,7 +1129,7 @@ export class Datatoken extends SmartContract {
return nftAddress
}
/** Returns true if address has deployDatatoken role
/** Returns true if address has deployERC20 role
* @param {String} dtAddress Datatoken adress
* @param {String} dtAddress Datatoken adress
* @return {Promise<boolean>}

View File

@ -81,7 +81,7 @@ export class Nft extends SmartContract {
symbol?: string,
templateIndex?: number
): Promise<string> {
if ((await this.getNftPermissions(nftAddress, address)).deployDatatoken !== true) {
if ((await this.getNftPermissions(nftAddress, address)).deployERC20 !== true) {
throw new Error(`Caller is not DatatokenDeployer`)
}
if (!templateIndex) templateIndex = 1
@ -316,7 +316,7 @@ export class Nft extends SmartContract {
if (
(await this.getNftPermissions(nftAddress, address)).manager !== true ||
(address === datatokenDeployer &&
(await this.getNftPermissions(nftAddress, address)).deployDatatoken !== true)
(await this.getNftPermissions(nftAddress, address)).deployERC20 !== true)
) {
throw new Error(`Caller is not Manager nor DatatokenDeployer`)
}

View File

@ -303,7 +303,7 @@ describe('Datatoken', () => {
it('#setPaymentCollector - should set a new paymentCollector, if ERC 20 DEPLOYER', async () => {
assert(
(await nftDatatoken.getNftPermissions(nftAddress, datatokenDeployer))
.deployDatatoken === true
.deployERC20 === true
)
await datatoken.setPaymentCollector(datatokenAddress, datatokenDeployer, user3)