|
@@ -82,11 +82,15 @@ class CompanyWithUserController
|
|
|
|
|
|
|
|
$bin = dirname(__DIR__) . '/bin/easycli';
|
|
$bin = dirname(__DIR__) . '/bin/easycli';
|
|
|
$result = BashExecutor::run($bin . ' polygon create-new-address');
|
|
$result = BashExecutor::run($bin . ' polygon create-new-address');
|
|
|
- if (($result['exitCode'] ?? 1) !== 0) {
|
|
|
|
|
|
|
+ if ((int)($result['exitCode'] ?? 1) !== 0) {
|
|
|
|
|
+ $cliOutput = trim((string)($result['output'] ?? ''));
|
|
|
|
|
+ $cliError = trim((string)($result['error'] ?? ''));
|
|
|
|
|
+ error_log('[CompanyWithUserController] easycli wallet generation failed. Output: ' . $cliOutput . ' | Error: ' . $cliError);
|
|
|
$pdo->rollBack();
|
|
$pdo->rollBack();
|
|
|
return ResponseLib::sendFail("Wallet generation failed", ['error' => $result['error'] ?? ''], "E_INTERNAL")->withStatus(500);
|
|
return ResponseLib::sendFail("Wallet generation failed", ['error' => $result['error'] ?? ''], "E_INTERNAL")->withStatus(500);
|
|
|
}
|
|
}
|
|
|
$output = trim((string)($result['output'] ?? ''));
|
|
$output = trim((string)($result['output'] ?? ''));
|
|
|
|
|
+
|
|
|
$parsed = [];
|
|
$parsed = [];
|
|
|
foreach (preg_split('/\r?\n/', $output) as $line) {
|
|
foreach (preg_split('/\r?\n/', $output) as $line) {
|
|
|
$line = trim($line);
|
|
$line = trim($line);
|