Răsfoiți Sursa

token.address.toLowerCase()

skyfffire 3 ani în urmă
părinte
comite
db9e931b64
1 a modificat fișierele cu 3 adăugiri și 3 ștergeri
  1. 3 3
      scripts/lp/lpGenerate.ts

+ 3 - 3
scripts/lp/lpGenerate.ts

@@ -132,7 +132,7 @@ export class LpGenerate {
       const token = await this.handleToken(lp, true)
 
       // token的hash不同时为lp的情况才更新
-      if (!this.lpInstance[token.address]) {
+      if (!this.lpInstance[token.address.toLowerCase()]) {
         await history.appendOrUpdate(type, token.address, token)
       }
     } catch (e) {}
@@ -141,7 +141,7 @@ export class LpGenerate {
       const token = await this.handleToken(lp, false)
 
       // token的hash不同时为lp的情况才更新
-      if (!this.lpInstance[token.address]) {
+      if (!this.lpInstance[token.address.toLowerCase()]) {
         await history.appendOrUpdate(type, token.address, token)
       }
     } catch (e) {}
@@ -149,7 +149,7 @@ export class LpGenerate {
 
   async saveLp(lp: any, type='0') {
     // 本地lp实例存档
-    this.lpInstance[lp.LP] = lp
+    this.lpInstance[lp.LP.toLowerCase()] = lp
 
     await History.appendOrUpdate(type, lp.LP, lp)
   }