fuels-ts icon indicating copy to clipboard operation
fuels-ts copied to clipboard

feat: parser scaffolding

Open nedsalk opened this issue 1 year ago • 2 comments

Summary

  • Adds the parsing functionality for an ABI
import type { Abi, AbiSpecification } from '@fuel-ts/abi'
import { AbiParser } from '@fuel-ts/abi'

const jsonAbi: AbiSpecification = '{ "specVersion": "1" }' 
const abi: Abi = AbiParser.parse(jsonAbi);

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 avatar Sep 03 '24 14:09 nedsalk

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

Name Status Preview Comments Updated (UTC)
create-fuels-template ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 22, 2025 1:48pm
fuels-template ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 22, 2025 1:48pm
ts-api-docs ❌ Failed (Inspect) Jan 22, 2025 1:48pm
ts-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 22, 2025 1:48pm
ts-docs-api ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 22, 2025 1:48pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
create-fuels-counter-example ⬜️ Ignored (Inspect) Jan 22, 2025 1:48pm

vercel[bot] avatar Sep 03 '24 14:09 vercel[bot]

CodSpeed Performance Report

Merging #3089 will degrade performances by 17.21%

Comparing ns/feat/abi-parser (a2f0004) with np/feat/abi-refactor (1390116)

Summary

❌ 1 regressions
✅ 17 untouched benchmarks

:warning: Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark np/feat/abi-refactor ns/feat/abi-parser Change
should successfully conduct a custom transfer between wallets (x20 times) 99.4 ms 120 ms -17.21%

codspeed-hq[bot] avatar Sep 25 '24 13:09 codspeed-hq[bot]

@maschad Thanks for the approval! Still, given that this parser is public-facing as well, we realized that we need to test its outputs independently also. Although it satisfies our needs for the coder and typegen, we might inadvertently introduce regressions that aren't caught by them and which'd be caught by tests targeting it specifically. Therefore, we'll re-request a round of review after the tests are done.

nedsalk avatar Dec 07 '24 14:12 nedsalk

This is a comment from @danielbate on #3402 - with a couple amendments (ref):

  • [ ] Documentation around the AbiSpecification. (ref)
  • [ ] Documentation on the metadata types. (ref)
  • [ ] Documentation the flow from Abi (JSON) -> AbiSpecification -> Normalised ABI -> Coder/gen isn't completely clear to me. So I can still use the coder and gen without normalising the ABI? (ref). And because the user can still interact directly with just ABI?

(This has been added to the description)

petertonysmith94 avatar Dec 12 '24 09:12 petertonysmith94