-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add additional fields * wip * wip * wip * fix ios tests * fix * wip * wip * fix * wip * wip * wi[ * wip * wip * wip * wip * wip * wip * wip * wip * wip * update test --------- Co-authored-by: Ghenadie Vasiliev-Pusca <[email protected]>
- Loading branch information
1 parent
cdc28ae
commit 8cac8a1
Showing
39 changed files
with
857 additions
and
339 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
crates/sargon-uniffi/src/system/sargon_os/transactions/support/mod.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
mod pre_auth_to_review; | ||
mod transaction_to_review; | ||
|
||
pub use pre_auth_to_review::*; | ||
pub use transaction_to_review::*; |
28 changes: 28 additions & 0 deletions
28
crates/sargon-uniffi/src/system/sargon_os/transactions/support/pre_auth_to_review.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
use crate::prelude::*; | ||
use sargon::PreAuthEnclosedManifest as InternalPreAuthEnclosedManifest; | ||
use sargon::PreAuthOpenManifest as InternalPreAuthOpenManifest; | ||
use sargon::PreAuthToReview as InternalPreAuthToReview; | ||
|
||
/// This is the result of the Pre-Auth preview analysis. | ||
/// It contains all the information needed to compute and display the transaction details to the user. | ||
#[derive(Clone, PartialEq, InternalConversion, uniffi::Enum)] | ||
pub enum PreAuthToReview { | ||
Open(PreAuthOpenManifest), | ||
Enclosed(PreAuthEnclosedManifest), | ||
} | ||
|
||
/// Pre-Auth analysis open manifest, which contains multiple interactions with the parent manifest, | ||
/// thus its preview can be computed only based on the static analysis manifest summary | ||
#[derive(Clone, PartialEq, InternalConversion, uniffi::Record)] | ||
pub struct PreAuthOpenManifest { | ||
pub manifest: SubintentManifest, | ||
pub summary: ManifestSummary, | ||
} | ||
|
||
/// Pre-Auth analysis enclosed manifest, which does not contain any interactions with the parent manifest, | ||
/// thus its preview can be computed as if it would have been a standalone transaction. | ||
#[derive(Clone, PartialEq, InternalConversion, uniffi::Record)] | ||
pub struct PreAuthEnclosedManifest { | ||
pub manifest: SubintentManifest, | ||
pub summary: ExecutionSummary, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
crates/sargon/fixtures/transaction/multi_account_resource_transfer_subintent.rtm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
CALL_METHOD | ||
Address("account_sim1cyvgx33089ukm2pl97pv4max0x40ruvfy4lt60yvya744cve475w0q") | ||
"lock_fee" | ||
Decimal("500") | ||
; | ||
CALL_METHOD | ||
Address("account_sim1cyvgx33089ukm2pl97pv4max0x40ruvfy4lt60yvya744cve475w0q") | ||
"withdraw" | ||
Address("resource_sim1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxakj8n3") | ||
Decimal("330") | ||
; | ||
TAKE_FROM_WORKTOP | ||
Address("resource_sim1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxakj8n3") | ||
Decimal("150") | ||
Bucket("bucket1") | ||
; | ||
CALL_METHOD | ||
Address("account_sim1c8mulhl5yrk6hh4jsyldps5sdrp08r5v9wusupvzxgqvhlp4c4nwjz") | ||
"try_deposit_or_abort" | ||
Bucket("bucket1") | ||
Enum<0u8>() | ||
; | ||
TAKE_FROM_WORKTOP | ||
Address("resource_sim1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxakj8n3") | ||
Decimal("130") | ||
Bucket("bucket2") | ||
; | ||
CALL_METHOD | ||
Address("account_sim1c8s2hass5g62ckwpv78y8ykdqljtetv4ve6etcz64gveykxznj36tr") | ||
"try_deposit_or_abort" | ||
Bucket("bucket2") | ||
Enum<0u8>() | ||
; | ||
TAKE_FROM_WORKTOP | ||
Address("resource_sim1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxakj8n3") | ||
Decimal("50") | ||
Bucket("bucket3") | ||
; | ||
CALL_METHOD | ||
Address("account_sim1c8ct6jdcwqrg3gzskyxuy0z933fe55fyjz6p56730r95ulzwl3ppva") | ||
"try_deposit_or_abort" | ||
Bucket("bucket3") | ||
Enum<0u8>() | ||
; | ||
YIELD_TO_PARENT; |
25 changes: 25 additions & 0 deletions
25
crates/sargon/fixtures/transaction/resource_transfer_subintent.rtm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
CALL_METHOD | ||
Address("account_rdx128y6j78mt0aqv6372evz28hrxp8mn06ccddkr7xppc88hyvynvjdwr") | ||
"lock_fee" | ||
Decimal("0.61") | ||
; | ||
CALL_METHOD | ||
Address("account_rdx128y6j78mt0aqv6372evz28hrxp8mn06ccddkr7xppc88hyvynvjdwr") | ||
"withdraw" | ||
Address("resource_rdx1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxradxrd") | ||
Decimal("1337") | ||
; | ||
TAKE_FROM_WORKTOP | ||
Address("resource_rdx1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxradxrd") | ||
Decimal("1337") | ||
Bucket("bucket1") | ||
; | ||
CALL_METHOD | ||
Address("account_rdx12xkzynhzgtpnnd02tudw2els2g9xl73yk54ppw8xekt2sdrlaer264") | ||
"try_deposit_or_abort" | ||
Bucket("bucket1") | ||
Enum<0u8>() | ||
; | ||
YIELD_TO_PARENT; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.