osmosis-labs / test-tube

Test tube for cosmos-sdk chains integration test, written in Rust!
Apache License 2.0
54 stars 33 forks source link

poolmanager::EstimateSwapExactAmountOut failed with no `sender` field #21

Closed byeongsu-hong closed 1 year ago

byeongsu-hong commented 1 year ago

I was using autobuild-15.0.0 to test an IBCX contract. but after bump to v15.1.0, this situation happened.

before bump

expected(raw)         : 7b22746f6b656e5f696e5f616d6f756e74223a2231303030303030227d
expected(hex_decoded) : {"token_in_amount":"1000000"}

actual(raw)           : 7b227374617267617465223a7b2270617468223a222f6f736d6f7369732e706f6f6c6d616e616765722e763162657461312e51756572792f457374696d617465537761704578616374416d6f756e744f7574222c2264617461223a22436763784d4441774d444177227d7d
actual(hex_decoded)   : {"stargate":{"path":"/osmosis.poolmanager.v1beta1.Query/EstimateSwapExactAmountOut","data":"CgcxMDAwMDAw"}}

There's also a bug that simulation result is returned as Request type - https://github.com/osmosis-labs/osmosis/issues/5048 - so i solved with decoding both type of response EstimateSwapExactAmountOutRequest and EstimateSwapExactAmountOutResponse and cherrypick the successful one.

But after bump it returns without totally different format like this.

expected(raw)         : 7b22746f6b656e5f696e5f616d6f756e74223a2231303030303030227d
expected(hex_decoded) : {"token_in_amount":"1000000"}

actual(raw)           : 7b22706f6f6c5f6964223a2230222c22726f75746573223a5b5d2c22746f6b656e5f6f7574223a22227d
actual(hex_decoded)   : {"pool_id":"0","routes":[],"token_out":""}

It is confused to reflect the returned payload after bump - it does not stores the result of simulation... So it'll be great to know what is actually happened in the core side!

byeongsu-hong commented 1 year ago

Solved after bump to main branch