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

Correcting types and event parsing for Cosmos SDK 0.50 #271

Merged
merged 4 commits into from
Jul 23, 2024

Conversation

stwiname
Copy link
Contributor

@stwiname stwiname commented Jul 18, 2024

Description

Improve the types to not be specific to a tendermint version.
Update parsing logs/events to work with 0.50 changes

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

Checklist

  • I have tested locally
  • I have performed a self review of my changes
  • Updated any relevant documentation
  • Linked to any relevant issues
  • I have added tests relevant to my changes
  • Any dependent changes have been merged and published in downstream modules
  • My code is up to date with the base branch
  • I have updated relevant changelogs. We suggest using chan

let msg: CosmosMessage;
try {
msg = wrapCosmosMsg(block, tx, log.msg_index, registry);
const eventMsgIndex = txEvent.attributes.find(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There doesn't seem to be an example where this would ever happen

Copy link
Contributor

github-actions bot commented Jul 18, 2024

Coverage report

Caution

Test run failed

St.
Category Percentage Covered / Total
🔴 Statements 41.92% 2269/5413
🟡 Branches 77.65% 278/358
🔴 Functions 48.57% 119/245
🔴 Lines 41.92% 2269/5413

Test suite run failed

Failed tests: 3/71. Failed suites: 1/8.
  ● Dictionary Queries › Message Filter Queries › Basic wasm filter works

    ApolloError: Response not successful: Received status code 500

      at new ApolloError (node_modules/@apollo/client/errors/index.js:39:28)
      at node_modules/@apollo/client/core/QueryManager.js:772:71
      at both (node_modules/@apollo/client/utilities/observables/asyncMap.js:22:31)
      at node_modules/@apollo/client/utilities/observables/asyncMap.js:11:72
      at Object.then (node_modules/@apollo/client/utilities/observables/asyncMap.js:11:24)
      at Object.error (node_modules/@apollo/client/utilities/observables/asyncMap.js:24:49)
      at notifySubscription (node_modules/zen-observable/lib/Observable.js:140:18)
      at onNotify (node_modules/zen-observable/lib/Observable.js:179:3)
      at SubscriptionObserver.error (node_modules/zen-observable/lib/Observable.js:240:7)
      at node_modules/@apollo/client/utilities/observables/iteration.js:7:68
          at Array.forEach (<anonymous>)
      at iterateObserversSafely (node_modules/@apollo/client/utilities/observables/iteration.js:7:25)
      at Object.error (node_modules/@apollo/client/utilities/observables/Concast.js:76:21)
      at notifySubscription (node_modules/zen-observable/lib/Observable.js:140:18)
      at onNotify (node_modules/zen-observable/lib/Observable.js:179:3)
      at SubscriptionObserver.error (node_modules/zen-observable/lib/Observable.js:240:7)
      at handleError (node_modules/@apollo/client/link/http/parseAndCheckHttpResponse.js:167:14)
      at node_modules/@apollo/client/link/http/createHttpLink.js:145:17

  ● Dictionary Queries › Message Filter Queries › Wasm with contract filter builds a valid query

    ApolloError: Response not successful: Received status code 500

      at new ApolloError (node_modules/@apollo/client/errors/index.js:39:28)
      at node_modules/@apollo/client/core/QueryManager.js:772:71
      at both (node_modules/@apollo/client/utilities/observables/asyncMap.js:22:31)
      at node_modules/@apollo/client/utilities/observables/asyncMap.js:11:72
      at Object.then (node_modules/@apollo/client/utilities/observables/asyncMap.js:11:24)
      at Object.error (node_modules/@apollo/client/utilities/observables/asyncMap.js:24:49)
      at notifySubscription (node_modules/zen-observable/lib/Observable.js:140:18)
      at onNotify (node_modules/zen-observable/lib/Observable.js:179:3)
      at SubscriptionObserver.error (node_modules/zen-observable/lib/Observable.js:240:7)
      at node_modules/@apollo/client/utilities/observables/iteration.js:7:68
          at Array.forEach (<anonymous>)
      at iterateObserversSafely (node_modules/@apollo/client/utilities/observables/iteration.js:7:25)
      at Object.error (node_modules/@apollo/client/utilities/observables/Concast.js:76:21)
      at notifySubscription (node_modules/zen-observable/lib/Observable.js:140:18)
      at onNotify (node_modules/zen-observable/lib/Observable.js:179:3)
      at SubscriptionObserver.error (node_modules/zen-observable/lib/Observable.js:240:7)
      at handleError (node_modules/@apollo/client/link/http/parseAndCheckHttpResponse.js:167:14)
      at node_modules/@apollo/client/link/http/createHttpLink.js:145:17

  ● Dictionary Queries › Message Filter Queries › Wasm with nested filter works

    ApolloError: Response not successful: Received status code 500

      at new ApolloError (node_modules/@apollo/client/errors/index.js:39:28)
      at node_modules/@apollo/client/core/QueryManager.js:772:71
      at both (node_modules/@apollo/client/utilities/observables/asyncMap.js:22:31)
      at node_modules/@apollo/client/utilities/observables/asyncMap.js:11:72
      at Object.then (node_modules/@apollo/client/utilities/observables/asyncMap.js:11:24)
      at Object.error (node_modules/@apollo/client/utilities/observables/asyncMap.js:24:49)
      at notifySubscription (node_modules/zen-observable/lib/Observable.js:140:18)
      at onNotify (node_modules/zen-observable/lib/Observable.js:179:3)
      at SubscriptionObserver.error (node_modules/zen-observable/lib/Observable.js:240:7)
      at node_modules/@apollo/client/utilities/observables/iteration.js:7:68
          at Array.forEach (<anonymous>)
      at iterateObserversSafely (node_modules/@apollo/client/utilities/observables/iteration.js:7:25)
      at Object.error (node_modules/@apollo/client/utilities/observables/Concast.js:76:21)
      at notifySubscription (node_modules/zen-observable/lib/Observable.js:140:18)
      at onNotify (node_modules/zen-observable/lib/Observable.js:179:3)
      at SubscriptionObserver.error (node_modules/zen-observable/lib/Observable.js:240:7)
      at handleError (node_modules/@apollo/client/link/http/parseAndCheckHttpResponse.js:167:14)
      at node_modules/@apollo/client/link/http/createHttpLink.js:145:17

Report generated by 🧪jest coverage report action from de0448b

Comment on lines +10 to +15
export type Block = tendermint34.Block | tendermint37.Block | comet38.Block;
export type BlockId = tendermint34.BlockId | tendermint37.BlockId | comet38.BlockId;
export type Validator = tendermint34.Validator | tendermint37.Validator | comet38.Validator;
export type TxData = tendermint34.TxData | tendermint37.TxData | comet38.TxData;
export type TxEvent = tendermint34.Event | tendermint37.Event | comet38.Event;
export type Header = tendermint34.Header | tendermint37.Header | comet38.Header;

Choose a reason for hiding this comment

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

👌 Nice 😎

@stwiname stwiname force-pushed the cosmos-0.50-support-cont branch from 8abf227 to de0448b Compare July 23, 2024 01:51
@stwiname stwiname marked this pull request as ready for review July 23, 2024 01:51
@stwiname stwiname merged commit db282e2 into main Jul 23, 2024
2 of 3 checks passed
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.

3 participants