Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into invariant-acctde…
Browse files Browse the repository at this point in the history
…lete

* upstream/develop:
  fixInnerObjTemplate2 amendment (5047)
  Set version to 2.3.0-b1
  Ignore restructuring commits (4997)
  Recompute loops (4997)
  Rewrite includes (4997)
  Rearrange sources (4997)
  Move CMake directory (4997)
  • Loading branch information
ximinez committed Jul 1, 2024
2 parents 191dbdb + 9fec615 commit 36389a0
Show file tree
Hide file tree
Showing 12 changed files with 221 additions and 194 deletions.
4 changes: 4 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@ e2384885f5f630c8f0ffe4bf21a169b433a16858
241b9ddde9e11beb7480600fd5ed90e1ef109b21
760f16f56835663d9286bd29294d074de26a7ba6
0eebe6a5f4246fced516d52b83ec4e7f47373edd
2189cc950c0cebb89e4e2fa3b2d8817205bf7cef
b9d007813378ad0ff45660dc07285b823c7e9855
fe9a5365b8a52d4acc42eb27369247e6f238a4f9
9a93577314e6a8d4b4a8368cc9d2b15a5d8303e8
3 changes: 1 addition & 2 deletions include/xrpl/protocol/STObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
namespace ripple {

class STArray;
class Rules;

inline void
throwFieldNotFound(SField const& field)
Expand Down Expand Up @@ -105,7 +104,7 @@ class STObject : public STBase, public CountedObject<STObject>
explicit STObject(SField const& name);

static STObject
makeInnerObject(SField const& name, Rules const& rules);
makeInnerObject(SField const& name);

iterator
begin() const;
Expand Down
2 changes: 1 addition & 1 deletion src/libxrpl/protocol/BuildInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ namespace BuildInfo {
// and follow the format described at http://semver.org/
//------------------------------------------------------------------------------
// clang-format off
char const* const versionString = "2.2.0"
char const* const versionString = "2.3.0-b1"
// clang-format on

#if defined(DEBUG) || defined(SANITIZER)
Expand Down
13 changes: 11 additions & 2 deletions src/libxrpl/protocol/STObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,19 @@ STObject::STObject(SerialIter& sit, SField const& name, int depth) noexcept(
}

STObject
STObject::makeInnerObject(SField const& name, Rules const& rules)
STObject::makeInnerObject(SField const& name)
{
STObject obj{name};
if (rules.enabled(fixInnerObjTemplate))

// The if is complicated because inner object templates were added in
// two phases:
// 1. If there are no available Rules, then always apply the template.
// 2. fixInnerObjTemplate added templates to two AMM inner objects.
// 3. fixInnerObjTemplate2 added templates to all remaining inner objects.
std::optional<Rules> const& rules = getCurrentTransactionRules();
bool const isAMMObj = name == sfAuctionSlot || name == sfVoteEntry;
if (!rules || (rules->enabled(fixInnerObjTemplate) && isAMMObj) ||
(rules->enabled(fixInnerObjTemplate2) && !isAMMObj))
{
if (SOTemplate const* elements =
InnerObjectFormats::getInstance().findSOTemplateBySField(name))
Expand Down
10 changes: 6 additions & 4 deletions src/libxrpl/protocol/XChainAttestations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,8 @@ AttestationClaim::AttestationClaim(Json::Value const& v)
STObject
AttestationClaim::toSTObject() const
{
STObject o{sfXChainClaimAttestationCollectionElement};
STObject o =
STObject::makeInnerObject(sfXChainClaimAttestationCollectionElement);
addHelper(o);
o[sfXChainClaimID] = claimID;
if (dst)
Expand Down Expand Up @@ -345,7 +346,8 @@ AttestationCreateAccount::AttestationCreateAccount(
STObject
AttestationCreateAccount::toSTObject() const
{
STObject o{sfXChainCreateAccountAttestationCollectionElement};
STObject o = STObject::makeInnerObject(
sfXChainCreateAccountAttestationCollectionElement);
addHelper(o);

o[sfXChainAccountCreateCount] = createCount;
Expand Down Expand Up @@ -497,7 +499,7 @@ XChainClaimAttestation::XChainClaimAttestation(
STObject
XChainClaimAttestation::toSTObject() const
{
STObject o{sfXChainClaimProofSig};
STObject o = STObject::makeInnerObject(sfXChainClaimProofSig);
o[sfAttestationSignerAccount] =
STAccount{sfAttestationSignerAccount, keyAccount};
o[sfPublicKey] = publicKey;
Expand Down Expand Up @@ -609,7 +611,7 @@ XChainCreateAccountAttestation::XChainCreateAccountAttestation(
STObject
XChainCreateAccountAttestation::toSTObject() const
{
STObject o{sfXChainCreateAccountProofSig};
STObject o = STObject::makeInnerObject(sfXChainCreateAccountProofSig);

o[sfAttestationSignerAccount] =
STAccount{sfAttestationSignerAccount, keyAccount};
Expand Down
Loading

0 comments on commit 36389a0

Please sign in to comment.