-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Event streams #74
Event streams #74
Conversation
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
…into eth-eventstreams Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
kata/pkg/types/abi_serializer.go
Outdated
func ABIBySolDefinition(ctx context.Context, a abi.ABI) (map[string]*abi.Entry, error) { | ||
byDefs := make(map[string]*abi.Entry) | ||
for _, e := range a { | ||
solDef, childStructs, err := e.SolidityDefCtx(ctx) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the new feature that gives Solidity-like definitions of events/structs (hopefully useful for various other things too, such as TypedData <-> Struct helpers we've discussed in the past)
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
@@ -24,7 +24,7 @@ ext { | |||
include "mocks/**/*.go" | |||
} | |||
|
|||
targetCoverage = 93 | |||
targetCoverage = 94 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🥳
) | ||
|
||
type EnumStringOptions interface { | ||
~string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is this sorcery
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TIL "Approximation constraint element" is a thing
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
return -1, err | ||
} | ||
baseBlock := int64(-1) | ||
if len(checkpoints) > 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it sensible to use gorm First
or Take
when we're only looking for one record?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you use First
(or Take
which seems like what we want) it gives you an error, you need to check against:
errors.Is(result.Error, gorm.ErrRecordNotFound)
This seems less readable imho than just using an array and checking in our code.
So I'm leaving it for this PR - as it's what I've done elsewhere.
Would be fine to see a different pattern go in if preferred, but it would I think be worth being standardized in all the places we do this already.
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Depends on hyperledger/firefly-signer#71 (in a chain with hyperledger/firefly-signer#70)
internal
type event streamsaddress
currently (easy to add later if use cases come up)topic[0]
matches one or moresignature
s from the ABIindexed
etc.)detector
for each event streamdispatcher
abi
for a stream cannot be modifiedfirefly-signer
in Generate Solidity style full descriptions of functions/events/structs hyperledger/firefly-signer#71 to support thistypes
went in tootypes.JSONP
to support thistypes.Enum
with an updated way to work with enums using generics