Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Remove "if true then"

...

Code Block
languagejs
themeConfluence
linenumberstrue
 rule mischief_hat_lifted {
    select when mischief hat_lifted
    foreach subscriptions:established() setting (subscription)
      pre {
        map = {"test": 1}
        message = map.encode() // signChannelMessage requires a string so objects should be encoded
        signed_message = engine:signChannelMessage(subscription{"Rx"}, message)
      }
      if true then
      event:send({
         "eci": subs_attrs{"outbound_eci"},
         "eid": "hat-lifted",
         "domain": "mischief",
         "type": "hat_lifted",
         "attrs": {"signed_message": signed_message, "sub_id" : subscription{"Id"}}
        })
  }

...

Code Block
languagejs
themeConfluence
linenumberstrue
 rule mischief_encrypted {
    select when mischief encrypted
    foreach subscriptions:established() setting (subscription)
      pre {
        map = {"encryption": 1}
        message = map.encode() // The encryptChannelMessage requires a string so objects should be encoded
        eci = subscription{"Rx"}
		subID = subscription{"Id"}
        encrypted_object = engine:encryptChannelMessage(eci, message, subscription{"Tx_public_key"})
      }
      if true then
      event:send({
         "eci": subs_attrs{"outbound_eci"},
         "eid": "hat-lifted",
         "domain": "mischief",
         "type": "encrypted",
         "attrs": {	"encryptedMessage": encrypted_object{"encryptedMessage"}, 
					"sub_id" : subID, 
					"nonce": encrypted_object{"nonce"}}
        })
  }

...