Răsfoiți Sursa

use find By block test

skyfffire 3 ani în urmă
părinte
comite
7dcf5b7dfd
2 a modificat fișierele cu 16 adăugiri și 6 ștergeri
  1. 11 2
      scripts/interface/history.ts
  2. 5 4
      scripts/lp/lpMaintenance.ts

+ 11 - 2
scripts/interface/history.ts

@@ -1,7 +1,7 @@
 import http from '../../utils/http'
 
 export default class History {
-  static async findByHashOrBlockOrDataVague(block: String, hashCode: String, dataVague: String,
+  static async findByHashOrBlockOrDataVague(block: string, hashCode: string, dataVague: string,
                                             start: Number, size: Number) {
     let url = '/ethmev/findByHashOrBlockOrDataVague'
     const rst = await http.post(url, {
@@ -14,7 +14,16 @@ export default class History {
     return rst.data
   }
 
-  static async appendOrUpdate(block: String, hashCode: String, data: any) {
+  static async findByBlock(block: string) {
+    let url = '/ethmev/findByBlock'
+
+    const rst = await http.post(url, {
+      block: block
+    })
+    return rst.data
+  }
+
+  static async appendOrUpdate(block: string, hashCode: string, data: any) {
     let url = '/ethmev/appendOrUpdate'
     const rst = await http.post(url, {
       'block': block,

+ 5 - 4
scripts/lp/lpMaintenance.ts

@@ -98,18 +98,19 @@ export class LpMaintenance {
       if (this.maxMemoryChanged) {
         this.showMemory('a loop...')
       }
+      this.showMemory('a loop...')
       this.maxMemoryChanged = false
 
-      const topLpPullRst = await history.findByHashOrBlockOrDataVague('topLp', '', '', 0, 20000)
+      const topLpPullRst = await history.findByBlock('topLp')
       if (!topLpPullRst.state) continue
       const topLpList = topLpPullRst.data
-      const lpPullRst = await history.findByHashOrBlockOrDataVague('lp', '', '', 0, 100000)
+      const lpPullRst = await history.findByBlock('lp')
       if (!lpPullRst.state) continue
       const lpList = lpPullRst.data
-      const normalLpPullRst = await history.findByHashOrBlockOrDataVague('normalLp', '', '', 0, 20000)
+      const normalLpPullRst = await history.findByBlock('normalLp')
       if (!normalLpPullRst.state) continue
       const normalLpList = normalLpPullRst.data
-      const zeroLpPullRst = await history.findByHashOrBlockOrDataVague('0', '', '', 0, 150000)
+      const zeroLpPullRst = await history.findByBlock('0')
       if (!zeroLpPullRst.state) continue
       const zeroLpList = zeroLpPullRst.data