Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore!: mandate abi in Predicate constructor #3387

Merged
merged 4 commits into from
Nov 13, 2024

Conversation

nedsalk
Copy link
Contributor

@nedsalk nedsalk commented Nov 12, 2024

Summary

This PR makes the abi parameter mandatory on Predicate instantiation and removes tests that test if it wasn't provided.

Breaking Changes

Instantiating a Predicate now requires providing its abi. If you want to use the Predicate as an Account, please instantiate it via the Account class

// before
const predicate = new Predicate({ provider, bytecode }); // worked even though abi is missing

// after
const predicate = new Predicate({ abi, provider, bytecode }); // abi is now mandatory

// predicate as account
const account = new Account(predicateAddress, provider);

Checklist

  • All changes are covered by tests (or not applicable)
  • All changes are documented (or not applicable)
  • I reviewed the entire PR myself (preferably, on GH UI)
  • I described all Breaking Changes (or there's none)

@nedsalk nedsalk added chore Issue is a chore Breaking Change labels Nov 12, 2024
@nedsalk nedsalk self-assigned this Nov 12, 2024
Copy link

vercel bot commented Nov 12, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
fuels-template ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 13, 2024 0:16am
ts-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 13, 2024 0:16am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
ts-docs-api ⬜️ Ignored (Inspect) Nov 13, 2024 0:16am

Copy link

codspeed-hq bot commented Nov 12, 2024

CodSpeed Performance Report

Merging #3387 will improve performances by ×2.5

Comparing ns/chore/mandate-abi-in-predicate (fa70a3e) with master (1226ac3)

Summary

⚡ 1 improvements
✅ 17 untouched benchmarks

Benchmarks breakdown

Benchmark master ns/chore/mandate-abi-in-predicate Change
should successfully conduct a custom transfer between wallets (x20 times) 120.4 ms 48.2 ms ×2.5

Copy link
Contributor

Coverage Report:

Lines Branches Functions Statements
64.35%(+0.01%) 69.63%(+0.06%) 73.32%(+0%) 64.79%(+0.01%)
Changed Files:
Ok File (✨=New File) Lines Branches Functions Statements
🔴 packages/account/src/predicate/predicate.ts 21.62%
(-0.45%)
29.03%
(-2.39%)
11.11%
(+0%)
20.51%
(-0.47%)
🔴 packages/account/src/providers/transaction-request/transaction-request.ts 88.57%
(+0%)
78.08%
(+1.37%)
84%
(+0%)
88.81%
(+0%)

@nedsalk nedsalk merged commit 82e35a4 into master Nov 13, 2024
25 checks passed
@nedsalk nedsalk deleted the ns/chore/mandate-abi-in-predicate branch November 13, 2024 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Issue is a chore
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make the abi a required parameter on the Predicate constructor
4 participants