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

remove hardhat deps

This commit is contained in:
paulo-ocean 2024-09-09 12:48:06 +01:00
parent 13827001e8
commit 5611eab817
3 changed files with 355 additions and 1835 deletions

2154
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -53,13 +53,11 @@
"web3": "^1.8.0"
},
"dependencies": {
"@nomiclabs/hardhat-ethers": "^2.2.3",
"@oceanprotocol/contracts": "^2.2.0",
"cross-fetch": "^4.0.0",
"crypto-js": "^4.1.1",
"decimal.js": "^10.4.1",
"ethers": "^5.7.2",
"hardhat": "^2.22.10"
"ethers": "^5.7.2"
},
"devDependencies": {
"@truffle/hdwallet-provider": "^2.0.14",

View File

@ -1,8 +1,21 @@
import { assert } from 'chai'
import { KNOWN_CONFIDENTIAL_EVMS } from '../../src/config'
import { calculateTemplateIndex, isConfidentialEVM } from '../../src/utils'
import { provider, getAddresses } from '../config'
import {
calculateActiveTemplateIndex,
calculateTemplateIndex,
isConfidentialEVM
} from '../../src/utils'
import { Signer } from 'ethers/lib/ethers'
let nftOwner: Signer
let addresses: any
describe('Asset utils (createAsset)', () => {
before(async () => {
nftOwner = (await provider.getSigner(0)) as Signer
addresses = await getAddresses()
})
it('should check if confidential EVM', async () => {
for (const network of KNOWN_CONFIDENTIAL_EVMS.networks) {
network.name.map((networkName) => {
@ -79,4 +92,21 @@ describe('Asset utils (createAsset)', () => {
)
assert(notOkIndexNonConfidential === -1, 'Template 3 should not exist on sepolia!')
})
// checking if active by connecting to the smart contract as well
it('V2 - should get correct template index from contract artifacts (using template ID as template)', async () => {
const okTemplate = await calculateActiveTemplateIndex(
nftOwner,
addresses.ERC721Factory,
3
)
assert(okTemplate === 3, 'wrong template index, should be index 3!')
const wrongOne = await calculateActiveTemplateIndex(
nftOwner,
addresses.ERC721Factory,
6
)
assert(wrongOne === -1, 'wrong template index, should only exist 3!')
})
})