Skip to content

Commit

Permalink
Rename fixtures from dat to json because they were not binary
Browse files Browse the repository at this point in the history
  • Loading branch information
Sajjon committed Jan 8, 2025
1 parent 33fcb5e commit 2b9098d
Show file tree
Hide file tree
Showing 19 changed files with 35 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,15 @@ mod tests {

use base64::engine::general_purpose::URL_SAFE_NO_PAD;

#[test]
fn aaaaparse_url_into_request() {
let request_params = SampleRequestParams::new_from_text_vector();
assert_eq!(
request_params.session_id,
Some("37a817c9-d71a-4926-b749-efef2d0b1304".to_string())
);
}

#[test]
fn parse_url_into_request() {
let request_params = SampleRequestParams::new_from_text_vector();
Expand Down
8 changes: 4 additions & 4 deletions crates/core/prelude/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ macro_rules! fixture_in {
}

#[macro_export]
macro_rules! fixture_tx {
macro_rules! fixture_tx_file {
($file: expr) => {
$crate::fixture_in!(env!("FIXTURES_TX"), $file)
};
Expand All @@ -15,14 +15,14 @@ macro_rules! fixture_tx {
#[macro_export]
macro_rules! fixture_rtm {
($file: expr) => {
$crate::fixture_tx!(concat!($file, ".rtm"))
$crate::fixture_tx_file!(concat!($file, ".rtm"))
};
}

#[macro_export]
macro_rules! fixture_dat {
macro_rules! fixture_tx {
($file: expr) => {
$crate::fixture_tx!(concat!($file, ".dat"))
$crate::fixture_tx_file!(concat!($file, ".json"))
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ impl Default for FeeLocks {
#[cfg(test)]
mod tests {

use prelude::{fixture_dat, fixture_rtm};
use prelude::{fixture_rtm, fixture_tx};

use super::*;

Expand All @@ -63,7 +63,7 @@ mod tests {
let instructions_string =
fixture_rtm!("transfer_1to2_multiple_nf_and_f_tokens");

let receipt = deserialize_receipt(fixture_dat!(
let receipt = deserialize_receipt(fixture_tx!(
"transfer_1to2_multiple_nf_and_f_tokens"
));

Expand Down Expand Up @@ -168,7 +168,7 @@ mod tests {
fn third_party_deposits_update() {
let instructions_string = fixture_rtm!("third_party_deposits_update");
let receipt =
deserialize_receipt(fixture_dat!("third_party_deposits_update"));
deserialize_receipt(fixture_tx!("third_party_deposits_update"));

let transaction_manifest = TransactionManifest::new(
instructions_string,
Expand Down Expand Up @@ -229,7 +229,7 @@ mod tests {
fn create_single_fungible() {
let instructions_string = fixture_rtm!("create_single_fungible");
let receipt =
deserialize_receipt(fixture_dat!("create_single_fungible"));
deserialize_receipt(fixture_tx!("create_single_fungible"));

let transaction_manifest = TransactionManifest::new(
instructions_string,
Expand Down Expand Up @@ -279,8 +279,7 @@ mod tests {
#[test]
fn create_nft_collection() {
let instructions_string = fixture_rtm!("create_nft_collection");
let receipt =
deserialize_receipt(fixture_dat!("create_nft_collection"));
let receipt = deserialize_receipt(fixture_tx!("create_nft_collection"));

let transaction_manifest = TransactionManifest::new(
instructions_string,
Expand Down Expand Up @@ -361,8 +360,7 @@ mod tests {
#[test]
fn mint_nft_gumball_card() {
let instructions_string = fixture_rtm!("mint_nft_gumball_card");
let receipt =
deserialize_receipt(fixture_dat!("mint_nft_gumball_card"));
let receipt = deserialize_receipt(fixture_tx!("mint_nft_gumball_card"));

let transaction_manifest = TransactionManifest::new(
instructions_string,
Expand Down Expand Up @@ -430,7 +428,7 @@ mod tests {
fn present_proof_swap_candy() {
let instructions_string = fixture_rtm!("present_proof_swap_candy");
let receipt =
deserialize_receipt(fixture_dat!("present_proof_swap_candy"));
deserialize_receipt(fixture_tx!("present_proof_swap_candy"));

let transaction_manifest = TransactionManifest::new(
instructions_string,
Expand Down Expand Up @@ -483,7 +481,7 @@ mod tests {
fn create_pool() {
let instructions_string = fixture_rtm!("create_pool");

let receipt = deserialize_receipt(fixture_dat!("create_pool"));
let receipt = deserialize_receipt(fixture_tx!("create_pool"));

let transaction_manifest = TransactionManifest::new(
instructions_string,
Expand Down Expand Up @@ -519,8 +517,7 @@ mod tests {
fn contribute_to_bi_pool() {
let instructions_string = fixture_rtm!("contribute_to_bi_pool");

let receipt =
deserialize_receipt(fixture_dat!("contribute_to_bi_pool"));
let receipt = deserialize_receipt(fixture_tx!("contribute_to_bi_pool"));

let transaction_manifest = TransactionManifest::new(
instructions_string,
Expand Down Expand Up @@ -576,7 +573,7 @@ mod tests {
fn stake_to_three_validators() {
let instructions_string = fixture_rtm!("stake_to_three_validators");
let receipt =
deserialize_receipt(fixture_dat!("stake_to_three_validators"));
deserialize_receipt(fixture_tx!("stake_to_three_validators"));

let transaction_manifest = TransactionManifest::new(
instructions_string,
Expand Down Expand Up @@ -654,7 +651,7 @@ mod tests {
#[test]
fn redeem_from_bi_pool() {
let instructions_string = fixture_rtm!("redeem_from_bi_pool");
let receipt = deserialize_receipt(fixture_dat!("redeem_from_bi_pool"));
let receipt = deserialize_receipt(fixture_tx!("redeem_from_bi_pool"));

let transaction_manifest = TransactionManifest::new(
instructions_string,
Expand Down Expand Up @@ -706,7 +703,7 @@ mod tests {
fn unstake_partially_from_one_validator() {
let instructions_string =
fixture_rtm!("unstake_partially_from_one_validator");
let receipt = deserialize_receipt(fixture_dat!(
let receipt = deserialize_receipt(fixture_tx!(
"unstake_partially_from_one_validator"
));

Expand Down Expand Up @@ -784,7 +781,7 @@ mod tests {
fn claim_two_stakes_from_one_validator() {
let instructions_string =
fixture_rtm!("claim_two_stakes_from_one_validator");
let receipt = deserialize_receipt(fixture_dat!(
let receipt = deserialize_receipt(fixture_tx!(
"claim_two_stakes_from_one_validator"
));

Expand Down Expand Up @@ -858,7 +855,7 @@ mod tests {
let instructions_string =
fixture_rtm!("account_locker_claim_fungibles_and_non_fungibles");

let receipt = deserialize_receipt(fixture_dat!(
let receipt = deserialize_receipt(fixture_tx!(
"account_locker_claim_fungibles_and_non_fungibles"
));

Expand Down Expand Up @@ -914,7 +911,7 @@ mod tests {
fn account_delete() {
let instructions_string = fixture_rtm!("account_delete");

let receipt = deserialize_receipt(fixture_dat!("account_delete"));
let receipt = deserialize_receipt(fixture_tx!("account_delete"));

let transaction_manifest = TransactionManifest::new(
instructions_string,
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

{
"kind": "CommitSuccess",
"state_updates_summary": {
Expand All @@ -15,7 +16,7 @@
"resource_address": "resource_tdx_2_1ng3g2nj5pfpmdphgz0nrh8z0gtqcxx5z5dn48t85ar0z0zjhefufaw",
"ids": [
"{1c1ce92c810094a7-65659db6a666c19c-6cea4367bb789b55-276b137712ceecce}",
"{5aebd0270calf3f87-51031498741f57b5-d24fe0d62a976589-519c6a92423888cc}"
"{5aebd0270caf3f87-51031498741f57b5-d24fe0d62a976589-519c6a92423888cc}"
]
}
}
Expand All @@ -28,7 +29,7 @@
"resource_address": "resource_tdx_2_1ng3g2nj5pfpmdphgz0nrh8z0gtqcxx5z5dn48t85ar0z0zjhefufaw",
"ids": [
"{1c1ce92c810094a7-65659db6a666c19c-6cea4367bb789b55-276b137712ceecce}",
"{5aebd0270calf3f87-51031498741f57b5-d24fe0d62a976589-519c6a92423888cc}"
"{5aebd0270caf3f87-51031498741f57b5-d24fe0d62a976589-519c6a92423888cc}"
]
}
}
Expand Down Expand Up @@ -64,4 +65,4 @@
"contingent": "0",
"non_contingent": "0"
}
}
}
4 changes: 2 additions & 2 deletions fixtures/transaction/claim_two_stakes_from_one_validator.rtm
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ CALL_METHOD
Address("resource_tdx_2_1ng3g2nj5pfpmdphgz0nrh8z0gtqcxx5z5dn48t85ar0z0zjhefufaw")
Array<NonFungibleLocalId>(
NonFungibleLocalId("{1c1ce92c810094a7-65659db6a666c19c-6cea4367bb789b55-276b137712ceecce}"),
NonFungibleLocalId("{5aebd0270calf3f87-51031498741f57b5-d24fe0d62a976589-519c6a92423888cc}")
NonFungibleLocalId("{5aebd0270caf3f87-51031498741f57b5-d24fe0d62a976589-519c6a92423888cc}")
)
;
TAKE_ALL_FROM_WORKTOP
Expand All @@ -30,4 +30,4 @@ CALL_METHOD
Address("account_tdx_2_129uv9r46an4hwng8wc97qwpraspvnrc7v2farne4lr6ff7yaevaz2a")
"deposit"
Bucket("bucket2")
;
;
File renamed without changes.
2 changes: 1 addition & 1 deletion fixtures/vector/deep_link_request_params.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"origin": "https://d1vq8n3dnxcyhd.cloudfront.net",
"public_key": "318a26af44cf32c17fc0b843e41ef0384485a1a1785087108faa9fb978ff3a0e",
"identity_public_key": "1c56777babc9f746bccfcef90bdbfa5634e0e8796141a8d218fc1d5b69275df6",
"request": "eyJpdGVtcyI6eyJkaXNjcmltaW5hdG9yIjoiYXV0aG9yaXplZFJlcXVlc3QiLCJhdXRoIjp7ImRpc2NyaW1pbmF0b3IiOiJsb2dpbldpdGhDaGFsbGVuZ2UiLCJjaGFsbGVuZ2UiOiIxN2NhOWYyMWJkMWIzOGRiNDM5MjMwMjVkN2RlMTMxMWQ2ZjU5ODk4OTQ3NGYxNDM0ZGVkOGVlZDgwNmQyYzU3In0sInJlc2V0Ijp7ImFjY291bnRzIjpmYWxzZSwicGVyc29uYURhdGEiOmZhbHNlfX0sImludGVyYWN0aW9uSWQiOiIwMTFjZWUwMy05NjFhLTRlNTUtYjY5Yi02ZWNhZDBiMDY4YzciLCJtZXRhZGF0YSI6eyJ2ZXJzaW9uIjoyLCJkQXBwRGVmaW5pdGlvbkFkZHJlc3MiOiJhY2NvdW50X3RkeF8yXzEyeWY5Z2Q1M3lmZXA3YTY2OWZ2MnQzd203bno5emVlendkMDRuMDJhANDMza2VyOHZ6YTZyaGUiLCJuZXR3b3JrSWQiOjIsIm9yaWdpbiI6Imh0dHBzOi8vZDF2cThuM2RueGN5aGQuY2xvdWRmcm9udC5uZXQifX0",
"request": "eyJpdGVtcyI6eyJkaXNjcmltaW5hdG9yIjoiYXV0aG9yaXplZFJlcXVlc3QiLCJhdXRoIjp7ImRpc2NyaW1pbmF0b3IiOiJsb2dpbldpdGhDaGFsbGVuZ2UiLCJjaGFsbGVuZ2UiOiIxN2NhOWYyMWJkMWIzOGRiNDM5MjMwMjVkN2RlMTMxMWQ2ZjU5ODk4OTQ3NGYxNDM0ZGVkOGVlZDgwNmQyYzU3In0sInJlc2V0Ijp7ImFjY291bnRzIjpmYWxzZSwicGVyc29uYURhdGEiOmZhbHNlfX0sImludGVyYWN0aW9uSWQiOiIwMTFjZWUwMy05NjFhLTRlNTUtYjY5Yi02ZWNhZDBiMDY4YzciLCJtZXRhZGF0YSI6eyJ2ZXJzaW9uIjoyLCJkQXBwRGVmaW5pdGlvbkFkZHJlc3MiOiJhY2NvdW50X3RkeF8yXzEyeWY5Z2Q1M3lmZXA3YTY2OWZ2MnQzd203bno5emVlendkMDRuMDJhNDMza2VyOHZ6YTZyaGUiLCJuZXR3b3JrSWQiOjIsIm9yaWdpbiI6Imh0dHBzOi8vZDF2cThuM2RueGN5aGQuY2xvdWRmcm9udC5uZXQifX0",
"dapp_definition_address": "account_tdx_2_12yf9gd53yfep7a669fv2t3wm7nz9zeezwd04n02a433ker8vza6rhe",
"signature": "4b401b67b5ccb72e54f08f6fb3efb0027dc5e087d3829dea6d411d30759ff0cc75079b43b96de7740b10128d7ca86cd37a196ea9e9f724fea74f400ab4e02206"
}

0 comments on commit 2b9098d

Please sign in to comment.