|
@ -205,14 +205,23 @@ func TestPoolTxs(t *testing.T) { |
|
|
assert.Equal(t, tx.TxID, fetchedTxID) |
|
|
assert.Equal(t, tx.TxID, fetchedTxID) |
|
|
} |
|
|
} |
|
|
// 400
|
|
|
// 400
|
|
|
// Wrong signature
|
|
|
|
|
|
|
|
|
// Wrong fee
|
|
|
badTx := tc.poolTxsToSend[0] |
|
|
badTx := tc.poolTxsToSend[0] |
|
|
badTx.FromIdx = "hez:foo:1000" |
|
|
|
|
|
|
|
|
badTx.Amount = "99999999999999999999999" |
|
|
|
|
|
badTx.Fee = 255 |
|
|
jsonTxBytes, err := json.Marshal(badTx) |
|
|
jsonTxBytes, err := json.Marshal(badTx) |
|
|
assert.NoError(t, err) |
|
|
assert.NoError(t, err) |
|
|
jsonTxReader := bytes.NewReader(jsonTxBytes) |
|
|
jsonTxReader := bytes.NewReader(jsonTxBytes) |
|
|
err = doBadReq("POST", endpoint, jsonTxReader, 400) |
|
|
err = doBadReq("POST", endpoint, jsonTxReader, 400) |
|
|
assert.NoError(t, err) |
|
|
assert.NoError(t, err) |
|
|
|
|
|
// Wrong signature
|
|
|
|
|
|
badTx = tc.poolTxsToSend[0] |
|
|
|
|
|
badTx.FromIdx = "hez:foo:1000" |
|
|
|
|
|
jsonTxBytes, err = json.Marshal(badTx) |
|
|
|
|
|
assert.NoError(t, err) |
|
|
|
|
|
jsonTxReader = bytes.NewReader(jsonTxBytes) |
|
|
|
|
|
err = doBadReq("POST", endpoint, jsonTxReader, 400) |
|
|
|
|
|
assert.NoError(t, err) |
|
|
// Wrong to
|
|
|
// Wrong to
|
|
|
badTx = tc.poolTxsToSend[0] |
|
|
badTx = tc.poolTxsToSend[0] |
|
|
ethAddr := "hez:0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" |
|
|
ethAddr := "hez:0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" |
|
|