-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
refactor(textual): Use Title/Content
instead of Text
#14730
Merged
Merged
Changes from 16 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
f9cd972
Use title/content
amaury1093 f59fecf
Fix messages
amaury1093 3567a6c
Fix
amaury1093 83560a0
Fix messages
amaury1093 cfed2f0
Fix anys
amaury1093 dcbafea
Update tx.json
amaury1093 0445256
Fix e2e and repeated
amaury1093 5b05407
Fix repeated
amaury1093 a1f726c
rename tx to envelope
amaury1093 3f4d74e
revert
amaury1093 1329e59
Fix envelope
amaury1093 9bf0700
Fix e2e
amaury1093 b0be9a3
Merge branch 'main' into am/14665-textual-screen
amaury1093 26031fc
Update ADR
amaury1093 74ba6b7
Merge branch 'am/14665-textual-screen' of ssh://github.com/cosmos/cos…
amaury1093 8d7a30d
Update docs/architecture/adr-050-sign-mode-textual.md
amaury1093 c849e19
Merge branch 'main' of ssh://github.com/cosmos/cosmos-sdk into am/146…
amaury1093 b37c99f
Merge branch 'main' into am/14665-textual-screen
amaury1093 5dcd920
Merge branch 'main' into am/14665-textual-screen
amaury1093 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
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 |
---|---|---|
|
@@ -7,22 +7,25 @@ import ( | |
) | ||
|
||
var ( | ||
textKey = cbor.NewUint(1) | ||
indentKey = cbor.NewUint(2) | ||
expertKey = cbor.NewUint(3) | ||
titleKey = cbor.NewUint(1) | ||
contentKey = cbor.NewUint(2) | ||
indentKey = cbor.NewUint(3) | ||
expertKey = cbor.NewUint(4) | ||
) | ||
|
||
// encode encodes an array of screens according to the CDDL: | ||
// | ||
// screens = [* screen] | ||
// screen = { | ||
// ? text_key: tstr, | ||
// ? title_key: tstr, | ||
// ? content_key: tstr, | ||
// ? indent_key: uint, | ||
// ? expert_key: bool, | ||
// } | ||
// text_key = 1 | ||
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. Change to |
||
// indent_key = 2 | ||
// expert_key = 3 | ||
// content_key = 2 | ||
// indent_key = 3 | ||
// expert_key = 4 | ||
// | ||
// with empty values ("", 0, false) omitted from the screen map. | ||
func encode(screens []Screen, w io.Writer) error { | ||
|
@@ -35,8 +38,11 @@ func encode(screens []Screen, w io.Writer) error { | |
|
||
func (s Screen) Cbor() cbor.Cbor { | ||
m := cbor.NewMap() | ||
if s.Text != "" { | ||
m = m.Add(textKey, cbor.NewText(s.Text)) | ||
if s.Title != "" { | ||
m = m.Add(titleKey, cbor.NewText(s.Title)) | ||
} | ||
if s.Content != "" { | ||
m = m.Add(contentKey, cbor.NewText(s.Content)) | ||
} | ||
if s.Indent > 0 { | ||
// #nosec G701 | ||
|
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.
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.
Consider "advised to X characters".