Skip to content

Commit

Permalink
Switch to @ton-community/tlb-parser and add one more Block cell to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
PolyProgrammist committed Feb 11, 2024
1 parent b826168 commit b9cdba8
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 9 deletions.
1 change: 0 additions & 1 deletion .github/workflows/jest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ jobs:
node-version: '20'
- run: npm install
- run: npm install -g ts-node
- run: sed -i 's/"+", "Type"/"#", "Type"/g' "node_modules/@igorivaniuk/tlb-parser/dist/ast/nodes.d.ts"
- run: npm run build
- run: ts-node generate_tests.ts
- run: npm run test
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/astbuilder/fill_constructors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
NameExpr,
NegateExpr,
NumberExpr,
} from "@igorivaniuk/tlb-parser/dist/ast/nodes";
} from "@ton-community/tlb-parser/dist/ast/nodes";
import * as crc32 from "crc-32";
import {
TLBBinaryOp,
Expand Down
2 changes: 1 addition & 1 deletion src/astbuilder/handle_field.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
FieldNamedDef,
MathExpr,
NameExpr,
} from "@igorivaniuk/tlb-parser/dist/ast/nodes";
} from "@ton-community/tlb-parser/dist/ast/nodes";
import { TLBField } from "../ast";
import { getType } from "./handle_type";
import { TLBConstructorBuild, TLBTypeBuild } from "./utils";
Expand Down
2 changes: 1 addition & 1 deletion src/astbuilder/handle_type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
NegateExpr,
NumberExpr,
Expression as ParserExpression,
} from "@igorivaniuk/tlb-parser/dist/ast/nodes";
} from "@ton-community/tlb-parser/dist/ast/nodes";
import {
TLBBinaryOp,
TLBFieldType,
Expand Down
2 changes: 1 addition & 1 deletion src/astbuilder/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
NegateExpr,
NumberExpr,
SimpleExpr,
} from "@igorivaniuk/tlb-parser/dist/ast/nodes";
} from "@ton-community/tlb-parser/dist/ast/nodes";
import {
TLBBinaryOp,
TLBConstructorTag,
Expand Down
4 changes: 2 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Program } from "@igorivaniuk/tlb-parser/dist/ast/nodes";
import { Program } from "@ton-community/tlb-parser/dist/ast/nodes";
import { TLBCode, TLBType } from "./ast";
import {
TLBCodeBuild,
Expand All @@ -10,7 +10,7 @@ import { CodeBuilder } from "./generators/CodeBuilder";
import { CodeGenerator, CommonGenDeclaration } from "./generators/generator";
import { TypescriptGenerator } from "./generators/typescript/generator";

import { ast } from '@igorivaniuk/tlb-parser'
import { ast } from "@ton-community/tlb-parser";
import fs from 'fs'


Expand Down
7 changes: 7 additions & 0 deletions test/tlbgen.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -519,5 +519,12 @@ describe('Generating tlb code', () => {
// expect(deepEqual(cs.hash(), builder.endCell().hash())).toBeTruthy()

checkSameOnStoreLoad(blk, loadBlock, storeBlock)

const state2 = 'te6cckECEQEAAt0AJBAR71Wq////EQECAwQCoJvHqYcAAAAAgAECfjyTAAAAAQAAAAAAAAAAAAAAAABlyLWCAAAogZ67zMAAACiBnrvM0GBwTmIACCBSAiVwRAIlWR/EAAAABQAAAAAAAAAuBQYCEbjkjftFjQskhAcIKooETrjlNgwuHXtEbLkDiuPrh7ZsS5HcxL7sNQNLOzzxOJ8XpFaKmfMqRiqpTnODMFdkpeK+t1j9zpUGcLCGnyCbQQIcAhwJCiOJSjP2/QsLOJrSCYuSECQN4EQ1pAkI/Vq884HrhAXxgd/DMXKL3mNyX4QAmdB48ZNajadP6O+MetbFj9DF2crDtBqc+RNACwwNAJgAACiBnqyKhAIlcESQSl3z7iZHMb+ZzHB8UIicVmATlmlWML4cDjyK41AJDYwykU65Oj8VFycT567wJMI2c1Fp8XEpQ0oBBl7EszbpAJgAACiBnqyKigJ+PJIwkmdyOJaxAUgUAn96h7ctdbYa5ZqyLAxMr2CCCwI53+D63OzKxdebePB4BjmKCG0WpYdB4mhfQTshVEFholJiAiWCyjMIQaAjO2wWUZhB/mYlt0AIDg4ADQAQ7msoAAhojAEDTrjlNgwuHXtEbLkDiuPrh7ZsS5HcxL7sNQNLOzzxOJ8eUBr0CDsnKj+rfShCIEjNWz4L02mNMNBkMZ/Gt7d08wIcAB9ojAEDF6RWipnzKkYqqU5zgzBXZKXivrdY/c6VBnCwhp8gm0F20Jc6TiScBHS6NjRcwVkdaQJ0Gui4rsOnO0bOcbXHBAIcAB8oSAEBDImrgKWVyalum/bej1OHSpOS2UkgmMuIkBF7MzHXi7MAGChIAQEVd40DOrZ4FN5JCQjeUCvgm+Lo7v7TK7JOTt/GFqoW0AAZKEgBARILJG1IfD7ez2RrP8gh/dsLILjLke5aI27M3MaDIy1bABgCASAPEAATvgAAA7yRYnrqkAATv////7yLlvycUBOzqtE=';
const cs2 = Cell.fromBase64(state2);

let blk2 = loadBlock(cs2.beginParse());

checkSameOnStoreLoad(blk2, loadBlock, storeBlock)
})
})

0 comments on commit b9cdba8

Please sign in to comment.