Skip to content

Commit

Permalink
chore: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
aaitor committed Nov 9, 2023
1 parent 177dda2 commit 31aec9c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
4 changes: 4 additions & 0 deletions integration/external/Services_NFT1155.e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,8 @@ describe('Gate-keeping of Web Services using NFT ERC-1155 End-to-End', () => {
tokenId: subscriptionDDO.shortId(),
duration: 0, // Doesnt expire
amount: costServiceInCredits, // The cost of accessing the service
maxCreditsToCharge: 2n,
minCreditsToCharge: 1n,
nftTransfer,
},
},
Expand Down Expand Up @@ -537,6 +539,7 @@ describe('Gate-keeping of Web Services using NFT ERC-1155 End-to-End', () => {
it('should be able to retrieve services associated with a subscription filtering by endpoints', async () => {
const result = await nevermined.search.servicesBySubscription(
subscriptionDDO.id,
NeverminedNFT1155Type.nft1155Credit,
endpointsFilter,
)
assert.equal(result.totalResults.value, 1)
Expand All @@ -553,6 +556,7 @@ describe('Gate-keeping of Web Services using NFT ERC-1155 End-to-End', () => {
it('should not be able to retrieve any services associated with a subscription filtering by endpoints which do not exist', async () => {
const result = await nevermined.search.servicesBySubscription(
subscriptionDDO.id,
NeverminedNFT1155Type.nft1155Credit,
endpointsFilter2,
)
assert.equal(result.totalResults.value, 0)
Expand Down
4 changes: 0 additions & 4 deletions src/keeper/contracts/templates/NFTAccessTemplate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,6 @@ export class NFTAccessTemplate extends BaseTemplate<NFTAccessTemplateParams, Ser
nftAccessService.attributes.main.nftAttributes,
)

console.log(`Track :: NFT Tokens to burn: ${amount}`)
console.log(JSON.stringify(nftAccessService.attributes.main.nftAttributes))
console.log(params)

const contractAddress = DDO.getNftContractAddressFromService(nftAccessService)

const tokenId = DDO.getTokenIdFromService(nftAccessService) || ddo.id
Expand Down
4 changes: 0 additions & 4 deletions src/models/NFTAttributes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,8 @@ export class NFTServiceAttributes {

if (dynamicAmount !== undefined) {
if (dynamicAmount > nftAttributes.maxCreditsToCharge) {
// TODO: Evaluate if thow an exception or return the max credits that can be charged
//throw new DynamicCreditsOverLimit(`The amount of credits to consume ${dynamicAmount} is higher than the max credits charged ${this.maxCreditsToCharge}`)
return nftAttributes.maxCreditsToCharge
} else if (dynamicAmount < nftAttributes.minCreditsToCharge) {
// TODO: Evaluate if thow an exception or return the min amount to be charged
//throw new DynamicCreditsUnderLimit(`The amount of credits to consume ${dynamicAmount} is lower than the min credits charged ${this.minCreditsToCharge}`)
nftAttributes.minCreditsToCharge
}
return dynamicAmount
Expand Down

0 comments on commit 31aec9c

Please sign in to comment.