Skip to content

Conversation

@AdityaGupta20871
Copy link

Features Added

  • Minimum nanoergs per box validation (based on box size)
  • Miner fee validation (fee-per-byte threshold)
  • Custom fee ErgoTree support
  • Configurable validation options
  • Can disable all checks or specific checks

Methods

  • validateTransaction() - Main validation function
  • checkMinNanoergsPerBox() - Box value validation
  • checkMinerFee() - Fee validation
  • isFeeContract() - Fee contract detection
  • TransactionCheckOptions - Configuration type

Breaking Changes

None - validation is enabled by default but non-breaking:

  • Only errors (insufficient box values) cause failures
  • Warnings (missing fees) are logged but don't fail
  • Use checks: false to disable validation

Testing

  • 14 new unit tests in transactionChecks.spec.ts
  • 4 integration tests in mockChain.spec.ts
  • All 67 tests passing

Closes #120

@changeset-bot
Copy link

changeset-bot bot commented Oct 6, 2025

⚠️ No Changeset found

Latest commit: e99ee31

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@AdityaGupta20871
Copy link
Author

@arobsn LMK if any changes are needed! :)

@codecov
Copy link

codecov bot commented Oct 7, 2025

Codecov Report

❌ Patch coverage is 93.33333% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 99.94%. Comparing base (69c8309) to head (e99ee31).

Files with missing lines Patch % Lines
packages/mock-chain/src/mockChain.ts 77.77% 4 Missing ⚠️
packages/mock-chain/src/transactionChecks.ts 96.07% 4 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##            master     #205      +/-   ##
===========================================
- Coverage   100.00%   99.94%   -0.06%     
===========================================
  Files          124      125       +1     
  Lines        14204    14324     +120     
  Branches      1778     1808      +30     
===========================================
+ Hits         14204    14316     +112     
- Misses           0        8       +8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Oct 7, 2025

@fleet-sdk/blockchain-providers

npm i https://pkg.pr.new/@fleet-sdk/blockchain-providers@205

@fleet-sdk/common

npm i https://pkg.pr.new/@fleet-sdk/common@205

@fleet-sdk/compiler

npm i https://pkg.pr.new/@fleet-sdk/compiler@205

@fleet-sdk/core

npm i https://pkg.pr.new/@fleet-sdk/core@205

@fleet-sdk/crypto

npm i https://pkg.pr.new/@fleet-sdk/crypto@205

@fleet-sdk/mock-chain

npm i https://pkg.pr.new/@fleet-sdk/mock-chain@205

@fleet-sdk/serializer

npm i https://pkg.pr.new/@fleet-sdk/serializer@205

@fleet-sdk/wallet

npm i https://pkg.pr.new/@fleet-sdk/wallet@205

@fleet-sdk/ageusd-plugin

npm i https://pkg.pr.new/@fleet-sdk/ageusd-plugin@205

@fleet-sdk/babel-fees-plugin

npm i https://pkg.pr.new/@fleet-sdk/babel-fees-plugin@205

commit: e99ee31

Copy link
Member

@arobsn arobsn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AdityaGupta20871 thanks for your PR. Please check why multiple CI tasks are failing.

@AdityaGupta20871
Copy link
Author

AdityaGupta20871 commented Oct 7, 2025

@arobsn Fixed! The CI failures were due to:
Lint/format issues in my files which should be resolved (removed unused import, fixed template literals, fixed formatting)
Can you review it again! It also build successfully

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[mock-chain] add new transaction checks

2 participants