Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Copy xrc_mock from tvl in ic repo #268

Merged
merged 4 commits into from
Sep 3, 2024
Merged

feat: Copy xrc_mock from tvl in ic repo #268

merged 4 commits into from
Sep 3, 2024

Conversation

dskloetd
Copy link
Contributor

@dskloetd dskloetd commented Aug 26, 2024

Motivation

It can be useful to have an exchange rate canister available in a test environment without it making API calls to exchanges.
Instead of everybody implementing their own mock, we should provide one in this repo so it's easy to find and share.

In plan to use this in the snsdemo repo which creates the test environment used by nns-dapp.

Changes

  1. Copied https://github.com/dfinity/ic/tree/master/rs/rosetta-api/tvl/xrc_mock to src/xrc_mock
  2. Slightly changed the Cargo.toml to work in the current repo.
  3. Removed BUILD.bazel as this repo doesn't use bazel.
  4. Added a build script.
  5. Fix the docker build workflow via cargo-culting.

I plan to include a built wasm in the release artifacts in the future PR.

Tests

I don't think the existing mock that was copied has unit tests, but I used the mock built from this repo in my test environment to test the tvl replacement in nns-dapp.

@dskloetd dskloetd changed the title Copy xrc_mock from tvl in ic repo feat: Copy xrc_mock from tvl in ic repo Aug 26, 2024
@dskloetd dskloetd marked this pull request as ready for review September 2, 2024 17:56
@dskloetd dskloetd requested a review from a team as a code owner September 2, 2024 17:56
@dskloetd dskloetd merged commit 0d55a30 into main Sep 3, 2024
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants