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
Copy file name to clipboardExpand all lines: doc-site/docs/reference/types/_includes/contractlistener_description.md
+97-5Lines changed: 97 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,7 +40,7 @@ Each filter is identified by a generated `signature` that matches a single event
40
40
41
41
Ethereum provides a string standard for event signatures, of the form `EventName(uint256,bytes)`. Prior to v1.3.1, the signature of each Ethereum contract listener would exactly follow this Ethereum format.
42
42
43
-
As of v1.3.1, Ethereum signature strings have been changed, because this format does not fully describe the event - particularly because each top-level parameter can in the ABI definition be marked as `indexed`. For example, while the following two Solidity events have the same signature, they are serialized differently due to the different placement of `indexed` parameters, and thus a listener must define both individually to be able to process them:
43
+
As of v1.3.1, Ethereum format signature strings have been changed in FireFly, because this format does not fully describe the event - particularly because each top-level parameter can in the ABI definition be marked as `indexed`. For example, while the following two Solidity events have the same signature, they are serialized differently due to the different placement of `indexed` parameters, and thus a listener must define both individually to be able to process them:
44
44
45
45
- ERC-20 `Transfer`
46
46
@@ -54,7 +54,7 @@ As of v1.3.1, Ethereum signature strings have been changed, because this format
The two above are now expressed in the following manner by the Ethereum blockchain connector:
57
+
The two above are now expressed in the following manner by the FireFly Ethereum blockchain connector:
58
58
59
59
```solidity
60
60
Transfer(address,address,uint256) [i=0,1]
@@ -65,7 +65,7 @@ The `[i=]` listing at the end of the signature indicates the position of all par
65
65
66
66
Building on the blockchain-specific signature format for each event, FireFly will then compute the final signature for each filter and each contract listener as follows:
67
67
68
-
- Each filter signature is a combination of the location and the specific connector event signature, such as `0xa5ea5d0a6b2eaf194716f0cc73981939dca26da1:Changed(address,uint256) [i=0]`
68
+
- Each filter signature is a combination of the location and the specific connector event signature, such as `0xa5ea5d0a6b2eaf194716f0cc73981939dca26da1:Transfer(address,address,uint256) [i=0,1]`
69
69
- Each contract listener signature is a concatenation of all the filter signatures, separated by `;`
70
70
71
71
#### Duplicate filters
@@ -84,7 +84,7 @@ As noted above, each listener has a generated signature. This signature - contai
84
84
85
85
### Backwards compatibility
86
86
87
-
As noted throughout this document, the behavior of listeners is changed in v1.3.1. However, the following behaviors are retained for backwards-compatibility, to ensure that code written prior to v1.3.1 should continue to function.
87
+
As noted throughout this document, the behavior of listeners has changed in v1.3.1. However, the following behaviors are retained for backwards-compatibility, to ensure that code written prior to v1.3.1 should continue to function.
88
88
89
89
- The response from all query APIs of `listeners` will continue to populate top-level `event` and `location` fields
90
90
- The first entry from the `filters` array is duplicated to these fields
@@ -93,12 +93,104 @@ As noted throughout this document, the behavior of listeners is changed in v1.3.
93
93
- The `signature` field is preserved at the listener level
94
94
- The format has been changed as described above
95
95
96
-
###Input formats
96
+
## Input examples
97
97
98
98
The two input formats supported when creating a contract listener are shown below.
99
99
100
+
### With event definition
101
+
102
+
In these examples, the event schema in the FireFly Interface format is provided describing the event and its parameters. See [FireFly Interface Format](../firefly_interface_format.md)
These examples use an `interface` reference when creating the filters, the `eventPath` field is used to reference an event defined within the interface provided. In this case, we do not need to provide the event schema as the section above shows. See an example of creating a [FireFly Interface](../../tutorials/custom_contracts/ethereum.md/#the-firefly-interface-format) for an EVM smart contract.
Copy file name to clipboardExpand all lines: doc-site/docs/reference/types/contractlistener.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -121,9 +121,9 @@ title: ContractListener
121
121
122
122
| Field Name | Description | Type |
123
123
|------------|-------------|------|
124
-
|`event`| The definition of the event, either provided in-line when creating the listener, or extracted from the referenced FFI |[`FFISerializedEvent`](#ffiserializedevent)|
124
+
|`event`| The definition of the event, either provided in-line when creating the listener, or extracted from the referenced FFI when supplied |[`FFISerializedEvent`](#ffiserializedevent)|
125
125
|`location`| A blockchain specific contract identifier. For example an Ethereum contract address, or a Fabric chaincode name and channel |[`JSONAny`](simpletypes.md#jsonany)|
126
-
|`interface`| A reference to an existing FFI, containing pre-registered type information for the event |[`FFIReference`](#ffireference)|
126
+
|`interface`| A reference to an existing FFI, containing pre-registered type information for the event, used in combination with eventPath|[`FFIReference`](#ffireference)|
127
127
|`signature`| The stringified signature of the event and location, as computed by the blockchain plugin |`string`|
0 commit comments