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

feat: check quorums registered detail #331

Merged
merged 4 commits into from
Aug 29, 2024
Merged
Changes from all commits
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
20 changes: 20 additions & 0 deletions chainio/clients/avsregistry/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,26 @@ func (r *ChainReader) GetOperatorFromId(
return operatorAddress, nil
}

func (r *ChainReader) QueryRegistrationDetail(
opts *bind.CallOpts,
operatorAddress common.Address,
) ([]bool, error) {
operatorId, err := r.GetOperatorId(opts, operatorAddress)
if err != nil {
return nil, err
}
value, err := r.registryCoordinator.GetCurrentQuorumBitmap(opts, operatorId)
if err != nil {
return nil, err
}
numBits := value.BitLen()
var quorums []bool
for i := 0; i < numBits; i++ {
quorums = append(quorums, value.Int64()&(1<<i) != 0)
}
return quorums, nil
}

func (r *ChainReader) IsOperatorRegistered(
opts *bind.CallOpts,
operatorAddress common.Address,
Expand Down