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

Rust and Typescript examples for forc-index Forc.toml metadata #1

Merged
merged 5 commits into from
Nov 18, 2024

Conversation

zees-dev
Copy link
Contributor

@zees-dev zees-dev commented Nov 18, 2024

Changes

  • Added typescript example forc-index-ts which simply reads/parses Forc.toml project.metadata and then reads the contract ABI and prints out the loggedTypes json object (which can potentially be used for a proper indexing implementation)
  • Added an equivalent example for rust forc-index-rust
# > forc index --path ./sample-project/Forc.toml

📖 Reading Forc.toml configuration...
✓ Forc.toml validated successfully

📑 Reading ABI schema...
Path: sample-project/out/release/counter-contract-abi.json
✓ ABI schema loaded successfully

📋 Logged Types:

[Entry 1]
  🔍 Log ID: 17947550689929035683
  🔑 Concrete Type ID: f912824325897fa36746f20338e0f7a92f1e39c11bf82d47b971f7a528d7ad81

Linked PRs

Copy link
Member

@sdankel sdankel left a comment

Choose a reason for hiding this comment

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

Looks great!

@zees-dev zees-dev merged commit 1b6f8d9 into master Nov 18, 2024
1 check passed
@zees-dev zees-dev deleted the feat/forc-index-metadata branch November 18, 2024 09:44
zees-dev added a commit to FuelLabs/sway that referenced this pull request Nov 19, 2024
# Description
Adds support for `metadata` as `[project.metadata]` or
`[workspace.metadata]` in `Forc.toml` of value `toml::Value`

- Addresses:
https://github.com/FuelLabs/rfcs/blob/22bf3936a37b60bb496232c1b52bf59e204a0697/text/rfcs/0006-metadata-in-forc-manifest.md#reference-level-explanation
- Resolves: #2180

## Linked examples of usage
- FuelLabs/example-forc-plugins#1

---------

Co-authored-by: Sophie Dankel <[email protected]>
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.

3 participants