forked from cosmos/cosmos-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(x/tx): Support gogo registry in Textual (cosmos#15302)
- Loading branch information
1 parent
bf85bfb
commit 124aed4
Showing
29 changed files
with
299 additions
and
107 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
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
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,28 +1,27 @@ | ||
package std | ||
|
||
import ( | ||
"fmt" | ||
|
||
"cosmossdk.io/x/tx/signing" | ||
"cosmossdk.io/x/tx/signing/direct" | ||
"cosmossdk.io/x/tx/signing/textual" | ||
) | ||
|
||
// SignModeOptions are options for configuring the standard sign mode handler map. | ||
type SignModeOptions struct { | ||
// CoinMetadataQueryFn is the CoinMetadataQueryFn required for SIGN_MODE_TEXTUAL. | ||
CoinMetadataQueryFn textual.CoinMetadataQueryFn | ||
// Textual are options for SIGN_MODE_TEXTUAL | ||
Textual textual.SignModeOptions | ||
} | ||
|
||
// HandlerMap returns a sign mode handler map that Cosmos SDK apps can use out | ||
// of the box to support all "standard" sign modes. | ||
func (s SignModeOptions) HandlerMap() (*signing.HandlerMap, error) { | ||
if s.CoinMetadataQueryFn == nil { | ||
return nil, fmt.Errorf("missing %T needed for SIGN_MODE_TEXTUAL", s.CoinMetadataQueryFn) | ||
txt, err := textual.NewSignModeHandler(s.Textual) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
return signing.NewHandlerMap( | ||
direct.SignModeHandler{}, | ||
textual.NewSignModeHandler(s.CoinMetadataQueryFn), | ||
txt, | ||
), nil | ||
} |
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.