blocknetdx / eth-payment-processor

eth-payment-processor
3 stars 4 forks source link

Activate project w/ aBLOCK payment failed #22

Closed ConanMishler closed 2 years ago

ConanMishler commented 2 years ago

I don't know that we've tested whether it works to activate a new project with an aBLOCK payment, so I decided to test it (even though it cost me $10 in eth gas fees to send the aBLOCK!)

Here's what I did:

  1. I adjusted my DISCOUNT_ABLOCK value to 95%, then restarted the payment processor.
  2. I requested a new project and got this reply:
    {
    "result": {
        "api_key": "P2kLB9PpK2Be_PzG6u97pTnVkjaVVGFChDNv2e9vm2A",
        "expiry_time": "2022-02-14 04:00:26 EST",
        "payment_amount_tier1_aablock": 64.7457,
        "payment_amount_tier1_ablock": 1.367188,
        "payment_amount_tier1_eth": 0.012199,
        "payment_amount_tier2_aablock": 369.975426,
        "payment_amount_tier2_ablock": 7.8125,
        "payment_amount_tier2_eth": 0.069709,
        "payment_avax_address": "0x56f9F4a48c4D614b51C6036BE53d7dd89Aa90a1e",
        "payment_eth_address": "0xb847f6734975D99EB90E819DfEDfE666b4A15CD0",
        "project_id": "8ff20bd2-3505-4ff2-826a-dbd6a36fa481"
    }
    }
  3. I sent 1.367188 aBLOCK to 0xb847f6734975D99EB90E819DfEDfE666b4A15CD0
  4. I invoked the list_projects call to see if my new project had become active. It had not become active.
  5. I checked logs of exrproxy-env_eth_payment_api_1 container and found error messages like this:
    [2022-02-14:00:39:29] CRITICAL - error handling eth back event
    Traceback (most recent call last):
    File "/app/manager/util/eth_payments.py", line 164, in eth_start_back
    self.handle_eth_events(events)
    File "<string>", line 2, in handle_eth_events
    File "/usr/local/lib/python3.8/site-packages/pony/orm/core.py", line 533, in new_func
    result = func(*args, **kwargs)
    File "/app/manager/util/eth_payments.py", line 246, in handle_eth_events
    self.handle_eth_event(event)
    File "/app/manager/util/eth_payments.py", line 283, in handle_eth_event
    ablock_accounts = self.check_ablock_balance()
    File "/app/manager/util/eth_payments.py", line 266, in check_ablock_balance
    balance_contract = self.contract_ablock.functions.balanceOf(contract_address).call()
    File "/usr/local/lib/python3.8/site-packages/web3/contract.py", line 878, in __call__
    clone._set_function_info()
    File "/usr/local/lib/python3.8/site-packages/web3/contract.py", line 883, in _set_function_info
    self.abi = find_matching_fn_abi(
    File "/usr/local/lib/python3.8/site-packages/web3/_utils/contracts.py", line 163, in find_matching_fn_abi
    raise ValidationError(message)
    web3.exceptions.ValidationError: 
    Could not identify the intended function with name `balanceOf`, positional argument(s) of type `(<class 'str'>,)` and keyword argument(s) of type `{}`.
    Found 1 function(s) with the name `balanceOf`: ['balanceOf(address)']
    Function invocation failed due to no matching argument types.

    This was on my VPS4 if you want to login and poke around.

ConanMishler commented 2 years ago

This issue seems to be fixed by https://github.com/blocknetdx/eth-payment-processor/pull/23. However, I want to test aBLOCK payments again after ETH payments are working, just to confirm aBLOCK payments still work.