| 229 | } |
| 230 | } |
| 231 | func (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 | } |