Skip to content

Refactor transaction models to replace None with empty string for signing public key #107

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

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/asynch/transaction/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ where
T: Transaction<'a, F> + Serialize + DeserializeOwned + Clone,
{
let commond_fields = transaction.get_mut_common_fields();
commond_fields.signing_pub_key = Some(wallet.public_key.clone().into());
commond_fields.signing_pub_key = wallet.public_key.clone().into();

validate_account_xaddress(transaction, AccountFieldType::Account)?;
if validate_transaction_has_field(transaction, "Destination").is_ok() {
Expand Down
4 changes: 2 additions & 2 deletions src/models/transactions/account_delete.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ impl<'a> AccountDelete<'a> {
None,
sequence,
signers,
None,
"".into(),
source_tag,
ticket_sequence,
None,
Expand Down Expand Up @@ -116,7 +116,7 @@ mod test_serde {
"rPT1Sjq2YGrBMTttX4GZHjKu9dyfzbpAYe".into(),
Some(13),
);
let default_json_str = r#"{"Account":"rWYkbWkCeg8dP6rXALnjgZSjjLyih5NXm","TransactionType":"AccountDelete","Fee":"2000000","Flags":0,"Sequence":2470665,"SigningPubKey":"","Destination":"rPT1Sjq2YGrBMTttX4GZHjKu9dyfzbpAYe","DestinationTag":13}"#;
let default_json_str = r#"{"Account":"rWYkbWkCeg8dP6rXALnjgZSjjLyih5NXm","TransactionType":"AccountDelete","SigningPubKey":"","Fee":"2000000","Flags":0,"Sequence":2470665,"Destination":"rPT1Sjq2YGrBMTttX4GZHjKu9dyfzbpAYe","DestinationTag":13}"#;
// Serialize
let default_json_value = serde_json::to_value(default_json_str).unwrap();
let serialized_string = serde_json::to_string(&default_txn).unwrap();
Expand Down
4 changes: 2 additions & 2 deletions src/models/transactions/account_set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ impl<'a> AccountSet<'a> {
None,
sequence,
signers,
None,
"".into(),
source_tag,
ticket_sequence,
None,
Expand Down Expand Up @@ -558,7 +558,7 @@ mod tests {
None,
None,
);
let default_json_str = r#"{"Account":"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn","TransactionType":"AccountSet","Fee":"12","Flags":0,"Sequence":5,"SigningPubKey":"","Domain":"6578616D706C652E636F6D","MessageKey":"03AB40A0490F9B7ED8DF29D246BF2D6269820A0EE7742ACDD457BEA7C7D0931EDB","SetFlag":5}"#;
let default_json_str = r#"{"Account":"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn","TransactionType":"AccountSet","SigningPubKey":"","Fee":"12","Flags":0,"Sequence":5,"Domain":"6578616D706C652E636F6D","MessageKey":"03AB40A0490F9B7ED8DF29D246BF2D6269820A0EE7742ACDD457BEA7C7D0931EDB","SetFlag":5}"#;
// Serialize
let default_json_value = serde_json::to_value(default_json_str).unwrap();
let serialized_string = serde_json::to_string(&default_txn).unwrap();
Expand Down
2 changes: 1 addition & 1 deletion src/models/transactions/amm_bid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ impl<'a> AMMBid<'_> {
None,
sequence,
signers,
None,
"".into(),
source_tag,
ticket_sequence,
None,
Expand Down
2 changes: 1 addition & 1 deletion src/models/transactions/amm_create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ impl<'a> AMMCreate<'a> {
None,
sequence,
signers,
None,
"".into(),
source_tag,
ticket_sequence,
None,
Expand Down
2 changes: 1 addition & 1 deletion src/models/transactions/amm_delete.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ impl<'a> AMMDelete<'a> {
None,
sequence,
signers,
None,
"".into(),
source_tag,
ticket_sequence,
None,
Expand Down
2 changes: 1 addition & 1 deletion src/models/transactions/amm_deposit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ impl<'a> AMMDeposit<'a> {
None,
sequence,
signers,
None,
"".into(),
source_tag,
ticket_sequence,
None,
Expand Down
2 changes: 1 addition & 1 deletion src/models/transactions/amm_vote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ impl<'a> AMMVote<'a> {
None,
sequence,
signers,
None,
"".into(),
source_tag,
ticket_sequence,
None,
Expand Down
2 changes: 1 addition & 1 deletion src/models/transactions/amm_withdraw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ impl<'a> AMMWithdraw<'a> {
None,
sequence,
signers,
None,
"".into(),
source_tag,
ticket_sequence,
None,
Expand Down
4 changes: 2 additions & 2 deletions src/models/transactions/check_cancel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ impl<'a> CheckCancel<'a> {
None,
sequence,
signers,
None,
"".into(),
source_tag,
ticket_sequence,
None,
Expand Down Expand Up @@ -108,7 +108,7 @@ mod tests {
None,
"49647F0D748DC3FE26BDACBC57F251AADEFFF391403EC9BF87C97F67E9977FB0".into(),
);
let default_json_str = r#"{"Account":"rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo","TransactionType":"CheckCancel","Fee":"12","Flags":0,"SigningPubKey":"","CheckID":"49647F0D748DC3FE26BDACBC57F251AADEFFF391403EC9BF87C97F67E9977FB0"}"#;
let default_json_str = r#"{"Account":"rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo","TransactionType":"CheckCancel","SigningPubKey":"","Fee":"12","Flags":0,"CheckID":"49647F0D748DC3FE26BDACBC57F251AADEFFF391403EC9BF87C97F67E9977FB0"}"#;
// Serialize
let default_json_value = serde_json::to_value(default_json_str).unwrap();
let serialized_string = serde_json::to_string(&default_txn).unwrap();
Expand Down
4 changes: 2 additions & 2 deletions src/models/transactions/check_cash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ impl<'a> CheckCash<'a> {
None,
sequence,
signers,
None,
"".into(),
source_tag,
ticket_sequence,
None,
Expand Down Expand Up @@ -176,7 +176,7 @@ mod tests {
Some("100000000".into()),
None,
);
let default_json_str = r#"{"Account":"rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy","TransactionType":"CheckCash","Fee":"12","Flags":0,"SigningPubKey":"","CheckID":"838766BA2B995C00744175F69A1B11E32C3DBC40E64801A4056FCBD657F57334","Amount":"100000000"}"#;
let default_json_str = r#"{"Account":"rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy","TransactionType":"CheckCash","SigningPubKey":"","Fee":"12","Flags":0,"CheckID":"838766BA2B995C00744175F69A1B11E32C3DBC40E64801A4056FCBD657F57334","Amount":"100000000"}"#;
// Serialize
let default_json_value = serde_json::to_value(default_json_str).unwrap();
let serialized_string = serde_json::to_string(&default_txn).unwrap();
Expand Down
4 changes: 2 additions & 2 deletions src/models/transactions/check_create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ impl<'a> CheckCreate<'a> {
None,
sequence,
signers,
None,
"".into(),
source_tag,
ticket_sequence,
None,
Expand Down Expand Up @@ -131,7 +131,7 @@ mod tests {
Some(570113521),
Some("6F1DFD1D0FE8A32E40E1F2C05CF1C15545BAB56B617F9C6C2D63A6B704BEF59B".into()),
);
let default_json_str = r#"{"Account":"rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo","TransactionType":"CheckCreate","Fee":"12","Flags":0,"SigningPubKey":"","Destination":"rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy","SendMax":"100000000","DestinationTag":1,"Expiration":570113521,"InvoiceID":"6F1DFD1D0FE8A32E40E1F2C05CF1C15545BAB56B617F9C6C2D63A6B704BEF59B"}"#;
let default_json_str = r#"{"Account":"rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo","TransactionType":"CheckCreate","SigningPubKey":"","Fee":"12","Flags":0,"Destination":"rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy","SendMax":"100000000","DestinationTag":1,"Expiration":570113521,"InvoiceID":"6F1DFD1D0FE8A32E40E1F2C05CF1C15545BAB56B617F9C6C2D63A6B704BEF59B"}"#;
// Serialize
let default_json_value = serde_json::to_value(default_json_str).unwrap();
let serialized_string = serde_json::to_string(&default_txn).unwrap();
Expand Down
4 changes: 2 additions & 2 deletions src/models/transactions/deposit_preauth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ impl<'a> DepositPreauth<'a> {
None,
sequence,
signers,
None,
"".into(),
source_tag,
ticket_sequence,
None,
Expand Down Expand Up @@ -164,7 +164,7 @@ mod tests {
Some("rEhxGqkqPPSxQ3P25J66ft5TwpzV14k2de".into()),
None,
);
let default_json_str = r#"{"Account":"rsUiUMpnrgxQp24dJYZDhmV4bE3aBtQyt8","TransactionType":"DepositPreauth","Fee":"10","Flags":0,"Sequence":2,"SigningPubKey":"","Authorize":"rEhxGqkqPPSxQ3P25J66ft5TwpzV14k2de"}"#;
let default_json_str = r#"{"Account":"rsUiUMpnrgxQp24dJYZDhmV4bE3aBtQyt8","TransactionType":"DepositPreauth","SigningPubKey":"","Fee":"10","Flags":0,"Sequence":2,"Authorize":"rEhxGqkqPPSxQ3P25J66ft5TwpzV14k2de"}"#;
// Serialize
let default_json_value = serde_json::to_value(default_json_str).unwrap();
let serialized_string = serde_json::to_string(&default_txn).unwrap();
Expand Down
4 changes: 2 additions & 2 deletions src/models/transactions/escrow_cancel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ impl<'a> EscrowCancel<'a> {
None,
sequence,
signers,
None,
"".into(),
source_tag,
ticket_sequence,
None,
Expand Down Expand Up @@ -110,7 +110,7 @@ mod tests {
"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn".into(),
7,
);
let default_json_str = r#"{"Account":"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn","TransactionType":"EscrowCancel","Flags":0,"SigningPubKey":"","Owner":"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn","OfferSequence":7}"#;
let default_json_str = r#"{"Account":"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn","TransactionType":"EscrowCancel","SigningPubKey":"","Flags":0,"Owner":"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn","OfferSequence":7}"#;
// Serialize
let default_json_value = serde_json::to_value(default_json_str).unwrap();
let serialized_string = serde_json::to_string(&default_txn).unwrap();
Expand Down
4 changes: 2 additions & 2 deletions src/models/transactions/escrow_create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ impl<'a> EscrowCreate<'a> {
None,
sequence,
signers,
None,
"".into(),
source_tag,
ticket_sequence,
None,
Expand Down Expand Up @@ -207,7 +207,7 @@ mod tests {
Some(23480),
Some(533171558),
);
let default_json_str = r#"{"Account":"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn","TransactionType":"EscrowCreate","Flags":0,"SigningPubKey":"","SourceTag":11747,"Amount":"10000","Destination":"rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW","DestinationTag":23480,"CancelAfter":533257958,"FinishAfter":533171558,"Condition":"A0258020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855810100"}"#;
let default_json_str = r#"{"Account":"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn","TransactionType":"EscrowCreate","SigningPubKey":"","Flags":0,"SourceTag":11747,"Amount":"10000","Destination":"rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW","DestinationTag":23480,"CancelAfter":533257958,"FinishAfter":533171558,"Condition":"A0258020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855810100"}"#;
// Serialize
let default_json_value = serde_json::to_value(default_json_str).unwrap();
let serialized_string = serde_json::to_string(&default_txn).unwrap();
Expand Down
2 changes: 1 addition & 1 deletion src/models/transactions/escrow_finish.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ impl<'a> EscrowFinish<'a> {
None,
sequence,
signers,
None,
"".into(),
source_tag,
ticket_sequence,
None,
Expand Down
38 changes: 9 additions & 29 deletions src/models/transactions/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,27 +108,6 @@ pub enum TransactionType {
UNLModify,
}

#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Clone, new)]
#[serde(rename_all = "PascalCase")]
pub struct PreparedTransaction<'a, T> {
#[serde(flatten)]
pub transaction: T,
/// Hex representation of the public key that corresponds to the
/// private key used to sign this transaction. If an empty string,
/// indicates a multi-signature is present in the Signers field instead.
pub signing_pub_key: Cow<'a, str>,
}

#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Clone, new)]
#[serde(rename_all = "PascalCase")]
pub struct SignedTransaction<'a, T> {
#[serde(flatten)]
pub prepared_transaction: PreparedTransaction<'a, T>,
/// The signature that verifies this transaction as originating
/// from the account it says it is from.
pub txn_signature: Cow<'a, str>,
}

/// The base fields for all transaction models.
///
/// See Transaction Common Fields:
Expand All @@ -147,6 +126,11 @@ where
/// See Transaction Types:
/// `<https://xrpl.org/transaction-types.html>`
pub transaction_type: TransactionType,
/// Hex representation of the public key that corresponds to the
/// private key used to sign this transaction. If an empty string,
/// indicates a multi-signature is present in the Signers field instead.
#[serde(default)]
pub signing_pub_key: Cow<'a, str>,
/// Hash value identifying another transaction. If provided, this
/// transaction is only valid if the sending account's
/// previously-sent transaction matches the provided hash.
Expand Down Expand Up @@ -182,10 +166,6 @@ where
/// made. Conventionally, a refund should specify the initial
/// payment's SourceTag as the refund payment's DestinationTag.
pub signers: Option<Vec<Signer>>,
/// Hex representation of the public key that corresponds to the
/// private key used to sign this transaction. If an empty string,
/// indicates a multi-signature is present in the Signers field instead.
pub signing_pub_key: Option<Cow<'a, str>>,
/// Arbitrary integer used to identify the reason for this
/// payment, or a sender on whose behalf this transaction
/// is made. Conventionally, a refund should specify the initial
Expand Down Expand Up @@ -215,7 +195,7 @@ where
network_id: Option<u32>,
sequence: Option<u32>,
signers: Option<Vec<Signer>>,
signing_pub_key: Option<Cow<'a, str>>,
signing_pub_key: Cow<'a, str>,
source_tag: Option<u32>,
ticket_sequence: Option<u32>,
txn_signature: Option<Cow<'a, str>>,
Expand All @@ -231,7 +211,7 @@ where
network_id,
sequence,
signers,
signing_pub_key: Some(signing_pub_key.unwrap_or("".into())),
signing_pub_key,
source_tag,
ticket_sequence,
txn_signature,
Expand All @@ -249,7 +229,7 @@ where
.iter()
.all(|signer| signer.txn_signature.len() > 0 && signer.signing_pub_key.len() > 0)
} else {
self.txn_signature.is_some() && self.signing_pub_key.is_some()
self.txn_signature.is_some() && !self.signing_pub_key.is_empty()
}
}
}
Expand Down Expand Up @@ -349,7 +329,7 @@ where

fn is_signed(&self) -> bool {
self.get_common_fields().txn_signature.is_some()
&& self.get_common_fields().signing_pub_key.is_some()
&& !self.get_common_fields().signing_pub_key.is_empty()
}

/// Hashes the Transaction object as the ledger does. Only valid for signed
Expand Down
4 changes: 2 additions & 2 deletions src/models/transactions/nftoken_accept_offer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ impl<'a> NFTokenAcceptOffer<'a> {
None,
sequence,
signers,
None,
"".into(),
source_tag,
ticket_sequence,
None,
Expand Down Expand Up @@ -246,7 +246,7 @@ mod tests {
None,
None,
);
let default_json_str = r#"{"Account":"r9spUPhPBfB6kQeF6vPhwmtFwRhBh2JUCG","TransactionType":"NFTokenAcceptOffer","Fee":"12","Flags":0,"LastLedgerSequence":75447550,"Memos":[{"Memo":{"MemoData":"61356534373538372D633134322D346663382D616466362D393666383562356435386437","MemoFormat":null,"MemoType":null}}],"Sequence":68549302,"SigningPubKey":"","NFTokenSellOffer":"68CD1F6F906494EA08C9CB5CAFA64DFA90D4E834B7151899B73231DE5A0C3B77"}"#;
let default_json_str = r#"{"Account":"r9spUPhPBfB6kQeF6vPhwmtFwRhBh2JUCG","TransactionType":"NFTokenAcceptOffer","SigningPubKey":"","Fee":"12","Flags":0,"LastLedgerSequence":75447550,"Memos":[{"Memo":{"MemoData":"61356534373538372D633134322D346663382D616466362D393666383562356435386437","MemoFormat":null,"MemoType":null}}],"Sequence":68549302,"NFTokenSellOffer":"68CD1F6F906494EA08C9CB5CAFA64DFA90D4E834B7151899B73231DE5A0C3B77"}"#;
// Serialize
let default_json_value = serde_json::to_value(default_json_str).unwrap();
let serialized_string = serde_json::to_string(&default_txn).unwrap();
Expand Down
4 changes: 2 additions & 2 deletions src/models/transactions/nftoken_burn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ impl<'a> NFTokenBurn<'a> {
None,
sequence,
signers,
None,
"".into(),
source_tag,
ticket_sequence,
None,
Expand Down Expand Up @@ -118,7 +118,7 @@ mod tests {
"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65".into(),
Some("rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B".into()),
);
let default_json_str = r#"{"Account":"rNCFjv8Ek5oDrNiMJ3pw6eLLFtMjZLJnf2","TransactionType":"NFTokenBurn","Fee":"10","Flags":0,"SigningPubKey":"","NFTokenID":"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65","Owner":"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"}"#;
let default_json_str = r#"{"Account":"rNCFjv8Ek5oDrNiMJ3pw6eLLFtMjZLJnf2","TransactionType":"NFTokenBurn","SigningPubKey":"","Fee":"10","Flags":0,"NFTokenID":"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65","Owner":"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"}"#;
// Serialize
let default_json_value = serde_json::to_value(default_json_str).unwrap();
let serialized_string = serde_json::to_string(&default_txn).unwrap();
Expand Down
4 changes: 2 additions & 2 deletions src/models/transactions/nftoken_cancel_offer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ impl<'a> NFTokenCancelOffer<'a> {
None,
sequence,
signers,
None,
"".into(),
source_tag,
ticket_sequence,
None,
Expand Down Expand Up @@ -171,7 +171,7 @@ mod tests {
None,
vec!["9C92E061381C1EF37A8CDE0E8FC35188BFC30B1883825042A64309AC09F4C36D".into()],
);
let default_json_str = r#"{"Account":"ra5nK24KXen9AHvsdFTKHSANinZseWnPcX","TransactionType":"NFTokenCancelOffer","Flags":0,"SigningPubKey":"","NFTokenOffers":["9C92E061381C1EF37A8CDE0E8FC35188BFC30B1883825042A64309AC09F4C36D"]}"#;
let default_json_str = r#"{"Account":"ra5nK24KXen9AHvsdFTKHSANinZseWnPcX","TransactionType":"NFTokenCancelOffer","SigningPubKey":"","Flags":0,"NFTokenOffers":["9C92E061381C1EF37A8CDE0E8FC35188BFC30B1883825042A64309AC09F4C36D"]}"#;
// Serialize
let default_json_value = serde_json::to_value(default_json_str).unwrap();
let serialized_string = serde_json::to_string(&default_txn).unwrap();
Expand Down
4 changes: 2 additions & 2 deletions src/models/transactions/nftoken_create_offer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ impl<'a> NFTokenCreateOffer<'a> {
None,
sequence,
signers,
None,
"".into(),
source_tag,
ticket_sequence,
None,
Expand Down Expand Up @@ -351,7 +351,7 @@ mod tests {
None,
None,
);
let default_json_str = r#"{"Account":"rs8jBmmfpwgmrSPgwMsh7CvKRmRt1JTVSX","TransactionType":"NFTokenCreateOffer","Flags":1,"SigningPubKey":"","NFTokenID":"000100001E962F495F07A990F4ED55ACCFEEF365DBAA76B6A048C0A200000007","Amount":"1000000"}"#;
let default_json_str = r#"{"Account":"rs8jBmmfpwgmrSPgwMsh7CvKRmRt1JTVSX","TransactionType":"NFTokenCreateOffer","SigningPubKey":"","Flags":1,"NFTokenID":"000100001E962F495F07A990F4ED55ACCFEEF365DBAA76B6A048C0A200000007","Amount":"1000000"}"#;
// Serialize
let default_json_value = serde_json::to_value(default_json_str).unwrap();
let serialized_string = serde_json::to_string(&default_txn).unwrap();
Expand Down
Loading
Loading