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

Add ChainId to Starknet and Comet client state #173

Merged
merged 18 commits into from
Jan 15, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
debug: this compiles
rnbguy committed Jan 10, 2025
commit 9904ef4c128897a1d5108c6ee61a46da0bd53d7c
Original file line number Diff line number Diff line change
@@ -22,30 +22,30 @@ delegate_components! {
symbol!("latest_height"),
EncodeLengthDelimitedProtoField<1, UseContext>,
>,
EncodeField<
symbol!("chain_id"),
EncodeLengthDelimitedProtoField<2, UseContext>,
>,
// EncodeField<
// symbol!("chain_id"),
// EncodeLengthDelimitedProtoField<2, UseContext>,
// >,
Copy link
Member

@rnbguy rnbguy Jan 10, 2025

Choose a reason for hiding this comment

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

The commented out parts in this file are done the same way as EncodeStarknetConsensusState and EncodeStarknetHeader. Not sure why this doesn't work.

]>,
MutDecoderComponent: DecodeFrom<
Self,
CombineEncoders<Product![
DecodeRequiredProtoField<1, UseContext>,
DecodeRequiredProtoField<2, UseContext>,
// DecodeRequiredProtoField<2, UseContext>,
]>
>,
}
}

impl Transformer for EncodeStarknetClientState {
type From = Product![Height, ChainId];
type From = Product![Height /*ChainId*/];

type To = StarknetClientState;

fn transform(product![latest_height, chain_id]: Self::From) -> Self::To {
fn transform(product![latest_height /*chain_id*/]: Self::From) -> Self::To {
StarknetClientState {
latest_height,
chain_id,
chain_id: ChainId::new("starknet").unwrap(),
}
}
}