good morning!!!!

Skip to content
Snippets Groups Projects
Commit ddcc8e16 authored by Taylor Gerring's avatar Taylor Gerring
Browse files

SubmitWorkArgs tests

parent b414a130
Branches
Tags
No related merge requests found
......@@ -1370,3 +1370,51 @@ func TestSubmitWorkArgs(t *testing.T) {
t.Errorf("Digest shoud be %#v but is %#v", expected.Digest, args.Digest)
}
}
func TestSubmitWorkArgsInvalid(t *testing.T) {
input := `{}`
args := new(SubmitWorkArgs)
str := ExpectDecodeParamError(json.Unmarshal([]byte(input), args))
if len(str) > 0 {
t.Error(str)
}
}
func TestSubmitWorkArgsEmpty(t *testing.T) {
input := `[]`
args := new(SubmitWorkArgs)
str := ExpectInsufficientParamsError(json.Unmarshal([]byte(input), args))
if len(str) > 0 {
t.Error(str)
}
}
func TestSubmitWorkArgsNonceInt(t *testing.T) {
input := `[1, "0x1234567890abcdef1234567890abcdef", "0xD1GE5700000000000000000000000000"]`
args := new(SubmitWorkArgs)
str := ExpectInvalidTypeError(json.Unmarshal([]byte(input), args))
if len(str) > 0 {
t.Error(str)
}
}
func TestSubmitWorkArgsHeaderInt(t *testing.T) {
input := `["0x0000000000000001", 1, "0xD1GE5700000000000000000000000000"]`
args := new(SubmitWorkArgs)
str := ExpectInvalidTypeError(json.Unmarshal([]byte(input), args))
if len(str) > 0 {
t.Error(str)
}
}
func TestSubmitWorkArgsDigestInt(t *testing.T) {
input := `["0x0000000000000001", "0x1234567890abcdef1234567890abcdef", 1]`
args := new(SubmitWorkArgs)
str := ExpectInvalidTypeError(json.Unmarshal([]byte(input), args))
if len(str) > 0 {
t.Error(str)
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment