Conversation
There was a problem hiding this comment.
Looking good! Just left a few style suggestions and some mild safety ones, but nothing that's a showstopper (though I think anyhow -> thiserror is definitely worth doing).
I suppose there are ways we could reduce the boilerplate by storing the string representation, ID and selector in a const array or something similar at the top, but I don't think it's worth it to be stingy with the LOC of a generated file, so this approach looks good to me.
| Debug, Hash, PartialEq, Eq, Clone, Copy, serde::Serialize, serde::Deserialize, PartialOrd, Ord, | ||
| )] | ||
| #[repr(u64)] | ||
| pub enum ChainName { |
There was a problem hiding this comment.
I may be bikeshedding here, but is this really a ChainName? I would think this enum would be the Chain, and that Name would specifically refer to the stringified version of it.
There was a problem hiding this comment.
We inherit the naming, we use this type to read strings from configs or keystore (i.e. actual chain names).
Agree that now might be a good time to align
Co-authored-by: PabloMansanet <pablomansanet@gmail.com>
Co-authored-by: PabloMansanet <pablomansanet@gmail.com>
- use thiserror - reduce `ChainSelector`, `ChainId` types - fn from_chain_selector
…to gen-rs # Conflicts: # genchains_solana.go
Introducing Rust code generation.
go templatesrsfolder for rust:chainselectorswith testsNOTES: