Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unbond with less than 1 nano atom #2217

Closed
fedekunze opened this issue Mar 8, 2019 · 1 comment · Fixed by #2258
Closed

Unbond with less than 1 nano atom #2217

fedekunze opened this issue Mar 8, 2019 · 1 comment · Fixed by #2258
Assignees
Labels
bug 🐛 issues related to unhandled errors in the code that need to be fixed

Comments

@fedekunze
Copy link
Contributor

fedekunze commented Mar 8, 2019

Describe the bug

Either something with the precision is wrong on the SDK or we're not calculating shares correctly.

The minimum allowed precision is a utoms (nano atoms or 1e-7 atoms).

To Reproduce

Undelegate 5e-12 stake which translates to "shares_amount": "0.000050000000000000"

Expected behavior

Not allow to undelegate less than 1 nano atom

Screenshots

screen shot 2019-03-08 at 12 49 39 pm

Additional context

Transaction:

{
    "height": "4184",
    "txhash": "90BC800E95C9C35BAD3F8180DD4A3B3F319C46AB2F17006E2676EBCAB48A3323",
    "data": "DAimgpnkBRDgof6tAQ==",
    "log": "[{\"msg_index\":\"0\",\"success\":true,\"log\":\"\"}]",
    "gas_wanted": "500000",
    "gas_used": "101024",
    "tags": [
      {
        "key": "action",
        "value": "begin_unbonding"
      },
      {
        "key": "delegator",
        "value": "cosmos1h0k4vl3kfjurxfemnlhr684px8u6q3anz2f8ct"
      },
      {
        "key": "source-validator",
        "value": "cosmosvaloper1h0k4vl3kfjurxfemnlhr684px8u6q3an87aj5c"
      },
      {
        "key": "end-time",
        "value": "2019-03-11T11:06:14Z"
      }
    ],
    "tx": {
      "type": "auth/StdTx",
      "value": {
        "msg": [
          {
            "type": "cosmos-sdk/Undelegate",
            "value": {
              "delegator_addr": "cosmos1h0k4vl3kfjurxfemnlhr684px8u6q3anz2f8ct",
              "validator_addr": "cosmosvaloper1h0k4vl3kfjurxfemnlhr684px8u6q3an87aj5c",
              "shares_amount": "0.000050000000000000"
            }
          }
        ],
        "fee": {
          "amount": null,
          "gas": "500000"
        },
        "signatures": [
          {
            "pub_key": {
              "type": "tendermint/PubKeySecp256k1",
              "value": "Aiuxl8dL1b/EIFdy7+W4Q8acxbGmr/1OdIIYuqOdmV+A"
            },
            "signature": "D/SjZSZi8+yBw4iO0hQ5uEfpeOe/5u3QRoGxlHNrE0VZFTeUeOvbhQKuHLnC5U6ma3K4FtdhL0RQMMVoRWo2Tw=="
          }
        ],
        "memo": "Sent via Cosmos UI 🚀"
      }
    }
  }
@fedekunze fedekunze added the bug 🐛 issues related to unhandled errors in the code that need to be fixed label Mar 8, 2019
@fedekunze
Copy link
Contributor Author

the validator had delegator_shares: 99999999.999950000000000000

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 issues related to unhandled errors in the code that need to be fixed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants