Skip to content

Commit 6cde8cd

Browse files
author
John Doe
committed
Let raw winston be passed to and received from Peer object
1 parent dbf0fa4 commit 6cde8cd

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

arweave/arweave_lib.py

+8-5
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def price(self, data_size=0, target_address=None):
102102
response = self._get("{}/price/{}/{}", data_size, target_address)
103103
else:
104104
response = self._get("{}/price/{}", data_size)
105-
return winston_to_ar(response.text)
105+
return response.text
106106

107107
def send(self, json_data):
108108
"""Submit a Transaction"""
@@ -112,7 +112,7 @@ def send(self, json_data):
112112
def wallet_balance(self, address):
113113
"""Get a Wallet Balance"""
114114
response = self._get("{}/wallet/{}/balance", address)
115-
return winston_to_ar(response.text)
115+
return response.text
116116

117117
def tx_anchor(self):
118118
# TODO: the docs say this should be https://arweave.net/wallet/{address}/last_tx
@@ -193,7 +193,8 @@ def from_data(cls, jwk_data):
193193

194194
@property
195195
def balance(self):
196-
return self.peer.wallet_balance(self.address)
196+
balance = self.peer.wallet_balance(self.address)
197+
return winston_to_ar(balance)
197198

198199
def sign(self, message):
199200
h = SHA256.new(message)
@@ -283,7 +284,8 @@ def from_serialized_transaction(self, transaction_json):
283284
"Please supply a string containing json to initialize a serialized transaction")
284285

285286
def get_reward(self, data_size, target_address=None):
286-
return self.peer.price(data_size, target_address)
287+
reward = self.peer.price(data_size, target_address)
288+
return winston_to_ar(reward)
287289

288290
def add_tag(self, name, value):
289291
tag = create_tag(name, value, self.format == 2)
@@ -420,7 +422,8 @@ def get_transaction(self):
420422

421423
def get_price(self):
422424
try:
423-
return self.peer.price(self.data_size)
425+
price = self.peer.price(self.data_size)
426+
return winston_to_ar(price)
424427
except TransactionException as exception:
425428
pass
426429

0 commit comments

Comments
 (0)