diff --git a/src/lib/classes/lsp7-digital-asset.spec.ts b/src/lib/classes/lsp7-digital-asset.spec.ts index 43ab0953..55781f97 100644 --- a/src/lib/classes/lsp7-digital-asset.spec.ts +++ b/src/lib/classes/lsp7-digital-asset.spec.ts @@ -1,3 +1,4 @@ +import { SUPPORTED_HASH_FUNCTION_HASHES } from '@erc725/erc725.js/build/main/src/constants/constants'; import { ERC725YDataKeys } from '@lukso/lsp-smart-contracts'; import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'; import { providers } from 'ethers'; @@ -11,7 +12,6 @@ import { } from '../../../build/main/src/index'; import { testDeployWithSpecifiedCreators } from '../../../test/digital-asset.utils'; import { lsp4DigitalAsset } from '../../../test/lsp4-digital-asset.mock'; -import { JSONURL_KNOWN_HASH_FUNCTIONS } from '../helpers/config.helper'; import { ProxyDeployer } from './proxy-deployer'; @@ -232,7 +232,7 @@ describe('LSP7DigitalAsset', () => { const data = await digitalAsset.getData(ERC725YDataKeys.LSP4.LSP4Metadata); - expect(data.startsWith(JSONURL_KNOWN_HASH_FUNCTIONS['keccak256(utf8)'])).toBe(true); + expect(data.startsWith(SUPPORTED_HASH_FUNCTION_HASHES.HASH_KECCAK256_UTF8)).toBe(true); expect(data).toEqual(expectedLSP4Value); }); it('should have correct name and symbol set', async () => { diff --git a/src/lib/classes/lsp8-identifiable-digital-asset.spec.ts b/src/lib/classes/lsp8-identifiable-digital-asset.spec.ts index e597b49c..7528ad89 100644 --- a/src/lib/classes/lsp8-identifiable-digital-asset.spec.ts +++ b/src/lib/classes/lsp8-identifiable-digital-asset.spec.ts @@ -1,3 +1,4 @@ +import { SUPPORTED_HASH_FUNCTION_HASHES } from '@erc725/erc725.js/build/main/src/constants/constants'; import { ERC725YDataKeys, LSP8_TOKEN_ID_TYPES } from '@lukso/lsp-smart-contracts'; import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'; import { providers } from 'ethers'; @@ -12,7 +13,6 @@ import { } from '../../../build/main/src/index'; import { testDeployWithSpecifiedCreators } from '../../../test/digital-asset.utils'; import { lsp4DigitalAsset } from '../../../test/lsp4-digital-asset.mock'; -import { JSONURL_KNOWN_HASH_FUNCTIONS } from '../helpers/config.helper'; import { ProxyDeployer } from './proxy-deployer'; @@ -295,7 +295,7 @@ describe('LSP8IdentifiableDigitalAsset', () => { const data = await digitalAsset.getData(ERC725YDataKeys.LSP4.LSP4Metadata); - expect(data.startsWith(JSONURL_KNOWN_HASH_FUNCTIONS['keccak256(utf8)'])).toBe(true); + expect(data.startsWith(SUPPORTED_HASH_FUNCTION_HASHES.HASH_KECCAK256_UTF8)).toBe(true); expect(data).toEqual(expectedLSP4Value); }); diff --git a/src/lib/classes/universal-profile.spec.ts b/src/lib/classes/universal-profile.spec.ts index 01728d9c..6d7125e3 100644 --- a/src/lib/classes/universal-profile.spec.ts +++ b/src/lib/classes/universal-profile.spec.ts @@ -1,4 +1,5 @@ import { ERC725 } from '@erc725/erc725.js'; +import { SUPPORTED_HASH_FUNCTION_HASHES } from '@erc725/erc725.js/build/main/src/constants/constants'; import { ALL_PERMISSIONS, ERC725YDataKeys } from '@lukso/lsp-smart-contracts'; import KeyManagerContract from '@lukso/lsp-smart-contracts/artifacts/LSP6KeyManager.json'; import UniversalProfileContract from '@lukso/lsp-smart-contracts/artifacts/UniversalProfile.json'; @@ -19,7 +20,6 @@ import { testUPDeployment, } from '../../../test/test.utils'; import { UniversalProfile } from '../../../types/ethers-v5'; -import { JSONURL_KNOWN_HASH_FUNCTIONS } from '../helpers/config.helper'; import { getDeployedByteCode } from '../helpers/deployment.helper'; import { ContractNames, DeployedUniversalProfileContracts, DeploymentEvent } from '../interfaces'; @@ -67,7 +67,9 @@ describe('UniversalProfile', () => { const lsp3Data = await universalProfile.getData(ERC725YDataKeys.LSP3.LSP3Profile); - expect(lsp3Data.startsWith(JSONURL_KNOWN_HASH_FUNCTIONS['keccak256(utf8)'])).toBe(true); + expect(lsp3Data.startsWith(SUPPORTED_HASH_FUNCTION_HASHES.HASH_KECCAK256_UTF8)).toBe( + true + ); expect(lsp3Data).toEqual(expectedLSP3Value); }); }); diff --git a/src/lib/helpers/config.helper.ts b/src/lib/helpers/config.helper.ts index 2f7b98c6..8eb90b54 100644 --- a/src/lib/helpers/config.helper.ts +++ b/src/lib/helpers/config.helper.ts @@ -15,10 +15,5 @@ export const defaultUploadOptions: UploadOptions = { export const DEFAULT_CONTRACT_VERSION = lspSmartContractsVersion; -// TODO: add this constant inside the `@lukso/lsp-smart-contracts` package -export const JSONURL_KNOWN_HASH_FUNCTIONS = { - 'keccak256(utf8)': '0x6f357c6a', -}; - export const GAS_PRICE = 10_000_000_000; export const GAS_BUFFER = 100_000;