Skip to content

Commit

Permalink
Merge pull request #9 from EmelyanenkoK/fees_fix
Browse files Browse the repository at this point in the history
Body ref fees fix
  • Loading branch information
EmelyanenkoK authored Jun 19, 2023
2 parents 9cca796 + 2e9414b commit b474209
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions fees.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export function computeExternalMessageFees(msgPrices: MsgPrices, cell: Cell) {
return computeFwdFees(msgPrices, BigInt(storageStats.cells), BigInt(storageStats.bits));
}

export function computeMessageForwardFees(msgPrices: MsgPrices, msg: Message) {
export function computeMessageForwardFees(msgPrices: MsgPrices, msg: Message, bodyRef: boolean = false) {
// let msg = loadMessageRelaxed(cell.beginParse());
let storageStats: { bits: number, cells: number } = { bits: 0, cells: 0 };

Expand All @@ -132,7 +132,7 @@ export function computeMessageForwardFees(msgPrices: MsgPrices, msg: Message) {
}

// Body
let bc = collectCellStats(msg.body, true);
let bc = collectCellStats(msg.body, !bodyRef);
storageStats.bits += bc.bits;
storageStats.cells += bc.cells;

Expand Down
2 changes: 1 addition & 1 deletion tests/Controller.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1764,7 +1764,7 @@ describe('Cotroller mock', () => {
const trans = res.transactions[1];
expect(trans.outMessagesCount).toEqual(1);
const retMsg = trans.outMessages.get(0)!;
const fwdFees = computeMessageForwardFees(msgConfMc, retMsg);
const fwdFees = computeMessageForwardFees(msgConfMc, retMsg, true);
expect(res.transactions).toHaveTransaction({
from: controller.address,
to: validator.wallet.address,
Expand Down

0 comments on commit b474209

Please sign in to comment.