klaytn / rosetta-klaytn

Apache License 2.0
4 stars 6 forks source link

Return default balance and nonce to return result #61

Closed jimni1222 closed 2 years ago

jimni1222 commented 2 years ago

I added logic to check klay_getAccount is empty or not to return default account info which has 0 balance and 0 nonce.

I also tested with Postman and result was below

{
    "block_identifier": {
        "index": 89297094,
        "hash": "0x3c301ddd61be260772d3fa6717ecfceb903210759d9ca19c1e59643fb15e605d"
    },
    "balances": [
        {
            "value": "0",
            "currency": {
                "symbol": "KLAY",
                "decimals": 18
            }
        }
    ],
    "metadata": {
        "nonce": 0
    }
}