-
Notifications
You must be signed in to change notification settings - Fork 0
refactor: use constants to get forgeFactory address #355
base: develop
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #355 +/- ##
===========================================
- Coverage 58.89% 58.86% -0.04%
===========================================
Files 531 531
Lines 15092 15104 +12
Branches 2182 2185 +3
===========================================
+ Hits 8889 8891 +2
- Misses 6157 6167 +10
Partials 46 46
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
8962c7a
to
ee04b7d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, no hardcoded addresses
switch (network) { | ||
case "dalinet": | ||
if (tokenId === "5f96dd359ab300e2c702a54760f4d74a11db076aa17575179d36e06d75c96511") { | ||
return "DTRnY3JjFpAnCX1nFtF8M4v8X7WdvPYRxb"; | ||
} | ||
break; | ||
case "sandbox": | ||
if (tokenId === "ed4eaa7299284ac4c0665d2edecc3064a33134566d94e6ffceebc1ab32251a04") { | ||
return "SYD1xMGubmzW1qme18yxmVhpWxpoBJqv2v"; | ||
} | ||
|
||
if (tokenId === "8ddab07ee0f49c76db32018a9305d7634264c39a89317f68a8069c161f4b8ec6") { | ||
return "Scms9QGQnSe7SGegVAa61dR2GTUTa586R1"; | ||
} | ||
break; | ||
case "livenet": | ||
if (tokenId === "fbfbe7d9e8c005f1a9937d9fd17c4ef7da2ff8037a71e6cb7847b302eda4d08a") { | ||
return "USLEkzoncHwRdNyPVTPNJSjRXt6pYHzk43"; | ||
} | ||
if (tokenId === "8bdd3a5358a8c6e0d96796048a87a8d83d076c73f52a0b850575e95f192376f9") { | ||
return "UYcNuMK46RdFyGVmwrT3i11W16fE5N59j4"; | ||
} | ||
break; | ||
} | ||
return undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just use a Map for that
If the key is missing, look for it in the DB and add the result to the Map
// This little hack is intended to reduce the call to the nft database. | ||
// We call getUnikOwnerAddress of forgefactory at every certified transactions, especially at core bootstrap. | ||
// Its imply that forge factory NFT should not be transferable | ||
public getForgeFactoryAddress(tokenId: string): string | undefined { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
undefined
shouldn't be allowed as a returned value
21bc83d
to
78740d8
Compare
78740d8
to
40b35c4
Compare
SonarCloud Quality Gate failed. |
No description provided.