Skip to content

Commit

Permalink
genesis_decode
Browse files Browse the repository at this point in the history
#13
  • Loading branch information
WizardsOrb committed Nov 12, 2019
1 parent 5d09d06 commit a9a3e21
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions casper/cli.py
Expand Up @@ -13,7 +13,7 @@ def __init__(self, settings):
else:
self.no_jormungandr = False

def _run(self, runstring, errorstring=None):
def _run(self, runstring, errorstring=None, raw=False):

try:
output = subprocess.check_output(
Expand All @@ -24,6 +24,9 @@ def _run(self, runstring, errorstring=None):

if output.find("failed to make a REST request") < -1:
return
if raw is True:
return output

return output.replace("\n", "")

except subprocess.CalledProcessError:
Expand Down Expand Up @@ -121,7 +124,8 @@ def message_logs(self, parse=False):

def genesis_decode(self):
decoded_genesis = self._run(
f"curl -s {self.node}/api/v0/block/{self.genesis} | jcli genesis decode"
f"curl -s {self.node}/api/v0/block/{self.genesis} | jcli genesis decode",
raw=True
)
return decoded_genesis

Expand Down

0 comments on commit a9a3e21

Please sign in to comment.