Skip to content

Commit

Permalink
testing migrated tokens IBC transfers (with new subxt client and new …
Browse files Browse the repository at this point in the history
…assets ids) for PICA and DOT (#3801)

- [x] PR title is my best effort to provide summary of changes and has
clear text to be part of release notes
- [x] I marked PR by `misc` label if it should not be in release notes
- [x] I have linked Zenhub/Github or any other reference item if one
exists
- [x] I was clear on what type of deployment required to release my
changes (node, runtime, contract, indexer, on chain operation, frontend,
infrastructure) if any in PR title or description
- [x] I waited and did best effort for `pr-workflow-check /
draft-release-check` to finish with success(green check mark) with my
changes
- [x] I have added at least one reviewer in reviewers list
- [x] I tagged(@) or used other form of notification of one person who I
think can handle best review of this PR
- [x] I have proved that PR has no general regressions of relevant
features and processes required to release into production
  • Loading branch information
dzmitry-lahoda authored and cocokick committed Jul 27, 2023
1 parent 19039ed commit 569cae4
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 16 deletions.
10 changes: 6 additions & 4 deletions code/parachain/runtime/primitives/src/topology.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,15 @@ impl Picasso {
},
);

let mut dot =
InnerPrefixedDenom::from_str(CurrencyId::DOT.to_string().as_str()).expect("genesis");
dot.add_trace_prefix(TracePrefix::new(PortId::transfer(), ChannelId::new(1)));
let mut dot_from_composable =
InnerPrefixedDenom::from_str(CurrencyId::COMPOSABLE_DOT.to_string().as_str())
.expect("genesis");
dot_from_composable
.add_trace_prefix(TracePrefix::new(PortId::transfer(), ChannelId::new(1)));

let dot = (
CurrencyId::DOT.0 as u64,
Some(ForeignAssetId::IbcIcs20(PrefixedDenom(dot))),
Some(ForeignAssetId::IbcIcs20(PrefixedDenom(dot_from_composable))),
AssetInfo {
name: Some(
BiBoundedAssetName::from_vec(b"Polkadot".to_vec())
Expand Down
15 changes: 15 additions & 0 deletions flake/devnet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Tests

## Transfers

1.

```shell
nix run .#devnet-xc-fresh`
```

2. [Tokens set balance Alice DOT on Composable](0x0200340400d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d060000000000000000000000010000001f0000004a4801141695450800).
3. If next 2 do not work, increase timeout and retry several at same time.
4. [Transfer Composable DOT to Picasso DOT](0xbe0100d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d000000000000000000000128000000000000000600000000000000000000000100000000e40b5402000000000000000000000000)
5. [Transfer Picasso PICA to Composable](0xbe0100d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d01000000000000000000011e000000000000000100000000000000000000000000000000e8764817000000000000000000000000)
6. Make reverse transfers by analogy.
14 changes: 14 additions & 0 deletions flake/ibc.nix
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,20 @@
${self'.packages.hyperspace-composable-rococo-picasso-rococo}/bin/hyperspace create-connection --config-a /tmp/composable-devnet/picasso-centauri-ibc/config-chain-a.toml --config-b /tmp/composable-devnet/picasso-centauri-ibc/config-chain-b.toml --config-core /tmp/composable-devnet/picasso-centauri-ibc/config-core.toml --delay-period 10
'';
};

composable-picasso-ibc-relay = pkgs.writeShellApplication {
name = "composable-picasso-ibc-relay";
runtimeInputs = devnetTools.withBaseContainerTools;
text = ''
HOME="/tmp/composable-devnet/composable-picasso-ibc"
export HOME
RUST_LOG="hyperspace=info,hyperspace_parachain=debug,hyperspace_cosmos=debug"
export RUST_LOG
sed -i "s/private_key = \"\/\/Alice\"/private_key = \"\/\/Bob\"/" "/tmp/composable-devnet/composable-picasso-ibc/config-chain-a.toml"
sed -i "s/private_key = \"\/\/Alice\"/private_key = \"\/\/Bob\"/" "/tmp/composable-devnet/composable-picasso-ibc/config-chain-b.toml"
${self'.packages.hyperspace-composable-rococo-picasso-rococo}/bin/hyperspace relay --config-a /tmp/composable-devnet/composable-picasso-ibc/config-chain-a.toml --config-b /tmp/composable-devnet/composable-picasso-ibc/config-chain-b.toml --config-core /tmp/composable-devnet/composable-picasso-ibc/config-core.toml --delay-period 10
'';
};
};
};
}
17 changes: 5 additions & 12 deletions flake/process-compose.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
let
devnet-root-directory = "/tmp/composable-devnet";
validator-key = "osmo12smx2wdlyttvyzvzg54y2vnqwq2qjateuf7thj";
relay = "on_failure"; # `no` not to restart
in {
packages = rec {
default = pkgs.writeShellApplication {
Expand Down Expand Up @@ -121,7 +122,7 @@
};
log_location =
"/tmp/composable-devnet/osmosis-centauri-hermes-relay.log";
availability = { restart = "on_failure"; };
availability = { restart = relay; };
};

picasso-centauri-ibc-init = {
Expand Down Expand Up @@ -166,7 +167,7 @@
"picasso-centauri-ibc-channels-init".condition =
"process_completed_successfully";
};
availability = { restart = "on_failure"; };
availability = { restart = relay; };
};

composable-picasso-ibc-init = {
Expand Down Expand Up @@ -215,22 +216,14 @@
availability = { restart = "on_failure"; };
};
composable-picasso-ibc-relay = {
command = ''
HOME="/tmp/composable-devnet/composable-picasso-ibc"
export HOME
RUST_LOG="hyperspace=info,hyperspace_parachain=debug,hyperspace_cosmos=debug"
export RUST_LOG
sed -i "s/private_key = \"\/\/Alice\"/private_key = \"\/\/Bob\"/" "/tmp/composable-devnet/composable-picasso-ibc/config-chain-a.toml"
sed -i "s/private_key = \"\/\/Alice\"/private_key = \"\/\/Bob\"/" "/tmp/composable-devnet/composable-picasso-ibc/config-chain-b.toml"
${self'.packages.hyperspace-composable-rococo-picasso-rococo}/bin/hyperspace relay --config-a /tmp/composable-devnet/composable-picasso-ibc/config-chain-a.toml --config-b /tmp/composable-devnet/composable-picasso-ibc/config-chain-b.toml --config-core /tmp/composable-devnet/composable-picasso-ibc/config-core.toml --delay-period 10
'';
command = self'.packages.composable-picasso-ibc-relay;
log_location =
"/tmp/composable-devnet/composable-picasso-ibc-relay.log";
depends_on = {
"composable-picasso-ibc-channels-init".condition =
"process_completed_successfully";
};
availability = { restart = "on_failure"; };
availability = { restart = relay; };
};
};
};
Expand Down

0 comments on commit 569cae4

Please sign in to comment.