Skip to content

Commit

Permalink
feat: new emulator, new config
Browse files Browse the repository at this point in the history
chore: bump version, changelog
  • Loading branch information
krigga committed Mar 27, 2024
1 parent 8ef263b commit 57c629a
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 8 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.17.0] - 2024-03-27

### Changed

- Updated emulator WASM binary
- Changed the default and slim configs to use the latest config at the time of release, which enables TVM v6 opcodes

## [0.16.0] - 2024-03-01

This release contains a breaking change.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ton/sandbox",
"version": "0.16.0",
"version": "0.17.0",
"description": "TON transaction emulator",
"main": "dist/index.js",
"license": "MIT",
Expand Down
18 changes: 18 additions & 0 deletions src/blockchain/Blockchain.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -651,4 +651,22 @@ describe('Blockchain', () => {
expect(res.transactions[1].description.type).toEqual('generic')
expect(tt.description.isTock).toBe(true)
})

it('should support TVM v6 opcodes', async () => {
const blockchain = await Blockchain.create()
const addr = randomAddress()
await blockchain.setShardAccount(addr, createShardAccount({
address: addr,
code: Cell.fromBase64('te6ccgEBBAEAHAABFP8A9KQT9LzyyAsBAgFiAgMAAtAACaA41fBt'),
data: new Cell(),
balance: toNano('1'),
}))

const res = await blockchain.runGetMethod(addr, 'gasfee', [
{ type: 'int', value: 1n },
{ type: 'int', value: 0n },
])

expect(res.stackReader.readBigNumber()).toEqual(100000n)
})
})
4 changes: 2 additions & 2 deletions src/config/defaultConfig.ts

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/config/slimConfig.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export const slimConf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BASA0ACAAAQAAAACAAAAAIAAAAIAAAQEgNgAUa0ZVPxAEO5rKAAEBSDgBAcA5ALfQUy7nTs8AAAJwACrYn7aHDoYaZOELB7fIx0lsFfzu58bxcmSlH++c6KojdwX2/yWZOw/Zr08OxAx1OQZWjQc9ppdrOeJEc5dIgaEAAAAAD/////gAAAAAAAAABAIBIEo7AgEgQDwBASA9AgKRPz4AKjYEBwMFAExLQAExLQAAAAACAAAD6AAqNgIGAgUAD0JAAJiWgAAAAAEAAAH0AQEgQQIBIEVCAgm3///wYERDAAHcAAH8AgLZSEYCAWJHUQIBIFtbAgEgVkkCAc5eXgIBIF9LAQEgTAIDzUBOTQADqKACASBWTwIBIFNQAgEgUlEAAdQCAUheXgIBIFVUAgEgWVkCASBZWwIBIF1XAgEgWlgCASBbWQIBIF5eAgEgXFsAAUgAAVgCAdReXgABIAEBIGAAGsQAAAAEAAAAAAAAAC4CASBtYgIBIGhjAQFYZAEBwGUCASBnZgAVv////7y9GpSiABAAFb4AAAO8s2cNwVVQAgEga2kBASBqAFMB//////////////////////////////////////////+AAAAAgAAAAUABASBsAEDlZ1T4NCb2mwkme9h2rJfESCE0W34ma9lWp7+/uY3zXAIBIHBuAQFIbwBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACASBzcQEBIHIAQDMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzAQEgdABAVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVX9poTo`;
export const slimConfigSeqno = 36964449;
export const slimConfig = `te6cckECeAEABZwAAgPNwC8BAgEgGwICASAWAwIBIBEEAQFYBQEBwAYCASAIBwBDv+6SYlD5XEfFuCmona5jYtGN4iWVOW5abGAZxXh4ab9iwAIBIAoJAEK/jVwCELNdrdqiGfrEWdug/e+x+uTpeg0Hl3Of4FDWlMoCASAOCwIBWA0MAEG+3N3+hWqZxcuAeEGZwHcL6jHyjg1zOPc3hEgN70TNkBQAQb7Zm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AExLQAExLQAAAAACAAAD6AAqNgIGAgUAD0JAAJiWgAAAAAEAAAH0AQEgRAIBIEhFAgm3///wYEdGAAHcAAH8AgLZS0kCAWJKVAIBIF5eAgEgWUwCAc5hYQIBIGJOAQEgTwIDzUBRUAADqKACASBZUgIBIFZTAgEgVVQAAdQCAUhhYQIBIFhXAgEgXFwCASBcXgIBIGBaAgEgXVsCASBeXAIBIGFhAgEgX14AAUgAAVgCAdRhYQABIAEBIGMAGsQAAAAGAAAAAAAAAC4CASBwZQIBIGtmAQFYZwEBwGgCASBqaQAVv////7y9GpSiABAAFb4AAAO8s2cNwVVQAgEgbmwBASBtAFMB//////////////////////////////////////////+AAAAAgAAAAUABASBvAEDlZ1T4NCb2mwkme9h2rJfESCE0W34ma9lWp7+/uY3zXAIBIHNxAQFIcgBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACASB2dAEBIHUAQDMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzAQEgdwBAVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVvyxj8`;
2 changes: 1 addition & 1 deletion src/executor/Executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ export class Executor implements IExecutor {

private runCommon(args: (string | number)[]): EmulationResult {
this.debugLogs = []
const resp = JSON.parse(this.extractString(this.invoke('_emulate', args)))
const resp = JSON.parse(this.extractString(this.invoke('_emulate_with_emulator', args)))
const debugLogs = this.debugLogs.join('\n')

if (resp.fail) {
Expand Down
2 changes: 1 addition & 1 deletion src/executor/emulator-emscripten.js

Large diffs are not rendered by default.

Binary file modified src/executor/emulator-emscripten.wasm
Binary file not shown.
2 changes: 1 addition & 1 deletion src/executor/emulator-emscripten.wasm.js

Large diffs are not rendered by default.

0 comments on commit 57c629a

Please sign in to comment.