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
{{ message }}
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.
sendInternal(feeAddress, moduleID, crossChainCommandID, receivingChainID, fee, status, params):
# Processing on the mainchain
if ownChainAccount.ID == MAINCHAIN_ID:
# Chain has to exist on mainchain
if chainAccount(receivingChainID) does not exists:
return False
partnerChainID = receivingChainID
# Processing on a sidechain
else:
# Check for direct channel
if chainAccount(receivingChainID) does not exists:
partnerChainID = mainchainID
else:
partnerChainID = receivingChainID
# Chain must be live; This checks is always on the receivingChainID
if not isLive(receivingChainID):
return False
# Chain status must be active
if not chainAccount(partnerChainID).status == CHAIN_ACTIVE:
return False
# Create cross-chain message
ccm = {
"nonce": ownChainAccount.nonce,
"moduleID": moduleID,
"crossChainCommandID": crossChainCommandID,
"sendingChainID": ownChainAccount.ID,
"receivingChainID": receivingChainID,
"fee": fee,
"status": status,
"params": params
}
if validateFormat(ccm) == False:
return False
for each module mdl for which beforeSendCCM exists:
mdl.beforeSendCCM(feeAddress, ccm)
if the previous call fails:
return False
addToOutbox(partnerChainID, ccm)
ownChainAccount.nonce += 1
return True
Acceptance Criteria
Add unit tests for sendInternal
The text was updated successfully, but these errors were encountered:
Description
Create and send a cross chain message:
Acceptance Criteria
The text was updated successfully, but these errors were encountered: