stampchain-io / btc_stamps

Bitcoin Stamps Indexer
https://stampchain.io
GNU Affero General Public License v3.0
14 stars 5 forks source link

Branch `bitname/testnet` An exception occurs when the price field of the domain is `""`(blank characters) during deploy, resulting in the program terminating unexpectedly. #432

Closed btcopenstamp closed 1 week ago

btcopenstamp commented 1 month ago

Describe the bug An exception occurs when the price field of the domain is ""(blank characters) during deploy, resulting in the program terminating unexpectedly.

Branch/Release/Commit Hash of Problem Branch bitname/testnet.

To Reproduce Steps to reproduce the behavior:

  1. Deploy with price ""(blank characters).

Expected behavior The program can continue running without terminating.

Screenshots

Block: 3082036 (1.24s, hashes: L:N/A / TX:b9876 / M:ac6a2 / S:0 / S20:0)
Error in deploy operations: object of type 'NoneType' has no len()
An unexpected error occurred: object of type 'NoneType' has no len()

Additional context

  1. Deploy information:

    {
        "p": "src-101",
        "op": "deploy",
        "root": "btc",
        "name": "Bit Name Service",
        "lim": "10",
        "owner": "tb1q3nyw4jlmvsczyz3xc3yqc7rr7nvxfnudp49laq",
        "rec": [
            "tb1q3nyw4jlmvsczyz3xc3yqc7rr7nvxfnudp49laq",
            "tb1qs2hmngp9lescxsd5pxj68en04v8w2guc7nlsa9"
        ],
        "tick": "BNS",
        "pri": "",
        "desc": "Bitname Service powered by BTC stamp.",
        "mintstart": "0",
        "mintend": "18446744073709551615",
        "wla": "0317ac27154373716ab3bce4f170211446e7598c69ae3a90f058c831c56308323c",
        "imglp": "https://testnet.img.bitname.pro/img/",
        "imgf": "btc.png",
        "idua": "999"
    }
  2. The location where the code execution failed: https://github.com/stampchain-io/btc_stamps/blob/f43eb41acab2302be0c5287aac35828bbbddb05c/indexer/src/index_core/src101.py#L375

Similarly, there are many scenarios of program robustness errors caused by missing fields or illegal fields that need further testing and improvement.

By the way, the test cases in src101 are still old codes that cannot be executed and need to be updated and maintained.

vikkkko commented 1 month ago

This is a bug and we will review the code again

btcopenstamp commented 1 week ago

Hi @vikkkko just checking in—how is this issue progressing? Please be aware that based on our previous testing, this issue could potentially cause the indexer to go down.

@reinamora137

reinamora137 commented 1 week ago

Definitely a good time for some test cases

vikkkko commented 1 week ago

This has been fixed