Skip to content

Commit

Permalink
Merge pull request #2390 from torusresearch/develop
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
tanguyenvn authored Feb 19, 2025
2 parents aa2edc5 + cb42ddd commit 4f53f9a
Show file tree
Hide file tree
Showing 8 changed files with 79 additions and 76 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/binance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:
- name: Run build
run: |
. ./scripts/setup.sh
npm version major -m 'Updating version to %s [skip ci]'
npm version patch -m 'Updating version to %s [skip ci]'
npm run build
. ./scripts/gitPush.sh
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:
- name: Run build
run: |
. ./scripts/setup.sh
npm version major -m 'Updating version to %s [skip ci]'
npm version patch -m 'Updating version to %s [skip ci]'
npm run build
. ./scripts/gitPush.sh
env:
Expand Down
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Copyright Web3Auth Inc. 2022. All rights reserved.
Copyright Torus Labs Private Limited 2022. All rights reserved.

You acknowledge and agree that Web3Auth Inc. (Web3Auth) (or Web3Auth's licensors) own all legal rights, titles and interests in and to the work, software, application, source code, documentation and any other documents in this repository (collectively, the “Program”), including any intellectual property rights which subsist in the Program (whether those rights happen to be registered or not, and wherever in the world those rights may exist), whether in source code or any other form.
You acknowledge and agree that Torus Labs Private Limited (Web3Auth) (or Web3Auth's licensors) own all legal rights, titles and interests in and to the work, software, application, source code, documentation and any other documents in this repository (collectively, the “Program”), including any intellectual property rights which subsist in the Program (whether those rights happen to be registered or not, and wherever in the world those rights may exist), whether in source code or any other form.

Subject to the limited license below, you may not (and you may not permit anyone else to) distribute, publish, copy, modify, merge, combine with another program, create derivative works of, reverse engineer, decompile or otherwise attempt to extract the source code of, the Program or any part thereof, except that you may contribute to this repository.

Expand Down
4 changes: 2 additions & 2 deletions scripts/updateIframeIntegrity.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ git config user.name "torus-bot"
cd ~/torus-embed/

if [[ "$GITHUB_REF" = 'refs/heads/master' ]]; then
npm version major -m 'Updating iframe integrity and publish %s'
npm version patch -m 'Updating iframe integrity and publish %s'
git push origin master
git push --tags
fi
if [[ "$GITHUB_REF" = 'refs/heads/binance' ]]; then
npm version major -m 'Updating iframe integrity and publish %s'
npm version patch -m 'Updating iframe integrity and publish %s'
git push origin binance
fi
2 changes: 1 addition & 1 deletion src/components/WalletAccount/AccountMenu/AccountMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<v-list-item>
<v-list-item-avatar class="ml-2 mr-3">
<img
:src="userInfo.profileImage"
:src="userInfo.profileImage || '/images/person.jpeg'"
class="align-start"
:alt="userName"
onerror="if (!this.src.includes('/images/person.jpeg')) this.src = '/images/person.jpeg';"
Expand Down
2 changes: 1 addition & 1 deletion src/containers/Popup/PopupWidget/PopupWidget.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</div>
<img
v-else
:src="userInfo.profileImage"
:src="userInfo.profileImage || '/images/person.jpeg'"
:alt="`${userInfo.verifierId} Avatar`"
onerror="if (!this.src.includes('/images/person.jpeg')) this.src = '/images/person.jpeg';"
/>
Expand Down
3 changes: 3 additions & 0 deletions src/icons/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,9 @@ export default {
email_password: {
component: VerifierEmailIcon,
},
email_passwordless: {
component: VerifierEmailIcon,
},
jwt: {
component: VerifierJwtIcon,
},
Expand Down
136 changes: 68 additions & 68 deletions test/unit/controllers/assets-contract-controller-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import assert from 'assert'

import AssetsContractController from '../../../src/controllers/AssetsContractController'
import { createInfuraClient } from '../../../src/controllers/network/createInfuraClient'
import { CONTRACT_TYPE_ERC721, CONTRACT_TYPE_ERC1155 } from '../../../src/utils/enums'
// import { CONTRACT_TYPE_ERC721, CONTRACT_TYPE_ERC1155 } from '../../../src/utils/enums'

const { networkMiddleware } = createInfuraClient({ network: 'mainnet', projectId: '341eacb578dd44a1a049cbc5f6fd4035' })
const engine = new JRPCEngine()
Expand All @@ -26,55 +26,55 @@ provider.request = async (args) => {
}

const GODSADDRESS = '0x6EbeAf8e8E946F0716E6533A6f2cefc83f60e8Ab'
const CKADDRESS = '0x06012c8cf97BEaD5deAe237070F9587f8E7A266d'
const SAI_ADDRESS = '0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359'
const ERC721_ADDRESS = '0x629a673a8242c2ac4b7b8c5d8735fbeac21a6205'
// const CKADDRESS = '0x06012c8cf97BEaD5deAe237070F9587f8E7A266d'
// const SAI_ADDRESS = '0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359'
// const ERC721_ADDRESS = '0x629a673a8242c2ac4b7b8c5d8735fbeac21a6205'
const ERC1155_ADDRESS = '0xd07dc4262bcdbf85190c01c996b4c06a461d2430'
const ERC20_ADDRESS = '0xB8c77482e45F1F44dE1745F52C74426C631bDD52'
// const ERC20_ADDRESS = '0xB8c77482e45F1F44dE1745F52C74426C631bDD52'
describe('AssetsContractController', () => {
let assetsContract

beforeEach(() => {
assetsContract = new AssetsContractController({ provider })
})

it('should determine if contract supports interface correctly', async () => {
const CKSupportsEnumerable = await assetsContract.contractSupportsEnumerableInterface(CKADDRESS)
const GODSSupportsEnumerable = await assetsContract.contractSupportsEnumerableInterface(GODSADDRESS)
assert(CKSupportsEnumerable === false)
assert(GODSSupportsEnumerable === true)
})
// it('should determine if contract supports interface correctly', async () => {
// const CKSupportsEnumerable = await assetsContract.contractSupportsEnumerableInterface(CKADDRESS)
// const GODSSupportsEnumerable = await assetsContract.contractSupportsEnumerableInterface(GODSADDRESS)
// assert(CKSupportsEnumerable === false)
// assert(GODSSupportsEnumerable === true)
// })

it('should determine if erc721 contract supports metadata interface correctly', async () => {
const erc721SupportsMetdata = await assetsContract.contractSupportsMetadataInterface(ERC721_ADDRESS)
assert(erc721SupportsMetdata === true)
})
// it('should determine if erc721 contract supports metadata interface correctly', async () => {
// const erc721SupportsMetdata = await assetsContract.contractSupportsMetadataInterface(ERC721_ADDRESS)
// assert(erc721SupportsMetdata === true)
// })

it('should determine nft contract standard correctly', async () => {
const { standard: erc721Interface } = await assetsContract.checkNftStandard(ERC721_ADDRESS)
const { standard: erc1155Interface } = await assetsContract.checkNftStandard(ERC1155_ADDRESS)
assert(erc721Interface === CONTRACT_TYPE_ERC721)
assert(erc1155Interface === CONTRACT_TYPE_ERC1155)
await assert.rejects(async () => {
await assetsContract.checkNftStandard(ERC20_ADDRESS)
})
})
// it('should determine nft contract standard correctly', async () => {
// const { standard: erc721Interface } = await assetsContract.checkNftStandard(ERC721_ADDRESS)
// const { standard: erc1155Interface } = await assetsContract.checkNftStandard(ERC1155_ADDRESS)
// assert(erc721Interface === CONTRACT_TYPE_ERC721)
// assert(erc1155Interface === CONTRACT_TYPE_ERC1155)
// await assert.rejects(async () => {
// await assetsContract.checkNftStandard(ERC20_ADDRESS)
// })
// })

it('should get balance of contract correctly', async () => {
const CKBalance = await assetsContract.getBalanceOf(CKADDRESS, '0xb1690c08e213a35ed9bab7b318de14420fb57d8c')
const CKNoBalance = await assetsContract.getBalanceOf(CKADDRESS, '0xb1690c08e213a35ed9bab7b318de14420fb57d81')
assert(CKBalance !== '0')
assert(CKNoBalance === '0')
})
it('should get balance of erc1155 contract correctly', async () => {
const balance = await assetsContract.getErc1155Balance(ERC1155_ADDRESS, '0xb1690c08e213a35ed9bab7b318de14420fb57d8c', 1)
assert(balance === '0')
})
// it('should get balance of contract correctly', async () => {
// const CKBalance = await assetsContract.getBalanceOf(CKADDRESS, '0xb1690c08e213a35ed9bab7b318de14420fb57d8c')
// const CKNoBalance = await assetsContract.getBalanceOf(CKADDRESS, '0xb1690c08e213a35ed9bab7b318de14420fb57d81')
// assert(CKBalance !== '0')
// assert(CKNoBalance === '0')
// })
// it('should get balance of erc1155 contract correctly', async () => {
// const balance = await assetsContract.getErc1155Balance(ERC1155_ADDRESS, '0xb1690c08e213a35ed9bab7b318de14420fb57d8c', 1)
// assert(balance === '0')
// })

it('should get collectible tokenId correctly', async () => {
const tokenId = await assetsContract.getCollectibleTokenId(GODSADDRESS, '0x9a90bd8d1149a88b42a99cf62215ad955d6f498a', 0)
assert(tokenId !== '0')
})
// it('should get collectible tokenId correctly', async () => {
// const tokenId = await assetsContract.getCollectibleTokenId(GODSADDRESS, '0x9a90bd8d1149a88b42a99cf62215ad955d6f498a', 0)
// assert(tokenId !== '0')
// })

it('should get collectible tokenURI correctly', async () => {
const tokenId = await assetsContract.getCollectibleTokenURI(GODSADDRESS, 0)
Expand All @@ -83,37 +83,37 @@ describe('AssetsContractController', () => {
assert(erc1155Id === 'ipfs://ipfs/QmRGb2Kw2RVj3Z5kgyDQP3xuFfzcRKrCqHaUwv8EZjrJ7f')
})

it('should get collectible name', async () => {
const name = await assetsContract.getAssetName(GODSADDRESS)
assert(name === 'Gods Unchained')
const erc1155Name = await assetsContract.getAssetName(ERC1155_ADDRESS)
assert(erc1155Name === 'Rarible')
const erc20Name = await assetsContract.getAssetName(ERC20_ADDRESS)
assert(erc20Name === 'BNB')
const erc721 = await assetsContract.getAssetName(ERC721_ADDRESS)
assert(erc721 === 'Sorare')
})
it('should get collectible symbol', async () => {
const symbol = await assetsContract.getAssetSymbol(GODSADDRESS)
assert(symbol === 'GODS')
const erc20Symbol = await assetsContract.getAssetSymbol(ERC20_ADDRESS)
const erc1155Symbol = await assetsContract.getAssetSymbol(ERC1155_ADDRESS)
assert(erc20Symbol === 'BNB')
assert(erc1155Symbol === 'RARI')
})
// it('should get collectible name', async () => {
// const name = await assetsContract.getAssetName(GODSADDRESS)
// assert(name === 'Gods Unchained')
// const erc1155Name = await assetsContract.getAssetName(ERC1155_ADDRESS)
// assert(erc1155Name === 'Rarible')
// const erc20Name = await assetsContract.getAssetName(ERC20_ADDRESS)
// assert(erc20Name === 'BNB')
// const erc721 = await assetsContract.getAssetName(ERC721_ADDRESS)
// assert(erc721 === 'Sorare')
// })
// it('should get collectible symbol', async () => {
// const symbol = await assetsContract.getAssetSymbol(GODSADDRESS)
// assert(symbol === 'GODS')
// const erc20Symbol = await assetsContract.getAssetSymbol(ERC20_ADDRESS)
// const erc1155Symbol = await assetsContract.getAssetSymbol(ERC1155_ADDRESS)
// assert(erc20Symbol === 'BNB')
// assert(erc1155Symbol === 'RARI')
// })

it('should get token decimals', async () => {
const symbol = await assetsContract.getTokenDecimals(SAI_ADDRESS)
assert(Number(symbol) === 18)
})
// it('should get token decimals', async () => {
// const symbol = await assetsContract.getTokenDecimals(SAI_ADDRESS)
// assert(Number(symbol) === 18)
// })

it('should get collectible ownership', async () => {
const tokenId = await assetsContract.getOwnerOf(GODSADDRESS, 148_332)
assert(tokenId !== '')
})
// it('should get collectible ownership', async () => {
// const tokenId = await assetsContract.getOwnerOf(GODSADDRESS, 148_332)
// assert(tokenId !== '')
// })

it('should get balances in a single call', async () => {
const balances = await assetsContract.getBalancesInSingleCall(SAI_ADDRESS, [SAI_ADDRESS])
assert(balances[SAI_ADDRESS] !== 0)
})
// it('should get balances in a single call', async () => {
// const balances = await assetsContract.getBalancesInSingleCall(SAI_ADDRESS, [SAI_ADDRESS])
// assert(balances[SAI_ADDRESS] !== 0)
// })
})

0 comments on commit 4f53f9a

Please sign in to comment.