fairDataSociety / fdp-contracts

Fair Data Protocol smart contracts and its utilities
4 stars 1 forks source link

feat(contracts): FDS Registrar specs passing with fdp-play dev environment #35

Closed molekilla closed 2 years ago

molekilla commented 2 years ago
nugaon commented 2 years ago

FDSRegistar test is failing on my side:

  6 passing (35s)
  1 failing

  1) FDSRegistrar
       "before all" hook for "should allow new registrations":
     HardhatError: HH700: Artifact for contract "ENSRegistry" not found. 
nugaon commented 2 years ago

when I try to run npm run build:image:

Nothing to compile
No need to generate any newer typings.
Deploying contracts to the fdp-play environment...
HardhatError: HH700: Artifact for contract "ENSRegistry" not found. 
    at Artifacts._handleWrongArtifactForContractName ((...)
mkdir: cannot create directory ‘(...)/fdp-contracts/dist’: File exists
nugaon commented 2 years ago

I pushed the fixes still have problem with the JS lib:

> @fairdatasociety/fdp-contracts@1.0.0 test
> jest

  console.log
    WARNING: Missing strong random number source

      at Logger._log (../build/webpack:/fdp-contracts/node_modules/@ethersproject/logger/lib.esm/index.js:136:1)

 FAIL  test/it/ens.spec.ts
  ENS service tests
    ✕ Username should be available (29 ms)
    ✕ Should register username and set public key (16 ms)
    ✓ Accessing public key of unexisting username should throw error (1 ms)

(...)
  ● ENS service tests › Username should be available

    missing revert data in call exception; Transaction reverted without a reason string [ See: https://links.ethers.org/v5-errors-CALL_EXCEPTION ] (error={"reason":"processing response error","code":"SERVER_ERROR",

(...)

  ● ENS service tests › Should register username and set public key

Test Suites: 1 failed, 1 total
Tests:       2 failed, 1 passed, 3 total
Snapshots:   0 total
Time:        1.356 s, estimated 2 s
Ran all test suites.
[UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "Error: expect(received).rejects.toEqual(expected) // deep equality

Expected: [Error: Public key is not set or is invalid]
Received: [Error: missing revert data in call exception; Transaction reverted without a reason string [ See: https://links.ethers.org/v5-errors-CALL_EXCEPTION ] (error={"reason":"processing response error","code":"SERVER_ERROR","body":"{\"id\":50,\"jsonrpc\":\"2.0\",\"error\":{\"message\":\"VM Exception while processing transaction: revert\",\"stack\":\"CallError: VM Exception while processing transaction: revert\\n    at Blockchain.simulateTransaction (/app/dist/node/1.js:2:49538)\",\"code\":-32000,\"name\":\"CallError\",\"data\":\"0x\"}}","error":{"code":-32000,"data":"0x"},"requestBody":"{\"method\":\"eth_call\",\"params\":[{\"from\":\"0x90f8bf6a479f320ead074411a4b0e7944ea8c9c1\",\"to\":\"0x5b1869d9a4c187f2eaa108f3062412ecf0526b24\",\"data\":\"0xc8690233767c989edf4f762331e773ef9bb1a6c76411135a71f809739aa1e0a228e1bde8\"},\"latest\"],\"id\":50,\"jsonrpc\":\"2.0\"}","requestMethod":"POST","url":"http://127.0.0.1:9545/"}, data="0x", code=CALL_EXCEPTION, version=providers/5.6.4)]".] {
  code: 'ERR_UNHANDLED_REJECTION'
nugaon commented 2 years ago

this problem required npm run build in the js-library directory before test. so now with the fixes, everything seems work