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

Update Rust and Types #197

Merged
merged 3 commits into from
Mar 3, 2021
Merged

Update Rust and Types #197

merged 3 commits into from
Mar 3, 2021

Conversation

ethanfrey
Copy link
Member

@ethanfrey ethanfrey commented Mar 3, 2021

Closes #196

  • Update CI and Docker builds to Rust 1.50
  • Build and publish new docker build containers
  • Update Go types
  • Update test contracts to v0.14.0-alpha1

@ethanfrey ethanfrey marked this pull request as ready for review March 3, 2021 07:59
Copy link
Member

@webmaster128 webmaster128 left a comment

Choose a reason for hiding this comment

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

Looks good. I just don't know about the JSON representation of pub gas_limit: Option<u64>

type SubMsg struct {
ID uint64 `json:"id"`
Msg CosmosMsg `json:"msg"`
GasLimit *uint64 `json:"gas_limit,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

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

The JSON schema says this is null or an integer:

    "SubMsg_for_CustomMsg": {
      "description": "A sub-message that will guarantee a subcall_response callback on success or error Note on error the subcall will revert any partial state changes due to this message, but not revert any state changes in the calling contract (that must be done in the subcall_response entry point)",
      "type": "object",
      "required": [
        "id",
        "msg"
      ],
      "properties": {
        "gas_limit": {
          "type": [
            "integer",
            "null"
          ],
          "format": "uint64",
          "minimum": 0.0
        },
        "id": {
          "type": "integer",
          "format": "uint64",
          "minimum": 0.0
        },
        "msg": {
          "$ref": "#/definitions/CosmosMsg_for_CustomMsg"
        }
      }
    },

Are you sure it works with *uint64 and omitempty?

Copy link
Member Author

Choose a reason for hiding this comment

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

It is not a required field. This works fine

Copy link
Member

Choose a reason for hiding this comment

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

Alright, and it only needs to work from Rust to Go. Then we receive a number of null in Go.

@webmaster128 webmaster128 merged commit a7cedc3 into main Mar 3, 2021
@webmaster128 webmaster128 deleted the update-rust-and-types branch March 3, 2021 08:33
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.

Upgrade Rust to 1.50.0
2 participants