|
1 | 1 | import { Node, Location, PublicConfig, NodeCertification, Interfaces, UptimeEvent, NodeResourcesTotal, NodePower, PowerState, Power } from "../model"; |
2 | | -import { |
3 | | - TfgridModuleNodeCertificationSetEvent, TfgridModuleNodeDeletedEvent, |
4 | | - TfgridModuleNodePublicConfigStoredEvent, TfgridModuleNodeStoredEvent, |
5 | | - TfgridModuleNodeUpdatedEvent, TfgridModuleNodeUptimeReportedEvent, |
| 2 | +import { |
| 3 | + TfgridModuleNodeCertificationSetEvent, TfgridModuleNodeDeletedEvent, |
| 4 | + TfgridModuleNodePublicConfigStoredEvent, TfgridModuleNodeStoredEvent, |
| 5 | + TfgridModuleNodeUpdatedEvent, TfgridModuleNodeUptimeReportedEvent, |
6 | 6 | TfgridModulePowerStateChangedEvent, TfgridModulePowerTargetChangedEvent, |
7 | 7 | SmartContractModuleNodeExtraFeeSetEvent |
8 | 8 | } from "../types/events"; |
@@ -77,6 +77,13 @@ export async function nodeStored( |
77 | 77 |
|
78 | 78 | newNode.location = newLocation |
79 | 79 |
|
| 80 | + if (newNode.country?.toString().startsWith('0x')) { |
| 81 | + newNode.country = "" |
| 82 | + } |
| 83 | + if (newNode.city?.toString().startsWith('0x')) { |
| 84 | + newNode.city = "" |
| 85 | + } |
| 86 | + |
80 | 87 | await ctx.store.save<Node>(newNode) |
81 | 88 |
|
82 | 89 | const pubConfig = getNodePublicConfig(node) |
@@ -126,6 +133,13 @@ export async function nodeStored( |
126 | 133 | newNode.connectionPrice = nodeEvent.connectionPrice |
127 | 134 | } |
128 | 135 |
|
| 136 | + if (newNode.country?.toString().startsWith('0x')) { |
| 137 | + newNode.country = "" |
| 138 | + } |
| 139 | + if (newNode.city?.toString().startsWith('0x')) { |
| 140 | + newNode.city = "" |
| 141 | + } |
| 142 | + |
129 | 143 | await ctx.store.save<Node>(newNode) |
130 | 144 |
|
131 | 145 | const resourcesTotal = new NodeResourcesTotal() |
|
0 commit comments