Skip to content

Commit

Permalink
feat(types): allow serialization specifiers for trait fields (#1303)
Browse files Browse the repository at this point in the history
We treat `Int as int257` and `Int` as equivalent types, otherwise,
if serializations in the inherited and current trait/contracts are not equal
an error is reported
  • Loading branch information
i582 authored Jan 14, 2025
1 parent 602e1be commit 2dcff76
Show file tree
Hide file tree
Showing 20 changed files with 5,176 additions and 867 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Remove `org.ton.chain.any.v0` interface: PR [#1207](https://github.com/tact-lang/tact/pull/1207)
- To reduce fees, Tact no longer stores the parent contract code in the system cell that holds all the child contract codes used in `initOf`. Instead, the `MYCODE` instruction is used: PR [#1213](https://github.com/tact-lang/tact/pull/1213)
- Generated TS wrappers now use `const` where possible for variable declarations: PR [#1292](https://github.com/tact-lang/tact/pull/1292)
- Allow serialization specifiers for trait fields PR: [#1303](https://github.com/tact-lang/tact/pull/1303)

### Fixed

Expand Down
6 changes: 3 additions & 3 deletions src/test/e2e-emulated/contracts/sample-jetton.tact
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ contract SampleJetton with Jetton {
// ============================================================================================================ //
@interface("org.ton.jetton.master")
trait Jetton with Ownable {
totalSupply: Int; // Already set initially
max_supply: Int;
totalSupply: Int as coins; // Already set initially
max_supply: Int as coins;
mintable: Bool;
owner: Address;
content: Cell;
Expand Down Expand Up @@ -331,4 +331,4 @@ struct JettonWalletData {
owner: Address;
master: Address;
walletCode: Cell;
}
}
Loading

0 comments on commit 2dcff76

Please sign in to comment.