Skip to content

Commit

Permalink
fix e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
agouin committed Jan 10, 2024
1 parent c1a24e6 commit bd20c60
Show file tree
Hide file tree
Showing 7 changed files with 358 additions and 118 deletions.
5 changes: 4 additions & 1 deletion proto/strangelove/horcrux/cosigner.proto
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ message SetNoncesAndSignRequest {
repeated Nonce nonces = 2;
HRST hrst = 3;
bytes signBytes = 4;
string chainID = 5;
bytes voteExtUuid = 5;
repeated Nonce voteExtNonces = 6;
bytes voteExtSignBytes = 7;
string chainID = 8;
}

message SetNoncesAndSignResponse {
Expand Down
10 changes: 6 additions & 4 deletions signer/cosigner.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,13 @@ func (n CosignerUUIDNoncesMultiple) toProto() []*proto.UUIDNonce {
}

type CosignerSetNoncesAndSignRequest struct {
ChainID string
Nonces *CosignerUUIDNonces
ChainID string
HRST HRSTKey

Nonces *CosignerUUIDNonces
SignBytes []byte

VoteExtensionNonces *CosignerUUIDNonces
HRST HRSTKey
SignBytes []byte
VoteExtensionSignBytes []byte
}

Expand Down
22 changes: 17 additions & 5 deletions signer/cosigner_grpc_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,27 @@ func (rpc *CosignerGRPCServer) SetNoncesAndSign(
ctx context.Context,
req *proto.SetNoncesAndSignRequest,
) (*proto.SetNoncesAndSignResponse, error) {
res, err := rpc.cosigner.SetNoncesAndSign(ctx, CosignerSetNoncesAndSignRequest{
cosignerReq := CosignerSetNoncesAndSignRequest{
ChainID: req.ChainID,

HRST: HRSTKeyFromProto(req.Hrst),

Nonces: &CosignerUUIDNonces{
UUID: uuid.UUID(req.Uuid),
Nonces: CosignerNoncesFromProto(req.GetNonces()),
Nonces: CosignerNoncesFromProto(req.Nonces),
},
HRST: HRSTKeyFromProto(req.GetHrst()),
SignBytes: req.GetSignBytes(),
})
SignBytes: req.SignBytes,
}

if len(req.VoteExtSignBytes) > 0 && len(req.VoteExtUuid) == 16 {
cosignerReq.VoteExtensionNonces = &CosignerUUIDNonces{
UUID: uuid.UUID(req.VoteExtUuid),
Nonces: CosignerNoncesFromProto(req.VoteExtNonces),
}
cosignerReq.VoteExtensionSignBytes = req.VoteExtSignBytes
}

res, err := rpc.cosigner.SetNoncesAndSign(ctx, cosignerReq)
if err != nil {
rpc.raftStore.logger.Error(
"Failed to sign with shard",
Expand Down
284 changes: 227 additions & 57 deletions signer/proto/cosigner.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit bd20c60

Please sign in to comment.