-
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.
- Loading branch information
1 parent
c446600
commit 72f1627
Showing
8 changed files
with
57 additions
and
4 deletions.
There are no files selected for viewing
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/src/gateway_api/models/logic/request/transaction/preview/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,5 +1,7 @@ | ||
mod opt_ins; | ||
mod request_flags; | ||
mod transaction_preview; | ||
|
||
pub use opt_ins::*; | ||
pub use request_flags::*; | ||
pub use transaction_preview::*; |
29 changes: 29 additions & 0 deletions
29
crates/sargon/src/gateway_api/models/logic/request/transaction/preview/opt_ins.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,29 @@ | ||
use crate::prelude::*; | ||
|
||
impl TransactionPreviewRequestOptIns { | ||
pub fn new(radix_engine_toolkit_receipt: bool) -> Self { | ||
Self { | ||
radix_engine_toolkit_receipt, | ||
} | ||
} | ||
} | ||
|
||
impl Default for TransactionPreviewRequestOptIns { | ||
fn default() -> Self { | ||
Self::new(true) | ||
} | ||
} | ||
|
||
#[cfg(test)] | ||
mod tests { | ||
use super::*; | ||
|
||
#[allow(clippy::upper_case_acronyms)] | ||
type SUT = TransactionPreviewRequestOptIns; | ||
|
||
#[test] | ||
fn default_value() { | ||
let sut = SUT::default(); | ||
assert!(sut.radix_engine_toolkit_receipt); | ||
} | ||
} |
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/src/gateway_api/models/types/request/transaction/preview/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,5 +1,7 @@ | ||
mod opt_ins; | ||
mod request_flags; | ||
mod transaction_preview; | ||
|
||
pub use opt_ins::*; | ||
pub use request_flags::*; | ||
pub use transaction_preview::*; |
15 changes: 15 additions & 0 deletions
15
crates/sargon/src/gateway_api/models/types/request/transaction/preview/opt_ins.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,15 @@ | ||
use crate::prelude::*; | ||
|
||
#[derive( | ||
Clone, | ||
Copy, | ||
Debug, | ||
PartialEq, | ||
Eq, | ||
Serialize, | ||
Deserialize, /* Deserialize so we can test roundtrip of JSON vectors */ | ||
)] | ||
pub struct TransactionPreviewRequestOptIns { | ||
/** This flag controls whether the preview response will include a Radix Engine Toolkit serializable receipt or not. */ | ||
pub(crate) radix_engine_toolkit_receipt: bool, | ||
} |
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