Skip to content

Commit

Permalink
Merge pull request #304 from InjectiveLabs/feat/add_distribution_modu…
Browse files Browse the repository at this point in the history
…le_queries_support

Feat/add distribution module queries support
  • Loading branch information
aarmoa authored Feb 13, 2024
2 parents e02f0c7 + c64c8ca commit 0c61c63
Show file tree
Hide file tree
Showing 61 changed files with 1,066 additions and 251 deletions.
6 changes: 3 additions & 3 deletions examples/chain_client/0_LocalOrderHash.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ async def main() -> None:
gas_limit = base_gas + GAS_FEE_BUFFER_AMOUNT # add buffer for gas fee computation
gas_fee = "{:.18f}".format((gas_price * gas_limit) / pow(10, 18)).rstrip("0")
fee = [
composer.Coin(
composer.coin(
amount=gas_price * gas_limit,
denom=network.fee_denom,
)
Expand Down Expand Up @@ -150,7 +150,7 @@ async def main() -> None:
gas_limit = base_gas + GAS_FEE_BUFFER_AMOUNT # add buffer for gas fee computation
gas_fee = "{:.18f}".format((gas_price * gas_limit) / pow(10, 18)).rstrip("0")
fee = [
composer.Coin(
composer.coin(
amount=gas_price * gas_limit,
denom=network.fee_denom,
)
Expand Down Expand Up @@ -240,7 +240,7 @@ async def main() -> None:
gas_limit = base_gas + GAS_FEE_BUFFER_AMOUNT # add buffer for gas fee computation
gas_fee = "{:.18f}".format((gas_price * gas_limit) / pow(10, 18)).rstrip("0")
fee = [
composer.Coin(
composer.coin(
amount=gas_price * gas_limit,
denom=network.fee_denom,
)
Expand Down
2 changes: 1 addition & 1 deletion examples/chain_client/13_MsgIncreasePositionMargin.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ async def main() -> None:
gas_limit = int(sim_res["gasInfo"]["gasUsed"]) + GAS_FEE_BUFFER_AMOUNT # add buffer for gas fee computation
gas_fee = "{:.18f}".format((gas_price * gas_limit) / pow(10, 18)).rstrip("0")
fee = [
composer.Coin(
composer.coin(
amount=gas_price * gas_limit,
denom=network.fee_denom,
)
Expand Down
2 changes: 1 addition & 1 deletion examples/chain_client/15_MsgWithdraw.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ async def main() -> None:
gas_limit = int(sim_res["gasInfo"]["gasUsed"]) + GAS_FEE_BUFFER_AMOUNT # add buffer for gas fee computation
gas_fee = "{:.18f}".format((gas_price * gas_limit) / pow(10, 18)).rstrip("0")
fee = [
composer.Coin(
composer.coin(
amount=gas_price * gas_limit,
denom=network.fee_denom,
)
Expand Down
2 changes: 1 addition & 1 deletion examples/chain_client/16_MsgSubaccountTransfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ async def main() -> None:
gas_limit = int(sim_res["gasInfo"]["gasUsed"]) + GAS_FEE_BUFFER_AMOUNT # add buffer for gas fee computation
gas_fee = "{:.18f}".format((gas_price * gas_limit) / pow(10, 18)).rstrip("0")
fee = [
composer.Coin(
composer.coin(
amount=gas_price * gas_limit,
denom=network.fee_denom,
)
Expand Down
2 changes: 1 addition & 1 deletion examples/chain_client/17_MsgBatchUpdateOrders.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ async def main() -> None:
gas_limit = int(sim_res["gasInfo"]["gasUsed"]) + GAS_FEE_BUFFER_AMOUNT # add buffer for gas fee computation
gas_fee = "{:.18f}".format((gas_price * gas_limit) / pow(10, 18)).rstrip("0")
fee = [
composer.Coin(
composer.coin(
amount=gas_price * gas_limit,
denom=network.fee_denom,
)
Expand Down
2 changes: 1 addition & 1 deletion examples/chain_client/18_MsgBid.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ async def main() -> None:
gas_limit = int(sim_res["gasInfo"]["gasUsed"]) + GAS_FEE_BUFFER_AMOUNT # add buffer for gas fee computation
gas_fee = "{:.18f}".format((gas_price * gas_limit) / pow(10, 18)).rstrip("0")
fee = [
composer.Coin(
composer.coin(
amount=gas_price * gas_limit,
denom=network.fee_denom,
)
Expand Down
2 changes: 1 addition & 1 deletion examples/chain_client/19_MsgGrant.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ async def main() -> None:
gas_limit = int(sim_res["gasInfo"]["gasUsed"]) + GAS_FEE_BUFFER_AMOUNT # add buffer for gas fee computation
gas_fee = "{:.18f}".format((gas_price * gas_limit) / pow(10, 18)).rstrip("0")
fee = [
composer.Coin(
composer.coin(
amount=gas_price * gas_limit,
denom=network.fee_denom,
)
Expand Down
2 changes: 1 addition & 1 deletion examples/chain_client/1_MsgSend.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ async def main() -> None:
gas_limit = int(sim_res["gasInfo"]["gasUsed"]) + GAS_FEE_BUFFER_AMOUNT # add buffer for gas fee computation
gas_fee = "{:.18f}".format((gas_price * gas_limit) / pow(10, 18)).rstrip("0")
fee = [
composer.Coin(
composer.coin(
amount=gas_price * gas_limit,
denom=network.fee_denom,
)
Expand Down
2 changes: 1 addition & 1 deletion examples/chain_client/20_MsgExec.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ async def main() -> None:
gas_limit = int(sim_res["gasInfo"]["gasUsed"]) + GAS_FEE_BUFFER_AMOUNT # add buffer for gas fee computation
gas_fee = "{:.18f}".format((gas_price * gas_limit) / pow(10, 18)).rstrip("0")
fee = [
composer.Coin(
composer.coin(
amount=gas_price * gas_limit,
denom=network.fee_denom,
)
Expand Down
2 changes: 1 addition & 1 deletion examples/chain_client/21_MsgRevoke.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ async def main() -> None:
gas_limit = int(sim_res["gasInfo"]["gasUsed"]) + GAS_FEE_BUFFER_AMOUNT # add buffer for gas fee computation
gas_fee = "{:.18f}".format((gas_price * gas_limit) / pow(10, 18)).rstrip("0")
fee = [
composer.Coin(
composer.coin(
amount=gas_price * gas_limit,
denom=network.fee_denom,
)
Expand Down
2 changes: 1 addition & 1 deletion examples/chain_client/22_MsgSendToEth.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ async def main() -> None:
gas_limit = int(sim_res["gasInfo"]["gasUsed"]) + GAS_FEE_BUFFER_AMOUNT # add buffer for gas fee computation
gas_fee = "{:.18f}".format((gas_price * gas_limit) / pow(10, 18)).rstrip("0")
fee = [
composer.Coin(
composer.coin(
amount=gas_price * gas_limit,
denom=network.fee_denom,
)
Expand Down
2 changes: 1 addition & 1 deletion examples/chain_client/23_MsgRelayPriceFeedPrice.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ async def main() -> None:
gas_limit = int(sim_res["gasInfo"]["gasUsed"]) + GAS_FEE_BUFFER_AMOUNT # add buffer for gas fee computation
gas_fee = "{:.18f}".format((gas_price * gas_limit) / pow(10, 18)).rstrip("0")
fee = [
composer.Coin(
composer.coin(
amount=gas_price * gas_limit,
denom=network.fee_denom,
)
Expand Down
2 changes: 1 addition & 1 deletion examples/chain_client/24_MsgRewardsOptOut.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ async def main() -> None:
gas_limit = int(sim_res["gasInfo"]["gasUsed"]) + GAS_FEE_BUFFER_AMOUNT # add buffer for gas fee computation
gas_fee = "{:.18f}".format((gas_price * gas_limit) / pow(10, 18)).rstrip("0")
fee = [
composer.Coin(
composer.coin(
amount=gas_price * gas_limit,
denom=network.fee_denom,
)
Expand Down
2 changes: 1 addition & 1 deletion examples/chain_client/25_MsgDelegate.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ async def main() -> None:
gas_limit = int(sim_res["gasInfo"]["gasUsed"]) + GAS_FEE_BUFFER_AMOUNT # add buffer for gas fee computation
gas_fee = "{:.18f}".format((gas_price * gas_limit) / pow(10, 18)).rstrip("0")
fee = [
composer.Coin(
composer.coin(
amount=gas_price * gas_limit,
denom=network.fee_denom,
)
Expand Down
81 changes: 0 additions & 81 deletions examples/chain_client/26_MsgWithdrawDelegatorReward.py

This file was deleted.

2 changes: 1 addition & 1 deletion examples/chain_client/2_MsgDeposit.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ async def main() -> None:
gas_limit = int(sim_res["gasInfo"]["gasUsed"]) + GAS_FEE_BUFFER_AMOUNT # add buffer for gas fee computation
gas_fee = "{:.18f}".format((gas_price * gas_limit) / pow(10, 18)).rstrip("0")
fee = [
composer.Coin(
composer.coin(
amount=gas_price * gas_limit,
denom=network.fee_denom,
)
Expand Down
2 changes: 1 addition & 1 deletion examples/chain_client/30_ExternalTransfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ async def main() -> None:
gas_limit = int(sim_res["gasInfo"]["gasUsed"]) + GAS_FEE_BUFFER_AMOUNT # add buffer for gas fee computation
gas_fee = "{:.18f}".format((gas_price * gas_limit) / pow(10, 18)).rstrip("0")
fee = [
composer.Coin(
composer.coin(
amount=gas_price * gas_limit,
denom=network.fee_denom,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ async def main() -> None:
gas_limit = int(sim_res["gasInfo"]["gasUsed"]) + GAS_FEE_BUFFER_AMOUNT # add buffer for gas fee computation
gas_fee = "{:.18f}".format((gas_price * gas_limit) / pow(10, 18)).rstrip("0")
fee = [
composer.Coin(
composer.coin(
amount=gas_price * gas_limit,
denom=network.fee_denom,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ async def main() -> None:
gas_limit = int(sim_res["gasInfo"]["gasUsed"]) + GAS_FEE_BUFFER_AMOUNT # add buffer for gas fee computation
gas_fee = "{:.18f}".format((gas_price * gas_limit) / pow(10, 18)).rstrip("0")
fee = [
composer.Coin(
composer.coin(
amount=gas_price * gas_limit,
denom=network.fee_denom,
)
Expand Down
2 changes: 1 addition & 1 deletion examples/chain_client/33_MsgCancelBinaryOptionsOrder.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ async def main() -> None:
gas_limit = int(sim_res["gasInfo"]["gasUsed"]) + GAS_FEE_BUFFER_AMOUNT # add buffer for gas fee computation
gas_fee = "{:.18f}".format((gas_price * gas_limit) / pow(10, 18)).rstrip("0")
fee = [
composer.Coin(
composer.coin(
amount=gas_price * gas_limit,
denom=network.fee_denom,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ async def main() -> None:
gas_limit = int(sim_res["gasInfo"]["gasUsed"]) + GAS_FEE_BUFFER_AMOUNT # add buffer for gas fee computation
gas_fee = "{:.18f}".format((gas_price * gas_limit) / pow(10, 18)).rstrip("0")
fee = [
composer.Coin(
composer.coin(
amount=gas_price * gas_limit,
denom=network.fee_denom,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ async def main() -> None:
gas_limit = int(sim_res["gasInfo"]["gasUsed"]) + GAS_FEE_BUFFER_AMOUNT # add buffer for gas fee computation
gas_fee = "{:.18f}".format((gas_price * gas_limit) / pow(10, 18)).rstrip("0")
fee = [
composer.Coin(
composer.coin(
amount=gas_price * gas_limit,
denom=network.fee_denom,
)
Expand Down
2 changes: 1 addition & 1 deletion examples/chain_client/36_MsgRelayProviderPrices.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ async def main() -> None:
gas_limit = int(sim_res["gasInfo"]["gasUsed"]) + GAS_FEE_BUFFER_AMOUNT # add buffer for gas fee computation
gas_fee = "{:.18f}".format((gas_price * gas_limit) / pow(10, 18)).rstrip("0")
fee = [
composer.Coin(
composer.coin(
amount=gas_price * gas_limit,
denom=network.fee_denom,
)
Expand Down
2 changes: 1 addition & 1 deletion examples/chain_client/3_MsgCreateSpotLimitOrder.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ async def main() -> None:
gas_limit = int(sim_res["gasInfo"]["gasUsed"]) + GAS_FEE_BUFFER_AMOUNT # add buffer for gas fee computation
gas_fee = "{:.18f}".format((gas_price * gas_limit) / pow(10, 18)).rstrip("0")
fee = [
composer.Coin(
composer.coin(
amount=gas_price * gas_limit,
denom=network.fee_denom,
)
Expand Down
8 changes: 4 additions & 4 deletions examples/chain_client/40_MsgExecuteContract.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ async def main() -> None:
# prepare tx msg
# NOTE: COIN MUST BE SORTED IN ALPHABETICAL ORDER BY DENOMS
funds = [
composer.Coin(
composer.coin(
amount=69,
denom="factory/inj1hdvy6tl89llqy3ze8lv6mz5qh66sx9enn0jxg6/inj12ngevx045zpvacus9s6anr258gkwpmthnz80e9",
),
composer.Coin(amount=420, denom="peggy0x44C21afAaF20c270EBbF5914Cfc3b5022173FEB7"),
composer.Coin(amount=1, denom="peggy0x87aB3B4C8661e07D6372361211B96ed4Dc36B1B5"),
composer.coin(amount=420, denom="peggy0x44C21afAaF20c270EBbF5914Cfc3b5022173FEB7"),
composer.coin(amount=1, denom="peggy0x87aB3B4C8661e07D6372361211B96ed4Dc36B1B5"),
]
msg = composer.MsgExecuteContract(
sender=address.to_acc_bech32(),
Expand Down Expand Up @@ -71,7 +71,7 @@ async def main() -> None:
gas_limit = int(sim_res["gasInfo"]["gasUsed"]) + GAS_FEE_BUFFER_AMOUNT # add buffer for gas fee computation
gas_fee = "{:.18f}".format((gas_price * gas_limit) / pow(10, 18)).rstrip("0")
fee = [
composer.Coin(
composer.coin(
amount=gas_price * gas_limit,
denom=network.fee_denom,
)
Expand Down
2 changes: 1 addition & 1 deletion examples/chain_client/41_MsgCreateInsuranceFund.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ async def main() -> None:
gas_limit = int(sim_res["gasInfo"]["gasUsed"]) + GAS_FEE_BUFFER_AMOUNT # add buffer for gas fee computation
gas_fee = "{:.18f}".format((gas_price * gas_limit) / pow(10, 18)).rstrip("0")
fee = [
composer.Coin(
composer.coin(
amount=gas_price * gas_limit,
denom=network.fee_denom,
)
Expand Down
2 changes: 1 addition & 1 deletion examples/chain_client/42_MsgUnderwrite.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ async def main() -> None:
gas_limit = int(sim_res["gasInfo"]["gasUsed"]) + GAS_FEE_BUFFER_AMOUNT # add buffer for gas fee computation
gas_fee = "{:.18f}".format((gas_price * gas_limit) / pow(10, 18)).rstrip("0")
fee = [
composer.Coin(
composer.coin(
amount=gas_price * gas_limit,
denom=network.fee_denom,
)
Expand Down
2 changes: 1 addition & 1 deletion examples/chain_client/43_MsgRequestRedemption.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ async def main() -> None:
gas_limit = int(sim_res["gasInfo"]["gasUsed"]) + GAS_FEE_BUFFER_AMOUNT # add buffer for gas fee computation
gas_fee = "{:.18f}".format((gas_price * gas_limit) / pow(10, 18)).rstrip("0")
fee = [
composer.Coin(
composer.coin(
amount=gas_price * gas_limit,
denom=network.fee_denom,
)
Expand Down
Loading

0 comments on commit 0c61c63

Please sign in to comment.