Skip to content

Commit 0db9a92

Browse files
Merge pull request #113 from InjectiveLabs/f/fix_authz_msgexec
fix: MsgExec unpack method
2 parents 9bac59b + 3533ed4 commit 0db9a92

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

examples/chain_client/20_MsgExec.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,13 @@ async def main() -> None:
7878
return
7979

8080
sim_res_msg = ProtoMsgComposer.MsgResponses(sim_res.result.data, simulation=True)
81-
print("simulation msg response")
8281
print(sim_res_msg)
82+
unpacked_msg_res = ProtoMsgComposer.UnpackMsgExecResponse(
83+
msg_type=msg0.__class__.__name__,
84+
data=sim_res_msg[0]
85+
)
86+
print("simulation msg response")
87+
print(unpacked_msg_res)
8388

8489
# build tx
8590
gas_price = 500000000

pyinjective/composer.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,6 @@ def UnpackMsgExecResponse(msg_type, data):
592592
"MsgSubaccountTransfer": injective_exchange_tx_pb.MsgSubaccountTransferResponse,
593593
"MsgLiquidatePosition": injective_exchange_tx_pb.MsgLiquidatePositionResponse,
594594
"MsgIncreasePositionMargin": injective_exchange_tx_pb.MsgIncreasePositionMarginResponse,
595-
"MsgBid": injective_auction_tx_pb.MsgBidResponse,
596595
}
597596

598-
return header_map[msg_type].FromString(data)
597+
return header_map[msg_type].FromString(bytes(data, "utf-8"))

0 commit comments

Comments
 (0)