Skip to content

Commit 1e8963d

Browse files
committed
Make chainId first class, not under sub structure in JSON
Signed-off-by: Matthew Whitehead <[email protected]>
1 parent 4ee8af8 commit 1e8963d

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

internal/ethereum/event_enricher.go

+1-4
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ package ethereum
1919
import (
2020
"bytes"
2121
"context"
22-
"fmt"
2322

2423
"github.com/hyperledger/firefly-common/pkg/fftypes"
2524
"github.com/hyperledger/firefly-common/pkg/i18n"
@@ -64,9 +63,7 @@ func (ee *eventEnricher) filterEnrichEthLog(ctx context.Context, f *eventFilter,
6463

6564
info := eventInfo{
6665
logJSONRPC: *ethLog,
67-
ChainIdentifier: fftypes.JSONAnyPtr(fmt.Sprintf(`{
68-
"chainId": "%s"
69-
}`, ee.connector.chainID)),
66+
ChainId: ee.connector.chainID,
7067
}
7168

7269
var timestamp *fftypes.FFTime

internal/ethereum/event_stream.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ type eventFilter struct {
4545
// eventInfo is the top-level structure we pass to applications for each event (through the FFCAPI framework)
4646
type eventInfo struct {
4747
logJSONRPC
48-
InputMethod string `json:"inputMethod,omitempty"` // the method invoked, if it matched one of the signatures in the listener definition
49-
InputArgs *fftypes.JSONAny `json:"inputArgs,omitempty"` // the method parameters, if the method matched one of the signatures in the listener definition
50-
InputSigner *ethtypes.Address0xHex `json:"inputSigner,omitempty"` // the signing `from` address of the transaction
51-
ChainIdentifier *fftypes.JSONAny `json:"chainIdentifier,omitempty"` // an identifier for the chain this event relates to
48+
InputMethod string `json:"inputMethod,omitempty"` // the method invoked, if it matched one of the signatures in the listener definition
49+
InputArgs *fftypes.JSONAny `json:"inputArgs,omitempty"` // the method parameters, if the method matched one of the signatures in the listener definition
50+
InputSigner *ethtypes.Address0xHex `json:"inputSigner,omitempty"` // the signing `from` address of the transaction
51+
ChainId string `json:"chainId,omitempty"` // an identifier for the chain this event relates to
5252
}
5353

5454
// eventStream is the state we hold in memory for each eventStream

0 commit comments

Comments
 (0)