-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Create #[abi_name(name)]
annotation
#5955
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
Labels
compiler
General compiler. Should eventually become more specific as the issue is triaged
language feature
Core language features visible to end users
logging
Related to logging (tracing, stdout, stderr, log-files)
team:compiler
Compiler Team
Comments
tritao
added a commit
to tritao/sway
that referenced
this issue
Apr 2, 2025
Add `#[abi_name()` attribute to rename enum and struct ABI items. Here is example of how it can be used: ```sway contract; #[abi_name(name = "RenamedMyScript")] struct MyStruct {} #[abi_name(name = "RenamedMyEnum")] enum MyEnum { A: () } abi MyAbi { fn my_struct() -> MyStruct; fn my_enum() -> MyEnum; } impl MyAbi for Contract { fn my_struct() -> MyStruct { MyStruct{} } fn my_enum() -> MyEnum { MyEnum::A } } ``` Closes FuelLabs#5955.
8 tasks
tritao
added a commit
to tritao/sway
that referenced
this issue
Apr 2, 2025
Add `#[abi_name(name = "foo")` attribute to rename enum and struct ABI items. Here is example of how it can be used: ```sway contract; #[abi_name(name = "RenamedMyScript")] struct MyStruct {} #[abi_name(name = "RenamedMyEnum")] enum MyEnum { A: () } abi MyAbi { fn my_struct() -> MyStruct; fn my_enum() -> MyEnum; } impl MyAbi for Contract { fn my_struct() -> MyStruct { MyStruct{} } fn my_enum() -> MyEnum { MyEnum::A } } ``` Closes FuelLabs#5955.
tritao
added a commit
to tritao/sway
that referenced
this issue
Apr 4, 2025
Add `#[abi_name(name = "foo")` attribute to rename enum and struct ABI items. Here is example of how it can be used: ```sway contract; #[abi_name(name = "RenamedMyScript")] struct MyStruct {} #[abi_name(name = "RenamedMyEnum")] enum MyEnum { A: () } abi MyAbi { fn my_struct() -> MyStruct; fn my_enum() -> MyEnum; } impl MyAbi for Contract { fn my_struct() -> MyStruct { MyStruct{} } fn my_enum() -> MyEnum { MyEnum::A } } ``` Closes FuelLabs#5955.
tritao
added a commit
to tritao/sway
that referenced
this issue
Apr 7, 2025
Add `#[abi_name(name = "foo")` attribute to rename enum and struct ABI items. Here is example of how it can be used: ```sway contract; #[abi_name(name = "RenamedMyStruct")] struct MyStruct {} #[abi_name(name = "RenamedMyEnum")] enum MyEnum { A: () } abi MyAbi { fn my_struct() -> MyStruct; fn my_enum() -> MyEnum; } impl MyAbi for Contract { fn my_struct() -> MyStruct { MyStruct{} } fn my_enum() -> MyEnum { MyEnum::A } } ``` Closes FuelLabs#5955.
tritao
added a commit
to tritao/sway
that referenced
this issue
Apr 7, 2025
Add `#[abi_name(name = "foo")` attribute to rename enum and struct ABI items. Here is example of how it can be used: ```sway contract; #[abi_name(name = "RenamedMyStruct")] struct MyStruct {} #[abi_name(name = "RenamedMyEnum")] enum MyEnum { A: () } abi MyAbi { fn my_struct() -> MyStruct; fn my_enum() -> MyEnum; } impl MyAbi for Contract { fn my_struct() -> MyStruct { MyStruct{} } fn my_enum() -> MyEnum { MyEnum::A } } ``` Closes FuelLabs#5955.
tritao
added a commit
to tritao/sway
that referenced
this issue
Apr 15, 2025
Add `#[abi_name(name = "foo")` attribute to rename enum and struct ABI items. Here is example of how it can be used: ```sway contract; #[abi_name(name = "RenamedMyStruct")] struct MyStruct {} #[abi_name(name = "RenamedMyEnum")] enum MyEnum { A: () } abi MyAbi { fn my_struct() -> MyStruct; fn my_enum() -> MyEnum; } impl MyAbi for Contract { fn my_struct() -> MyStruct { MyStruct{} } fn my_enum() -> MyEnum { MyEnum::A } } ``` Closes FuelLabs#5955.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
compiler
General compiler. Should eventually become more specific as the issue is triaged
language feature
Core language features visible to end users
logging
Related to logging (tracing, stdout, stderr, log-files)
team:compiler
Compiler Team
Add support for a new annotation that allows you to change the name of a struct or enum in the type definitions that gets hashed as an event hash and a type id in the ABI spec.
The text was updated successfully, but these errors were encountered: