-
Notifications
You must be signed in to change notification settings - Fork 78
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
LPv2: Bump-up foreign investment. Fix failing investment ITs #1934
Changes from all commits
5cddf8f
b5249de
6ef03bd
3226798
a7ad1ad
c4042ec
a1a8346
8a9cc0e
c8dc8ef
4e623f6
c569e4f
94a0ea2
3e61244
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -99,7 +99,6 @@ pub mod pallet { | |
}; | ||
|
||
#[pallet::pallet] | ||
|
||
pub struct Pallet<T>(_); | ||
|
||
#[pallet::origin] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ | |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
|
||
use cfg_primitives::Balance; | ||
use cfg_primitives::{AccountId, Balance}; | ||
use cfg_types::{ | ||
domain_address::{Domain, DomainAddress}, | ||
tokens::CurrencyId, | ||
|
@@ -144,7 +144,7 @@ mod utils { | |
} | ||
} | ||
|
||
#[test_runtimes([development])] | ||
#[test_runtimes([centrifuge, development])] | ||
fn transfer_tokens_from_local<T: Runtime>() { | ||
let mut env = super::setup_full::<T>(); | ||
utils::prepare_hold_usdc_local::<T>(&mut env); | ||
|
@@ -173,7 +173,7 @@ fn transfer_tokens_from_local<T: Runtime>() { | |
}); | ||
} | ||
|
||
#[test_runtimes([development])] | ||
#[test_runtimes([centrifuge, development])] | ||
fn transfer_tranche_tokens_from_local<T: Runtime>() { | ||
let mut env = super::setup_full::<T>(); | ||
|
||
|
@@ -235,7 +235,7 @@ fn transfer_tranche_tokens_from_local<T: Runtime>() { | |
}); | ||
} | ||
|
||
#[test_runtimes([development], ignore = "solidity mismatch")] | ||
#[test_runtimes([centrifuge, development])] | ||
fn transfer_tranche_tokens_domain_to_local_to_domain<T: Runtime>() { | ||
let mut env = super::setup_full::<T>(); | ||
utils::prepare_hold_tt_domain::<T>(&mut env); | ||
|
@@ -261,6 +261,7 @@ fn transfer_tranche_tokens_domain_to_local_to_domain<T: Runtime>() { | |
]), | ||
) | ||
.unwrap(); | ||
|
||
evm.call( | ||
Keyring::TrancheInvestor(1), | ||
sp_core::U256::zero(), | ||
|
@@ -271,7 +272,9 @@ fn transfer_tranche_tokens_domain_to_local_to_domain<T: Runtime>() { | |
Token::FixedBytes(pool_a_tranche_1_id::<T>().into()), | ||
Token::Uint(DOMAIN_EVM.into()), | ||
Token::Uint(EVM_DOMAIN_CHAIN_ID.into()), | ||
Token::Address(Keyring::TrancheInvestor(2).into()), | ||
Token::FixedBytes( | ||
AccountId::from(as_h160_32bytes(Keyring::TrancheInvestor(2))).to_raw_vec(), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Damn, you were faster! Just came to the same conclusion after some debugging. Well done! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Happy to reach the same solution, double confident about this! |
||
), | ||
Comment on lines
+275
to
+277
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This makes the test pass. We need an account coded in some way that later when obtaining the local representation the extra padding does not change. I think the current account conversions are quite confusing, and we should need to simplify this into the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Absolutely! I am wondering why this test has worked in the past.. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Previously a |
||
Token::Uint(AMOUNT.into()), | ||
]), | ||
) | ||
|
@@ -310,7 +313,7 @@ fn transfer_tranche_tokens_domain_to_local_to_domain<T: Runtime>() { | |
}); | ||
} | ||
|
||
#[test_runtimes([development])] | ||
#[test_runtimes([centrifuge, development])] | ||
fn transfer_tranche_tokens_domain_to_local<T: Runtime>() { | ||
let mut env = super::setup_full::<T>(); | ||
utils::prepare_hold_tt_domain::<T>(&mut env); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -224,7 +224,7 @@ pub fn default_accounts() -> Vec<Keyring> { | |
|
||
/// Returns a Vector of default investor accounts | ||
pub fn default_investors() -> Vec<Keyring> { | ||
(0..=50).map(Keyring::TrancheInvestor).collect() | ||
(1..=2).map(Keyring::TrancheInvestor).collect() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This reduces the time for each test case to more than a minute on my computer (around 70 seconds less per test case). I think we can enable again the |
||
} | ||
|
||
#[cfg(test)] | ||
|
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.
The
<
character makes docs fail in they are computed as docs instead of normal comments.Modified this to be a coder comment instead of a user docs.
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.
Ah sorry for merging back that error. This branch had an outdated version though.
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.
Probably I think just pushed something in between your work. Now should pass 🤞🏻