Skip to content
This repository has been archived by the owner on Oct 25, 2024. It is now read-only.

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Rashad Alston authored and Rashad Alston committed Sep 25, 2023
1 parent 08f2807 commit 95028c5
Show file tree
Hide file tree
Showing 12 changed files with 270 additions and 141 deletions.
218 changes: 117 additions & 101 deletions packages/fuel-indexer-tests/tests/trybuild.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,109 +37,109 @@ module:
);

let tests = vec![
// (
// "fail_if_attribute_manifest_schema_arg_is_invalid.rs",
// "invalid_schema_simple_wasm.yaml",
// TestKind::Fail,
// // Using a custom manifest here
// format!(
// r#"
// namespace: test_namespace
// identifier: simple_wasm_executor
// abi: {tests_root_str}/contracts/simple-wasm/out/debug/contracts-abi.json
// # This schema file doesn't actually exist
// graphql_schema: schema.graphql
// contract_id: ~
// module:
// wasm: {project_root_str}/target/wasm32-unknown-unknown/release/simple_wasm.wasm"#
// ),
// ),
// (
// "fail_if_attribute_args_include_self.rs",
// "simple_wasm.yaml",
// TestKind::Fail,
// manifest_content.clone(),
// ),
// (
// "fail_if_attribute_args_not_included.rs",
// "simple_wasm.yaml",
// TestKind::Fail,
// manifest_content.clone(),
// ),
// (
// "fail_if_attribute_abi_arg_includes_invalid_type.rs",
// "simple_wasm.yaml",
// TestKind::Fail,
// manifest_content.clone(),
// ),
// (
// "fail_if_indexer_module_is_empty.rs",
// "simple_wasm.yaml",
// TestKind::Fail,
// manifest_content.clone(),
// ),
// (
// "fail_if_arg_not_passed_to_handler_function.rs",
// "simple_wasm.yaml",
// TestKind::Fail,
// manifest_content.clone(),
// ),
// (
// "pass_if_indexer_is_valid_single_type.rs",
// "simple_wasm.yaml",
// TestKind::Pass,
// manifest_content.clone(),
// ),
// (
// "pass_if_indexer_is_valid_multi_type.rs",
// "simple_wasm.yaml",
// TestKind::Pass,
// manifest_content.clone(),
// ),
// (
// "pass_if_unsupported_types_are_used.rs",
// "simple_wasm.yaml",
// TestKind::Pass,
// // Using a custom manifest here
// manifest_content.clone(),
// ),
// (
// "fail_if_abi_contains_reserved_fuel_type.rs",
// "invalid_abi_type_simple_wasm.yaml",
// TestKind::Fail,
// // Using a custom manifest here
// format!(
// r#"
// namespace: test_namespace
// identifier: simple_wasm_executor
// abi: {tests_root_str}/contracts/simple-wasm/out/debug/contracts-abi-reserved-name.json
// graphql_schema: {tests_root_str}/indexers/simple-wasm/schema/simple_wasm.graphql
// contract_id: ~
// module:
// wasm: {project_root_str}/target/wasm32-unknown-unknown/release/simple_wasm.wasm"#
// ),
// ),
// (
// "fail_if_ident_not_defined_in_abi.rs",
// "simple_wasm.yaml",
// TestKind::Fail,
// manifest_content.clone(),
// ),
// (
// "fail_if_non_function_patterns_included_in_module.rs",
// "simple_wasm.yaml",
// TestKind::Fail,
// manifest_content.clone(),
// ),
// (
// "fail_if_unsupported_type_used_in_handler_args.rs",
// "simple_wasm.yaml",
// TestKind::Fail,
// manifest_content.clone(),
// ),
(
"pass_if_using_sway_amm_abi.rs",
"fail_if_attribute_manifest_schema_arg_is_invalid.rs",
"invalid_schema_simple_wasm.yaml",
TestKind::Fail,
// Using a custom manifest here
format!(
r#"
namespace: test_namespace
identifier: simple_wasm_executor
abi: {tests_root_str}/contracts/simple-wasm/out/debug/contracts-abi.json
# This schema file doesn't actually exist
graphql_schema: schema.graphql
contract_id: ~
module:
wasm: {project_root_str}/target/wasm32-unknown-unknown/release/simple_wasm.wasm"#
),
),
(
"fail_if_attribute_args_include_self.rs",
"simple_wasm.yaml",
TestKind::Fail,
manifest_content.clone(),
),
(
"fail_if_attribute_args_not_included.rs",
"simple_wasm.yaml",
TestKind::Fail,
manifest_content.clone(),
),
(
"fail_if_attribute_abi_arg_includes_invalid_type.rs",
"simple_wasm.yaml",
TestKind::Fail,
manifest_content.clone(),
),
(
"fail_if_indexer_module_is_empty.rs",
"simple_wasm.yaml",
TestKind::Fail,
manifest_content.clone(),
),
(
"fail_if_arg_not_passed_to_handler_function.rs",
"simple_wasm.yaml",
TestKind::Fail,
manifest_content.clone(),
),
(
"pass_if_indexer_is_valid_single_type.rs",
"simple_wasm_single.yaml",
TestKind::Pass,
manifest_content.clone(),
),
(
"pass_if_indexer_is_valid_multi_type.rs",
"simple_wasm_multi.yaml",
TestKind::Pass,
manifest_content.clone(),
),
(
"pass_if_unsupported_types_are_used.rs",
"simple_wasm_unsupported.yaml",
TestKind::Pass,
// Using a custom manifest here
manifest_content.clone(),
),
(
"fail_if_abi_contains_reserved_fuel_type.rs",
"invalid_abi_type_simple_wasm.yaml",
TestKind::Fail,
// Using a custom manifest here
format!(
r#"
namespace: test_namespace
identifier: simple_wasm_executor
abi: {tests_root_str}/contracts/simple-wasm/out/debug/contracts-abi-reserved-name.json
graphql_schema: {tests_root_str}/indexers/simple-wasm/schema/simple_wasm.graphql
contract_id: ~
module:
wasm: {project_root_str}/target/wasm32-unknown-unknown/release/simple_wasm.wasm"#
),
),
(
"fail_if_ident_not_defined_in_abi.rs",
"simple_wasm.yaml",
TestKind::Fail,
manifest_content.clone(),
),
(
"fail_if_non_function_patterns_included_in_module.rs",
"simple_wasm.yaml",
TestKind::Fail,
manifest_content.clone(),
),
(
"fail_if_unsupported_type_used_in_handler_args.rs",
"simple_wasm.yaml",
TestKind::Fail,
manifest_content.clone(),
),
(
"pass_if_using_sway_amm_abi.rs",
"sway_amm.yaml",
TestKind::Pass,
// Using a custom manifest here
format!(
Expand All @@ -153,6 +153,22 @@ module:
wasm: {project_root_str}/target/wasm32-unknown-unknown/release/simple_wasm.wasm"#
),
),
(
"pass_if_using_sway_dao_abi.rs",
"simple_wasm.yaml",
TestKind::Pass,
// Using a custom manifest here
format!(
r#"
namespace: test_namespace
identifier: simple_wasm_executor
abi: {abi_root_str}/DAO-contract-abi.json
graphql_schema: {tests_root_str}/indexers/simple-wasm/schema/simple_wasm.graphql
contract_id: ~
module:
wasm: {project_root_str}/target/wasm32-unknown-unknown/release/simple_wasm.wasm"#
),
),
];

