-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #332 from InjectiveLabs/feat/update_dependencies_c…
…hain_v1_13 feat/update_dependencies_chain_v1_13
- Loading branch information
Showing
726 changed files
with
42,367 additions
and
17,442 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
version: v2 | ||
managed: | ||
enabled: true | ||
plugins: | ||
- remote: buf.build/protocolbuffers/python | ||
out: ./pyinjective/proto/ | ||
- remote: buf.build/grpc/python | ||
out: ./pyinjective/proto/ | ||
inputs: | ||
- module: buf.build/cosmos/cosmos-proto | ||
- module: buf.build/cosmos/gogo-proto | ||
- module: buf.build/googleapis/googleapis | ||
- module: buf.build/cosmos/ics23 | ||
- git_repo: https://github.com/InjectiveLabs/cosmos-sdk | ||
tag: v0.50.8-inj-0 | ||
- git_repo: https://github.com/InjectiveLabs/ibc-go | ||
tag: v8.3.2-inj-0 | ||
- git_repo: https://github.com/InjectiveLabs/wasmd | ||
tag: v0.51.0-inj-0 | ||
# - git_repo: https://github.com/InjectiveLabs/wasmd | ||
# branch: v0.51.x-inj | ||
# subdir: proto | ||
- git_repo: https://github.com/InjectiveLabs/injective-core | ||
tag: v1.13.0 | ||
subdir: proto | ||
# - git_repo: https://github.com/InjectiveLabs/injective-core | ||
# branch: master | ||
# subdir: proto | ||
- directory: proto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import asyncio | ||
import os | ||
|
||
import dotenv | ||
|
||
from pyinjective.composer import Composer as ProtoMsgComposer | ||
from pyinjective.core.broadcaster import MsgBroadcasterWithPk | ||
from pyinjective.core.network import Network | ||
from pyinjective.wallet import PrivateKey | ||
|
||
|
||
async def main() -> None: | ||
dotenv.load_dotenv() | ||
private_key_in_hexa = os.getenv("INJECTIVE_PRIVATE_KEY") | ||
|
||
# select network: local, testnet, mainnet | ||
network = Network.devnet() | ||
composer = ProtoMsgComposer(network=network.string()) | ||
|
||
message_broadcaster = MsgBroadcasterWithPk.new_using_simulation( | ||
network=network, | ||
private_key=private_key_in_hexa, | ||
) | ||
|
||
priv_key = PrivateKey.from_hex(private_key_in_hexa) | ||
pub_key = priv_key.to_public_key() | ||
address = pub_key.to_address() | ||
|
||
blocked_address = "inj1hkhdaj2a2clmq5jq6mspsggqs32vynpk228q3r" | ||
denom = "factory/inj1hkhdaj2a2clmq5jq6mspsggqs32vynpk228q3r/inj_test" | ||
role1 = composer.permissions_role( | ||
role=composer.DEFAULT_PERMISSIONS_EVERYONE_ROLE, | ||
permissions=composer.MINT_ACTION_PERMISSION | ||
| composer.RECEIVE_ACTION_PERMISSION | ||
| composer.BURN_ACTION_PERMISSION, | ||
) | ||
role2 = composer.permissions_role(role="blacklisted", permissions=composer.UNDEFINED_ACTION_PERMISSION) | ||
address_role1 = composer.permissions_address_roles(address=blocked_address, roles=["blacklisted"]) | ||
|
||
message = composer.msg_create_namespace( | ||
sender=address.to_acc_bech32(), | ||
denom=denom, | ||
wasm_hook="", | ||
mints_paused=False, | ||
sends_paused=False, | ||
burns_paused=False, | ||
role_permissions=[role1, role2], | ||
address_roles=[address_role1], | ||
) | ||
|
||
# broadcast the transaction | ||
result = await message_broadcaster.broadcast([message]) | ||
print("---Transaction Response---") | ||
print(result) | ||
|
||
|
||
if __name__ == "__main__": | ||
asyncio.get_event_loop().run_until_complete(main()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import asyncio | ||
import os | ||
|
||
import dotenv | ||
|
||
from pyinjective.composer import Composer as ProtoMsgComposer | ||
from pyinjective.core.broadcaster import MsgBroadcasterWithPk | ||
from pyinjective.core.network import Network | ||
from pyinjective.wallet import PrivateKey | ||
|
||
|
||
async def main() -> None: | ||
dotenv.load_dotenv() | ||
private_key_in_hexa = os.getenv("INJECTIVE_PRIVATE_KEY") | ||
|
||
# select network: local, testnet, mainnet | ||
network = Network.devnet() | ||
composer = ProtoMsgComposer(network=network.string()) | ||
|
||
message_broadcaster = MsgBroadcasterWithPk.new_using_simulation( | ||
network=network, | ||
private_key=private_key_in_hexa, | ||
) | ||
|
||
priv_key = PrivateKey.from_hex(private_key_in_hexa) | ||
pub_key = priv_key.to_public_key() | ||
address = pub_key.to_address() | ||
|
||
denom = "factory/inj1hkhdaj2a2clmq5jq6mspsggqs32vynpk228q3r/inj_test" | ||
message = composer.msg_delete_namespace( | ||
sender=address.to_acc_bech32(), | ||
namespace_denom=denom, | ||
) | ||
|
||
# broadcast the transaction | ||
result = await message_broadcaster.broadcast([message]) | ||
print("---Transaction Response---") | ||
print(result) | ||
|
||
|
||
if __name__ == "__main__": | ||
asyncio.get_event_loop().run_until_complete(main()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import asyncio | ||
import os | ||
|
||
import dotenv | ||
|
||
from pyinjective.composer import Composer as ProtoMsgComposer | ||
from pyinjective.core.broadcaster import MsgBroadcasterWithPk | ||
from pyinjective.core.network import Network | ||
from pyinjective.wallet import PrivateKey | ||
|
||
|
||
async def main() -> None: | ||
dotenv.load_dotenv() | ||
private_key_in_hexa = os.getenv("INJECTIVE_PRIVATE_KEY") | ||
|
||
# select network: local, testnet, mainnet | ||
network = Network.devnet() | ||
composer = ProtoMsgComposer(network=network.string()) | ||
|
||
message_broadcaster = MsgBroadcasterWithPk.new_using_simulation( | ||
network=network, | ||
private_key=private_key_in_hexa, | ||
) | ||
|
||
priv_key = PrivateKey.from_hex(private_key_in_hexa) | ||
pub_key = priv_key.to_public_key() | ||
address = pub_key.to_address() | ||
|
||
denom = "factory/inj1hkhdaj2a2clmq5jq6mspsggqs32vynpk228q3r/inj_test" | ||
|
||
message = composer.msg_update_namespace( | ||
sender=address.to_acc_bech32(), | ||
namespace_denom=denom, | ||
wasm_hook="inj19ld6swyldyujcn72j7ugnu9twafhs9wxlyye5m", | ||
mints_paused=True, | ||
sends_paused=True, | ||
burns_paused=True, | ||
) | ||
|
||
# broadcast the transaction | ||
result = await message_broadcaster.broadcast([message]) | ||
print("---Transaction Response---") | ||
print(result) | ||
|
||
|
||
if __name__ == "__main__": | ||
asyncio.get_event_loop().run_until_complete(main()) |
52 changes: 52 additions & 0 deletions
52
examples/chain_client/permissions/4_MsgUpdateNamespaceRoles.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import asyncio | ||
import os | ||
|
||
import dotenv | ||
|
||
from pyinjective.composer import Composer as ProtoMsgComposer | ||
from pyinjective.core.broadcaster import MsgBroadcasterWithPk | ||
from pyinjective.core.network import Network | ||
from pyinjective.wallet import PrivateKey | ||
|
||
|
||
async def main() -> None: | ||
dotenv.load_dotenv() | ||
private_key_in_hexa = os.getenv("INJECTIVE_PRIVATE_KEY") | ||
|
||
# select network: local, testnet, mainnet | ||
network = Network.devnet() | ||
composer = ProtoMsgComposer(network=network.string()) | ||
|
||
message_broadcaster = MsgBroadcasterWithPk.new_using_simulation( | ||
network=network, | ||
private_key=private_key_in_hexa, | ||
) | ||
|
||
priv_key = PrivateKey.from_hex(private_key_in_hexa) | ||
pub_key = priv_key.to_public_key() | ||
address = pub_key.to_address() | ||
|
||
blocked_address = "inj1hkhdaj2a2clmq5jq6mspsggqs32vynpk228q3r" | ||
denom = "factory/inj1hkhdaj2a2clmq5jq6mspsggqs32vynpk228q3r/inj_test" | ||
role1 = composer.permissions_role( | ||
role=composer.DEFAULT_PERMISSIONS_EVERYONE_ROLE, | ||
permissions=composer.RECEIVE_ACTION_PERMISSION, | ||
) | ||
role2 = composer.permissions_role(role="blacklisted", permissions=composer.UNDEFINED_ACTION_PERMISSION) | ||
address_role1 = composer.permissions_address_roles(address=blocked_address, roles=["blacklisted"]) | ||
|
||
message = composer.msg_update_namespace_roles( | ||
sender=address.to_acc_bech32(), | ||
namespace_denom=denom, | ||
role_permissions=[role1, role2], | ||
address_roles=[address_role1], | ||
) | ||
|
||
# broadcast the transaction | ||
result = await message_broadcaster.broadcast([message]) | ||
print("---Transaction Response---") | ||
print(result) | ||
|
||
|
||
if __name__ == "__main__": | ||
asyncio.get_event_loop().run_until_complete(main()) |
Oops, something went wrong.