Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: consolidate all ABI Sway programs #3171

Merged

Conversation

petertonysmith94
Copy link
Contributor

@petertonysmith94 petertonysmith94 commented Sep 16, 2024

Part of TS-599, TS-600

Summary

  • Consolidates all abi-typegen/* and abi-coder/exhaustive-example Sway programs into abi-contract, abi-predicate and abi-script.

  • Added two lists below which are the original test location (with method) and their destination location.

    Abi Typegen
    abi-typegen/tests abi-contract Notes
    array-of-enums types_struct_with_array_of_enums  
    array-with-generics.simple types_struct_with_nested_array  
    array-with-generics.with_generics types_array_with_generic_struct  
    bytes types_bytes  
    enum-of-enums types_enum_with_structs Has a nested enum with this enum
    enum-of-structs types_enum_with_structs Has nested struct within enum
    enum-simple types_enum_with_builtin_type  
    enum-simple-native types_enum  
    evm-address types_evm_address  
    fn-void types_void  
    full The backbones of this contract Copy + pasted this base contract as the initial starting point for abi-contract.
    libs-for-testing abi-library  
    minimal multi_arg_str_str  
    minimal-with-configurables configurables  
    option-simple types_option  
    predicate abi-predicate  
    predicate-with-configurables abi-predicate  
    raw-slice types_raw_slice  
    script abi-script  
    script-with-configurables abi-script  
    std-string types_std_string  
    struct-nested.single_params types_struct_with_multiple_struct_params  
    struct-nested.multi_params types_struct_with_complex_nested_struct  
    struct-simple types_struct_with_nested_struct  
    struct-with-array types_struct_with_implicit_generics  
    tuple-simple.single_param types_struct_with_nested_tuple  
    tuple-simple.tuple_params types_tuple_complex  
    vector-simple types_vector_u8  
    Exhaustive example
    Exhaustive example abi-contract  
    test_function types_bool  
    u_8 types_u8  
    u_16 types_u16  
    u_32 types_u32  
    u_64 types_u64  
    string types_str  
    boolean types_bool  
    b_256 types_b256  
    b_512 types_b512  
    two_args types_struct_simple  
    struct_simple types_struct_generic  
    struct_generic_simple types_struct_with_tuple  
    struct_with_tuple types_struct_with_implicit_generics  
    struct_with_implicit_generics types_bytes  
    bytes types_raw_slice  
    raw_slice types_std_string  
    dynamic_string types_asset_id  
    asset_id types_tuple_complex  
    tuple_as_param types_tuple_complex  
    array_simple types_array_struct  
    array_struct types_struct_with_array  
    vector_boolean types_vector_u8  
    vector_u8 types_vector_boolean  
    arg_then_vector_u8 types_vector_u8  
    vector_u8_then_arg types_vector_inside_vector  
    two_u8_vectors types_vector_inside_array  
    u32_then_three_vectors_u64 types_enum_with_vector  
    enum_simple types_struct_with_vector  
    enum_with_builtin_type types_enum  
    enum_with_structs types_enum_with_builtin_type  
    option_u8 types_enum_with_structs  
    return_configurables types_option_u8  
    simple_vector multi_arg_b256_bool  
    vector_inside_vector multi_arg_u32_vector_vector  
    vector_inside_array multi_arg_struct_vector  
    vector_inside_enum multi_arg_vector_b256  
    vector_inside_struct multi_arg_vector_vector  
    array_with_generic_struct types_struct_with_array  
    entry_one types_u64 🍎 Need to regenerate the fn signatures with new names
    sum multi_arg_u64_u64 🍎 Need to regenerate the fn signatures with new names
    sum_test 🍎 TODO 🍎 Need to regenerate the fn signatures with new names
    takes_array types_array 🍎 Need to regenerate the fn signatures with new names
    take_enum types_enum + types_bool 🍎 Need to regenerate the fn signatures with new names
    my_struct multi_arg_u64_struct 🍎 Need to regenerate the fn signatures with new names
    array_of_structs types_array_struct + types_str 🍎 Need to regenerate the fn signatures with new names
    complex_function multi_arg_complex 🍎 Need to regenerate the fn signatures with new names

Checklist

  • All changes are covered by tests (or not applicable)
  • All changes are documented (or not applicable)
  • I reviewed the entire PR myself (preferably, on GH UI)
  • I described all Breaking Changes (or there's none)

@petertonysmith94 petertonysmith94 added the chore Issue is a chore label Sep 16, 2024
@petertonysmith94 petertonysmith94 self-assigned this Sep 16, 2024
Copy link

vercel bot commented Sep 16, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
create-fuels-template ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 16, 2024 3:32pm
ts-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 16, 2024 3:32pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
create-fuels-counter-example ⬜️ Ignored (Inspect) Sep 16, 2024 3:32pm

@petertonysmith94
Copy link
Contributor Author

@nedsalk could you give this a pre-review please 🙏🏼

If you're happy put it in ready for review :)

@nedsalk
Copy link
Contributor

nedsalk commented Sep 16, 2024

LGTM, it's exhaustive and possibly repetitive, so we can maybe slim it down as we write tests with it and notice possible repetitions.

Copy link
Contributor

@danielbate danielbate left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondeful work, we should definitely refactor other fuel-gauge tests to use this, speed up pretest

Copy link

codspeed-hq bot commented Sep 16, 2024

CodSpeed Performance Report

Merging #3171 will improve performances by 39.09%

Comparing ps/chore/consolidate-all-contract-tests (9929b27) with np/feat/abi-refactor (09cddf0)

Summary

⚡ 1 improvements
✅ 20 untouched benchmarks

Benchmarks breakdown

Benchmark np/feat/abi-refactor ps/chore/consolidate-all-contract-tests Change
should successfully execute a contract mint 93.6 ms 67.3 ms +39.09%

@petertonysmith94 petertonysmith94 merged commit 8eb9316 into np/feat/abi-refactor Sep 16, 2024
21 of 22 checks passed
@petertonysmith94 petertonysmith94 deleted the ps/chore/consolidate-all-contract-tests branch September 16, 2024 15:47
@petertonysmith94 petertonysmith94 mentioned this pull request Sep 16, 2024
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Issue is a chore
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants