-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
feat(accounts): implement account abstraction execution #18499
Merged
Merged
Changes from 17 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
6819e26
add interfaces and mock impls
2bbbe3e
add msg sender annotations
3331dc1
add generated code
4aa573f
Merge branch 'main' into tip/accounts/aa/executor
16deb5b
tmp commit
77b959d
more stuff
3374e5c
tmp
b086371
Merge branch 'main' into tip/accounts/aa/executor
1d55059
cleanups plus start testing
b620597
refactors and cleanups
4fc24a7
full=>minimal
20cc6e3
add abstracted account flows testing
5b2f957
refine testing
0c0c4df
maybe finish testing
b307678
lint
8cb74e9
Merge branch 'main' into tip/accounts/aa/executor
testinginprod 31cd9e3
chore: CHANGELOG.md
8d8b75a
Update x/accounts/internal/implementation/api_builder.go
testinginprod 32a58f0
rename for clarity
d8e1c94
address review
c798130
address review 2
02c2b8a
more docs
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
536 changes: 316 additions & 220 deletions
536
api/cosmos/accounts/interfaces/account_abstraction/v1/interface.pulsar.go
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,6 +31,7 @@ type MsgServiceRouter struct { | |
interfaceRegistry codectypes.InterfaceRegistry | ||
routes map[string]MsgServiceHandler | ||
hybridHandlers map[string]func(ctx context.Context, req, resp protoiface.MessageV1) error | ||
responseByRequest map[string]string | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why is this needed? |
||
circuitBreaker CircuitBreaker | ||
} | ||
testinginprod marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
|
@@ -39,8 +40,10 @@ var _ gogogrpc.Server = &MsgServiceRouter{} | |
// NewMsgServiceRouter creates a new MsgServiceRouter. | ||
func NewMsgServiceRouter() *MsgServiceRouter { | ||
return &MsgServiceRouter{ | ||
routes: map[string]MsgServiceHandler{}, | ||
hybridHandlers: map[string]func(ctx context.Context, req, resp protoiface.MessageV1) error{}, | ||
routes: map[string]MsgServiceHandler{}, | ||
hybridHandlers: map[string]func(ctx context.Context, req, resp protoiface.MessageV1) error{}, | ||
responseByRequest: map[string]string{}, | ||
circuitBreaker: nil, | ||
} | ||
} | ||
|
||
|
@@ -87,16 +90,26 @@ func (msr *MsgServiceRouter) HybridHandlerByMsgName(msgName string) func(ctx con | |
return msr.hybridHandlers[msgName] | ||
} | ||
|
||
func (msr *MsgServiceRouter) ResponseByRequestName(msgName string) string { | ||
return msr.responseByRequest[msgName] | ||
} | ||
|
||
func (msr *MsgServiceRouter) registerHybridHandler(sd *grpc.ServiceDesc, method grpc.MethodDesc, handler interface{}) error { | ||
inputName, err := protocompat.RequestFullNameFromMethodDesc(sd, method) | ||
if err != nil { | ||
return err | ||
} | ||
outputName, err := protocompat.ResponseFullNameFromMethodDesc(sd, method) | ||
if err != nil { | ||
return err | ||
} | ||
cdc := codec.NewProtoCodec(msr.interfaceRegistry) | ||
hybridHandler, err := protocompat.MakeHybridHandler(cdc, sd, method, handler) | ||
if err != nil { | ||
return err | ||
} | ||
// map input name to output name | ||
msr.responseByRequest[string(inputName)] = string(outputName) | ||
// if circuit breaker is not nil, then we decorate the hybrid handler with the circuit breaker | ||
if msr.circuitBreaker == nil { | ||
msr.hybridHandlers[string(inputName)] = hybridHandler | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
missing godoc