forked from tact-lang/tact
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: getter name collisions in TS wrappers (tact-lang#556)
Exports a TS mapping from Tact getter names to their TS analogues
- Loading branch information
Showing
7 changed files
with
375 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
299 changes: 299 additions & 0 deletions
299
src/test/e2e-emulated/__snapshots__/getter-names-conflict.spec.ts.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,299 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`getter-names-conflict should handle conflicts in getter names correctly 1`] = ` | ||
Test { | ||
"abi": { | ||
"errors": { | ||
"10": { | ||
"message": "Dictionary error", | ||
}, | ||
"128": { | ||
"message": "Null reference exception", | ||
}, | ||
"129": { | ||
"message": "Invalid serialization prefix", | ||
}, | ||
"13": { | ||
"message": "Out of gas error", | ||
}, | ||
"130": { | ||
"message": "Invalid incoming message", | ||
}, | ||
"131": { | ||
"message": "Constraints error", | ||
}, | ||
"132": { | ||
"message": "Access denied", | ||
}, | ||
"133": { | ||
"message": "Contract stopped", | ||
}, | ||
"134": { | ||
"message": "Invalid argument", | ||
}, | ||
"135": { | ||
"message": "Code of a contract was not found", | ||
}, | ||
"136": { | ||
"message": "Invalid address", | ||
}, | ||
"137": { | ||
"message": "Masterchain support is not enabled for this contract", | ||
}, | ||
"2": { | ||
"message": "Stack underflow", | ||
}, | ||
"3": { | ||
"message": "Stack overflow", | ||
}, | ||
"32": { | ||
"message": "Method ID not found", | ||
}, | ||
"34": { | ||
"message": "Action is invalid or not supported", | ||
}, | ||
"37": { | ||
"message": "Not enough TON", | ||
}, | ||
"38": { | ||
"message": "Not enough extra-currencies", | ||
}, | ||
"4": { | ||
"message": "Integer overflow", | ||
}, | ||
"5": { | ||
"message": "Integer out of expected range", | ||
}, | ||
"6": { | ||
"message": "Invalid opcode", | ||
}, | ||
"7": { | ||
"message": "Type check error", | ||
}, | ||
"8": { | ||
"message": "Cell overflow", | ||
}, | ||
"9": { | ||
"message": "Cell underflow", | ||
}, | ||
}, | ||
"getters": [ | ||
{ | ||
"arguments": [], | ||
"name": "testGetter", | ||
"returnType": { | ||
"format": 257, | ||
"kind": "simple", | ||
"optional": false, | ||
"type": "int", | ||
}, | ||
}, | ||
{ | ||
"arguments": [], | ||
"name": "test_getter", | ||
"returnType": { | ||
"format": 257, | ||
"kind": "simple", | ||
"optional": false, | ||
"type": "int", | ||
}, | ||
}, | ||
{ | ||
"arguments": [], | ||
"name": "Test_getter", | ||
"returnType": { | ||
"format": 257, | ||
"kind": "simple", | ||
"optional": false, | ||
"type": "int", | ||
}, | ||
}, | ||
], | ||
"receivers": [ | ||
{ | ||
"message": { | ||
"kind": "empty", | ||
}, | ||
"receiver": "internal", | ||
}, | ||
], | ||
"types": [ | ||
{ | ||
"fields": [ | ||
{ | ||
"name": "code", | ||
"type": { | ||
"kind": "simple", | ||
"optional": false, | ||
"type": "cell", | ||
}, | ||
}, | ||
{ | ||
"name": "data", | ||
"type": { | ||
"kind": "simple", | ||
"optional": false, | ||
"type": "cell", | ||
}, | ||
}, | ||
], | ||
"header": null, | ||
"name": "StateInit", | ||
}, | ||
{ | ||
"fields": [ | ||
{ | ||
"name": "bounced", | ||
"type": { | ||
"kind": "simple", | ||
"optional": false, | ||
"type": "bool", | ||
}, | ||
}, | ||
{ | ||
"name": "sender", | ||
"type": { | ||
"kind": "simple", | ||
"optional": false, | ||
"type": "address", | ||
}, | ||
}, | ||
{ | ||
"name": "value", | ||
"type": { | ||
"format": 257, | ||
"kind": "simple", | ||
"optional": false, | ||
"type": "int", | ||
}, | ||
}, | ||
{ | ||
"name": "raw", | ||
"type": { | ||
"kind": "simple", | ||
"optional": false, | ||
"type": "slice", | ||
}, | ||
}, | ||
], | ||
"header": null, | ||
"name": "Context", | ||
}, | ||
{ | ||
"fields": [ | ||
{ | ||
"name": "bounce", | ||
"type": { | ||
"kind": "simple", | ||
"optional": false, | ||
"type": "bool", | ||
}, | ||
}, | ||
{ | ||
"name": "to", | ||
"type": { | ||
"kind": "simple", | ||
"optional": false, | ||
"type": "address", | ||
}, | ||
}, | ||
{ | ||
"name": "value", | ||
"type": { | ||
"format": 257, | ||
"kind": "simple", | ||
"optional": false, | ||
"type": "int", | ||
}, | ||
}, | ||
{ | ||
"name": "mode", | ||
"type": { | ||
"format": 257, | ||
"kind": "simple", | ||
"optional": false, | ||
"type": "int", | ||
}, | ||
}, | ||
{ | ||
"name": "body", | ||
"type": { | ||
"kind": "simple", | ||
"optional": true, | ||
"type": "cell", | ||
}, | ||
}, | ||
{ | ||
"name": "code", | ||
"type": { | ||
"kind": "simple", | ||
"optional": true, | ||
"type": "cell", | ||
}, | ||
}, | ||
{ | ||
"name": "data", | ||
"type": { | ||
"kind": "simple", | ||
"optional": true, | ||
"type": "cell", | ||
}, | ||
}, | ||
], | ||
"header": null, | ||
"name": "SendParameters", | ||
}, | ||
], | ||
}, | ||
"address": kQD80WcWxBhERIUXYb8hyvNv5hK-iToKR4Q5dEGUZ2NWl9Mx, | ||
"init": { | ||
"code": x{FF00F4A413F4BCF2C80B} | ||
x{62_} | ||
x{D001D0D3030171B0A301FA400120D74981010BBAF2E08820D70B0A208104FFBAF2D0898309BAF2E088545053036F04F86102F862DB3C59DB3CF2E08230C8F84301CC7F01CA00C9ED54} | ||
x{ED44D0D401F863D20030916DE0F828D70B0A8309BAF2E089DB3C} | ||
x{6D} | ||
x{0192307FE07021D749C21F953020D70B1FDEC00001D749C121B0917FE070} | ||
x{2_} | ||
x{2_} | ||
x{B9BDCDB3CDB3C31} | ||
x{ED44D0D401F863D20030916DE0F828D70B0A8309BAF2E089DB3C} | ||
x{6D} | ||
x{73} | ||
x{BBE1FDB3CDB3C31} | ||
x{ED44D0D401F863D20030916DE0F828D70B0A8309BAF2E089DB3C} | ||
x{6D} | ||
x{71} | ||
x{2_} | ||
x{BB1A6DB3CDB3C31} | ||
x{ED44D0D401F863D20030916DE0F828D70B0A8309BAF2E089DB3C} | ||
x{6D} | ||
x{72} | ||
x{B82BEED44D0D20001}, | ||
"data": x{4_} | ||
x{C_} | ||
x{A15891_} | ||
x{FF00F4A413F4BCF2C80B} | ||
x{62_} | ||
x{D001D0D3030171B0A301FA400120D74981010BBAF2E08820D70B0A208104FFBAF2D0898309BAF2E088545053036F04F86102F862DB3C59DB3CF2E08230C8F84301CC7F01CA00C9ED54} | ||
x{ED44D0D401F863D20030916DE0F828D70B0A8309BAF2E089DB3C} | ||
x{6D} | ||
x{0192307FE07021D749C21F953020D70B1FDEC00001D749C121B0917FE070} | ||
x{2_} | ||
x{2_} | ||
x{B9BDCDB3CDB3C31} | ||
x{ED44D0D401F863D20030916DE0F828D70B0A8309BAF2E089DB3C} | ||
x{6D} | ||
x{73} | ||
x{BBE1FDB3CDB3C31} | ||
x{ED44D0D401F863D20030916DE0F828D70B0A8309BAF2E089DB3C} | ||
x{6D} | ||
x{71} | ||
x{2_} | ||
x{BB1A6DB3CDB3C31} | ||
x{ED44D0D401F863D20030916DE0F828D70B0A8309BAF2E089DB3C} | ||
x{6D} | ||
x{72} | ||
x{B82BEED44D0D20001}, | ||
}, | ||
} | ||
`; |
16 changes: 16 additions & 0 deletions
16
src/test/e2e-emulated/contracts/getter-names-conflict.tact
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
contract Test { | ||
receive () {} | ||
|
||
get fun testGetter(): Int { | ||
return 1; | ||
} | ||
|
||
get fun test_getter(): Int { | ||
return 2; | ||
} | ||
|
||
get fun Test_getter(): Int { | ||
return 3; | ||
} | ||
} | ||
|
Oops, something went wrong.