lisk-sdk icon indicating copy to clipboard operation
lisk-sdk copied to clipboard

Add events for interoperability module

Open ishantiw opened this issue 2 years ago • 2 comments

Description

Add events according to LIP update https://github.com/LiskHQ/lips/pull/148

ChainAccountUpdated

  • name = EVENT_NAME_CHAIN_ACCOUNT_UPDATED
  • Topics: chainID
  • Data chainAccountSchema

InvalidRegistrationSignature

  • name = EVENT_NAME_INVALID_REGISTRATION_SIGNATURE.
  • Topics: chainID
  • The data property of this event is empty.

CrossChainMessageProcessed

  • name = EVENT_NAME_CCM_PROCESSED
  • Topics:
sendingChainID: The ID of the sending chain.
receivingChainID: The ID of the receiving chain
  • Data: ccmProcessedDataSchema

CrossChainMessageSentSuccess

  • name = EVENT_NAME_CCM_SENT_SUCCESS
  • Topics
sendingChainID: The ID of the sending chain.
receivingChainID: The ID of the receiving chain.
sentCCMID: The ID of the CCM that was sent.
  • Data
const ccmSentDataSchema = {
    "type": "object",
    "required": ["ccmID"],
    "properties": {
        "ccmID": {
            "dataType": "bytes",
            "length": HASH_LENGTH,
            "fieldNumber": 1
        }
    }
}

CrossChainMessageSentFailed

  • name = EVENT_NAME_CCM_SENT_FAILED
  • Topics
CCM_SENT_CODE_CHANNEL_UNAVAILABLE
CCM_SENT_CODE_MESSAGE_FEE_EXCEPTION
CCM_SENT_CODE_INVALID_FORMAT
  • Data
ccmSentDataSchema = {
    "type": "object",
    "required": ["code"],
    "properties": {
        "code": {
            "dataType": "uint32",
            "fieldNumber": 3
        }
    }
}

TerminatedStateAccountCreated

  • name = EVENT_NAME_TERMINATED_STATE_CREATED
  • Topics: chainID: The ID of the terminated chain account.
  • Data: The data property follows the terminatedStateAccountSchema schema

TerminatedOutboxCreated

  • name = EVENT_NAME_TERMINATED_OUTBOX_CREATED
  • Topics: chainID: The ID of the terminated outbox account.
  • The data property follows the terminatedOutboxAccountSchema schema

Acceptance Criteria

  • Should pass its unit test

Additional Information

  • Related https://github.com/LiskHQ/lips/pull/148
  • Depends on https://github.com/LiskHQ/lisk-sdk/issues/7555

ishantiw avatar Sep 22 '22 22:09 ishantiw

I would suggest to not use _NAME in event name, never saw such practice, rather the corresponding parameter names should be adjusted to avoid this requirement/need

sitetester avatar Sep 23 '22 08:09 sitetester

@sitetester _NAME is to distinguish between event name (EVENT_NAME_) and data constants (EVENT_DATA_)

ishantiw avatar Sep 23 '22 08:09 ishantiw