Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
feat: upgrade wasm libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
ex3ndr committed Apr 14, 2023
1 parent 9740089 commit f3ca45b
Show file tree
Hide file tree
Showing 7 changed files with 19 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).

## [Unreleased]

## Change
- Upgtade wasm emulation libraries
- Improving performance
- Increase logs buffer limit

## [4.0.0] - 2023-04-13

## Changed
Expand Down
4 changes: 2 additions & 2 deletions src/bindings/EmulatorBindings.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ describe('EmulatorBindings', () => {
.endCell();
let bindings = new EmulatorBindings();
let res = await bindings.runGetMethod({
verbosity: 0,
verbosity: 4,
code,
data,
address: contractAddress(0, { code, data }),
Expand Down Expand Up @@ -61,7 +61,7 @@ describe('EmulatorBindings', () => {
// ];
let bindings = new EmulatorBindings();
let res = await bindings.runGetMethod({
verbosity: 0,
verbosity: 3,
address: Address.parseRaw('0:26f3f75674dac80f4bb469fb3bbf21860c4c7be7bf7597aa29fca2aae5c5130b'),
code: Cell.fromBase64('te6cckECDgEAAjwAART/APSkE/S88sgLAQIBYgYCAgEgBAMATb3ejBOC52Hq6WVz2PQnYc6yVCjbNBOE7rGpaVsj5ZkWnXlv74sRzAElv11faiaGoA/DFAgIDrgACY7Z5AUARjD+AIvEhlbGxvIHdvcmxkIY/hQwgHv+IDB/8AJw8AJt/iAwAgLOCAcALUmYtHRydWWP4UMJqLVmYWxzZY/hQw4oA+tO2i7ftwIddJwh+VMCDXCx/eAtDTAwFxsMABkX+RcOIB+kAiUGZvBPhhApFb4CCCEJRqmLa6jzQw7UTQ1AH4YoEBAdc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IBCWG1t2zwOAfbIcQHKAVAHAcoAcAHKAlAFzxZQA/oCcAHKaCNusyVus7GOTH8BygDIcAHKAHABygAkbrOdfwHKAAQgbvLQgFAEzJY0A3ABygDiJG6znX8BygAEIG7y0IBQBMyWNANwAcoA4nABygACfwHKAALJWMyXMzMBcAHKAOIhbrMPADCcfwHKAAEgbvLQgAHMlTFwAcoA4skB+wAAHMgBghCv+Q9XWMsfyz/JhKJ/gQ=='),
Expand Down
8 changes: 6 additions & 2 deletions src/bindings/EmulatorBindings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ export class EmulatorBindings {
rand_seed: args.randomSeed.toString('hex'),
gas_limit: args.gasLimit.toString(),
method_id: args.methodId,
debug_enabled: true
};

// Execute
Expand All @@ -147,7 +148,7 @@ export class EmulatorBindings {
[
JSON.stringify(params),
stack.toBoc().toString('base64'),
args.config.toBoc().toString('base64')
args.config.toBoc().toString('base64'),
]
);
let resStr: string;
Expand Down Expand Up @@ -202,6 +203,7 @@ export class EmulatorBindings {
lt: args.lt.toString(),
rand_seed: args.randomSeed.toString('hex'),
ignore_chksig: false,
debug_enabled: true
};

// Execute
Expand All @@ -211,7 +213,7 @@ export class EmulatorBindings {
args.verbosity,
args.shardAccount.toBoc().toString('base64'),
args.message.toBoc().toString('base64'),
JSON.stringify(params)
JSON.stringify(params),
]);
let resStr: string;
try {
Expand Down Expand Up @@ -271,6 +273,8 @@ export class EmulatorBindings {
}
});
return module[name](...mappedArgs);
} catch (e) {
throw Error((e as any).message);
} finally {
allocatedPointers.forEach((pointer) => module._free(pointer));
}
Expand Down
2 changes: 1 addition & 1 deletion src/bindings/wasm/emulator-emscripten.js

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/emulator/ContractExecutor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ export class ContractExecutor {
// Resolve verbosity
let verbosity = this.verbosity !== null ? this.verbosity : this.system.globalVerbosity;
if (isCoverageEnabled()) {
verbosity = Verbosity.DEBUG; // Force debug verbosity for coverage
verbosity = Math.max(Verbosity.INFO, verbosity); // Force warning verbosity for coverage
}

let result = await this.system.bindings.runGetMethod({
Expand Down Expand Up @@ -255,7 +255,7 @@ export class ContractExecutor {
// Resolve verbosity
let verbosity = this.verbosity !== null ? this.verbosity : this.system.globalVerbosity;
if (isCoverageEnabled()) {
verbosity = Verbosity.DEBUG; // Force debug verbosity for coverage
verbosity = Math.max(Verbosity.INFO, verbosity); // Force debug verbosity for coverage
}

// Execute transaction
Expand Down

0 comments on commit f3ca45b

Please sign in to comment.