Skip to content

Commit 73e14b7

Browse files
more different error codes
1 parent 868a693 commit 73e14b7

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

src/node/chainserver/state/transactions/block_applier.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class BalanceChecker {
4444
void register_reward(AccountId to, Funds amount, uint16_t offset) // OK
4545
{
4646
if (!validAccountId(to))
47-
throw Error(EIDPOLICY);
47+
throw Error(EIDPOLICY2);
4848
payouts.emplace_back(to, amount, height, offset);
4949
size_t i = payouts.size() - 1;
5050
auto& ref = payouts[i];
@@ -74,9 +74,9 @@ class BalanceChecker {
7474
if (from == to)
7575
throw Error(ESELFSEND);
7676
if (!validAccountId(from))
77-
throw Error(EIDPOLICY);
77+
throw Error(EIDPOLICY3);
7878
if (!validAccountId(to))
79-
throw Error(EIDPOLICY);
79+
throw Error(EIDPOLICY4);
8080

8181
payments.emplace_back(from, compactFee, to, amount, tv.pin_nonce(), tv.signature());
8282
size_t i = payments.size() - 1;
@@ -291,7 +291,7 @@ Preparation BlockApplier::Preparer::prepare(const BodyView& bv, const NonzeroHei
291291
for (size_t i = 0; i < newAccounts.size(); ++i) {
292292
auto& acc = newAccounts[i];
293293
if (acc.in().is_zero()) {
294-
throw Error(EIDPOLICY); // id was not referred
294+
throw Error(EIDNOTREFERENCED); // id was not referred
295295
}
296296
if (acc.out() > Funds::zero()) // Not (acc.out() > acc.in()) because we do not like chains of new accounts
297297
throw Error(EBALANCE); // insufficient balance

src/shared/src/general/errors.hpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
XX(17, EMROOT, "merkle root mismatch") \
3838
XX(18, ENOBLOCK, "peer did not provide block") \
3939
XX(19, EUNREQUESTED, "received unrequested message") \
40-
XX(20, EIDPOLICY, "block transaction id policy violated") \
40+
XX(20, EIDNOTREFERENCED, "account id not referenced") \
4141
XX(21, EADDRPOLICY, "new address policy violated") \
4242
XX(22, EBALANCE, "insufficient balance") \
4343
XX(23, ECORRUPTEDSIG, "corrupted signature") \
@@ -98,6 +98,9 @@
9898
XX(100, EMSGINTEGRITY, "message integrity check failed") \
9999
XX(101, EADDRNOTFOUND, "address not found") \
100100
XX(102, EADDRIDNOTFOUND, "address id not found") \
101+
XX(103, EIDPOLICY2, "block transaction id policy violated") \
102+
XX(104, EIDPOLICY3, "block transaction id policy violated") \
103+
XX(105, EIDPOLICY4, "block transaction id policy violated") \
101104
XX(198, EBATCHSIZE2, "invalid batch size") \
102105
XX(199, EBATCHSIZE3, "invalid batch size") \
103106
XX(200, EINV_HEX, "cannot parse hexadecimal input") \

0 commit comments

Comments
 (0)