Skip to content
This repository has been archived by the owner on May 11, 2024. It is now read-only.

Commit

Permalink
test: update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
davidtaikocha committed Nov 3, 2023
1 parent 2c3a99a commit b8e409f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions prover/server/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ type Status struct {
MinPseZkevmTierFee uint64 `json:"minPseZkevmTierFee"`
MaxExpiry uint64 `json:"maxExpiry"`
CurrentCapacity uint64 `json:"currentCapacity"`
ProverAddress string `json:"proverAddress"`
HeartBeatSignature string `json:"heartBeatSignature"`
Prover string `json:"prover"`
HeartBeatSignature []byte `json:"heartBeatSignature"`
}

// GetStatus handles a query to the current prover server status.
Expand All @@ -63,8 +63,8 @@ func (srv *ProverServer) GetStatus(c echo.Context) error {
MinPseZkevmTierFee: srv.minPseZkevmTierFee.Uint64(),
MaxExpiry: uint64(srv.maxExpiry.Seconds()),
CurrentCapacity: srv.capacityManager.ReadCapacity(),
ProverAddress: srv.proverAddress.Hex(),
HeartBeatSignature: common.Bytes2Hex(sig),
Prover: srv.proverAddress.Hex(),
HeartBeatSignature: sig,
})
}

Expand Down
6 changes: 3 additions & 3 deletions prover/server/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ func (s *ProverServerTestSuite) TestGetStatusSuccess() {
s.Equal(uint64(s.s.maxExpiry.Seconds()), status.MaxExpiry)
s.Greater(status.CurrentCapacity, uint64(0))
s.NotEmpty(status.HeartBeatSignature)
pubKey, err := crypto.SigToPub([]byte("HEART_BEAT"), common.Hex2Bytes(status.HeartBeatSignature))
pubKey, err := crypto.SigToPub(crypto.Keccak256Hash([]byte("HEART_BEAT")).Bytes(), status.HeartBeatSignature)
s.Nil(err)
s.NotEmpty(status.ProverAddress)
s.Equal(status.ProverAddress, crypto.PubkeyToAddress(*pubKey).Hex())
s.NotEmpty(status.Prover)
s.Equal(status.Prover, crypto.PubkeyToAddress(*pubKey).Hex())
}

func (s *ProverServerTestSuite) TestProposeBlockSuccess() {
Expand Down

0 comments on commit b8e409f

Please sign in to comment.