Skip to content
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(x/tx): legacy amino json sign mode handler #15515

Merged
merged 68 commits into from
Apr 3, 2023

Conversation

kocubinski
Copy link
Member

@kocubinski kocubinski commented Mar 22, 2023

Description

Closes: #15170

Also includes a minor cleanup to #15557, removal of gogoproto dependency mistakenly introduced in the unknown proto testpb files.


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • included the correct type prefix in the PR title
  • added ! to the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • followed the guidelines for building modules
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary
  • confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed ! in the type prefix if API or client breaking change
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage
  • manually tested (if applicable)

@kocubinski kocubinski force-pushed the kocubinski/sign-legacy-amino-json branch from 51d823b to b960845 Compare March 28, 2023 21:28
Copy link
Member

@tac0turtle tac0turtle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets add it to the handler map in std

Copy link
Member

@aaronc aaronc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally this looks good, but I haven't had a chance to thoroughly review tests yet.

x/tx/internal/testpb/unknonwnproto.proto Show resolved Hide resolved
Copy link
Member

@julienrbrt julienrbrt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

},
}

//fee := &txv1beta1.Fee{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it should be deleted?

}

if signerData.Address == "" {
return nil, fmt.Errorf("got empty address in %s handler: invalid request", h.Mode())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason we do not wrap the errors anymore like in the legacy_amino_json.go file?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what would be wrapping what, is returning a simple error not enough?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know, I wondered because I was comparing the two files

}
isTipper := tip != nil && tip.Tipper == signerData.Address

var fee *aminojsonpb.AminoSignFee
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add the same comment as in the other file legacy_amino_json file, about the no fee and no gas?

@kocubinski kocubinski enabled auto-merge (squash) April 3, 2023 16:41
Comment on lines 13 to +18
// Textual are options for SIGN_MODE_TEXTUAL
Textual textual.SignModeOptions
// DirectAux are options for SIGN_MODE_DIRECT_AUX
DirectAux direct_aux.SignModeHandlerOptions
// AminoJSON are options for SIGN_MODE_LEGACY_AMINO_JSON
AminoJSON aminojson.SignModeHandlerOptions
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we refactor these options to not duplicate shared options? For instance I imagine that a lot of these will require type resolvers and file resolvers. Let's just have individual fields for each type of option here. Okay to do in a separate PR if that's easier

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

x/tx SIGN_MODE_LEGACY_AMINO_JSON handler
4 participants