Skip to content

πŸ‘¨πŸ»β€πŸ”¬ Sample Blueprint with tests, benchmark and automatically generated code

License

ilyar/sample-blueprint

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

11 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ‘¨πŸ»β€πŸ”¬ Sample Blueprint

Sample Blueprint with tests, benchmark and automatically generated code see develop.md and contributing.md πŸ€—

Example collect metric

Build @ton-sandbox-bech and @ton-blueprint-bech:

git clone --branch=feature/betch git@github.com:ton-org/sandbox.git sandbox-bench
cd sandbox-bench
yarn && yarn build && yarn pack --out dist/%s-bech.tgz && cd ..

git clone --branch=feature/betch git@github.com:ton-org/blueprint.git blueprint-bench
cd blueprint-bench
yarn && yarn build && yarn pack --out dist/%s-bech.tgz && cd ..

git clone git@github.com:ilyar/sample-blueprint.git
cd sample-blueprint
pnpm add -D ../sandbox-bench/dist/@ton-sandbox-bech.tgz ../blueprint-bench/dist/@ton-blueprint-bech.tgz

Setup jest.config.ts:

import type { Config } from 'jest';

const config: Config = {
    preset: 'ts-jest',
    testEnvironment: '@ton/sandbox/jest-environment',
    testPathIgnorePatterns: ['/node_modules/', '/dist/'],
    reporters: [
        'default',
        ['@ton/sandbox/jest-reporter', {
            contractDatabase: 'abi.json',
            contractExcludes: [
                'TreasuryContract',
            ],
        }],
    ]
};

export default config;

Run tests and collect metric:

npx blueprint snapshot -l "some label"

Get report:

npx blueprint test --gas-report

Or setup gas-report.config.ts:

import config from './jest.config';

config.testNamePattern = '^SampleBench .* - should sent incrAction$'
config.testEnvironment = '@ton/sandbox/jest-environment'
config.reporters = [
    ['@ton/sandbox/jest-reporter', {
        contractDatabase: 'abi.json',
        contractExcludes: [
            'TreasuryContract',
        ],
    }],
]
export default config;

Run tests and collect metric:

npx blueprint snapshot -l "some label" -- --config gas-report.config.ts

Get report:

npx blueprint test --gas-report -- --config gas-report.config.ts
# or
pnpm gas-report

πŸ§™πŸ»β€β™‚οΈ See result .benchmark and gas-report.json

About

πŸ‘¨πŸ»β€πŸ”¬ Sample Blueprint with tests, benchmark and automatically generated code

Topics

Resources

License

Contributing

Stars

Watchers

Forks