Skip to content

feat: enhance rosetta support#11590

Closed
Vritra4 wants to merge 19 commits intocosmos:masterfrom
terra-money:feature/support-rosetta
Closed

feat: enhance rosetta support#11590
Vritra4 wants to merge 19 commits intocosmos:masterfrom
terra-money:feature/support-rosetta

Conversation

@Vritra4
Copy link
Copy Markdown
Contributor

@Vritra4 Vritra4 commented Apr 11, 2022

feat/fix to enhance rosetta support

Description

followup of #10766
Closes: #10618

we did integration test with coinbase so this PR includes all of our fixes and features requested from coinbase.

features:

  • add fee_suggetion feature for /construction/metadata
    • adding suggested_fee in result
    • added realted configurations
  • enable offline mode
    • offline-moded cosmo-sdk will return error for sequence-related APIs like /construction/metadata
  • bump rosetta-sdk-go to v0.7.7

fixes:

  • fix bugs: /block returns with nil pointer address when a request has both of index and hash
  • increase timeout to prevent timeout when genesis is huge
  • force set events about fees to success
    • to pass reconcilition, fee have to be presented as success.
    • it is available because failed transaction have no events other than fee

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)

Copy link
Copy Markdown
Contributor

@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.

LGTM, could you add a changlog entry pleas

return nil, errors.ToRosetta(err)
}

price, err := sdk.ParseDecCoin(metadata["gas_price"].(string))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we should be safe and have explicit type assertions on these metadata fields and return an error when the type is invalid. Otherwise, this could could panic of metadata structure changes.

"time"

"github.com/coinbase/rosetta-sdk-go/types"
clientflags "github.com/cosmos/cosmos-sdk/client/flags"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

gofmt

// DefaultOffline defines the default offline value
DefaultOffline = false
// DefaultEnableDefaultFeeSuggest indicates to use fee suggestion
DefaultEnableDefaultFeeSuggest = false
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

odd to read, we can remove Default prefix and address the changes that @alexanderbez suggested for naming

Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>
Co-authored-by: Anil Kumar Kammari <anil@vitwit.com>
@Vritra4
Copy link
Copy Markdown
Contributor Author

Vritra4 commented Apr 12, 2022

My apologies.. miscreated pr with outdated and invalid test branch. I'll create again with right branch after applying your suggestions.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Events for failed transactions

5 participants