Phala-Network / phat-offchain-rollup

Phat Contract Offchain Rollup implementation
Apache License 2.0
18 stars 13 forks source link

Phat (Substrate) Contract Testing Command Fails with Devphase #27

Closed FaisalAl-Tameemi closed 1 year ago

FaisalAl-Tameemi commented 1 year ago

Running yarn devphase contract test within the ./phat repo fails with the following log:

Screenshot from 2023-06-11 20-42-15

Specs:

Added context:


Originally posted by @FaisalAl-Tameemi in https://github.com/Phala-Network/phat-offchain-rollup/issues/26#issuecomment-1586240789

l00k commented 1 year ago

You can specify "-v" param to get more verbose output.

But direct issue was with outdated devphase ;) for the first glance all is ok (version number), but now @devphase/cli should be used instead of devphase.

  1. delete devphase.config.ts (it is outdated)
  2. switch devphase: 0.2.2 to @devphase/cli: ^0.2.1 in package.json

However tests are also not compatible with new stack. I will try to create PR for that soon.

FaisalAl-Tameemi commented 1 year ago

Awesome, that did it. Thank you :100:

h4x3rotab commented 1 year ago

Glad to see the problem was solved. Thank you, @l00k, for the help!

I have a few questions for @l00k:

  1. Why do you suggest to delete devphase.config.ts? Do you mean the content is outdated, or the config file is deprecated?
  2. Do you suggest to install devphase globally or use npx to execute it? I used to run npx devphase <command...> in the past.
l00k commented 1 year ago

@h4x3rotab those short term solution suggestions.

1. Why do you suggest to delete `devphase.config.ts`? Do you mean the content is outdated, or the config file is deprecated?

In this case config file was outdated. Most of fields were just in default state so I don't think it is reasonable to leave them here. I think we should leave only fields where really "configure" something. The rest should be removed and only mentioned (described on devphase site)

2. Do you suggest to install devphase globally or use `npx` to execute it? I used to run `npx devphase <command...>` in the past.

@devphase/cli could be used as global package. As long as user use both devphase and Phala binaries from latest release there is no need to include this package in dependencies. In some cases devphase and Phala binaries may not work properly (old release) but those are edge cases. I personally prefer to include such things in project package.json but that is only my preference.