for (name, manifest_name, kind, manifest_content) in tests {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -469,16 +469,16 @@
"typeArguments": null
},
"attributes": [
{
"name": "payable",
"arguments": []
},
{
"name": "storage",
"arguments": [
"read",
"write"
]
},
{
"name": "payable",
"arguments": []
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -426,16 +426,16 @@
"typeArguments": null
},
"attributes": [
{
"name": "payable",
"arguments": []
},
{
"name": "storage",
"arguments": [
"read",
"write"
]
},
{
"name": "payable",
"arguments": []
}
]
},
Expand Down Expand Up @@ -509,16 +509,16 @@
"typeArguments": null
},
"attributes": [
{
"name": "payable",
"arguments": []
},
{
"name": "storage",
"arguments": [
"read",
"write"
]
},
{
"name": "payable",
"arguments": []
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -407,16 +407,16 @@
"typeArguments": null
},
"attributes": [
{
"name": "payable",
"arguments": []
},
{
"name": "storage",
"arguments": [
"read",
"write"
]
},
{
"name": "payable",
"arguments": []
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -664,16 +664,16 @@
"typeArguments": null
},
"attributes": [
{
"name": "payable",
"arguments": []
},
{
"name": "storage",
"arguments": [
"read",
"write"
]
},
{
"name": "payable",
"arguments": []
}
]
},
Expand Down Expand Up @@ -749,16 +749,16 @@
"typeArguments": null
},
"attributes": [
{
"name": "payable",
"arguments": []
},
{
"name": "storage",
"arguments": [
"read",
"write"
]
},
{
"name": "payable",
"arguments": []
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -567,16 +567,16 @@
"typeArguments": null
},
"attributes": [
{
"name": "payable",
"arguments": []
},
{
"name": "storage",
"arguments": [
"read",
"write"
]
},
{
"name": "payable",
"arguments": []
}
]
},
Expand Down
Loading

0 comments on commit 95028c5

Please sign in to comment.