@@ -11,7 +11,7 @@ import (
1111var (
1212 account = Account {TwinID : 1 , Relays : []string {}, RMBEncKey : "" }
1313 farm = Farm {FarmID : 1 , FarmName : "freeFarm" , TwinID : 1 }
14- node = Node {NodeID : 1 , FarmID : farmID , TwinID : twinID }
14+ node = Node {NodeID : 1 , FarmID : farmID , TwinID : twinID , Resources : Resources { CRU : 2342 } }
1515)
1616
1717const (
@@ -44,6 +44,10 @@ const (
4444 getNodeWithTwinID
4545 listNodesInFarm
4646
47+ getNodeCapacityRewardsWithStatusOK
48+ getNodeCapacityRewardsWithStatusNotFound
49+ getNodeCapacityRewardsWithStatusUnprocessableEntity
50+
4751 testMnemonic = "bottom drive obey lake curtain smoke basket hold race lonely fit walk"
4852
4953 farmID uint64 = 1
@@ -220,6 +224,24 @@ func serverHandler(r *http.Request, request, count int, require *require.Asserti
220224 require .NoError (err )
221225 return http .StatusOK , resp
222226
227+ case getNodeCapacityRewardsWithStatusOK :
228+ require .Equal ("/v1/nodes/1/rewards" , r .URL .Path )
229+ require .Equal (http .MethodGet , r .Method )
230+ resp , err := json .Marshal (NodeCapacityReward {})
231+ require .NoError (err )
232+ return http .StatusOK , resp
233+
234+ case getNodeCapacityRewardsWithStatusNotFound :
235+ require .Equal ("/v1/nodes/1/rewards" , r .URL .Path )
236+ require .Equal (http .MethodGet , r .Method )
237+ return http .StatusNotFound , nil
238+
239+ case getNodeCapacityRewardsWithStatusUnprocessableEntity :
240+ require .Equal ("/v1/nodes/90/rewards" , r .URL .Path )
241+ require .Equal (http .MethodGet , r .Method )
242+ resp , err := json .Marshal (NodeCapacityReward {TfReward : 239843 })
243+ require .NoError (err )
244+ return http .StatusUnprocessableEntity , resp
223245 // unauthorized requests
224246 case newClientWithNoAccount ,
225247 getAccountWithPKStatusNotFount ,
@@ -230,7 +252,6 @@ func serverHandler(r *http.Request, request, count int, require *require.Asserti
230252 require .Equal (account .PublicKey , r .URL .Query ().Get ("public_key" ))
231253 require .Equal (http .MethodGet , r .Method )
232254 return http .StatusNotFound , nil
233-
234255 }
235256
236257 return http .StatusNotAcceptable , nil
0 commit comments