* Allows unit and integration tests to share the same bash code via a utility library named testlib.sh.
* Linting and formatting of bash scripts was added to the Makefile targets lint and format.
* Updated the docker image and Go used by git actions
Switches from our partial Monero RPC client implementation to a full-API client to help with testing, reliability, debugging and future features. Other changes:
* GenerateBlocks written for better results when called by multiple parties simultaneously
* monero.Client interface renamed to monero.WalletClient to be orthogonal with monero.DaemonClient interface
* monero.NewClient(...) renamed to monero.NewWalletClient(...) to be orthogonal with monero.NewDaemonClient(...)
* monero.CreateMoneroWallet(...) simplified to monero.CreateWallet(...) (package prefix already states wallet type)
* monero/clent.go, monero/daemon.go renamed to monero/wallet_client.go, monero/daemon_client.go
* monero/rpc.go removed with code consolidated into monero/wallet_client.go and monero/daemon_client.go
* Updated go-ethereum dep to 1.10.21
* Code now installs/uses an abigen that automatically matches the version of our go-ethereum in the go.mod
* solc was updated to 0.8.16 (in the docs, we don't install it, but anyone wanting to generate identical output needs it).
* Minimum go version is now 1.18
* golangci-lint updated to v1.48.0 (was needed to play nicely with go 1.18 and the new generated code)
* dleq/cgo-dleq submodule updated to latest version
* Fixes lock issues on the XMR Maker's offer list (new package protocol/xmrmaker/offers)
* Fixes lock issues on the swapState maps
* Fixes go routine sync issues in TestError_ShouldOnlyTakeOfferOnce that were sometimes breaking TestSuccess_ConcurrentSwaps
* Ensures that the id field of "types.Offer" is initialized when created
Updates the repo to install the latest version of ganache (ganache-cli is obsolete).
One of the things that changed in the newer version of Ganache, is gas fee estimation uses the timestamp from the last mined block instead of the local computer's current timestamp. This mirrors what Geth does, so the Ganache change is helpful, but it caused a few problems that this PR fixes.
If we want to do dynamic fee estimation for a transaction that can not happen before time T0 or T1, we need to wait until there is one mined block after T0 or T1 to create our transaction. Otherwise the transaction will be reverted during fee estimation, returning an error when creating the transaction, and we'll never send the transaction out to the network.
Ganache, by default, only mines blocks when you create a transaction. In order to have a mined block after T0 or T1 to calculate transaction fees, we stopped using instamine, and now mine a block every second. This PR chose the minimum block interval for speedier tests.
Co-authored-by: noot <36753753+noot@users.noreply.github.com>
* version independent monerod path with localhost-only binding
* fixed lint target and install script
* created 3rd ETH key constant to avoid race condition in tests
* updated run-integration-tests.sh with the same changes made to run-unit-tests.sh
* new design for paritioning out 2 unique keys to test packages
* restored accidentally deleted tests/alice.key
* removed websocket connection leaks from tests
* made file paths unique between tests with better file cleanup
* fix for the websocket connection leak commit
* reverted increase of GenerateBlocks (didn't mean to commit that)
* fixed maker/taker key that I had reversed
* fixed incorrect zero-balance check
* fixed comment on ClaimOrRefund
* added back sample script for installing go in /usr/local/go
* etchclient creation cleanup using t.Cleanup()
* minor cleanup to ganache_test_keys code
* initial dynamic monero-wallet-rpc implementation for tests
* converted monero tests to use dynamic monero-wallet-rpc services
* unit tests all using dynamic monero-wallet-rpc services
* fixed 2 tests that failed after moving to dynamic monero-wallet-rpc services
* fixed low balance issues in TestSwapState_NotifyClaimed
Co-authored-by: noot <36753753+noot@users.noreply.github.com>
* rework contracts to use less gas by storing just swap hash when creating a swap
* prevent overriding of existing swaps
* ensure swap exists when trying to refund
* update bindings script and go contract bindings
* update swapfactory go tests
* updating protocol, compiles
* update recoverer, everything builds
* fix cmd/recover tests
* fix recover tests
* lint
* fix checkContractCode
* fix protocol/ tests
* inherit secp256k1 instead of using library to prevent double deployment
* rerun abigen and hardcode runtime bin for now
* add nolint to long hardcoded runtime bin line
* cleanup commented out stuff
Co-authored-by: noot <elizabethjbinks@gmail.com>