Skip to content

Commit

Permalink
Merge branch 'main' into fix-changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
anton-trunov committed Apr 22, 2024
2 parents 8ff29c2 + a9a436d commit c4d487f
Show file tree
Hide file tree
Showing 13 changed files with 1,038 additions and 1,187 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/tact.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ jobs:
then false
fi
- name: Tact CLI non-zero exit code
if: runner.os != 'Windows'
run: |
! ./bin/tact --config test/tact-cli/tact.config.json
- name: Link Tact compiler
run: |
yarn link
Expand Down
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- The `toString` extension function for `Address` type: PR [#224](https://github.com/tact-lang/tact/pull/224)
- The bitwise XOR operation (`^`): PR [#238](https://github.com/tact-lang/tact/pull/238)
- The `isEmpty` extension function for the `Map` type: PR [#266](https://github.com/tact-lang/tact/pull/266)
- The `pow2` power function of with base 2: PR [#267](https://github.com/tact-lang/tact/pull/267)
- The `pow2` power function with base 2: PR [#267](https://github.com/tact-lang/tact/pull/267)

### Changed

Expand All @@ -28,6 +28,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- The `newAddress` function now evaluates to a constant value if possible: PR [#237](https://github.com/tact-lang/tact/pull/237)
- The `pow` power function could only be used at compile-time, but now it is available in the standard library and can be called both at runtime and compile-time: PR [#267](https://github.com/tact-lang/tact/pull/267)
- The `dump()` and `dumpStack()` functions now print the file path, line number, and column number in addition to the data: PR [#271](https://github.com/tact-lang/tact/pull/271)
- Use `|` instead of `+` for send mode flags because the bitwise OR operation is idempotent and hence safer: PR [#274](https://github.com/tact-lang/tact/pull/274)
- Bumped the versions of `@ton/core` and `ohm-js` to the most recent ones: PR [#276](https://github.com/tact-lang/tact/pull/276)

### Fixed

Expand All @@ -39,6 +41,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Precedence levels for bitwise operators, equality and comparisons now matches common languages, like JavaScript: PR [#265](https://github.com/tact-lang/tact/pull/265)
- Incorrect variable scoping in the `repeat`, `while` and `until` loops: PR [#269](https://github.com/tact-lang/tact/pull/269)
- FunC compilation errors when trying to `dump()` values of the `Cell`, `Slice`, `Builder` and `StringBuilder` types: PR [#271](https://github.com/tact-lang/tact/pull/271)
- Tact's CLI returns a non-zero exit code if compilation fails: PR [#278](https://github.com/tact-lang/tact/pull/278)

## [1.2.0] - 2024-02-29

Expand Down
5 changes: 4 additions & 1 deletion bin/tact
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,17 @@ if (!args["--config"]) {
// Perform compilation
(async () => {
try {
await main.run({
const success = await main.run({
configPath: args["--config"],
projectNames: args["--project"] ? args["--project"] : [],
});
// https://nodejs.org/docs/v20.12.1/api/process.html#exit-codes
if (!success) process.exit(30);
} catch (e) {
console.warn(
"Internal compiler error. Please, report it to https://github.com/tact-lang/tact/issues.",
);
console.log(e);
process.exit(30);
}
})();
4 changes: 2 additions & 2 deletions examples/multisig.tact
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ contract MultisigSigner {
send(SendParameters{
value: 0,
to: self.master,
mode: SendRemainingBalance + SendIgnoreErrors,
mode: SendRemainingBalance | SendIgnoreErrors,
bounce: false,
body: Signed{ request: self.request }.toCell()
});
Expand Down Expand Up @@ -95,7 +95,7 @@ contract Multisig {
send(SendParameters{
value: 0,
to: opAddress,
mode: SendRemainingValue + SendIgnoreErrors,
mode: SendRemainingValue | SendIgnoreErrors,
bounce: true,
code: opInit.code,
data: opInit.data
Expand Down
6 changes: 3 additions & 3 deletions examples/payouts.tact
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ contract Payouts with OwnableTransferable {
send(SendParameters{
to: address,
value: 0,
mode: SendRemainingValue + SendIgnoreErrors,
mode: SendRemainingValue | SendIgnoreErrors,
bounce: true,
body: CanPayout{amount: amount}.toCell()
});
Expand All @@ -102,15 +102,15 @@ contract Payouts with OwnableTransferable {
send(SendParameters{
to: msg.address,
value: msg.amount,
mode: SendRemainingValue + SendIgnoreErrors,
mode: SendRemainingValue | SendIgnoreErrors,
bounce: false,
body: "Success".asComment()
});
} else {
send(SendParameters{
to: msg.address,
value: 0,
mode: SendRemainingValue + SendIgnoreErrors,
mode: SendRemainingValue | SendIgnoreErrors,
bounce: false,
body: "Already paid".asComment()
});
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,22 @@
"dependencies": {
"@ipld/dag-pb": "2.1.18",
"@tact-lang/opcode": "^0.0.14",
"@ton/core": "0.49.2",
"@ton/core": "0.56.3",
"@ton/crypto": "^3.2.0",
"arg": "^5.0.2",
"blockstore-core": "1.0.5",
"change-case": "^4.1.2",
"ipfs-unixfs-importer": "9.0.10",
"mkdirp": "^2.1.3",
"multiformats": "9.9.0",
"ohm-js": "16.5.0",
"path-normalize": "^6.0.10",
"multiformats": "^13.1.0",
"ohm-js": "^17.1.0",
"path-normalize": "^6.0.13",
"prando": "^6.0.1",
"qs": "^6.11.0",
"qs": "^6.12.1",
"zod": "^3.22.4"
},
"devDependencies": {
"@ohm-js/cli": "^1.1.0",
"@ohm-js/cli": "^2.0.0",
"@release-it/keep-a-changelog": "^3.1.0",
"@tact-lang/coverage": "^0.0.8",
"@tact-lang/emulator": "^4.2.3",
Expand Down
4 changes: 2 additions & 2 deletions src/imports/stdlib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,10 @@ files['std/base.tact'] =
'ICAgICBsZXQgY3R4OiBDb250ZXh0ID0gY29udGV4dCgpOwogICAgICAgICAgICBsZXQgYmFsYW5jZTogSW50ID0gbXlCYWxhbmNlKCk7CiAgICAgICAgICAgIGxldCBi' +
'YWxhbmNlQmVmb3JlTWVzc2FnZTogSW50ID0gYmFsYW5jZSAtIGN0eC52YWx1ZTsKICAgICAgICAgICAg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BCdWlsZGVyOwoKQG5hbWUoc3RvcmVfaW50KQpleHRlbmRzIG5hdGl2' +
Expand Down
2 changes: 1 addition & 1 deletion src/test/bugs/issue43.tact
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ trait Jetton with Ownable {
to: msg.response_destination!!,
value: 0,
bounce: false,
mode: SendRemainingValue + SendIgnoreErrors,
mode: SendRemainingValue | SendIgnoreErrors,
body: TokenExcesses{
queryId: msg.queryId
}.toCell()
Expand Down
6 changes: 3 additions & 3 deletions src/test/features/deep-sequence.tact
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ contract A {
send(SendParameters{
value: 0,
to: address,
mode: SendRemainingValue + SendIgnoreErrors,
mode: SendRemainingValue | SendIgnoreErrors,
bounce: true,
code: init.code,
data: init.data,
Expand All @@ -35,7 +35,7 @@ contract B {
send(SendParameters{
value: 0,
to: address,
mode: SendRemainingValue + SendIgnoreErrors,
mode: SendRemainingValue | SendIgnoreErrors,
bounce: true,
code: init.code,
data: init.data,
Expand All @@ -60,7 +60,7 @@ contract C {
send(SendParameters{
value: 0,
to: address,
mode: SendRemainingValue + SendIgnoreErrors,
mode: SendRemainingValue | SendIgnoreErrors,
bounce: true,
code: init.code,
data: init.data,
Expand Down
4 changes: 2 additions & 2 deletions stdlib/std/base.tact
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ trait BaseTrait {
let balanceBeforeMessage: Int = balance - ctx.value;
if (balanceBeforeMessage < self.storageReserve) {
nativeReserve(self.storageReserve, ReserveExact);
send(SendParameters{bounce: bounce, to: to, value: 0, mode: SendRemainingBalance + SendIgnoreErrors, body: body, code: code, data: data });
send(SendParameters{bounce: bounce, to: to, value: 0, mode: SendRemainingBalance | SendIgnoreErrors, body: body, code: code, data: data });
return;
}
}

// Just send with remaining balance
send(SendParameters{bounce: bounce, to: to, value: 0, mode: SendRemainingValue + SendIgnoreErrors, body: body, code: code, data: data });
send(SendParameters{bounce: bounce, to: to, value: 0, mode: SendRemainingValue | SendIgnoreErrors, body: body, code: code, data: data });
}
}
3 changes: 3 additions & 0 deletions test/tact-cli/fail.tact
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
contract Fail {
syntax_error
}
10 changes: 10 additions & 0 deletions test/tact-cli/tact.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"$schema": "http://raw.githubusercontent.com/tact-lang/tact/main/grammar/configSchema.json",
"projects": [
{
"name": "fail",
"path": "./fail.tact",
"output": "./output"
}
]
}
Loading

0 comments on commit c4d487f

Please sign in to comment.