Skip to content

Commit

Permalink
[Proof editor] add "-unsigned" to the default proof filename when app…
Browse files Browse the repository at this point in the history
…licable

When signing stakes in a different wallet than the wallet controlling the master key, the proof signature will be all 0s. Reflect this in the file name when saving the proof, to help with managing the files during the multi-step signing procedure.
  • Loading branch information
PiRK committed Aug 24, 2022
1 parent f26560a commit 2bb17b5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion electroncash_gui/qt/avalanche_dialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -578,10 +578,16 @@ def on_save_proof_clicked(self):
"No proof to be saved. The save button should not be enabled."
)
proof = Proof.from_hex(self.proof_display.toPlainText())

default_filename = f"{proof.proofid.get_hex()[:8]}"
if not proof.verify_master_signature():
default_filename += "-unsigned"
default_filename += ".proof"

fileName, __ = QtWidgets.QFileDialog.getSaveFileName(
self,
"Save proof to file",
f"{proof.proofid.get_hex()[:8]}.proof",
default_filename,
filter="Avalanche proof (*.proof);;All files (*)",
)
if not fileName:
Expand Down

0 comments on commit 2bb17b5

Please sign in to comment.