mirror of
https://github.com/oceanprotocol/ocean.js.git
synced 2024-11-26 20:39:05 +01:00
wip: add unit test
This commit is contained in:
parent
f59f3da675
commit
995a7f0ef9
@ -10,3 +10,4 @@ export * from './SignatureUtils'
|
|||||||
export * from './TokenUtils'
|
export * from './TokenUtils'
|
||||||
export * from './ProviderErrors'
|
export * from './ProviderErrors'
|
||||||
export * from './OrderUtils'
|
export * from './OrderUtils'
|
||||||
|
export * from './Assets'
|
||||||
|
27
test/unit/AssetUtils.ts
Normal file
27
test/unit/AssetUtils.ts
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
import { assert } from 'chai'
|
||||||
|
import { KNOWN_CONFIDENTIAL_EVMS } from '../../src/config'
|
||||||
|
import { isConfidentialEVM } from '../../src/utils'
|
||||||
|
|
||||||
|
describe('Asste utils (createAsset)', () => {
|
||||||
|
it('should check if confidential EVM', async () => {
|
||||||
|
for (const name of KNOWN_CONFIDENTIAL_EVMS.names) {
|
||||||
|
assert(
|
||||||
|
isConfidentialEVM(name) === true,
|
||||||
|
`Network: "${name}" is not a confidental EVM`
|
||||||
|
)
|
||||||
|
}
|
||||||
|
for (const chain of KNOWN_CONFIDENTIAL_EVMS.chainIds) {
|
||||||
|
assert(
|
||||||
|
isConfidentialEVM(chain) === true,
|
||||||
|
`Chain Id: "${chain}" is not a confidental EVM`
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
// optimism sepolia
|
||||||
|
// 11155420
|
||||||
|
assert(
|
||||||
|
isConfidentialEVM(11155420) === false,
|
||||||
|
`Chain Id: "11155420" is wrongly considered a confidental EVM`
|
||||||
|
)
|
||||||
|
})
|
||||||
|
})
|
Loading…
x
Reference in New Issue
Block a user