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

Elimination of Msg Proto nesting structure #534

Open
Senna46 opened this issue May 16, 2023 · 4 comments
Open

Elimination of Msg Proto nesting structure #534

Senna46 opened this issue May 16, 2023 · 4 comments

Comments

@Senna46
Copy link
Contributor

Senna46 commented May 16, 2023

This Msg have nested proto. A error occurs in Tx simulation from the frontend.

  • MsgOpenPosition

Since it cannot be simulated, it is impossible to determine if it succeeded without sending the Tx, querying the Tx hash, and seeing the results.

So, create MsgOpenPerpetualFuturesPositon & MsgOpenPerpetualOptionsPositon.
This will solve this problem.

@kimurayu45z
Copy link
Contributor

is the cause really derived from protobuf.Any field?

@Senna46
Copy link
Contributor Author

Senna46 commented May 16, 2023

This Error
can't unmarshal Any nested proto *types.MsgOpenPosition: Any JSON doesn't have '@type'

The google.protobuf.ITimestamp in MsgPlaceBid has a similar problem.
Error during Simulate.

@kimurayu45z
Copy link
Contributor

I think it is like a problem in cosmos-client-ts side

can you share the JSON that is used for simulation?

@Senna46
Copy link
Contributor Author

Senna46 commented May 19, 2023

@kimurayu45z
If simulate or broadcast this msg directly, an error will occur; if broadcast through Keplr, no problem.

 {
    "sender": "ununifi155u042u8wk3al32h3vzxu989jj76k4zcu44v6w",
    "margin": {
        "denom": "ubtc",
        "amount": "1000000"
    },
    "market": {
        "base_denom": "ubtc",
        "quote_denom": "uusdc"
    },
    "position_instance": {
        "type_url": "/ununifi.derivatives.PerpetualFuturesPositionInstance",
        "value": "CAESEzEwMDAwMDAwMDAwMDAwMDAwMDAYAQ=="
    }
}

position_instance is cosmosclient.codec.instanceToProtoAny() of

{
    "position_type": "LONG",
    "size": "1000000000000000000",
    "leverage": 1
}

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

No branches or pull requests

2 participants