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

[CL][Misc]Create testcases for GetIfFound #3138

Closed
mattverse opened this issue Oct 25, 2022 · 1 comment
Closed

[CL][Misc]Create testcases for GetIfFound #3138

mattverse opened this issue Oct 25, 2022 · 1 comment
Assignees
Labels
F: concentrated-liquidity Tracking the development of concentrated liquidity feature to improve filtering on the project board Good first issue

Comments

@mattverse
Copy link
Member

Background

We recently added a helper method in the osmoutils, that would instead of pannicing if not found (which is what MustGet does), we return a boolean field and an error instead which looks like this:

func GetIfFound(store store.KVStore, key []byte, result proto.Message) (found bool, err error) {
	b := store.Get(key)
	if b == nil {
		return false, nil
	}
	if err := proto.Unmarshal(b, result); err != nil {
		return true, err
	}
	return true, nil
}

Actual implementation: 016f275#diff-b6d3bf142ce5c79530054885a752706a87726315c61bd5ff4a3abe8de0b275a9R129-R138

Suggested Design

We want to come back to this method and eventually add test cases for this specific method.
The PR itself could be made off of concentrated-liquidity-main branch until that branch is merged to main.

Acceptance Criteria

We have a test case for GetIfFound

@mattverse mattverse added Good first issue F: concentrated-liquidity Tracking the development of concentrated liquidity feature to improve filtering on the project board labels Oct 25, 2022
@mattverse mattverse changed the title Create testcases for GetIfFound [CL][Misc]Create testcases for GetIfFound Oct 25, 2022
@hieuvubk
Copy link
Contributor

I would like to work on this issue if no one on process

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F: concentrated-liquidity Tracking the development of concentrated liquidity feature to improve filtering on the project board Good first issue
Projects
Archived in project
Development

No branches or pull requests

2 participants