-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: remove baseapp from
x/accounts
(#23355)
Co-authored-by: Tyler <[email protected]>
- Loading branch information
1 parent
9a27317
commit 952db2b
Showing
28 changed files
with
205 additions
and
152 deletions.
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
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 |
---|---|---|
@@ -1,11 +1,23 @@ | ||
module cosmossdk.io/core/testing | ||
|
||
go 1.23 | ||
go 1.23.1 | ||
|
||
toolchain go1.23.4 | ||
|
||
require ( | ||
cosmossdk.io/core v1.0.0 | ||
github.com/cosmos/gogoproto v1.7.0 | ||
github.com/tidwall/btree v1.7.0 | ||
go.uber.org/mock v0.5.0 | ||
google.golang.org/grpc v1.69.4 | ||
) | ||
|
||
require cosmossdk.io/schema v1.0.0 // indirect | ||
require ( | ||
cosmossdk.io/schema v1.0.0 // indirect | ||
github.com/google/go-cmp v0.6.0 // indirect | ||
golang.org/x/net v0.33.0 // indirect | ||
golang.org/x/sys v0.28.0 // indirect | ||
golang.org/x/text v0.21.0 // indirect | ||
google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53 // indirect | ||
google.golang.org/protobuf v1.35.1 // indirect | ||
) |
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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package msgrouter | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
|
||
gogoproto "github.com/cosmos/gogoproto/proto" | ||
|
||
"cosmossdk.io/core/router" | ||
"cosmossdk.io/core/transaction" | ||
) | ||
|
||
// msgTypeURL returns the TypeURL of a proto message. | ||
func msgTypeURL(msg gogoproto.Message) string { | ||
return gogoproto.MessageName(msg) | ||
} | ||
|
||
type routerHandler func(context.Context, transaction.Msg) (transaction.Msg, error) | ||
|
||
var _ router.Service = &RouterService{} | ||
|
||
// custom router service for integration tests | ||
type RouterService struct { | ||
handlers map[string]routerHandler | ||
} | ||
|
||
func NewRouterService() *RouterService { | ||
return &RouterService{ | ||
handlers: make(map[string]routerHandler), | ||
} | ||
} | ||
|
||
func (rs *RouterService) RegisterHandler(handler routerHandler, typeUrl string) { | ||
rs.handlers[typeUrl] = handler | ||
} | ||
|
||
func (rs RouterService) CanInvoke(ctx context.Context, typeUrl string) error { | ||
if rs.handlers[typeUrl] == nil { | ||
return fmt.Errorf("no handler for typeURL %s", typeUrl) | ||
} | ||
return nil | ||
} | ||
|
||
func (rs RouterService) Invoke(ctx context.Context, req transaction.Msg) (transaction.Msg, error) { | ||
typeUrl := msgTypeURL(req) | ||
if rs.handlers[typeUrl] == nil { | ||
return nil, fmt.Errorf("no handler for typeURL %s", typeUrl) | ||
} | ||
return rs.handlers[typeUrl](ctx, req) | ||
} |
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
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
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.