#[cfg(test)]
mod tests {
use crate::integration::utils::CliTest;
#[test]
fn test_contract_info() {
let cli = CliTest::new();
let _contract_hash = "0xef4073a0f2b305a38ec4050e4d3d28bc40ea63f5";
let output = cli.run_command(&["contract", "list-native-contracts"]);
assert!(output.status.code().unwrap_or(127) != 127, "Command not found");
}
#[test]
#[ignore] fn test_contract_manifest() {
let cli = CliTest::new();
let _contract_hash = "0xef4073a0f2b305a38ec4050e4d3d28bc40ea63f5";
let output = cli.run_command(&["contract", "list-native-contracts"]);
assert!(output.status.code().unwrap_or(127) != 127, "Command not found");
}
#[test]
#[ignore] fn test_contract_methods() {
let cli = CliTest::new();
let _contract_hash = "0xef4073a0f2b305a38ec4050e4d3d28bc40ea63f5";
let output = cli.run_command(&["contract", "list-native-contracts"]);
assert!(output.status.code().unwrap_or(127) != 127, "Command not found");
}
#[test]
fn test_contract_test_invoke() {
let cli = CliTest::new();
let params_json = r#"["test"]"#;
let contract_hash = "0xef4073a0f2b305a38ec4050e4d3d28bc40ea63f5"; let method = "transfer";
let output = cli.run_command(&[
"contract",
"invoke",
"--script-hash",
contract_hash,
"--method",
method,
"--params",
params_json,
"--test-invoke",
]);
assert!(output.status.code().unwrap_or(127) != 127, "Command not found");
}
#[test]
#[ignore] fn test_contract_storage() {
let cli = CliTest::new();
let _contract_hash = "0xef4073a0f2b305a38ec4050e4d3d28bc40ea63f5";
let output = cli.run_command(&["contract", "list-native-contracts"]);
assert!(output.status.code().unwrap_or(127) != 127, "Command not found");
}
#[test]
fn test_contract_deploy() {
let cli = CliTest::new();
let nef_content = "NEF1FAKECONTENTaa";
let nef_file = cli.create_temp_file(nef_content);
let manifest_content = r#"{
"name": "TestContract",
"groups": [],
"features": {},
"abi": {
"methods": [
{
"name": "verify",
"parameters": [],
"returntype": "Boolean",
"offset": 0
}
],
"events": []
},
"permissions": [
{
"contract": "*",
"methods": "*"
}
],
"trusts": [],
"supportedstandards": [],
"extra": null
}"#;
let manifest_file = cli.create_temp_file(manifest_content);
let output = cli.run_command(&[
"contract",
"deploy",
"--nef",
nef_file.to_str().unwrap(),
"--manifest",
manifest_file.to_str().unwrap(),
]);
assert!(output.status.code().unwrap_or(127) != 127, "Command not found");
}
}