Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PH] Resolve Duplicate Transaction ID Generation in Transaction Generator #757

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions tests/TestHarness/Node.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,18 +518,18 @@ def checkBlockForTransactions(self, transIds, blockNum):
return transIds

def waitForTransactionsInBlockRange(self, transIds, startBlock=2, maxFutureBlocks=0):
lastBlockProcessed = startBlock
overallFinalBlock = startBlock + maxFutureBlocks
nextBlockToProcess = startBlock
overallEndBlock = startBlock + maxFutureBlocks
while len(transIds) > 0:
currentLoopEndBlock = self.getHeadBlockNum()
if currentLoopEndBlock > overallFinalBlock:
currentLoopEndBlock = overallFinalBlock
for blockNum in range(currentLoopEndBlock, lastBlockProcessed - 1, -1):
if currentLoopEndBlock > overallEndBlock:
currentLoopEndBlock = overallEndBlock
for blockNum in range(nextBlockToProcess, currentLoopEndBlock + 1):
transIds = self.checkBlockForTransactions(transIds, blockNum)
if len(transIds) == 0:
return transIds
lastBlockProcessed = currentLoopEndBlock
if currentLoopEndBlock == overallFinalBlock:
nextBlockToProcess = currentLoopEndBlock + 1
if currentLoopEndBlock == overallEndBlock:
Utils.Print("ERROR: Transactions were missing upon expiration of waitOnblockTransactions")
break
self.waitForHeadToAdvance()
Expand Down
2 changes: 1 addition & 1 deletion tests/trx_generator/trx_generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ namespace eosio::testing {
trx.actions.emplace_back(std::move(act));
}
trx.context_free_actions.emplace_back(action({}, config::null_account_name, name("nonce"),
fc::raw::pack(std::to_string(nonce_prefix) + ":" + std::to_string(++nonce) + ":" +
fc::raw::pack(std::to_string(_generator_id) + ":" + std::to_string(nonce_prefix) + ":" + std::to_string(++nonce) + ":" +
fc::time_point::now().time_since_epoch().count())));

trx.sign(priv_key, chain_id);
Expand Down