Skip to content

Commit

Permalink
Removed unneeded tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mstrug-rdx committed Oct 16, 2023
1 parent be48c9a commit c012a72
Showing 1 changed file with 0 additions and 106 deletions.
106 changes: 0 additions & 106 deletions radix-engine-tests/tests/component.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,112 +115,6 @@ fn blueprint_name_can_be_obtained_from_a_method() {
assert_eq!(blueprint_name, "ComponentTest")
}

#[test]
fn pass_bucket_to_other_component() {
let mut test_runner = TestRunnerBuilder::new().build();
let package_address = test_runner.publish_package_simple(PackageLoader::get("component"));

// create two components
let receipt = test_runner.execute_manifest(
ManifestBuilder::new()
.lock_fee_from_faucet()
.call_function(
package_address,
"ComponentTest",
"create_component",
manifest_args!(),
)
.call_function(
package_address,
"ComponentTest",
"create_component",
manifest_args!(),
)
.build(),
vec![],
);
let result = receipt.expect_commit_success();

let component_address_1 = result.new_component_addresses()[0];
let component_address_2 = result.new_component_addresses()[1];
let resource_address_1 = result.new_resource_addresses()[0];

// take bucket with resources from component 1 and pass it to the component 2
// which burns it
let receipt = test_runner.execute_manifest(
ManifestBuilder::new()
.lock_fee_from_faucet()
.call_method(component_address_1, "put_component_state", manifest_args!())
.take_all_from_worktop(resource_address_1, "bucket_name")
.call_method_with_name_lookup(component_address_2, "burn_bucket", |lookup| {
(lookup.bucket("bucket_name"),)
})
.build(),
vec![],
);

// verify if manifest executed with success
receipt.expect_commit_success();
}

#[test]
fn pass_proof_to_other_component() {
let mut test_runner = TestRunnerBuilder::new().build();
let package_address = test_runner.publish_package_simple(PackageLoader::get("component"));

// create 1st component
let receipt = test_runner.execute_manifest(
ManifestBuilder::new()
.lock_fee_from_faucet()
.call_function(
package_address,
"ComponentTest2",
"create_component",
manifest_args!(),
)
.build(),
vec![],
);
let result = receipt.expect_commit_success();

let component_address_1 = result.new_component_addresses().first().cloned().unwrap();
let resource_address_1 = result.new_resource_addresses().first().cloned().unwrap();

// create 2nd component passing resource address from 1st component
let receipt = test_runner.execute_manifest(
ManifestBuilder::new()
.lock_fee_from_faucet()
.call_function(
package_address,
"ComponentTest3",
"create_component",
manifest_args!(resource_address_1),
)
.build(),
vec![],
);
let result = receipt.expect_commit_success();
let component_address_2 = result.new_component_addresses().first().cloned().unwrap();

// take buckate and proof from the 1st component and pass
// to the 2nd component for resource address validation
let receipt = test_runner.execute_manifest(
ManifestBuilder::new()
.lock_fee_from_faucet()
.call_method(component_address_1, "generate_nft_proof", manifest_args!())
.pop_from_auth_zone("proof_1")
.call_method_with_name_lookup(component_address_2, "check_proof", |lookup| {
(lookup.proof("proof_1"),)
})
.burn_all_from_worktop(resource_address_1) // resources from bucket returned by generate_nft_proof()
.build(),
vec![],
);

// verify if manifest executed with success
receipt.expect_commit_success();
}

#[test]
fn pass_bucket_and_proof_to_other_component() {
let mut test_runner = TestRunnerBuilder::new().build();
Expand Down

0 comments on commit c012a72

Please sign in to comment.