-
Notifications
You must be signed in to change notification settings - Fork 15
Add more information to SimulationOutput #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
Conversation
| mod deadline; | ||
| pub mod engine; | ||
| mod error; | ||
| pub mod error; |
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.
error::* is already re-exported below
|
|
||
| #[near(serializers = [borsh, json])] | ||
| #[autoimpl(Deref using self.0)] | ||
| #[autoimpl(DerefMut using self.0)] |
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.
DerefMut was not implemented here on purpose: all mutations happen on Amounts level to enforce using .checked_...() operations
|
|
||
| impl<T> From<T> for Amounts<T> { | ||
| fn from(m: T) -> Self { | ||
| Amounts(m) |
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.
| Amounts(m) | |
| Self::new(m) |
| pub ft_withdrawals: Option<Vec<FtWithdraw>>, | ||
| pub nft_withdrawals: Option<Vec<NftWithdraw>>, | ||
| pub mt_withdrawals: Option<Vec<MtWithdraw>>, |
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.
| pub ft_withdrawals: Option<Vec<FtWithdraw>>, | |
| pub nft_withdrawals: Option<Vec<NftWithdraw>>, | |
| pub mt_withdrawals: Option<Vec<MtWithdraw>>, | |
| #[serde(skip_serializing_if = "Vec::is_empty")] | |
| pub ft_withdrawals: Vec<FtWithdraw>, | |
| #[serde(skip_serializing_if = "Vec::is_empty")] | |
| pub nft_withdrawals: Vec<NftWithdraw>, | |
| #[serde(skip_serializing_if = "Vec::is_empty")] | |
| pub mt_withdrawals: Vec<MtWithdraw>, |
| .unwrap(); | ||
| let sim_res = env.defuse.simulate_intents(signed.clone()).await.unwrap(); | ||
| assert_eq!(sim_res.balance_diff, into_simulation_diff(accounts.clone())); | ||
| println!("Balance diff: {:#?}", sim_res.balance_diff); |
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.
Maybe print the whole simulation output?
| println!("Balance diff: {:#?}", sim_res.balance_diff); | |
| println!("simulation_output: {}", serde_json::to_string(&sim_res).unwrap()); |
And do it before asserting?
|
Closed in favor of #91 |
Replaces #74
This uses only the Inspector to get this data. This is why this is based on another branch as both have similar changes to the Inspector interface.