Add additional tests for importprivkey.
This commit is contained in:
parent
8d9b8fcf82
commit
fa2bf4423e
2 changed files with 16 additions and 2 deletions
|
@ -3586,7 +3586,7 @@ func (cmd *ImportPrivKeyCmd) UnmarshalJSON(b []byte) error {
|
|||
return err
|
||||
}
|
||||
|
||||
if len(r.Params) > 3 {
|
||||
if len(r.Params) == 0 || len(r.Params) > 3 {
|
||||
return ErrWrongNumberOfParams
|
||||
}
|
||||
|
||||
|
|
|
@ -674,7 +674,21 @@ var jsoncmdtests = []struct {
|
|||
},
|
||||
},
|
||||
{
|
||||
name: "basic importprivkey + opts",
|
||||
name: "basic importprivkey + 1 opt",
|
||||
f: func() (Cmd, error) {
|
||||
return NewImportPrivKeyCmd(float64(1),
|
||||
"somereallongprivatekey",
|
||||
"some text")
|
||||
},
|
||||
result: &ImportPrivKeyCmd{
|
||||
id: float64(1),
|
||||
PrivKey: "somereallongprivatekey",
|
||||
Label: "some text",
|
||||
Rescan: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "basic importprivkey + 2 opts",
|
||||
f: func() (Cmd, error) {
|
||||
return NewImportPrivKeyCmd(float64(1),
|
||||
"somereallongprivatekey",
|
||||
|
|
Loading…
Reference in a new issue