Skip to content

Commit

Permalink
refactor: rename call_contract_method to send_transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
Den authored and Den committed Sep 10, 2024
1 parent 59a2ac2 commit 942121f
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion tests/common/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def get_transaction_by_id(transaction_id: str):
return raw_response.json()


def call_contract_method(
def send_transaction(
account: Account,
contract_address: str,
method_name: str,
Expand Down
6 changes: 3 additions & 3 deletions tests/integration/accounts/test_accounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
payload,
post_request_localhost,
wait_for_transaction,
call_contract_method,
send_transaction,
)


Expand Down Expand Up @@ -79,7 +79,7 @@ def test_accounts_transfers():

# Test transfer
transfer_amount = 200
_, transaction_response_call_1 = call_contract_method(
_, transaction_response_call_1 = send_transaction(
account_1, account_2.address, None, None, transfer_amount
)
assert has_success_status(transaction_response_call_1)
Expand Down Expand Up @@ -117,7 +117,7 @@ def test_accounts_burn():

# Test burn
burn_amount = 200
_, transaction_response_call_1 = call_contract_method(
_, transaction_response_call_1 = send_transaction(
account_1, None, None, None, burn_amount
)
assert has_success_status(transaction_response_call_1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from tests.common.request import (
deploy_intelligent_contract,
call_contract_method,
send_transaction,
payload,
post_request_localhost,
)
Expand Down Expand Up @@ -54,7 +54,7 @@ def test_football_prediction_market():
########################################
############# RESOLVE match ############
########################################
_, transaction_response_call_1 = call_contract_method(
_, transaction_response_call_1 = send_transaction(
from_account,
contract_address,
"resolve",
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/contract_examples/test_llm_erc20.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from tests.common.request import (
deploy_intelligent_contract,
call_contract_method,
send_transaction,
payload,
post_request_localhost,
)
Expand Down Expand Up @@ -73,7 +73,7 @@ def test_llm_erc20():
########################################
#### TRANSFER from User A to User B ####
########################################
_, transaction_response_call_1 = call_contract_method(
_, transaction_response_call_1 = send_transaction(
from_account_a,
contract_address,
"transfer",
Expand Down
12 changes: 6 additions & 6 deletions tests/integration/contract_examples/test_log_indexer.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from tests.common.request import (
deploy_intelligent_contract,
call_contract_method,
send_transaction,
payload,
post_request_localhost,
)
Expand Down Expand Up @@ -67,7 +67,7 @@ def test_log_indexer():
# ########################################
# ############## Add log 0 ###############
# ########################################
_, transaction_response_add_log_0 = call_contract_method(
_, transaction_response_add_log_0 = send_transaction(
from_account,
contract_address,
"add_log",
Expand Down Expand Up @@ -102,7 +102,7 @@ def test_log_indexer():
# ########################################
# ############## Add log 1 ###############
# ########################################
_, transaction_response_add_log_1 = call_contract_method(
_, transaction_response_add_log_1 = send_transaction(
from_account,
contract_address,
"add_log",
Expand All @@ -124,7 +124,7 @@ def test_log_indexer():
# ########################################
# ########### Update log 0 ##############
# ########################################
_, transaction_response_update_log_0 = call_contract_method(
_, transaction_response_update_log_0 = send_transaction(
from_account,
contract_address,
"update_log",
Expand All @@ -147,7 +147,7 @@ def test_log_indexer():
# ########################################
# ########### Remove log 0 ##############
# ########################################
_, transaction_response_remove_log_0 = call_contract_method(
_, transaction_response_remove_log_0 = send_transaction(
from_account,
contract_address,
"remove_log",
Expand All @@ -172,7 +172,7 @@ def test_log_indexer():
# ########################################

# Add third log
_, transaction_response_add_log_2 = call_contract_method(
_, transaction_response_add_log_2 = send_transaction(
from_account,
contract_address,
"add_log",
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/contract_examples/test_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from tests.common.request import (
deploy_intelligent_contract,
call_contract_method,
send_transaction,
payload,
post_request_localhost,
)
Expand Down Expand Up @@ -65,7 +65,7 @@ def test_storage():
assert contract_state_1["result"]["data"] == INITIAL_STATE

# Update State
_, transaction_response_call_1 = call_contract_method(
_, transaction_response_call_1 = send_transaction(
from_account, contract_address, "update_storage", [UPDATED_STATE]
)

Expand Down
8 changes: 4 additions & 4 deletions tests/integration/contract_examples/test_user_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from tests.common.request import (
deploy_intelligent_contract,
call_contract_method,
send_transaction,
payload,
post_request_localhost,
)
Expand Down Expand Up @@ -72,7 +72,7 @@ def test_user_storage():
########################################
########## ADD User A State ############
########################################
_, transaction_response_call_1 = call_contract_method(
_, transaction_response_call_1 = send_transaction(
from_account_a, contract_address, "update_storage", [INITIAL_STATE_USER_A]
)
assert has_success_status(transaction_response_call_1)
Expand Down Expand Up @@ -109,7 +109,7 @@ def test_user_storage():
########################################
########## ADD User B State ############
########################################
_, transaction_response_call_2 = call_contract_method(
_, transaction_response_call_2 = send_transaction(
from_account_b, contract_address, "update_storage", [INITIAL_STATE_USER_B]
)
assert has_success_status(transaction_response_call_2)
Expand All @@ -136,7 +136,7 @@ def test_user_storage():
#########################################
######### UPDATE User A State ###########
#########################################
_, transaction_response_call_3 = call_contract_method(
_, transaction_response_call_3 = send_transaction(
from_account_a, contract_address, "update_storage", [UPDATED_STATE_USER_A]
)
assert has_success_status(transaction_response_call_3)
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/contract_examples/test_wizard_of_coin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from tests.common.request import (
deploy_intelligent_contract,
call_contract_method,
send_transaction,
payload,
post_request_localhost,
)
Expand Down Expand Up @@ -51,7 +51,7 @@ def test_wizard_of_coin():
contract_address = call_method_response_deploy["result"]["data"]["contract_address"]

# Call Contract Function
_, transaction_response_call_1 = call_contract_method(
_, transaction_response_call_1 = send_transaction(
from_account,
contract_address,
"ask_for_coin",
Expand Down

0 comments on commit 942121f

Please sign in to comment.