mirror of
https://github.com/jwinterm/grin-wallet.git
synced 2026-12-01 19:33:56 +01:00
revoke builds the self-spend via new(), which used a random slate id, so a crash between new() and sign() left an orphaned self-spend and a retry created another one. Derive the self-spend slate id deterministically from the revoked slate (blake2b, already a dependency) and let contract::new take an optional slate id; a retry then reuses the in-progress context via get_or_create instead of orphaning a fresh self-spend. The other new() caller passes None (random id). Adds a unit test that the derived id is deterministic and distinct.