Skip to content

Add vmResourceUsage method to TransactionBuilder#354

Merged
rkalis merged 4 commits intoCashScript:v0.12-releasefrom
mainnet-pat:vm_resource
Sep 23, 2025
Merged

Add vmResourceUsage method to TransactionBuilder#354
rkalis merged 4 commits intoCashScript:v0.12-releasefrom
mainnet-pat:vm_resource

Conversation

@mainnet-pat
Copy link
Copy Markdown
Contributor

Resolves #343

The call outputs an array of AuthenticationProgramStateResourceLimits['metrics'] objects for contracts and undefined for other input types.

If called with verbose set, it will also output a summary table to the console:

┌─────────┬─────────────────────────────────────────────────┬─────┬──────────────┬───────────┬────────┐
│ (index) │ Contract - Function                             │ Ops │ OpCost       │ SigChecks │ Hashes │
├─────────┼─────────────────────────────────────────────────┼─────┼──────────────┼───────────┼────────┤
│ 0       │ 'SingleFunction - test_require_single_function' │ 7   │ '1155/36000' │ '0/1'     │ '2/22' │
│ 1       │ 'ZeroHandling - test_zero_handling'             │ 13  │ '1760/40800' │ '0/1'     │ '2/25' │
│ 2       │ 'P2PKH'                                         │ 0   │ ''           │ ''        │ ''     │
└─────────┴─────────────────────────────────────────────────┴─────┴──────────────┴───────────┴────────┘

@vercel
Copy link
Copy Markdown

vercel Bot commented Sep 9, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
cashscript Ready Ready Preview Comment Sep 23, 2025 9:56am

@codecov
Copy link
Copy Markdown

codecov Bot commented Sep 9, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.43%. Comparing base (fa26642) to head (57cc439).

Additional details and impacted files
@@           Coverage Diff            @@
##           master     #354    +/-   ##
========================================
  Coverage   97.42%   97.43%            
========================================
  Files          78       78            
  Lines       17962    18004    +42     
  Branches      891     1313   +422     
========================================
+ Hits        17500    17542    +42     
+ Misses        462      460     -2     
- Partials        0        2     +2     

☔ 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.

@rkalis rkalis changed the base branch from master to v0.12-release September 23, 2025 08:58
@rkalis
Copy link
Copy Markdown
Member

rkalis commented Sep 23, 2025

Thanks for the contribution. We made a few small changes, and we'll merge the PR now! 🫡

@rkalis rkalis merged commit fa4785a into CashScript:v0.12-release Sep 23, 2025
2 of 3 checks passed
rkalis added a commit that referenced this pull request Oct 2, 2025
Co-authored-by: Rosco Kalis <roscokalis@gmail.com>
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.

Consider how to make Vm Limits resource usage accessible to devs

2 participants