Reduce interface to STAccount (RIPD-994):

Since a non-default STAccount is now guaranteed to always be
160 bits, it was possible to reduce the number of methods that
it provides.

In the process of narrowing the STAccount interface it became
reasonable to remove some methods that duplicated functionality.
A few classes offered both a value() and a getValue() method.
The getValue() method is removed from those classes.
This commit is contained in:
Scott Schurr
2015-11-04 18:18:26 -08:00
committed by Nik Bougalis
parent f72b14ec36
commit 289bc7deb3
10 changed files with 25 additions and 110 deletions

View File

@@ -134,10 +134,9 @@ STTx::getMentionedAccounts () const
{
if (auto sa = dynamic_cast<STAccount const*> (&it))
{
AccountID id;
assert(sa->isValueH160());
if (sa->getValueH160(id))
list.insert(id);
assert(! sa->isDefault());
if (! sa->isDefault())
list.insert(sa->value());
}
else if (auto sa = dynamic_cast<STAmount const*> (&it))
{
@@ -488,7 +487,7 @@ isAccountFieldOkay (STObject const& st)
for (int i = 0; i < st.getCount(); ++i)
{
auto t = dynamic_cast<STAccount const*>(st.peekAtPIndex (i));
if (t && !t->isValueH160 ())
if (t && t->isDefault ())
return false;
}