Skip to content

Commit

Permalink
Make error messages re payload a bit more specific
Browse files Browse the repository at this point in the history
  • Loading branch information
UdjinM6 committed Nov 14, 2018
1 parent 153afb9 commit 658b7af
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion qa/rpc-tests/dip3-deterministicmns.py
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ def test_fail_create_protx(self, node):
address = node.getnewaddress()
key = node.getnewaddress()
blsKey = node.bls('generate')
assert_raises_jsonrpc(None, "bad-tx-type", node.protx, 'register_fund', address, '127.0.0.1:10000', key, blsKey['public'], key, 0, address)
assert_raises_jsonrpc(None, "bad-tx-type-dip3", node.protx, 'register_fund', address, '127.0.0.1:10000', key, blsKey['public'], key, 0, address)

def test_success_create_protx(self, node):
address = node.getnewaddress()
Expand Down
4 changes: 2 additions & 2 deletions src/evo/cbtx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ bool CheckCbTx(const CTransaction& tx, const CBlockIndex* pindexPrev, CValidatio

CCbTx cbTx;
if (!GetTxPayload(tx, cbTx)) {
return state.DoS(100, false, REJECT_INVALID, "bad-tx-payload");
return state.DoS(100, false, REJECT_INVALID, "bad-cbtx-payload");
}

if (cbTx.nVersion > CCbTx::CURRENT_VERSION) {
Expand All @@ -45,7 +45,7 @@ bool CheckCbTxMerkleRootMNList(const CBlock& block, const CBlockIndex* pindex, C

CCbTx cbTx;
if (!GetTxPayload(*block.vtx[0], cbTx)) {
return state.DoS(100, false, REJECT_INVALID, "bad-tx-payload");
return state.DoS(100, false, REJECT_INVALID, "bad-cbtx-payload");
}

if (pindex) {
Expand Down
8 changes: 4 additions & 4 deletions src/evo/providertx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ bool CheckProRegTx(const CTransaction& tx, const CBlockIndex* pindexPrev, CValid

CProRegTx ptx;
if (!GetTxPayload(tx, ptx)) {
return state.DoS(100, false, REJECT_INVALID, "bad-tx-payload");
return state.DoS(100, false, REJECT_INVALID, "bad-protx-payload");
}

if (ptx.nVersion > CProRegTx::CURRENT_VERSION) {
Expand Down Expand Up @@ -207,7 +207,7 @@ bool CheckProUpServTx(const CTransaction& tx, const CBlockIndex* pindexPrev, CVa

CProUpServTx ptx;
if (!GetTxPayload(tx, ptx)) {
return state.DoS(100, false, REJECT_INVALID, "bad-tx-payload");
return state.DoS(100, false, REJECT_INVALID, "bad-protx-payload");
}

if (ptx.nVersion > CProRegTx::CURRENT_VERSION) {
Expand Down Expand Up @@ -259,7 +259,7 @@ bool CheckProUpRegTx(const CTransaction& tx, const CBlockIndex* pindexPrev, CVal

CProUpRegTx ptx;
if (!GetTxPayload(tx, ptx)) {
return state.DoS(100, false, REJECT_INVALID, "bad-tx-payload");
return state.DoS(100, false, REJECT_INVALID, "bad-protx-payload");
}

if (ptx.nVersion > CProRegTx::CURRENT_VERSION) {
Expand Down Expand Up @@ -335,7 +335,7 @@ bool CheckProUpRevTx(const CTransaction& tx, const CBlockIndex* pindexPrev, CVal

CProUpRevTx ptx;
if (!GetTxPayload(tx, ptx)) {
return state.DoS(100, false, REJECT_INVALID, "bad-tx-payload");
return state.DoS(100, false, REJECT_INVALID, "bad-protx-payload");
}

if (ptx.nVersion > CProRegTx::CURRENT_VERSION) {
Expand Down
4 changes: 2 additions & 2 deletions src/evo/specialtx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ bool CheckSpecialTx(const CTransaction& tx, const CBlockIndex* pindexPrev, CVali
return CheckCbTx(tx, pindexPrev, state);
}

return state.DoS(10, false, REJECT_INVALID, "bad-tx-type");
return state.DoS(10, false, REJECT_INVALID, "bad-tx-type-check");
}

bool ProcessSpecialTx(const CTransaction& tx, const CBlockIndex* pindex, CValidationState& state)
Expand All @@ -57,7 +57,7 @@ bool ProcessSpecialTx(const CTransaction& tx, const CBlockIndex* pindex, CValida
return true; // nothing to do
}

return state.DoS(100, false, REJECT_INVALID, "bad-tx-type");
return state.DoS(100, false, REJECT_INVALID, "bad-tx-type-proc");
}

bool UndoSpecialTx(const CTransaction& tx, const CBlockIndex* pindex)
Expand Down

0 comments on commit 658b7af

Please sign in to comment.