def commit(self, txnCount, stateRoot, txnRoot) -> List:
"""
:param txnCount: The number of requests to commit (The actual requests
are picked up from the uncommitted list from the ledger)
:param stateRoot: The state trie root after the txns are committed
:param txnRoot: The txn merkle root after the txns are committed
:return: list of committed transactions
"""
(seqNoStart, seqNoEnd), committedTxns = \
self.ledger.commitTxns(txnCount)
stateRoot = base58.b58decode(stateRoot.encode())
# Probably the following assertion fail should trigger catchup
assert self.ledger.root_hash == txnRoot, '{} {}'.format(
self.ledger.root_hash, txnRoot)
self.state.commit(rootHash=stateRoot)
return txnsWithSeqNo(seqNoStart, seqNoEnd, committedTxns)
评论列表
文章目录