-
Notifications
You must be signed in to change notification settings - Fork 7
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
455 create integration tests for stellar mainnet with archived proofs #456
455 create integration tests for stellar mainnet with archived proofs #456
Conversation
…nnet-with-archived-proofs
These have to match what we have in the custom subxt client otherwise the integration tests will not start properly
755bbb1
to
6f36ec4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Overall logic seems good. I have just one more comment that I think you addressed in the description.
I realize that start_instant_...
is the same except for the corresponding call here to create the partial network elements. Is it not possible to de-duplecate the code because of the return types here?
@@ -25,7 +33,7 @@ pub const LESS_THAN_4_CURRENCY_CODE: CurrencyId = CurrencyId::AlphaNum4( | |||
|
|||
#[allow(dead_code)] | |||
pub const DEFAULT_MAINNET_DEST_SECRET_KEY: &'static str = | |||
"SCJ7XV73Q642EPMUMSPO5ECOXWTMWR52MGPMWT6ELV3VUFPH653IOEUS"; | |||
"SBLI7RKEJAEFGLZUBSCOFJHQBPFYIIPLBCKN7WVCWT4NEG2UJEW33N73"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this account holding any real value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is, and it has to because it needs to have trustlines to some assets established in order to receive them 😬
We might want to give this task a higher priority to clean it all up but it's not that easy since we use a lot of different secrets which would need to be streamlined first.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh okay, well we may want to delete this comment for now 😂.
clients/vault/tests/helper/mod.rs
Outdated
FixedU128::saturating_from_rational(1u128, 10u128), | ||
) | ||
.await; | ||
async fn set_exchange_rate(client: &SpacewalkParachain, currency: CurrencyId, ratio: FixedU128) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we just call set_exchange_rate_and_wait
? Or is this a placeholder for later adding more logic?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are totally right, I removed it because it's redundant
stellar_relay: if !is_public_network { | ||
create_stellar_testnet_config() | ||
} else { | ||
StellarRelayConfig::default() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This default
config is coming from the default
implementation of the pallet, which is imported from spacewalk_runtime_testnet
. Does the pallet itself implements the default config for mainnet?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the Default
implementation of the pallet will use a relay configuration that works for Stellar mainnet, see here. Do you think it's confusing and we should make it more explicit here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's fine! perhaps just a comment would be enough.
…nnet-with-archived-proofs
So the function
Then you get
This means we have to make the return type of the |
Okay I imagined it was something like this, I was also thinking exactly something like:
But If this or something similarly simple won't work, I don't think it is worth it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to go for me! The tests passed for the Ubuntu variant so it should be okay.
Thanks for the review @gianfra-t 👌 . I'll leave this open until tomorrow in case someone else from @pendulum-chain/devs wants to review it (since we said we'd want to have 2 reviewers). |
…nnet-with-archived-proofs
…nnet-with-archived-proofs
9efb0fc
to
6076364
Compare
I'll merge this now since the CI passed. |
Changes
is_public_network
indicator where needed to differentiate between usage of Stellar testnet and mainnet instead of assuming testnet by defaultcargo run --bin spacewalk standalone
it will also use the testnet runtime. We can change it to make this configurable but I thought it might be best to keep it like this.testnet
andmainnet
runtimes are perfectly the same, except for theIsPublicNetwork
configuration parameter of thestellar-relay
pallet. For this I also didn't find a better way than duplicating the runtime unfortunately.rpc
crate into thetestchain
directory. While trying the approach of deduplicated functions with traits it was necessary to have the rpc functions defined inside the node directory in order not to have circular dependencies. While I neglected that approach again, I think there is no good reason to keep therpc
crate separate from the node.This PR unfortunately duplicates a lot of the code related to mainnet vs testnet execution of the standalone chain. I tried to deduplicate the functions by using respective traits but I failed to set this up correctly. Because it's quite cumbersome and already consumed too much time I decided to go ahead and duplicate the functions inserting the specific runtime and executor as required.
Closes #455.