alloy-rs / alloy-rs/alloy

[Feature] Expansive docs & more in depth examples

Đang mở
#2,298 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
enhancement
Ngôn ngữ chính
Rust
Star
1.3k
Fork
668
Merge trung bình
2 ngày 1 giờ
Pull request đã merge (30 ngày)
29

Mô tả

### Component

other

### Describe the feature you would like

The docs don't seem to cover all the features & functionality of Alloy.

For example, there's no mention of testing or testing approaches, but while looking through the packages. I did see however that the docs were updated yesterday to include some new features, like `MockProvider`

Additionally, every reference/example is just simply in `fn main()`, this from my own experience makes the references not that applicable when trying to solve issues with their usage outside of the exact demonstrated usage.

What would be great:

- All features listed in the docs
- More complex examples, such as spawning subscriptions in a separate file, or running functions which require `tokio` runtime without assuming the tokio main decorator being placed on `fn main`
- A full test which spawns anvil, demonstrates creation, consumption and interaction with `SigningKey` & `Signer`
- Common conversions, while there are some examples, I've found issues with trying to align common types to the types requested from `sol!` parsed function signatures
- The examples for type conversions for the majority use hardcoded input types, while this does demonstrate expectations, this isn't a common scenario. What would have been brilliant as a reference, is taking 1 variable, and casting it to the common types. For example getting a Signer's address, then getting concating into a message to then sign that satisfies common Solidity signature params. (message: "Authorising App: 0x123...C0Ff33")

I imagine an example that could cover a few base's would be an NFT permit creating rust server. This could demonstrate consuming & using keys, responding to requests, signing, verifying & transacting, with some balance management thrown in. This is a common example seen in other library demonstrates which could be a bit more relatable for devs getting into using Rust & Alloy.

### Additional context

Background:

Predominantly Solidity, Forge, Hardhat, Dapp dev. Comfortable with Yul.

Not a lot of Rust experience, worked with Go for quite a while.

I usually look around for a reference project, like a production level repo but given this is usually closed source back end, finding references like that was a bit sparce.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.