From 8757e81ed607f709b45502304b121ab6c8560976 Mon Sep 17 00:00:00 2001 From: xiaohuo Date: Thu, 29 Aug 2024 11:32:49 +0800 Subject: [PATCH] feat: check quorums registered detail (#331) * feat: return quorum registration detail * fix: check if ith bit is set * refactor: use map instead of array * chore: revert back to use array --- chainio/clients/avsregistry/reader.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/chainio/clients/avsregistry/reader.go b/chainio/clients/avsregistry/reader.go index dac569c7..54331cc2 100644 --- a/chainio/clients/avsregistry/reader.go +++ b/chainio/clients/avsregistry/reader.go @@ -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<