diff --git a/parse.py b/parse.py index 46b7f3f..3bc86ed 100644 --- a/parse.py +++ b/parse.py @@ -427,13 +427,15 @@ def voucher_transfer_handler(cmd): f'--rpc-url {rpc} ' f'{s} ' f'"transfer(address,uint256)" {to} {value}' + f' --json ' ) result = subprocess.run(command, shell=True, capture_output=True, text=True) if result.returncode != 0: raise subprocess.CalledProcessError(result.returncode, command, output=result.stdout, stderr=result.stderr) if result.stderr: raise ValueError(f"Command failed with error: {result.stderr}") - return result.stdout + data = json.loads(result.stdout) + return data["transactionHash"] @@ -468,13 +470,15 @@ def voucher_mint_handler(cmd): f'--rpc-url {rpc} ' f' {s} ' f'"mintTo(address,uint256)" {to} {value}' + f' --json ' ) result = subprocess.run(command, shell=True, capture_output=True, text=True) if result.returncode != 0: raise subprocess.CalledProcessError(result.returncode, command, output=result.stdout, stderr=result.stderr) if result.stderr: raise ValueError(f"Command failed with error: {result.stderr}") - return result.stdout + data = json.loads(result.stdout) + return data["transactionHash"]