Skip to content

Commit

Permalink
Remove comments and update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
danielailie committed Aug 14, 2023
1 parent 237c80a commit 336206e
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 13 deletions.
1 change: 1 addition & 0 deletions .jest/setEnvVars.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
process.env.DEPLOYER_ADDRESS = 'erd1qqqqqqqqqqqqqpgqut6lamz9dn480ytj8cmcwvydcu3lj55epltq9t9kam';
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,9 @@
],
"moduleDirectories": [
"node_modules"
],
"setupFiles": [
"<rootDir>/.jest/setEnvVars.js"
]
}
}
6 changes: 3 additions & 3 deletions src/modules/minters/minters-deployer.abi.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export class MintersDeployerAbiService {
private contract = new ContractLoader(MarketplaceUtils.deployerMintersAbiPath, MarketplaceUtils.deployerAbiInterface);

async deployMinter(request: DeployMinterRequest): Promise<TransactionNode> {
const contract = await this.contract.getContract('erd1qqqqqqqqqqqqqpgqut6lamz9dn480ytj8cmcwvydcu3lj55epltq9t9kam');
const contract = await this.contract.getContract(process.env.DEPLOYER_ADDRESS);

return contract.methodsExplicit
.createNftMinter([
Expand All @@ -27,7 +27,7 @@ export class MintersDeployerAbiService {
}

async pauseNftMinter(ownerAddress: string, request: UpgradeMinterRequest): Promise<TransactionNode> {
const contract = await this.contract.getContract('erd1qqqqqqqqqqqqqpgqut6lamz9dn480ytj8cmcwvydcu3lj55epltq9t9kam');
const contract = await this.contract.getContract(process.env.DEPLOYER_ADDRESS);

return contract.methodsExplicit
.pauseNftMinter([new AddressValue(new Address(request.minterAddress))])
Expand All @@ -38,7 +38,7 @@ export class MintersDeployerAbiService {
}

async resumeNftMinter(ownerAddress: string, request: UpgradeMinterRequest): Promise<TransactionNode> {
const contract = await this.contract.getContract('erd1qqqqqqqqqqqqqpgqut6lamz9dn480ytj8cmcwvydcu3lj55epltq9t9kam');
const contract = await this.contract.getContract(process.env.DEPLOYER_ADDRESS);

return contract.methodsExplicit
.resumeNftMinter([new AddressValue(new Address(request.minterAddress))])
Expand Down
12 changes: 3 additions & 9 deletions src/modules/minters/minters-mutations.resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,26 +27,20 @@ export class MintersMutationsResolver extends BaseResolver(MintersResponse) {
}

@Mutation(() => TransactionNode)
// @UseGuards(JwtOrNativeAuthGuard, GqlAdminAuthGuard)
@UseGuards(JwtOrNativeAuthGuard, GqlAdminAuthGuard)
async deployMinter(@Args('input') input: DeployMinterArgs): Promise<TransactionNode> {
return await this.minterDeployerService.deployMinter(DeployMinterRequest.fromArgs(input));
}

@Mutation(() => TransactionNode)
@UseGuards(JwtOrNativeAuthGuard, GqlAdminAuthGuard)
async pauseMinter(
@Args('input') input: UpgradeMinterArgs,
@AuthUser() user: UserAuthResult,
): Promise<TransactionNode> {
async pauseMinter(@Args('input') input: UpgradeMinterArgs, @AuthUser() user: UserAuthResult): Promise<TransactionNode> {
return await this.minterDeployerService.pauseNftMinter(user.address, UpgradeMinterRequest.fromArgs(input));
}

@Mutation(() => TransactionNode)
@UseGuards(JwtOrNativeAuthGuard, GqlAdminAuthGuard)
async resumeMinter(
@Args('input') input: UpgradeMinterArgs,
@AuthUser() user: UserAuthResult,
): Promise<TransactionNode> {
async resumeMinter(@Args('input') input: UpgradeMinterArgs, @AuthUser() user: UserAuthResult): Promise<TransactionNode> {
return await this.minterDeployerService.resumeNftMinter(user.address, UpgradeMinterRequest.fromArgs(input));
}
}
3 changes: 2 additions & 1 deletion test/jest-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@
"transform": {
"^.+\\.(t|j)s$": "ts-jest"
},
"coverageDirectory": "./coverage/unit"
"coverageDirectory": "./coverage/unit",
"setupFiles": ["<rootDir>/.jest/setEnvVars.js"]
}

0 comments on commit 336206e

Please sign in to comment.