test(benches): Add Highload-Wallet v3 benchmarks#3435
Conversation
|
Waiting for tests and then approve |
There was a problem hiding this comment.
Good job! Solid PR overall. Just a few small comments. One thing: there are quite a few magic numbers in the tests - please consider replacing them with named constants or removing unnecessary ones.
I’d also suggest adding more comments to the Tact code so that people looking at it for examples can better understand what’s going on
| codeSizeResults: CodeSizeResult, | ||
| fromInit: FromInitHighloadWalletV3, | ||
| ) { | ||
| let blockchain: Blockchain; |
There was a problem hiding this comment.
setup() instead of global vars
|
|
||
| // after commit, check the message to prevent an error in the action phase | ||
|
|
||
| let messageSlice = msgInner.messageToSend.beginParse(); |
There was a problem hiding this comment.
Can we use structs instead of manual parsing?
Kaladin13
left a comment
There was a problem hiding this comment.
Good job on Tact code! A couple of notes about ts
|
|
||
| const justTestFlow = async (kind: "external" | "internal") => { | ||
| const testReceiver = receiver.address; | ||
| const forwardToSelfValue = toNano(0.17239); |
|
|
||
| let step: Step; | ||
|
|
||
| const justTestFlow = async (kind: "external" | "internal") => { |
There was a problem hiding this comment.
Let's rename it to something meaningful
| message: internalMessage, | ||
| mode: SendMode.PAY_GAS_SEPARATELY, | ||
| queryId, | ||
| createdAt: ~~(Date.now() / 1000), |
There was a problem hiding this comment.
| createdAt: ~~(Date.now() / 1000), | |
| createdAt: (Date.now() / 1000), |
There was a problem hiding this comment.
No, just Math.floor() is needed here, not ~~
| "cells": "17", | ||
| "bits": "4373" | ||
| }, | ||
| "pr": "https://github.com/ton-blockchain/highload-wallet-contract-v3" |
| .endCell(); | ||
| } | ||
|
|
||
| *generateBadMsg() { |
| "externalTransfer": "6200", | ||
| "internalTransfer": "2065" | ||
| }, | ||
| "pr": "https://github.com/ton-blockchain/highload-wallet-contract-v3" |
| message: internalMessage, | ||
| mode: SendMode.PAY_GAS_SEPARATELY, | ||
| queryId, | ||
| createdAt: ~~(Date.now() / 1000), |
There was a problem hiding this comment.
No, just Math.floor() is needed here, not ~~
| export const SUBWALLET_ID = 0; | ||
|
|
||
| const getRandom = (min: number, max: number) => { | ||
| return Math.random() * (max - min) + min; |
There was a problem hiding this comment.
maybe
import { randomInt } from 'crypto'?
Closes #3395