You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
createTerminatedStateAccount(chainID, stateRoot = None):
if stateRoot:
if chainAccount(chainID) exists:
chainAccount(chainID).status = CHAIN_TERMINATED
remove the entry with storeKey = uint32be(chainID) from the outbox root substore
terminatedState = {
"stateRoot": stateRoot,
"mainchainStateRoot": EMPTY_BYTES,
"initialized": True
}
elif chainAccount(chainID) exists:
chainAccount(chainID).status = CHAIN_TERMINATED
remove the entry with storeKey = uint32be(chainID) from the outbox root substore
terminatedState = {
"stateRoot": chainAccount(chainID).lastCertificate.stateRoot,
"mainchainStateRoot": EMPTY_BYTES,
"initialized": True
}
# State root is not available, set it to empty bytes temporarily.
# This should only happen on a sidechain.
else:
# Processing on the mainchain
if ownChainAccount.ID == MAINCHAIN_ID:
# If the account does not exist on the mainchain, the input chainID is invalid.
return False
terminatedState = {
"stateRoot": EMPTY_BYTES,
"mainchainStateRoot": chainAccount(MAINCHAIN_ID).lastCertificate.stateRoot,
"initialized": False
}
create an entry in the terminated state substore with
storeKey = uint32be(chainID)
storeValue = serialization of terminatedState
return True
Acceptance Criteria
Add unit tests for all function paths
The text was updated successfully, but these errors were encountered:
Description
Add function below to interoperability store:
Acceptance Criteria
The text was updated successfully, but these errors were encountered: