-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: update protos to be correctly namespaced
- Loading branch information
1 parent
8d75c25
commit a92023d
Showing
10 changed files
with
156 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package rpcServer | ||
|
||
import ( | ||
"context" | ||
protocolV1 "github.com/Layr-Labs/protocol-apis/gen/protos/eigenlayer/sidecar/v1/protocol" | ||
) | ||
|
||
func (rpc *RpcServer) GetRegisteredAvsForOperator(ctx context.Context, request *protocolV1.GetRegisteredAvsForOperatorRequest) (*protocolV1.GetRegisteredAvsForOperatorResponse, error) { | ||
//TODO implement me | ||
panic("implement me") | ||
} | ||
|
||
func (rpc *RpcServer) GetDelegatedStrategiesForOperator(ctx context.Context, request *protocolV1.GetDelegatedStrategiesForOperatorRequest) (*protocolV1.GetDelegatedStrategiesForOperatorResponse, error) { | ||
//TODO implement me | ||
panic("implement me") | ||
} | ||
|
||
func (rpc *RpcServer) GetOperatorDelegatedStakeForStrategy(ctx context.Context, request *protocolV1.GetOperatorDelegatedStakeForStrategyRequest) (*protocolV1.GetOperatorDelegatedStakeForStrategyResponse, error) { | ||
//TODO implement me | ||
panic("implement me") | ||
} | ||
|
||
func (rpc *RpcServer) GetDelegatedStakersForOperator(ctx context.Context, request *protocolV1.GetDelegatedStakersForOperatorRequest) (*protocolV1.GetDelegatedStakersForOperatorResponse, error) { | ||
//TODO implement me | ||
panic("implement me") | ||
} | ||
|
||
func (rpc *RpcServer) GetStakerShares(ctx context.Context, request *protocolV1.GetStakerSharesRequest) (*protocolV1.GetStakerSharesResponse, error) { | ||
//TODO implement me | ||
panic("implement me") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
package protocolDataService | ||
|
||
import ( | ||
"github.com/Layr-Labs/sidecar/internal/config" | ||
"github.com/Layr-Labs/sidecar/pkg/eigenState/stakerShares" | ||
"github.com/Layr-Labs/sidecar/pkg/service/types" | ||
"go.uber.org/zap" | ||
"gorm.io/gorm" | ||
) | ||
|
||
type ProtocolDataService struct { | ||
db *gorm.DB | ||
logger *zap.Logger | ||
globalConfig *config.Config | ||
} | ||
|
||
func NewProtocolDataService( | ||
db *gorm.DB, | ||
logger *zap.Logger, | ||
globalConfig *config.Config, | ||
) *ProtocolDataService { | ||
return &ProtocolDataService{ | ||
db: db, | ||
logger: logger, | ||
globalConfig: globalConfig, | ||
} | ||
} | ||
|
||
func (pds *ProtocolDataService) ListRegisteredAVSsForOperator(operator string, blockHeight uint64) (interface{}, error) { | ||
return nil, nil | ||
} | ||
|
||
func (pds *ProtocolDataService) ListDelegatedStrategiesForOperator(operator string, blockHeight uint64) (interface{}, error) { | ||
return nil, nil | ||
} | ||
|
||
func (pds *ProtocolDataService) GetOperatorDelegatedStake(operator string, strategy string, blockHeight uint64) (interface{}, error) { | ||
return nil, nil | ||
} | ||
|
||
func (pds *ProtocolDataService) ListDelegatedStakersForOperator(operator string, blockHeight uint64, pagination types.Pagination) (interface{}, error) { | ||
return nil, nil | ||
} | ||
|
||
func (pds *ProtocolDataService) ListStakerShares(staker string, blockHeight uint64) ([]*stakerShares.StakerShareDeltas, error) { | ||
shares := make([]*stakerShares.StakerShareDeltas, 0) | ||
|
||
whereParams := []interface{}{staker} | ||
where := "staker = ?" | ||
if blockHeight > 0 { | ||
where += " AND block_height <= ?" | ||
whereParams = append(whereParams, blockHeight) | ||
} | ||
|
||
res := pds.db.Model(&stakerShares.StakerShareDeltas{}). | ||
Where(where, whereParams...). | ||
Find(&shares) | ||
|
||
if res.Error != nil { | ||
return nil, res.Error | ||
} | ||
return shares, nil | ||
} |
Oops, something went wrong.