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

Abi - Refactor / Kickoff #3029

Closed
7 tasks done
arboleya opened this issue Aug 25, 2024 · 3 comments
Closed
7 tasks done

Abi - Refactor / Kickoff #3029

arboleya opened this issue Aug 25, 2024 · 3 comments
Assignees
Labels
chore Issue is a chore feat Issue is a feature

Comments

@arboleya
Copy link
Member

arboleya commented Aug 25, 2024

Instead of merely combining both packages in a single folder, the aim is to refactor them using the same structural approach. After recently modified Spec and Encoding strategies, and with future-proofing in mind, we can look ahead and strategize a proper foundation that should be resilient to future needs.

  • Draft new directory structure
  • Draft high-level package diagram/flowchart
  • Define basic concepts for types' classes (oop, functions, etc.)
    • We will follow the general principles that internally we will strive for functional based, with external entrypoint generally exposed a class.
  • Define essential layers: AbiParser, AbiCoder, AbiGen (typegen)
  • Add foundation for the new abi package, basic infra for tests, etc.
  • Consolidate and share existent fixtures between all layers
  • Favor feature-complete contracts over small minimalistic ones
    • Consolidate + refactor abi-coder/exhaustive-examples test and to fuel-gauge/abi-contract
    • Consolidate abi-typegen/* tests and merge into the related fuel-gauge/abi-* Sway program.
    • Consolidate all abi-coder/encoding/**Coder related tests into Sway
@arboleya arboleya added feat Issue is a feature chore Issue is a chore labels Aug 25, 2024
@arboleya arboleya added this to the Caterpillar v1 milestone Aug 25, 2024
@arboleya
Copy link
Member Author

overview

@arboleya
Copy link
Member Author

arboleya commented Aug 27, 2024

Basic sketch of what could be a starting point for the file structure.

abi
├── coder
│   ├── AbiCoder.ts
│   ├── encodings
│   │   ├── v1
│   │   │   ├── array.ts
│   │   │   └── enum.ts
│   │   └── v2
│   │       ├── array.ts
│   │       └── enum.ts
│   └── types
├── gen
│   ├── AbiGen.ts
│   ├── formatters
│   │   ├── configurables.ts
│   │   ├── enums.ts
│   │   ├── functions.ts
│   │   └── ...
│   ├── renders
│   │   ├── renderContract.ts
│   │   └── ...
│   ├── templates
│   │   ├── typescript
│   │   │   ├── contract-factory.hbs
│   │   │   ├── contract.hbs
│   │   │   └── ...
│   │   └── javascript
│   └── types
├── parser
│   ├── AbiParser.ts
│   ├── specs
│   │   ├── v1
│   │   │   ├── interface.ts
│   │   │   └── transpiler.ts
│   │   └── v2
│   └── types
└── test
    ├── fixtures
    │   └── forc-projects
    └── integration

@arboleya arboleya changed the title Abi - Refactor Kickoff Abi - Refactor / Kickoff Aug 27, 2024
@arboleya arboleya removed this from the Caterpillar v1 milestone Sep 7, 2024
@arboleya arboleya added the temp:notion label Sep 8, 2024 — with Linear
@arboleya arboleya added the temp-linear label Sep 8, 2024 — with Linear
@nedsalk nedsalk mentioned this issue Sep 10, 2024
4 tasks
@nedsalk nedsalk self-assigned this Sep 12, 2024
@petertonysmith94
Copy link
Contributor

We have addressed the key issues of this PR, so I am closing this as complete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Issue is a chore feat Issue is a feature
Projects
None yet
Development

No branches or pull requests

3 participants