Skip to content

Commit

Permalink
chore: updates e2e testing
Browse files Browse the repository at this point in the history
  • Loading branch information
ckartik committed Dec 9, 2024
1 parent ab6c4c6 commit 1be8aa6
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion p2p/pkg/rpc/provider/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,14 +241,24 @@ func (s *Service) Stake(
tx, txErr = s.registryContract.RegisterAndStake(opts)
receipt, err := s.watcher.WaitForReceipt(ctx, tx)
if err != nil {
return nil, status.Errorf(codes.Internal, "waiting for receipt: %v", err)
return nil, status.Errorf(codes.Internal, "waiting for receipt for registration: %v", err)
}
if receipt.Status != types.ReceiptStatusSuccessful {
return nil, status.Errorf(codes.Internal, "receipt status: %v", receipt.Status)
}

for i, _ := range stake.BlsPublicKeys {
tx, txErr = s.registryContract.AddVerifiedBLSKey(opts, []byte(stake.BlsPublicKeys[i]), []byte(stake.BlsSignatures[i]))
if txErr != nil {
return nil, status.Errorf(codes.Internal, "adding verified bls key: %v", txErr)
}
receipt, err = s.watcher.WaitForReceipt(ctx, tx)
if err != nil {
return nil, status.Errorf(codes.Internal, "waiting for receipt for adding verified bls key: %v", err)
}
if receipt.Status != types.ReceiptStatusSuccessful {
return nil, status.Errorf(codes.Internal, "receipt status: %v", receipt.Status)
}
}
} else {
tx, txErr = s.registryContract.Stake(opts)
Expand Down

0 comments on commit 1be8aa6

Please sign in to comment.