-
Notifications
You must be signed in to change notification settings - Fork 1
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
chore(tests): add restaking simulation tests #212
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
37123c0
to
e623ddb
Compare
operatorsKeeper := opk.(*operatorskeeper.Keeper) | ||
servicesKeeper := sk.(*serviceskeeper.Keeper) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the point of using interfaces as the params type, if you are going to cast them anyway? I think it's better to either:
- Require non-interface types directly as params, or
- Use interfaces everywhere
This way you don't have to downcast anything and it's easier to manage everything
operator, found := operatorssimulation.GetRandomExistingOperator(r, ctx, operatorsKeeper, func(o operatorstypes.Operator) bool { | ||
// Search a service that the operator has joined | ||
for _, s := range services { | ||
hasJoined, _ := k.HasOperatorJoinedService(ctx, o.ID, s.ID) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of o
and s
I would suggest using names as operator
and service
to make it easier to read
return simtypes.NoOpMsg(types.ModuleName, sdk.MsgTypeURL(msg), "could not get operators"), nil, nil | ||
} | ||
|
||
// Get a service and an operator that is not allowed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Get a service and an operator that is not allowed | |
// Get a service and an operator that is inside the allow list |
d06d6bc
to
34b6ab0
Compare
Description
Closes: MILK-150
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!
to the type prefix if API or client breaking changeCHANGELOG.md
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...
!
in the type prefix if API or client breaking change