MCPcopy Create free account
hub / github.com/DOSNetwork/core / queryTest

Method queryTest

dosnode/dos_restapis.go:231–259  ·  view source on GitHub ↗
(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

229 }
230}
231func (d *DosNode) queryTest(w http.ResponseWriter, r *http.Request) {
232 groupId := big.NewInt(0)
233 lastSys := big.NewInt(0)
234 userSeed := big.NewInt(0)
235 requestId := big.NewInt(0)
236 switch r.Method {
237 case "GET":
238 for k, v := range r.URL.Query() {
239 fmt.Printf("[DOS] %s: %s\n", k, v)
240 if k == "gid" {
241 i, err := strconv.Atoi(v[0])
242 if err == nil && i >= 0 {
243 groupId = groupId.SetInt64(int64(i))
244 }
245 } else if k == "rid" {
246 i, err := strconv.Atoi(v[0])
247 if err == nil && i >= 0 {
248 requestId = requestId.SetInt64(int64(i))
249 }
250 }
251 }
252 }
253 d.onchainEvent <- &onchain.LogRequestUserRandom{
254 RequestId: requestId,
255 LastSystemRandomness: lastSys,
256 UserSeed: userSeed,
257 DispatchedGroupId: groupId,
258 }
259}

Callers

nothing calls this directly

Calls 2

SetInt64Method · 0.95
QueryMethod · 0.45

Tested by

no test coverage detected