Skip to content

Commit

Permalink
feat: improve test cases for assetOrVC(only DID Spaces) (#245)
Browse files Browse the repository at this point in the history
  • Loading branch information
skypesky committed Jan 30, 2024
1 parent 948138a commit 9a5d441
Show file tree
Hide file tree
Showing 6 changed files with 2,034 additions and 72 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.36.74 (January 30, 2024)

- feat: improve test cases for assetOrVC(only DID Spaces)

## 0.36.73 (January 22, 2024)

- feat: add assetOrVC test case for did spaces
Expand Down
9 changes: 9 additions & 0 deletions api/routes/auth/test-nft-or-vc-filter-only-did-spaces.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const { fromPublicKey } = require('@ocap/wallet');
const { toAddress, fromBase58, toBuffer } = require('@ocap/util');
const { toTypeInfo } = require('@arcblock/did');
const { getDidSpacesInfoByClaims } = require('@abtnode/auth/lib/util/spaces');
const { verifyAssetClaim } = require('../../libs/util');
const { wallet } = require('../../libs/auth');

Expand Down Expand Up @@ -70,6 +71,14 @@ module.exports = {
throw new Error('Neither NFT nor VC is provided');
}

const didSpacesInfo = await getDidSpacesInfoByClaims({ claims });

// eslint-disable-next-line no-console
console.log({ didSpacesInfo });
if (!didSpacesInfo) {
throw new Error('DidSpaces is not found');
}

if (asset) {
logger.info('claim.assetOrVC.onAuth.asset', asset);

Expand Down
2 changes: 1 addition & 1 deletion blocklet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ files:
- blocklet.md
- README.md
- build
version: 0.36.73
version: 0.36.74
author:
name: ArcBlock
email: blocklet@arcblock.io
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"blocklet.yml",
"README.md"
],
"version": "0.36.73",
"version": "0.36.74",
"author": "wangshijun <shijun@arcblock.io> https://github.com/wangshijun",
"keywords": [
"dapp",
Expand All @@ -28,6 +28,7 @@
"email": "shijun@arcblock.io"
},
"dependencies": {
"@abtnode/auth": "^1.16.23-beta-abdda301",
"@arcblock/did": "^1.18.108",
"@arcblock/did-auth": "^1.18.108",
"@arcblock/did-auth-storage-nedb": "^1.7.1",
Expand Down Expand Up @@ -111,7 +112,7 @@
"workbox-webpack-plugin": "^6.5.4"
},
"scripts": {
"dev": "blocklet dev",
"dev": "blocklet dev --open",
"lint": "eslint src api",
"lint:fix": "eslint src api --fix",
"precommit": "npm run lint",
Expand Down Expand Up @@ -179,4 +180,4 @@
"@ocap/wallet": "1.18.108"
},
"license": "Apache-2.0"
}
}
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.36.73
0.36.74

0 comments on commit 9a5d441

Please sign in to comment.