Skip to content

Commit

Permalink
aezeed: fix flake in TestDecipherIncorrectMnemonic
Browse files Browse the repository at this point in the history
  • Loading branch information
yyforyongyu committed Sep 4, 2023
1 parent a252cb4 commit 50f2c27
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion aezeed/cipherseed_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,17 @@ func TestDecipherIncorrectMnemonic(t *testing.T) {
// a checksum failure.
swapIndex1 := 9
swapIndex2 := 13
mnemonic[swapIndex1], mnemonic[swapIndex2] = mnemonic[swapIndex2], mnemonic[swapIndex1]

mnemonic[swapIndex1], mnemonic[swapIndex2] =
mnemonic[swapIndex2], mnemonic[swapIndex1]

// If the words happen to be the same by pure chance, we'll try again
// with different indexes.
if mnemonic[swapIndex1] == mnemonic[swapIndex2] {
swapIndex1 = 3
mnemonic[swapIndex1], mnemonic[swapIndex2] =
mnemonic[swapIndex2], mnemonic[swapIndex1]
}

// If we attempt to decrypt now, we should get a checksum failure.
// If we attempt to map back to the original cipher seed now, then we
Expand Down

0 comments on commit 50f2c27

Please sign in to comment.