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

query_registration_detail method #162

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

pablodeymo
Copy link
Collaborator

@pablodeymo pablodeymo commented Nov 14, 2024

This PR implements the method taken from Go SDK repo:

        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
        }

@pablodeymo pablodeymo changed the title [WIP] Started working on query_registration_detail query_registration_detail method Nov 19, 2024
@pablodeymo pablodeymo marked this pull request as ready for review November 22, 2024 20:32
let inner_value = quorum_bitmap._0.into_limbs()[0];

let mut quorums = Vec::<bool>::new();
for i in 0..64_u64 {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Note that this implementation returns a vec of constant length 64. Instead, the go implementation returns an array that has the minimum required length to hold the registered quorums

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