Skip to content

Commit

Permalink
Merge pull request #61 from radixdlt/fix/lock-fee-from-faucet
Browse files Browse the repository at this point in the history
Fix: Add lock_fee_from_faucet
  • Loading branch information
motosharpley committed Jun 26, 2024
2 parents ca14e33 + e468d2e commit 63cd9ae
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions step-by-step/02-hello-token-explained/tests/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions step-by-step/03-create-a-custom-resource/tests/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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,
Expand Down
3 changes: 3 additions & 0 deletions step-by-step/19-hello-test/tests/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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,
Expand Down
6 changes: 6 additions & 0 deletions step-by-step/20-candy-store-tests/tests/candy_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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();
Expand All @@ -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| {