Skip to content

Commit

Permalink
neutron e2e token swap test (#54)
Browse files Browse the repository at this point in the history
* token swap e2e test

* extra space

* use ServiceAccountType

* Yan's suggestion

* Fix conflicts
  • Loading branch information
keyleu authored Oct 8, 2024
1 parent d66324c commit f150d10
Show file tree
Hide file tree
Showing 20 changed files with 1,065 additions and 459 deletions.
46 changes: 45 additions & 1 deletion .github/workflows/check-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:

local-ic-polytone:
needs: build
name: Authorization-Processor polytone integration test
name: authorization & processor polytone integration test
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down Expand Up @@ -106,3 +106,47 @@ jobs:

- name: Cleanup
run: killall local-ic && exit 0

local-ic-token-swap:
needs: build
name: token swap e2e test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}

- name: Install local-ic
run: git clone https://github.com/strangelove-ventures/interchaintest && cd interchaintest/local-interchain && make install

- name: Get cargo
uses: actions-rs/toolchain@v1
with:
toolchain: stable

- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: optimized-contracts
path: ./artifacts

- name: List downloaded files
run: ls -l ./artifacts

- name: Start local-ic and wait for it to be ready
run: |
cd local-interchaintest
local-ic start neutron_juno --api-port 42069 &
curl --head -X GET --retry 200 --retry-connrefused --retry-delay 5 http://localhost:42069
- name: Run token_swap example
env:
RUST_LOG: debug
run: cargo run --package local-interchaintest --example token_swap

- name: Cleanup
run: killall local-ic && exit 0
14 changes: 6 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion contracts/authorization/src/authorization.rs
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ fn check_restriction(
//
// assert_eq!(data.pointer("/x/y/1").unwrap(), &json!("zz"));
// assert_eq!(data.pointer("/a/b/c"), None);
let pointer = |keys: &[String]| -> String { keys.join("/") };
let pointer = |keys: &[String]| -> String { format!("/{}", keys.join("/")) };

match param_restriction {
ParamRestriction::MustBeIncluded(keys) => {
Expand Down
Loading

0 comments on commit f150d10

Please sign in to comment.