Skip to content

Commit

Permalink
Address reviewer's feedback
Browse files Browse the repository at this point in the history
* Remove asserts in tests
* Update copyright
  • Loading branch information
gregtatcam committed Oct 29, 2024
1 parent b636836 commit 7c08b58
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/test/app/MPToken_test.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
/*
This file is part of rippled: https://github.com/ripple/rippled
Copyright (c) 2023 Ripple Labs Inc.
Copyright (c) 2024 Ripple Labs Inc.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
Expand Down
8 changes: 5 additions & 3 deletions src/test/jtx/impl/mpt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ MPTTester::makeHolders(std::vector<Account> const& holders)
std::unordered_map<std::string, Account> accounts;
for (auto const& h : holders)
{
assert(accounts.find(h.human()) == accounts.cend());
if (accounts.find(h.human()) != accounts.cend())
Throw<std::runtime_error>("Duplicate holder");
accounts.emplace(h.human(), h);
}
return accounts;
Expand All @@ -74,7 +75,8 @@ MPTTester::MPTTester(Env& env, Account const& issuer, MPTInit const& arg)
env_.require(owners(issuer_, 0));
for (auto it : holders_)
{
assert(issuer_.id() != it.second.id());
if (issuer_.id() == it.second.id())
Throw<std::runtime_error>("Issuer can't be holder");
env_.require(owners(it.second, 0));
}
}
Expand Down Expand Up @@ -243,7 +245,7 @@ MPTTester::set(MPTSet const& arg)
else if (*arg.flags & tfMPTUnlock)
flags &= ~lsfMPTLocked;
else
assert(0);
Throw<std::runtime_error>("Invalid flags");
}
env_.require(mptflags(*this, flags, holder));
};
Expand Down
2 changes: 1 addition & 1 deletion src/xrpld/app/tx/detail/MPTokenIssuanceCreate.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
/*
This file is part of rippled: https://github.com/ripple/rippled
Copyright (c) 2023 Ripple Labs Inc.
Copyright (c) 2024 Ripple Labs Inc.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
Expand Down

0 comments on commit 7c08b58

Please sign in to comment.