From e468d2e81b1b849cca72b6240ab1540375313af6 Mon Sep 17 00:00:00 2001 From: davidcuellarrdx Date: Wed, 26 Jun 2024 17:18:42 +0100 Subject: [PATCH] Fix: Add lock_fee_from_faucet --- step-by-step/02-hello-token-explained/tests/lib.rs | 2 ++ step-by-step/03-create-a-custom-resource/tests/lib.rs | 2 ++ .../09-hello-token-front-end/scrypto-package/tests/lib.rs | 2 ++ step-by-step/19-hello-test/tests/lib.rs | 3 +++ step-by-step/20-candy-store-tests/tests/candy_store.rs | 6 ++++++ 5 files changed, 15 insertions(+) diff --git a/step-by-step/02-hello-token-explained/tests/lib.rs b/step-by-step/02-hello-token-explained/tests/lib.rs index 38e5f75..3c7b358 100644 --- a/step-by-step/02-hello-token-explained/tests/lib.rs +++ b/step-by-step/02-hello-token-explained/tests/lib.rs @@ -15,6 +15,7 @@ fn test_hello() { // Test the `instantiate_hello` function. let manifest = ManifestBuilder::new() + .lock_fee_from_faucet() .call_function( package_address, "Hello", @@ -31,6 +32,7 @@ fn test_hello() { // Test the `free_token` method. let manifest = ManifestBuilder::new() + .lock_fee_from_faucet() .call_method(component, "free_token", manifest_args!()) .call_method( account, diff --git a/step-by-step/03-create-a-custom-resource/tests/lib.rs b/step-by-step/03-create-a-custom-resource/tests/lib.rs index 8a5ceb5..0896d11 100644 --- a/step-by-step/03-create-a-custom-resource/tests/lib.rs +++ b/step-by-step/03-create-a-custom-resource/tests/lib.rs @@ -15,6 +15,7 @@ fn test_hello() { // Test the `instantiate_hello` function. let manifest = ManifestBuilder::new() + .lock_fee_from_faucet() .call_function( package_address, "Hello", @@ -31,6 +32,7 @@ fn test_hello() { // Test the `free_token` method. let manifest = ManifestBuilder::new() + .lock_fee_from_faucet() .call_method(component, "free_token", manifest_args!()) .call_method( account, diff --git a/step-by-step/09-hello-token-front-end/scrypto-package/tests/lib.rs b/step-by-step/09-hello-token-front-end/scrypto-package/tests/lib.rs index 98df833..aafb1dd 100644 --- a/step-by-step/09-hello-token-front-end/scrypto-package/tests/lib.rs +++ b/step-by-step/09-hello-token-front-end/scrypto-package/tests/lib.rs @@ -15,6 +15,7 @@ fn test_hello() { // Test the `instantiate_hello` function. let manifest = ManifestBuilder::new() + .lock_fee_from_faucet() .call_function( package_address, "Hello", @@ -31,6 +32,7 @@ fn test_hello() { // Test the `free_token` method. let manifest = ManifestBuilder::new() + .lock_fee_from_faucet() .call_method(component, "free_token", manifest_args!()) .call_method( account, diff --git a/step-by-step/19-hello-test/tests/lib.rs b/step-by-step/19-hello-test/tests/lib.rs index a326e9b..a92168d 100644 --- a/step-by-step/19-hello-test/tests/lib.rs +++ b/step-by-step/19-hello-test/tests/lib.rs @@ -15,6 +15,7 @@ fn test_hello() { // Test the `instantiate_hello` function. let manifest = ManifestBuilder::new() + .lock_fee_from_faucet() .call_function( package_address, "Hello", @@ -26,11 +27,13 @@ fn test_hello() { manifest, vec![NonFungibleGlobalId::from_public_key(&public_key)], ); + println!("{:?}\n", receipt); let component = receipt.expect_commit(true).new_component_addresses()[0]; // Test the `free_token` method. let manifest = ManifestBuilder::new() + .lock_fee_from_faucet() .call_method(component, "free_token", manifest_args!()) .call_method( account, diff --git a/step-by-step/20-candy-store-tests/tests/candy_store.rs b/step-by-step/20-candy-store-tests/tests/candy_store.rs index f75f3c8..a69c770 100644 --- a/step-by-step/20-candy-store-tests/tests/candy_store.rs +++ b/step-by-step/20-candy-store-tests/tests/candy_store.rs @@ -16,6 +16,7 @@ fn test_candy_store() { // Build a manifest to instantiate the CandyStore, including initial price argument. let gumball_price = dec!(10); let manifest = ManifestBuilder::new() + .lock_fee_from_faucet() .call_function( package_address, "CandyStore", @@ -47,6 +48,7 @@ fn test_candy_store() { // ----------------- Get the current price of gumballs ----------------- // Build a manifest to call the get_prices method. let manifest = ManifestBuilder::new() + .lock_fee_from_faucet() .call_method(component_address, "get_prices", manifest_args!()) .deposit_batch(account_address) .build(); @@ -69,6 +71,7 @@ fn test_candy_store() { // ----------------- Buy gumballs ----------------- // Build a manifest to call the buy_gumball method. let manifest = ManifestBuilder::new() + .lock_fee_from_faucet() .withdraw_from_account(account_address, XRD, dec!(20)) .take_from_worktop(XRD, dec!(20), "xrd") .call_method_with_name_lookup(component_address, "buy_gumball", |lookup| { @@ -95,6 +98,7 @@ fn test_candy_store() { // ----------------- Set the new price for gumballs ----------------- // Build a manifest to call the set_gumball_price method with the proof of the owner badge. let manifest = ManifestBuilder::new() + .lock_fee_from_faucet() .create_proof_from_account_of_amount(account_address, owner_badge, dec!(1)) .call_method( component_address, @@ -122,6 +126,7 @@ fn test_candy_store() { // ----------------- Restock the candy store ----------------- // Build a manifest to call the restock_store method with proof of the owner badge. let manifest = ManifestBuilder::new() + .lock_fee_from_faucet() .create_proof_from_account_of_amount(account_address, owner_badge, dec!(1)) .call_method(component_address, "restock_store", manifest_args!()) .deposit_batch(account_address) @@ -145,6 +150,7 @@ fn test_candy_store() { // ----------------- Withdraw earnings from the candy store ----------------- // Build a manifest to call the withdraw_earnings method with proof of the owner badge. let manifest = ManifestBuilder::new() + .lock_fee_from_faucet() .create_proof_from_account_of_amount(account_address, owner_badge, dec!(1)) .call_method(component_address, "withdraw_earnings", manifest_args!()) .deposit_batch(account_address)