Skip to content
This repository has been archived by the owner on Oct 28, 2021. It is now read-only.

testclient issue with test_modifytimestamp #5881

Open
winsvega opened this issue Jan 15, 2020 · 0 comments
Open

testclient issue with test_modifytimestamp #5881

winsvega opened this issue Jan 15, 2020 · 0 comments
Labels
rpc test Test-related work

Comments

@winsvega
Copy link
Contributor

void ClientTest::modifyTimestamp(int64_t _timestamp)
{
    Block block(chainParams().accountStartNonce);
    DEV_READ_GUARDED(x_preSeal)
        block = m_preSeal;

    Transactions transactions;
    DEV_READ_GUARDED(x_postSeal)
        transactions = m_postSeal.pending();
    block.resetCurrent(_timestamp);

    DEV_WRITE_GUARDED(x_preSeal)
        m_preSeal = block;

    auto& lastHashes = bc().lastBlockHashes();
    assert(bc().currentHash() == block.info().parentHash());
    for (auto const& t: transactions)
        block.execute(lastHashes, t);

    DEV_WRITE_GUARDED(x_working)
        m_working = block;
    DEV_READ_GUARDED(x_postSeal)
        m_postSeal = block;

    onPostStateChanged();
}

does someone remember why this line?
assert(bc().currentHash() == block.info().parentHash());

when block is rewind and then modify timestamp is called. this line is triggered.

@gumb0 gumb0 added rpc test Test-related work labels Jan 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
rpc test Test-related work
Projects
None yet
Development

No branches or pull requests

2 participants