Skip to content

Commit

Permalink
refactor(docs): exit codes page overhaul (#978)
Browse files Browse the repository at this point in the history
  • Loading branch information
novusnota authored Oct 24, 2024
1 parent a90b7af commit 458f996
Show file tree
Hide file tree
Showing 10 changed files with 566 additions and 225 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- The `parseImports` function now returns AST import nodes instead of raw strings: PR [#966](https://github.com/tact-lang/tact/pull/966)
- Optional types for `self` argument in `extends mutates` functions are now allowed: PR [#854](https://github.com/tact-lang/tact/pull/854)
- Docs: complete overhaul of the exit codes page: PR [#978](https://github.com/tact-lang/tact/pull/978)

### Fixed

Expand Down
1 change: 1 addition & 0 deletions cspell-fift-words-adjusted.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Pos
Split
abort
abs
addop
allot
and
anon
Expand Down
2 changes: 2 additions & 0 deletions cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@
"Tarjan",
"testdata",
"Topup",
"Toncoin",
"Toncoins",
"Trunov",
"typechecker",
"uintptr",
Expand Down
4 changes: 4 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ All commands are run from the root of the project, from a terminal:
| `yarn astro ...` | Run CLI commands like `astro add`, `astro check`, etc.
| `yarn astro -- --help` | Get help using the Astro CLI.

### ⚠️ Gotchas

- When updating TextMate grammars in `grammars/` (for example, `grammar-tact.json`), make sure that the value for the `"name"` property is written all lowercase, otherwise highlighting will break.

### 👀 Want to learn more about the framework behind Tact docs?

Check out [Starlight’s docs](https://starlight.astro.build/), read [the Astro documentation](https://docs.astro.build), or jump into the [Astro Discord server](https://astro.build/chat).
Expand Down
3 changes: 2 additions & 1 deletion docs/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ export default defineConfig({
behavior: "append",
properties: {
class: "autolink-header",
ariaHidden: true,
ariaHidden: "true",
ariaLabel: "Link to this header",
tabIndex: -1,
},
}],
Expand Down
38 changes: 11 additions & 27 deletions docs/cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,55 +2,39 @@
"$schema": "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json",
"version": "0.2",
"language": "en",
"dictionaryDefinitions": [
{
"name": "fift-words",
"path": "../cspell-fift-words-adjusted.txt"
},
{
"name": "tvm-instructions",
"path": "../cspell-tvm-instructions.txt"
}
],
"dictionaries": ["fift-words", "tvm-instructions"],
"words": [
"ADDRAND",
"BBITS",
"BREFS",
"Brujin",
"CHKSIGNS",
"CHKSIGNU",
"CONFIGOPTPARAM",
"CTOS",
"Cheatsheet",
"Cheatsheets",
"Comptime",
"DEBUGSTR",
"DUEPAYMENT",
"Daniil",
"Decompilation",
"Decompiled",
"Descr",
"Domínguez",
"ENDC",
"Epva",
"Fift",
"Fift",
"GASCONSUMED",
"GETFORWARDFEE",
"GETFORWARDFEESIMPLE",
"GETGASFEE",
"GETGASFEESIMPLE",
"GETORIGINALFWDFEE",
"GETSTORAGEFEE",
"Georgiy",
"HASHCU",
"HASHEXT",
"HASHSU",
"Héctor",
"IPFS",
"Jesús",
"Jetton",
"Jettons",
"KECCAK",
"Komarov",
"Korshakov",
"LDDICT",
"LDIX",
"LDREF",
"LDSLICEX",
"LDUX",
"LDVARUINT",
"LTIME",
"Laika",
"MYADDR",
"Masterchain",
Expand Down
732 changes: 540 additions & 192 deletions docs/src/content/docs/book/exit-codes.mdx

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/generator/createABI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ export function createABI(ctx: CompilerContext, name: string): ContractABI {
errors["36"] = {
message: "Invalid destination address in outbound message",
};
errors["37"] = { message: "Not enough TON" };
errors["38"] = { message: "Not enough extra-currencies" };
errors["37"] = { message: "Not enough Toncoin" };
errors["38"] = { message: "Not enough extra currencies" };
errors["39"] = {
message: "Outbound message does not fit into a cell after rewriting",
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ exports[`local-type-inference should automatically set types for let statements
"message": "Invalid destination address in outbound message",
},
"37": {
"message": "Not enough TON",
"message": "Not enough Toncoin",
},
"38": {
"message": "Not enough extra-currencies",
"message": "Not enough extra currencies",
},
"39": {
"message": "Outbound message does not fit into a cell after rewriting",
Expand Down
2 changes: 1 addition & 1 deletion src/test/exit-codes/contracts/compute-phase-errors.tact
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ contract ComputePhaseErrorsTester {
/// Exit code 11
receive("11") {
// Unlike nativeSendMessage which uses SENDRAWMSG, this one uses SENDMSG,
// and therefore fails in Compute time when the message is ill-formed
// and therefore fails in Compute phase when the message is ill-formed
nativeSendMessageReturnForwardFee(emptyCell(), 0);
}

Expand Down

0 comments on commit 458f996

Please sign in to comment.