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

Changed type aliases to type definitions #228

Open
wants to merge 6 commits into
base: dev
Choose a base branch
from

Conversation

0xpanicError
Copy link

Changed all type aliases in the sdk to type definitions

What Changed?

here are the types that were changed

// types/avs.go

type TaskIndex = uint32
type TaskResponseDigest = Bytes32

// types/operator.go

type OperatorAddr = common.Address
type StakeAmount = *big.Int
type OperatorId = Bytes32
type BlockNum = uint32

Reviewer Checklist

  • Code is well-documented
  • Code adheres to Go naming conventions
  • Code deprecates any old functionality before removing it

) (types.QuorumNums, [][]opstateretriever.OperatorStateRetrieverOperator, error) {
quorumBitmap, operatorStakes, err := r.operatorStateRetriever.GetOperatorState0(
opts,
r.registryCoordinatorAddr,
operatorId,
blockNumber)
uint32(blockNumber))
Copy link
Collaborator

Choose a reason for hiding this comment

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

not sure these explicit type casts are the way to go. If we ever change blockNumber to be uint64 for eg then we'll have to go change these everywhere.

We could define a UnderlyingType() on all the types to unwrap them, which we could use here like blockNumber.UnderlyingType(), but not convinced this is nice either.

Need to think about this more and discuss with @shrimalmadhur

Copy link
Author

Choose a reason for hiding this comment

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

even in the blsagg_test.go file there were 15 instances of blockNum defined as blockNum := uint32(1)
The OperatorStateRetriever takes in blockNum as uint32

should I in the mean time revert the changes made to blockNum ?

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

Successfully merging this pull request may close these issues.

2 participants