Skip to content

Commit

Permalink
Problem: wrong description on empty flag when create validator (#128)
Browse files Browse the repository at this point in the history
* Problem: wrong description on empty flag when create validator

* align edit

* align transfer
  • Loading branch information
mmsqe authored Apr 23, 2024
1 parent 4704c4a commit 9fa1e71
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 20 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
- [#117](https://github.com/crypto-com/pystarport/pull/117) make event_query_tx_for optional.
- [#121](https://github.com/crypto-com/pystarport/pull/121), [#122](https://github.com/crypto-com/pystarport/pull/122), [#125](https://github.com/crypto-com/pystarport/pull/125) Support sdk 0.50.
- [#127](https://github.com/crypto-com/pystarport/pull/127) Support adding new key when patching config
- [#128](https://github.com/crypto-com/pystarport/pull/128) fix wrong description on empty flag when create validator and align flags for edit validator.

*Feb 7, 2023*

Expand Down
16 changes: 6 additions & 10 deletions pystarport/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,16 +416,16 @@ def transfer(
coins,
i=0,
generate_only=False,
fees=None,
event_query_tx=True,
**kwargs,
):
return self.cosmos_cli(i).transfer(
from_,
to,
coins,
generate_only,
fees,
event_query_tx=event_query_tx,
**kwargs,
)

def transfer_from_ledger(
Expand Down Expand Up @@ -554,11 +554,8 @@ def create_validator(
commission_rate="0.1",
commission_max_rate="0.2",
min_self_delegation="1",
identity="",
website="",
security_contact="",
details="",
event_query_tx=True,
**kwargs,
):
"""MsgCreateValidator
create the node with create_node before call this"""
Expand All @@ -569,11 +566,8 @@ def create_validator(
commission_rate,
commission_max_rate,
min_self_delegation,
identity,
website,
security_contact,
details,
event_query_tx=event_query_tx,
**kwargs,
)

def edit_validator(
Expand All @@ -586,6 +580,7 @@ def edit_validator(
security_contact=None,
details=None,
event_query_tx=True,
**kwargs,
):
"""MsgEditValidator"""
return self.cosmos_cli(i).edit_validator(
Expand All @@ -596,6 +591,7 @@ def edit_validator(
security_contact,
details,
event_query_tx=event_query_tx,
**kwargs,
)

def gov_propose(self, proposer, kind, proposal, i=0):
Expand Down
16 changes: 6 additions & 10 deletions pystarport/cosmoscli.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,8 +346,8 @@ def transfer(
to,
coins,
generate_only=False,
fees=None,
event_query_tx=True,
**kwargs,
):
rsp = json.loads(
self.raw(
Expand All @@ -363,7 +363,7 @@ def transfer(
keyring_backend="test",
chain_id=self.chain_id,
node=self.node_rpc,
fees=fees,
**kwargs,
)
)
if not generate_only and rsp["code"] == 0 and event_query_tx:
Expand Down Expand Up @@ -660,11 +660,8 @@ def create_validator(
commission_rate="0.1",
commission_max_rate="0.2",
min_self_delegation="1",
identity="",
website="",
security_contact="",
details="",
event_query_tx=True,
**kwargs,
):
"""MsgCreateValidator
create the node with create_node before call this"""
Expand Down Expand Up @@ -697,15 +694,12 @@ def create_validator(
commission_max_change_rate=commission_max_change_rate,
# description
moniker=moniker,
identity=identity,
website=website,
security_contact=security_contact,
details=details,
# basic
home=self.data_dir,
node=self.node_rpc,
keyring_backend="test",
chain_id=self.chain_id,
**kwargs,
)
)
if rsp["code"] == 0 and event_query_tx:
Expand All @@ -721,6 +715,7 @@ def edit_validator(
security_contact=None,
details=None,
event_query_tx=True,
**kwargs,
):
"""MsgEditValidator"""
options = dict(
Expand All @@ -744,6 +739,7 @@ def edit_validator(
keyring_backend="test",
chain_id=self.chain_id,
**{k: v for k, v in options.items() if v is not None},
**kwargs,
)
)
if rsp["code"] == 0 and event_query_tx:
Expand Down

0 comments on commit 9fa1e71

Please sign in to comment.