Skip to content

Commit f5b1167

Browse files
authored
refactor: rename wallets transaction methods (#133)
1 parent 7a12d5c commit f5b1167

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

client/api/wallets.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ def transactions(self, wallet_id, page=None, limit=100, **kwargs):
2929
}
3030
return self.with_endpoint('api').request_get(f'wallets/{wallet_id}/transactions', params)
3131

32-
def transactions_sent(self, wallet_id, page=None, limit=100):
32+
def sent_transactions(self, wallet_id, page=None, limit=100):
3333
params = {
3434
'page': page,
3535
'limit': limit,
3636
}
3737
return self.with_endpoint('api').request_get(f'wallets/{wallet_id}/transactions/sent', params)
3838

39-
def transactions_received(self, wallet_id, page=None, limit=100):
39+
def received_transactions(self, wallet_id, page=None, limit=100):
4040
params = {
4141
'page': page,
4242
'limit': limit,

tests/api/test_wallets.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def test_transactions_calls_correct_url_with_passed_in_params():
134134
assert 'limit=69' in responses.calls[0].request.url
135135

136136

137-
def test_transactions_sent_calls_correct_url_with_default_params():
137+
def test_sent_transactions_calls_correct_url_with_default_params():
138138
wallet_id = '12345'
139139
responses.add(
140140
responses.GET,
@@ -144,14 +144,14 @@ def test_transactions_sent_calls_correct_url_with_default_params():
144144
)
145145

146146
client = ArkClient('http://127.0.0.1:4002/api')
147-
client.wallets.transactions_sent(wallet_id)
147+
client.wallets.sent_transactions(wallet_id)
148148
assert len(responses.calls) == 1
149149
assert responses.calls[0].request.url == (
150150
'http://127.0.0.1:4002/api/wallets/12345/transactions/sent?limit=100'
151151
)
152152

153153

154-
def test_transactions_sent_calls_correct_url_with_passed_in_params():
154+
def test_sent_transactions_calls_correct_url_with_passed_in_params():
155155
wallet_id = '12345'
156156
responses.add(
157157
responses.GET,
@@ -161,7 +161,7 @@ def test_transactions_sent_calls_correct_url_with_passed_in_params():
161161
)
162162

163163
client = ArkClient('http://127.0.0.1:4002/api')
164-
client.wallets.transactions_sent(wallet_id, page=5, limit=69)
164+
client.wallets.sent_transactions(wallet_id, page=5, limit=69)
165165
assert len(responses.calls) == 1
166166
assert responses.calls[0].request.url.startswith(
167167
'http://127.0.0.1:4002/api/wallets/12345/transactions/sent?'
@@ -170,7 +170,7 @@ def test_transactions_sent_calls_correct_url_with_passed_in_params():
170170
assert 'limit=69' in responses.calls[0].request.url
171171

172172

173-
def test_transactions_received_calls_correct_url_with_default_params():
173+
def test_received_transactions_calls_correct_url_with_default_params():
174174
wallet_id = '12345'
175175
responses.add(
176176
responses.GET,
@@ -180,14 +180,14 @@ def test_transactions_received_calls_correct_url_with_default_params():
180180
)
181181

182182
client = ArkClient('http://127.0.0.1:4002/api')
183-
client.wallets.transactions_received(wallet_id)
183+
client.wallets.received_transactions(wallet_id)
184184
assert len(responses.calls) == 1
185185
assert responses.calls[0].request.url == (
186186
'http://127.0.0.1:4002/api/wallets/12345/transactions/received?limit=100'
187187
)
188188

189189

190-
def test_transactions_received_calls_correct_url_with_passed_in_params():
190+
def test_received_transactions_calls_correct_url_with_passed_in_params():
191191
wallet_id = '12345'
192192
responses.add(
193193
responses.GET,
@@ -197,7 +197,7 @@ def test_transactions_received_calls_correct_url_with_passed_in_params():
197197
)
198198

199199
client = ArkClient('http://127.0.0.1:4002/api')
200-
client.wallets.transactions_received(wallet_id, page=5, limit=69)
200+
client.wallets.received_transactions(wallet_id, page=5, limit=69)
201201
assert len(responses.calls) == 1
202202
assert responses.calls[0].request.url.startswith(
203203
'http://127.0.0.1:4002/api/wallets/12345/transactions/received?'

0 commit comments

Comments
 (0)