Skip to content

Commit 4e74dbb

Browse files
authored
feat: add send mode matcher (#27)
1 parent 0cd1ee6 commit 4e74dbb

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## Unreleased
9+
10+
### Added
11+
12+
- Added `mode` matcher for transaction
13+
814
## [0.8.0] - 2025-06-16
915

1016
### Added

src/test/transaction.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ import { inspect } from 'node-inspect-extracted';
44
import { CompareResult } from './interface';
55
import { prettifyTransaction } from '../utils/pretty-transaction';
66

7+
export type ExtendedTransaction = Transaction & {
8+
mode?: number;
9+
};
10+
711
export type FlatTransaction = {
812
from?: Address;
913
to?: Address;
@@ -28,6 +32,7 @@ export type FlatTransaction = {
2832
exitCode?: number;
2933
actionResultCode?: number;
3034
success?: boolean;
35+
mode?: number;
3136
};
3237

3338
type WithFunctions<T> = {
@@ -54,14 +59,15 @@ function extractEc(cc: CurrencyCollection): [number, bigint][] {
5459
return r;
5560
}
5661

57-
export function flattenTransaction(tx: Transaction): FlatTransaction {
62+
export function flattenTransaction(tx: ExtendedTransaction): FlatTransaction {
5863
return {
5964
lt: tx.lt,
6065
now: tx.now,
6166
outMessagesCount: tx.outMessagesCount,
6267
oldStatus: tx.oldStatus,
6368
endStatus: tx.endStatus,
6469
totalFees: tx.totalFees.coins,
70+
mode: tx.mode,
6571
...(tx.inMessage
6672
? {
6773
from: tx.inMessage.info.src instanceof Address ? tx.inMessage.info.src : undefined,

src/utils/pretty-transaction.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { Address, Transaction } from '@ton/core';
1+
import { Address } from '@ton/core';
22

33
import errors from '../errors.json';
4-
import { flattenTransaction, FlatTransaction } from '../test/transaction';
4+
import { ExtendedTransaction, flattenTransaction, FlatTransaction } from '../test/transaction';
55
import { contractsMeta } from './ContractsMeta';
66

77
type PrettifiedProps = {
@@ -80,7 +80,7 @@ function prettifyAddress(address: Address | undefined): string | undefined {
8080
return `${address.toString()} (${contractLabel})`;
8181
}
8282

83-
export function prettifyTransaction(tx: Transaction): PrettyTransaction {
83+
export function prettifyTransaction(tx: ExtendedTransaction): PrettyTransaction {
8484
const flatTx = flattenTransaction(tx);
8585
return {
8686
...flatTx,

0 commit comments

Comments
 (0)