Skip to content

Commit

Permalink
some modify
Browse files Browse the repository at this point in the history
  • Loading branch information
xinran chen committed Jul 11, 2023
1 parent b443aa9 commit f294cdc
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion miner-api/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,4 @@ func (c *ProverTaskController) GetTask(ctx *gin.Context) {
return
}
ctx.JSON(http.StatusOK, task)

}
2 changes: 1 addition & 1 deletion miner-api/internal/orm/prover_task.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func (o *ProverTask) GetProverTasksByHashes(ctx context.Context, hashes []string

func (o *ProverTask) GetProverTasksByProver(ctx context.Context, pubkey string) ([]*ProverTask, error) {
var proverTasks []*ProverTask
err := o.db.WithContext(ctx).Model(&ProverTask{}).Where(&ProverTask{ProverPublicKey: pubkey}).Order("id asc").Find(&proverTasks).Error
err := o.db.WithContext(ctx).Model(&ProverTask{}).Where(&ProverTask{ProverPublicKey: pubkey}).Order("created_at asc").Find(&proverTasks).Error
if err != nil {
return nil, fmt.Errorf("ProverTask.GetProverTasksByProver error: %w, prover %s", err, pubkey)
}
Expand Down
2 changes: 1 addition & 1 deletion miner-api/test/prover_task_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func testGetProverTasksByProver(t *testing.T) {
}

func testGetTotalRewards(t *testing.T) {
rewards := make(map[string]uint64)
rewards := make(map[string]decimal.Decimal)
getResp(t, fmt.Sprintf("%s/total_rewards?pubkey=%s", basicPath, proverPubkey), &rewards)
assert.Equal(t, decimal.NewFromInt(22), rewards["rewards"])
}
Expand Down

0 comments on commit f294cdc

Please sign in to comment.