Skip to content

Commit

Permalink
remove child subintents
Browse files Browse the repository at this point in the history
  • Loading branch information
matiasbzurovski committed Oct 17, 2024
1 parent 9e50789 commit 5948392
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,6 @@
"transactionManifest": "CALL_METHOD\n Address(\"account_rdx128y6j78mt0aqv6372evz28hrxp8mn06ccddkr7xppc88hyvynvjdwr\")\n \"lock_fee\"\n Decimal(\"0.61\")\n;\nCALL_METHOD\n Address(\"account_rdx128y6j78mt0aqv6372evz28hrxp8mn06ccddkr7xppc88hyvynvjdwr\")\n \"withdraw\"\n Address(\"resource_rdx1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxradxrd\")\n Decimal(\"1337\")\n;\nTAKE_FROM_WORKTOP\n Address(\"resource_rdx1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxradxrd\")\n Decimal(\"1337\")\n Bucket(\"bucket1\")\n;\nCALL_METHOD\n Address(\"account_rdx12xkzynhzgtpnnd02tudw2els2g9xl73yk54ppw8xekt2sdrlaer264\")\n \"try_deposit_or_abort\"\n Bucket(\"bucket1\")\n Enum<0u8>()\n;\n",
"blobs": [],
"message": "message",
"child_subintent_hashes": [
"subintent_hash_one"
],
"expiration": {
"discriminator": "expireAtTime",
"value": "2023-09-11T16:05:56.000Z"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use crate::prelude::*;
decl_version_type!(Subintent);

#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, uniffi::Record)]
#[serde(rename_all = "camelCase")]
pub struct DappToWalletInteractionSubintentRequestItem {
pub version: SubintentVersion,

Expand All @@ -12,9 +13,6 @@ pub struct DappToWalletInteractionSubintentRequestItem {
#[serde(skip_serializing_if = "Option::is_none")]
pub message: Option<String>,

#[serde(skip_serializing_if = "Option::is_none")]
pub child_subintent_hashes: Option<Vec<String>>,

#[serde(skip_serializing_if = "Option::is_none")]
pub expiration: Option<DappToWalletInteractionSubintentExpiration>,
}
Expand All @@ -24,14 +22,12 @@ impl DappToWalletInteractionSubintentRequestItem {
version: impl Into<SubintentVersion>,
unvalidated_manifest: impl Into<UnvalidatedTransactionManifest>,
message: impl Into<Option<String>>,
child_subintent_hashes: impl Into<Option<Vec<String>>>,
expiration: impl Into<Option<DappToWalletInteractionSubintentExpiration>>,
) -> Self {
Self {
version: version.into(),
unvalidated_manifest: unvalidated_manifest.into(),
message: message.into(),
child_subintent_hashes: child_subintent_hashes.into(),
expiration: expiration.into(),
}
}
Expand All @@ -43,7 +39,6 @@ impl HasSampleValues for DappToWalletInteractionSubintentRequestItem {
SubintentVersion::sample(),
UnvalidatedTransactionManifest::sample(),
"message".to_owned(),
vec!["subintent_hash_one".to_owned()],
DappToWalletInteractionSubintentExpiration::sample(),
)
}
Expand All @@ -53,7 +48,6 @@ impl HasSampleValues for DappToWalletInteractionSubintentRequestItem {
SubintentVersion::sample_other(),
UnvalidatedTransactionManifest::sample_other(),
"message_other".to_owned(),
vec!["subintent_hash_two".to_owned()],
DappToWalletInteractionSubintentExpiration::sample_other(),
)
}
Expand Down Expand Up @@ -87,7 +81,6 @@ mod tests {
"transactionManifest" : "CALL_METHOD\n Address(\"account_rdx128y6j78mt0aqv6372evz28hrxp8mn06ccddkr7xppc88hyvynvjdwr\")\n \"lock_fee\"\n Decimal(\"0.61\")\n;\nCALL_METHOD\n Address(\"account_rdx128y6j78mt0aqv6372evz28hrxp8mn06ccddkr7xppc88hyvynvjdwr\")\n \"withdraw\"\n Address(\"resource_rdx1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxradxrd\")\n Decimal(\"1337\")\n;\nTAKE_FROM_WORKTOP\n Address(\"resource_rdx1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxradxrd\")\n Decimal(\"1337\")\n Bucket(\"bucket1\")\n;\nCALL_METHOD\n Address(\"account_rdx12xkzynhzgtpnnd02tudw2els2g9xl73yk54ppw8xekt2sdrlaer264\")\n \"try_deposit_or_abort\"\n Bucket(\"bucket1\")\n Enum<0u8>()\n;\n",
"blobs" : [],
"message" : "message",
"child_subintent_hashes" : ["subintent_hash_one"],
"expiration": {
"discriminator": "expireAtTime",
"value": "2023-09-11T16:05:56.000Z"
Expand Down
31 changes: 16 additions & 15 deletions crates/sargon/tests/vectors/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -974,22 +974,23 @@ mod wallet_to_dapp_interaction_tests {
),
);

let pre_authorization_response_items = WalletToDappInteractionResponseItems::PreAuthorization(
WalletToDappInteractionPreAuthorizationResponseItems::new(
SignedPartialTransaction::sample(),
),
);

let pre_authorization_response = WalletToDappInteractionResponse::Success(
WalletToDappInteractionSuccessResponse::new(
WalletInteractionId::from_str(
"17d530f6-0cb6-4122-8540-64e46a2e0f84",
)
.unwrap(),
pre_authorization_response_items,
),
);
let pre_authorization_response_items =
WalletToDappInteractionResponseItems::PreAuthorization(
WalletToDappInteractionPreAuthorizationResponseItems::new(
SignedPartialTransaction::sample(),
),
);

let pre_authorization_response =
WalletToDappInteractionResponse::Success(
WalletToDappInteractionSuccessResponse::new(
WalletInteractionId::from_str(
"17d530f6-0cb6-4122-8540-64e46a2e0f84",
)
.unwrap(),
pre_authorization_response_items,
),
);

let responses = vec![
authorized_request_response,
Expand Down

0 comments on commit 5948392

Please sign in to comment.