Skip to content

Commit 75d1794

Browse files
committed
Update to latest.
1 parent 7950d90 commit 75d1794

File tree

6 files changed

+39
-10
lines changed

6 files changed

+39
-10
lines changed

sway-core/src/abi_generation/abi_str.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,13 @@ impl TypeId {
2121
resolved_type_id: TypeId,
2222
) -> Result<String, ErrorEmitted> {
2323
let type_engine = engines.te();
24-
let self_abi_str = type_engine
25-
.get(*self)
26-
.abi_str(handler, ctx, engines, true)?;
24+
let self_abi_str = if let TypeInfo::Alias { .. } = &*type_engine.get(*self) {
25+
String::default()
26+
} else {
27+
type_engine
28+
.get(*self)
29+
.abi_str(handler, ctx, engines, true)?
30+
};
2731
if self.is_generic_parameter(engines, resolved_type_id) {
2832
Ok(format!("generic {self_abi_str}"))
2933
} else {

test/src/e2e_vm_tests/test_programs/should_pass/language/configurable_consts/json_abi_oracle_new_encoding.release.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
{
22
"concreteTypes": [
3+
{
4+
"aliasOf": "c89951a24c6ca28c13fd1cfdc646b2b656d69e61a92b91023be7eb58eb914b6b",
5+
"concreteTypeId": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
6+
"type": ""
7+
},
38
{
49
"concreteTypeId": "2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d",
510
"type": "()"
@@ -72,7 +77,7 @@
7277
"offset": 5104
7378
},
7479
{
75-
"concreteTypeId": "c89951a24c6ca28c13fd1cfdc646b2b656d69e61a92b91023be7eb58eb914b6b",
80+
"concreteTypeId": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
7681
"indirect": false,
7782
"name": "ANOTHER_U8",
7883
"offset": 4840

test/src/e2e_vm_tests/test_programs/should_pass/language/main_args/main_args_generics/json_abi_oracle_new_encoding.debug.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
"concreteTypeId": "f0ea9e428f47d8b233443fc8f7d3bb5ad2ae35d5175e8c15f0f76b3459c9c080",
55
"metadataTypeId": 0,
66
"type": "(struct TwoGenerics<u64,u32>, struct OneGeneric<u8>)"
7+
},
8+
{
9+
"aliasOf": "f0ea9e428f47d8b233443fc8f7d3bb5ad2ae35d5175e8c15f0f76b3459c9c080",
10+
"concreteTypeId": "559aead08264d5795d3909718cdd05abd49572e84fe55590eef31a88a08fdffd",
11+
"type": "A"
712
}
813
],
914
"configurables": [],
@@ -14,12 +19,12 @@
1419
"attributes": null,
1520
"inputs": [
1621
{
17-
"concreteTypeId": "f0ea9e428f47d8b233443fc8f7d3bb5ad2ae35d5175e8c15f0f76b3459c9c080",
22+
"concreteTypeId": "559aead08264d5795d3909718cdd05abd49572e84fe55590eef31a88a08fdffd",
1823
"name": "input"
1924
}
2025
],
2126
"name": "main",
22-
"output": "f0ea9e428f47d8b233443fc8f7d3bb5ad2ae35d5175e8c15f0f76b3459c9c080"
27+
"output": "559aead08264d5795d3909718cdd05abd49572e84fe55590eef31a88a08fdffd"
2328
}
2429
],
2530
"loggedTypes": [],

test/src/e2e_vm_tests/test_programs/should_pass/language/main_args/main_args_generics/json_abi_oracle_new_encoding.release.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
"concreteTypeId": "f0ea9e428f47d8b233443fc8f7d3bb5ad2ae35d5175e8c15f0f76b3459c9c080",
55
"metadataTypeId": 0,
66
"type": "(struct TwoGenerics<u64,u32>, struct OneGeneric<u8>)"
7+
},
8+
{
9+
"aliasOf": "f0ea9e428f47d8b233443fc8f7d3bb5ad2ae35d5175e8c15f0f76b3459c9c080",
10+
"concreteTypeId": "559aead08264d5795d3909718cdd05abd49572e84fe55590eef31a88a08fdffd",
11+
"type": "A"
712
}
813
],
914
"configurables": [],
@@ -14,12 +19,12 @@
1419
"attributes": null,
1520
"inputs": [
1621
{
17-
"concreteTypeId": "f0ea9e428f47d8b233443fc8f7d3bb5ad2ae35d5175e8c15f0f76b3459c9c080",
22+
"concreteTypeId": "559aead08264d5795d3909718cdd05abd49572e84fe55590eef31a88a08fdffd",
1823
"name": "input"
1924
}
2025
],
2126
"name": "main",
22-
"output": "f0ea9e428f47d8b233443fc8f7d3bb5ad2ae35d5175e8c15f0f76b3459c9c080"
27+
"output": "559aead08264d5795d3909718cdd05abd49572e84fe55590eef31a88a08fdffd"
2328
}
2429
],
2530
"loggedTypes": [],

test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/abi_with_alias/json_abi_oracle_new_encoding.debug.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
"concreteTypeId": "41bd1a98f0a59642d8f824c805b798a5f268d1f7d05808eb05c4189c493f1be0",
99
"metadataTypeId": 0,
1010
"type": "(u64, u64)"
11+
},
12+
{
13+
"aliasOf": "41bd1a98f0a59642d8f824c805b798a5f268d1f7d05808eb05c4189c493f1be0",
14+
"concreteTypeId": "0c549b98c3db49207607c6f5f063b081b1a724bc479a2a1b353ff2c60f3f1d49",
15+
"type": "AliasedTuple"
1116
}
1217
],
1318
"configurables": [],
@@ -18,7 +23,7 @@
1823
"attributes": null,
1924
"inputs": [
2025
{
21-
"concreteTypeId": "41bd1a98f0a59642d8f824c805b798a5f268d1f7d05808eb05c4189c493f1be0",
26+
"concreteTypeId": "0c549b98c3db49207607c6f5f063b081b1a724bc479a2a1b353ff2c60f3f1d49",
2227
"name": "arg1"
2328
}
2429
],

test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/abi_with_alias/json_abi_oracle_new_encoding.release.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
"concreteTypeId": "41bd1a98f0a59642d8f824c805b798a5f268d1f7d05808eb05c4189c493f1be0",
99
"metadataTypeId": 0,
1010
"type": "(u64, u64)"
11+
},
12+
{
13+
"aliasOf": "41bd1a98f0a59642d8f824c805b798a5f268d1f7d05808eb05c4189c493f1be0",
14+
"concreteTypeId": "0c549b98c3db49207607c6f5f063b081b1a724bc479a2a1b353ff2c60f3f1d49",
15+
"type": "AliasedTuple"
1116
}
1217
],
1318
"configurables": [],
@@ -18,7 +23,7 @@
1823
"attributes": null,
1924
"inputs": [
2025
{
21-
"concreteTypeId": "41bd1a98f0a59642d8f824c805b798a5f268d1f7d05808eb05c4189c493f1be0",
26+
"concreteTypeId": "0c549b98c3db49207607c6f5f063b081b1a724bc479a2a1b353ff2c60f3f1d49",
2227
"name": "arg1"
2328
}
2429
],

0 commit comments

Comments
 (0)