-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Open
Labels
ABIEverything to do the ABI, especially the JSON representationEverything to do the ABI, especially the JSON representationbugSomething isn't workingSomething isn't workingteam:compilerCompiler TeamCompiler Team
Description
Related Component
forc
Problem
For the program in the steps below, the aliased type name is missing from the types in the generated json abi. I made some sample aliased types, but I believe that it's a general problem for all aliases.
I came across it when FuelLabs/fuels-ts#3032. It's not a showstopper, it's just that the types won't be shown to the end user under the alias but rather as the actual type the alias is pointing to (e.g. not AliasedString
but the equivalent of str[5]
which is string
in our case).
Steps
contract;
struct MyStruct {
a: u32,
}
type AliasedTuple = (AssetId, u32);
type AliasedArray = [u32; 4];
type AliasedString = str[5];
type AliasedStruct = MyStruct;
abi MyContract {
fn aliased_tuple(input: AliasedTuple) -> u32;
fn aliased_array(input: AliasedArray) -> u32;
fn aliased_string(input: AliasedString) -> u32;
fn aliased_struct(input: AliasedStruct) -> u32;
}
impl MyContract for Contract {
fn aliased_tuple(input: AliasedTuple) -> u32 {
4
}
fn aliased_array(input: AliasedArray) -> u32 {
4
}
fn aliased_string(input: AliasedString) -> u32 {
4
}
fn aliased_struct(input: AliasedStruct) -> u32 {
4
}
}
Possible Solution(s)
No response
Notes
No response
Installed components
- forc 0.63.5
Metadata
Metadata
Assignees
Labels
ABIEverything to do the ABI, especially the JSON representationEverything to do the ABI, especially the JSON representationbugSomething isn't workingSomething isn't workingteam:compilerCompiler TeamCompiler Team