-
Notifications
You must be signed in to change notification settings - Fork 214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wallet create tests #194
Wallet create tests #194
Conversation
eeed08a
to
3f1b147
Compare
@@ -168,7 +168,7 @@ instance FromText WalletName where | |||
| T.length t < walletNameMinLength = | |||
Left $ TextDecodingError $ | |||
"name is too short: expected at least " | |||
<> show walletNameMinLength <> " chars" | |||
<> show walletNameMinLength <> " char" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
characters ?
@@ -102,9 +109,246 @@ spec = do | |||
r2 <- request @ApiWallet ctx ("POST", "v2/wallets") Default payload | |||
expectResponseCode @IO HTTP.status409 r2 | |||
|
|||
describe "WALLETS_CREATE_04 - Wallet name" $ do | |||
let walNameMax = T.pack (replicate walletNameMaxLength 'ą') | |||
let matrix = [ ( show walletNameMinLength ++ " char long" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Careful with the variable-length indentation here (and below) 🙏
|
||
describe "WALLETS_CREATE_05 - Mnemonics" $ do | ||
let matrix = [ ( "[] as mnemonic_sentence -> fail" | ||
, [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, indentation please 😬
, specMnemonicSentence | ||
, [ expectResponseCode @IO HTTP.status400 | ||
, expectErrorMessage "ErrMnemonicWords (ErrWrongNumberOfWords 15 24)" | ||
] -- probably need to modify after bug #192 fixed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed. Let's get #192 resolved today and merge this one after in its corrected form 👍
ed48147
to
79dd1e6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@KtorZ I have aligned the test after #197. In some cases there are some different than expected errors thrown. Please have a look at the comments inline...
I have also added cases for passphrase
and mnemonic_second_factor
. I want to add more tests for address_pool_gap and some destructive scenarios, but maybe I can add it on another PR - not to make this one too big.
) | ||
, ( "Japanese mnemonics -> fail", japaneseMnemonics15 | ||
, [ expectResponseCode @IO HTTP.status400 | ||
, expectErrorMessage "Found invalid (non-English) word: " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@KtorZ here Found invalid (non-English) word:
only for Japanese mnemonics, for Chinese and French throws Invalid number of words
. Why is that?
, [ expectResponseCode @IO HTTP.status400 | ||
, expectErrorMessage "Invalid number of words: 9 or 12\ | ||
\ words are expected." | ||
] -- why not Invalid entropy checksum ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here I was expecting Invalid entropy checksum
. The mnemonic list is invalid...
, ( "Chinese mnemonics -> fail", chineseMnemonics9 | ||
, [ expectResponseCode @IO HTTP.status400 | ||
, expectErrorMessage "Found invalid (non-English) word:" | ||
] -- why only for Chinese? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
again Found invalid (non-English) word:
. This time for Chinese mnemonics...
for Japanese and French it throws Invalid number of words:
b613108
to
1272eb0
Compare
1272eb0
to
8ec7915
Compare
, ( "-1 -> fail", (-1) | ||
, [ expectResponseCode @IO HTTP.status400 | ||
, expectErrorMessage "ErrGapOutOfRange 255" | ||
] -- probably to be modified after #204 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, merging as is, will add more tests in additional PRs (and fix error messages after #204)
… name too short/empty
8ec7915
to
3cb5659
Compare
Issue Number
Overview
Comments