Skip to content

Commit

Permalink
Updated expiration settings for ConfigUpgrades
Browse files Browse the repository at this point in the history
  • Loading branch information
SirTyson committed Jul 28, 2023
1 parent af0f81e commit 0ad2053
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/herder/Upgrades.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1301,14 +1301,14 @@ ConfigUpgradeSetFrame::makeFromKey(AbstractLedgerTxn& ltx,
ConfigUpgradeSetKey const& key)
{
auto ltxe = ltx.loadWithoutRecord(ConfigUpgradeSetFrame::getLedgerKey(key));
if (!ltxe)
if (!ltxe || !isLive(ltxe.current(), ltx.getHeader().ledgerSeq))
{
return nullptr;
}
auto const& contractData = ltxe.current().data.contractData();
if (contractData.body.bodyType() != DATA_ENTRY ||
contractData.body.data().val.type() != SCV_BYTES ||
contractData.durability != PERSISTENT)
contractData.durability != TEMPORARY)
{
return nullptr;
}
Expand Down Expand Up @@ -1406,7 +1406,7 @@ ConfigUpgradeSetFrame::getLedgerKey(ConfigUpgradeSetKey const& upgradeKey)
lk.contractData().contract.type(SC_ADDRESS_TYPE_CONTRACT);
lk.contractData().contract.contractId() = upgradeKey.contractID;
lk.contractData().key = v;
lk.contractData().durability = PERSISTENT;
lk.contractData().durability = TEMPORARY;
return lk;
}

Expand Down
2 changes: 1 addition & 1 deletion src/test/TxTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1726,7 +1726,7 @@ makeConfigUpgradeSet(AbstractLedgerTxn& ltx, ConfigUpgradeSet configUpgradeSet)
le.data.contractData().body.bodyType(DATA_ENTRY);
le.data.contractData().contract.type(SC_ADDRESS_TYPE_CONTRACT);
le.data.contractData().contract.contractId() = contractID;
le.data.contractData().durability = PERSISTENT;
le.data.contractData().durability = TEMPORARY;
le.data.contractData().expirationLedgerSeq = UINT32_MAX;
le.data.contractData().key = key;
le.data.contractData().body.data().val = val;
Expand Down

5 comments on commit 0ad2053

@latobarita
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from sisuresh
at SirTyson@0ad2053

@latobarita
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging SirTyson/stellar-core/move-expiration = 0ad2053 into auto

@latobarita
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SirTyson/stellar-core/move-expiration = 0ad2053 merged ok, testing candidate = 7e3b6f8

@latobarita
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = 7e3b6f8

Please sign in to comment.