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

GetStateInfo and MustGetStateInfo can be more efficient #848

Open
ThanhNhann opened this issue Apr 17, 2024 · 0 comments
Open

GetStateInfo and MustGetStateInfo can be more efficient #848

ThanhNhann opened this issue Apr 17, 2024 · 0 comments

Comments

@ThanhNhann
Copy link

We can update RollappKeeper.GetStateInfo(ctx sdk.Context, rollappId string, index uint64) to RollappKeeper.GetStateInfo(ctx sdk.Context, stateInfoIndex rtypes.StateInfoIndex) because stateInfoIndex includes rollappId and index

type StateInfoIndex struct {
	// rollappId is the rollapp that the sequencer belongs to and asking to update
	// it used to identify the what rollapp a StateInfo belongs
	// The rollappId follows the same standard as cosmos chain_id
	RollappId string `protobuf:"bytes,1,opt,name=rollappId,proto3" json:"rollappId,omitempty"`
	// index is a sequential increasing number, updating on each
	// state update used for indexing to a specific state info, the first index is 1
	Index uint64 `protobuf:"varint,2,opt,name=index,proto3" json:"index,omitempty"`
}
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

No branches or pull requests

1 participant