()
| 52 | const localAccount = await this.readLocal(); |
| 53 | if (localAccount) return localAccount; |
| 54 | |
| 55 | // 注册新账户 |
| 56 | return await this.register(); |
| 57 | } |
| 58 | |
| 59 | private static async readLocal(): Promise<{ privateKey: string; address6: string } | null> { |
| 60 | const result = await SystemExecutor.runSudo(`cat ${WARP_CONFIG_FILE}`); |
| 61 | if (!result.success || !result.output) return null; |
| 62 | |
| 63 | try { |
| 64 | const data = JSON.parse(result.output); |
no test coverage detected