hyperledger-cacti / cacti

Hyperledger Cacti is a new approach to the blockchain interoperability problem
https://wiki.hyperledger.org/display/cactus
Apache License 2.0
344 stars 286 forks source link

build(plugin-satp-hermes): fix solidty test compilation remix-ide libs #3585

Open petermetz opened 1 month ago

petermetz commented 1 month ago

Description

Right now there are 3 different compilation methods used by Hermes to compile solidity code and neither of them actually work:

  1. The hardhat one doesn't seem to be configured properly.
  2. Forge doesn't work because of the undeclared dependencies pointing to remix test libs
  3. Remix compilation doesn't work because it's not configured either so you have to manually open the remix ide and compile there instead of running a command on the terminal on your localhost.

The objective is to have a single one that actually works.

More Context

examples/cactus-example-cbdc-bridging-backend/src/solidity/test/satp-erc20-test.sol examples/cactus-example-cbdc-bridging-backend/src/solidity/test/satp-wrapper-test.sol

packages/cactus-plugin-satp-hermes/src/test/solidity/contracts/test/satp-erc20-test.sol packages/cactus-plugin-satp-hermes/src/test/solidity/contracts/test/satp-wrapper-test.sol

import "remix_tests.sol";
import "remix_accounts.sol";

image

image

https://www.google.com/search?client=firefox-b-1-d&q=import+remix_tests.sol+ https://remix-ide.readthedocs.io/en/latest/unittesting.html https://remix-ide.readthedocs.io/en/latest/assert_library.html https://www.npmjs.com/package/@remix-project/remix-tests?activeTab=code https://github.com/ethereum/remix-ide/blob/master/docs/unittesting_examples.md

Acceptance Criteria

  1. The build works, tests are passing
  2. Neither build nor test uses dependencies that are undeclared (the Remix Testing library) - either declare the dependency so that package managers can import it or stop using it altogether if it's proprietary and/or not open source

cc: @RafaelAPB