Error message requires improvement when it equals the gas price. #489

Closed
opened 2022-12-09 16:51:02 +00:00 by prandnum · 10 comments
prandnum commented 2022-12-09 16:51:02 +00:00 (Migrated from gitlab.com)
unlocked >>> transfer account01 son-account 0.00013800 ETH null true
transfer account01 son-account 0.00013800 ETH null true
0 exception: unspecified
Transaction fee: 0.00013800 ETH, is greater than transferred amount 0.00013800 ETH
    {"sidechain_fee":"0.00013800 ETH","amount":"0.00013800 ETH"}
    th_a  wallet.cpp:3352 transfer

    {"from":"account01","to":"son-account","amount":"0.00013800","asset_symbol":"ETH","memo":"","broadcast":true}
    th_a  wallet.cpp:3359 transfer
unlocked >>>

What should be the behavior:
if this scenario is allowed, then
there should not be any error
else
print error "Transaction fee: 0.00013800 ETH, is greater or equal to the transferred amount 0.00013800 ETH"

``` unlocked >>> transfer account01 son-account 0.00013800 ETH null true transfer account01 son-account 0.00013800 ETH null true 0 exception: unspecified Transaction fee: 0.00013800 ETH, is greater than transferred amount 0.00013800 ETH {"sidechain_fee":"0.00013800 ETH","amount":"0.00013800 ETH"} th_a wallet.cpp:3352 transfer {"from":"account01","to":"son-account","amount":"0.00013800","asset_symbol":"ETH","memo":"","broadcast":true} th_a wallet.cpp:3359 transfer unlocked >>> ``` What should be the behavior: if this scenario is allowed, then there should not be any error else print error "Transaction fee: 0.00013800 ETH, is greater or equal to the transferred amount 0.00013800 ETH"
prandnum commented 2022-12-09 16:52:08 +00:00 (Migrated from gitlab.com)

mentioned in issue #478

mentioned in issue #478
vampik commented 2022-12-12 07:47:55 +00:00 (Migrated from gitlab.com)

assigned to @vampik

assigned to @vampik
vampik commented 2022-12-12 07:49:34 +00:00 (Migrated from gitlab.com)

@prandnum We should not allow user to withdraw if transfer amount is equal to fee (user would just lose this amount and wouldn't receive anything)

@prandnum We should not allow user to withdraw if transfer amount is equal to fee (user would just lose this amount and wouldn't receive anything)
prandnum commented 2022-12-13 09:56:30 +00:00 (Migrated from gitlab.com)

@vampik in that case the error message needs to be enhanced again

FROM --> Transaction fee: 0.00013800 ETH, is greater than transferred amount 0.00013800 ETH
TO --> Transaction fee: 0.00013800 ETH, is greater than or equal to the transferred amount 0.00013800 ETH

@vampik in that case the error message needs to be enhanced again FROM --> `Transaction fee: 0.00013800 ETH, is greater than transferred amount 0.00013800 ETH` TO --> `Transaction fee: 0.00013800 ETH, is greater than or equal to the transferred amount 0.00013800 ETH`
vampik commented 2022-12-15 07:16:50 +00:00 (Migrated from gitlab.com)

mentioned in commit d387e324fe

mentioned in commit d387e324fe515924197fa6d695c4a296c20eef8a
vampik commented 2022-12-15 07:18:48 +00:00 (Migrated from gitlab.com)

mentioned in merge request !190

mentioned in merge request !190
vampik commented 2022-12-15 07:19:03 +00:00 (Migrated from gitlab.com)

assigned to @serkixenos

assigned to @serkixenos
serkixenos commented 2022-12-21 17:24:56 +00:00 (Migrated from gitlab.com)

mentioned in commit bd041bc13f

mentioned in commit bd041bc13f36b9e3cd62f1218ace0dfa404acc81
vampik commented 2022-12-26 04:35:52 +00:00 (Migrated from gitlab.com)

assigned to @prandnum

assigned to @prandnum
prandnum commented 2023-01-04 15:00:23 +00:00 (Migrated from gitlab.com)

The issue is fixed now

unlocked >>> transfer account01 son-account 0.00013800 ETH null true
transfer account01 son-account 0.00013800 ETH null true
0 exception: unspecified
Transaction fee: 0.00013800 ETH, is greater than or equal to the transferred amount 0.00013800 ETH
    {"sidechain_fee":"0.00013800 ETH","amount":"0.00013800 ETH"}
    th_a  wallet.cpp:3352 transfer

    {"from":"account01","to":"son-account","amount":"0.00013800","asset_symbol":"ETH","memo":"","broadcast":true}
    th_a  wallet.cpp:3359 transfer
unlocked >>> transfer account01 son-account 0.00013799 ETH null true 
transfer account01 son-account 0.00013799 ETH null true
0 exception: unspecified
Transaction fee: 0.00013800 ETH, is greater than or equal to the transferred amount 0.00013799 ETH
    {"sidechain_fee":"0.00013800 ETH","amount":"0.00013799 ETH"}
    th_a  wallet.cpp:3352 transfer

    {"from":"account01","to":"son-account","amount":"0.00013799","asset_symbol":"ETH","memo":"","broadcast":true}
    th_a  wallet.cpp:3359 transfer
unlocked >>> transfer account01 son-account 0.00013801 ETH null true 
transfer account01 son-account 0.00013801 ETH null true
{
  "ref_block_num": 21537,
  "ref_block_prefix": 1621336053,
  "expiration": "2023-01-04T14:57:24",
  "operations": [[
      0,{
        "fee": {
          "amount": 0,
          "asset_id": "1.3.0"
        },
        "from": "1.2.52",
        "to": "1.2.19",
        "amount": {
          "amount": 13801,
          "asset_id": "1.3.2"
        },
        "extensions": []
      }
    ]
  ],
  "extensions": [],
  "signatures": [
    "2077cf0405ac22e7f97074c082a43bf230dcec6ed964bec927f542a78a5276134472f72bd6fcdd788834870c702a398a93a713a0b296959d59c0252c12c0bc3532"
  ]
}
unlocked >>> list_account_balances account01                         
list_account_balances account01
49999950 TEST
1.99986199 ETH
1000000 PBTC
1000000 PEOS
1000000 PETH

unlocked >>> list_account_balances son-account                       
list_account_balances son-account
0.00013801 ETH

unlocked >>> list_account_balances son-account
list_account_balances son-account
0 ETH

unlocked >>> list_account_balances account01   
list_account_balances account01
49999950 TEST
1.99986199 ETH
1000000 PBTC
1000000 PEOS
1000000 PETH

unlocked >>> get_object 1.39.1
get_object 1.39.1
[{
    "id": "1.39.1",
    "timestamp": "2023-01-04T14:57:00",
    "sidechain": "ethereum",
    "object_id": "1.37.0",
    "transaction": "0xe088747b0000000000000000000000005c79a9f5767e3c1b926f963fa24e21d8a04289ae00000000000000000000000000000000000000000000000000007d84f506840000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000006312E33372E300000000000000000000000000000000000000000000000000000",
    "signers": [{
        "son_id": "1.33.0",
        "weight": 1,
        "signing_key": "TEST8TCQFzyYDp3DPgWZ24261fMPSCzXxVyoF3miWeTj6JTi2DZdrL",
        "public_key": "5fbbb31be52608d2f52247e8400b7fcaa9e0bc12"
      },{
        "son_id": "1.33.1",
        "weight": 1,
        "signing_key": "TEST82qv1LKFvwVKD9pg5JQf6qqwLcoeqUniQjWJ3wKTodyWa7gHUs",
        "public_key": "76ce31bd03f601c3fc13732def921c5bac282676"
      },{
        "son_id": "1.33.2",
        "weight": 1,
        "signing_key": "TEST6xdp7MrEPnaNK9GuF3KTeTizgGN6JC5nPmxx81higFepSZ8N7r",
        "public_key": "09ee460834498a4ee361beb819470061b7381b49"
      },{
        "son_id": "1.33.3",
        "weight": 1,
        "signing_key": "TEST55j32Up75gHCxJBPN18vEytL9anDgEVFtsaCii38keGQG71X22",
        "public_key": "6aefbd09209e1ee2e0a589d31e732f69b77713d2"
      },{
        "son_id": "1.33.4",
        "weight": 1,
        "signing_key": "TEST68bX5bB16GkEAig6w2WTh9NbM9nHa66CemnDRx2njRY9bbWXhU",
        "public_key": "631e128b16f9adcf1bb6385112b1519c917d77a7"
      }
    ],
    "signatures": [[
        "1.33.0",
        "{\n    \"v\": \"1c\",\n    \"r\": \"e79aa8a579b018aab4979b40b2076fc6b9e5d0dcf439ded436b3952e057ee2d8\",\n    \"s\": \"43d27cd9b6f660f785f8c284683f8d669c42546642c41b183f6b2c233a2d3348\"\n}\n"
      ],[
        "1.33.1",
        "{\n    \"v\": \"1b\",\n    \"r\": \"77b9cc4b6ffdedb5c16c2c8b4ac19796384d49f5bce2ac47130d2c16834ee5fd\",\n    \"s\": \"5307190ef1da68d1010047b0031dd4451bfeb04bff494f37be3880181be17600\"\n}\n"
      ],[
        "1.33.2",
        "{\n    \"v\": \"1b\",\n    \"r\": \"b4a2e007ed53b7e2714c377273a016bf445a6a52c788cd66196b65b939f2f5e7\",\n    \"s\": \"4cdcecf9604f895cb0dfaba49b45d633f2259795fd40fdfaf8ab16374d59a7e2\"\n}\n"
      ],[
        "1.33.3",
        "{\n    \"v\": \"1b\",\n    \"r\": \"5edb18a12464955ff04747f24c3907656d46ecd42ac16cfd06b74713020669d5\",\n    \"s\": \"0d2b8e0a9ac9e69de7f42f6facc7b025b4bb23a7429908476bec9ffd5da4577f\"\n}\n"
      ],[
        "1.33.4",
        ""
      ]
    ],
    "sidechain_transaction": "{\n    \"result_array\": [\n        {\n            \"transaction\": \"0xe088747b0000000000000000000000005c79a9f5767e3c1b926f963fa24e21d8a04289ae00000000000000000000000000000000000000000000000000007d84f506840000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000006312E33372E300000000000000000000000000000000000000000000000000000\",\n            \"sidechain_transaction\": \"{\\\"jsonrpc\\\":\\\"2.0\\\",\\\"id\\\":21739,\\\"result\\\":\\\"0xb20821baf2b8ec3b6883a4bd6d4584807bf3dd55b97b8dce11de65400b4200aa\\\"}\\n\",\n            \"transaction_receipt\": \"0xb20821baf2b8ec3b6883a4bd6d4584807bf3dd55b97b8dce11de65400b4200aa\"\n        }\n    ]\n}\n",
    "total_weight": 5,
    "current_weight": 4,
    "threshold": 4,
    "status": "settled"
  }
]
unlocked >>>                  

The issue is fixed now ``` unlocked >>> transfer account01 son-account 0.00013800 ETH null true transfer account01 son-account 0.00013800 ETH null true 0 exception: unspecified Transaction fee: 0.00013800 ETH, is greater than or equal to the transferred amount 0.00013800 ETH {"sidechain_fee":"0.00013800 ETH","amount":"0.00013800 ETH"} th_a wallet.cpp:3352 transfer {"from":"account01","to":"son-account","amount":"0.00013800","asset_symbol":"ETH","memo":"","broadcast":true} th_a wallet.cpp:3359 transfer unlocked >>> transfer account01 son-account 0.00013799 ETH null true transfer account01 son-account 0.00013799 ETH null true 0 exception: unspecified Transaction fee: 0.00013800 ETH, is greater than or equal to the transferred amount 0.00013799 ETH {"sidechain_fee":"0.00013800 ETH","amount":"0.00013799 ETH"} th_a wallet.cpp:3352 transfer {"from":"account01","to":"son-account","amount":"0.00013799","asset_symbol":"ETH","memo":"","broadcast":true} th_a wallet.cpp:3359 transfer unlocked >>> transfer account01 son-account 0.00013801 ETH null true transfer account01 son-account 0.00013801 ETH null true { "ref_block_num": 21537, "ref_block_prefix": 1621336053, "expiration": "2023-01-04T14:57:24", "operations": [[ 0,{ "fee": { "amount": 0, "asset_id": "1.3.0" }, "from": "1.2.52", "to": "1.2.19", "amount": { "amount": 13801, "asset_id": "1.3.2" }, "extensions": [] } ] ], "extensions": [], "signatures": [ "2077cf0405ac22e7f97074c082a43bf230dcec6ed964bec927f542a78a5276134472f72bd6fcdd788834870c702a398a93a713a0b296959d59c0252c12c0bc3532" ] } unlocked >>> list_account_balances account01 list_account_balances account01 49999950 TEST 1.99986199 ETH 1000000 PBTC 1000000 PEOS 1000000 PETH unlocked >>> list_account_balances son-account list_account_balances son-account 0.00013801 ETH unlocked >>> list_account_balances son-account list_account_balances son-account 0 ETH unlocked >>> list_account_balances account01 list_account_balances account01 49999950 TEST 1.99986199 ETH 1000000 PBTC 1000000 PEOS 1000000 PETH unlocked >>> get_object 1.39.1 get_object 1.39.1 [{ "id": "1.39.1", "timestamp": "2023-01-04T14:57:00", "sidechain": "ethereum", "object_id": "1.37.0", "transaction": "0xe088747b0000000000000000000000005c79a9f5767e3c1b926f963fa24e21d8a04289ae00000000000000000000000000000000000000000000000000007d84f506840000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000006312E33372E300000000000000000000000000000000000000000000000000000", "signers": [{ "son_id": "1.33.0", "weight": 1, "signing_key": "TEST8TCQFzyYDp3DPgWZ24261fMPSCzXxVyoF3miWeTj6JTi2DZdrL", "public_key": "5fbbb31be52608d2f52247e8400b7fcaa9e0bc12" },{ "son_id": "1.33.1", "weight": 1, "signing_key": "TEST82qv1LKFvwVKD9pg5JQf6qqwLcoeqUniQjWJ3wKTodyWa7gHUs", "public_key": "76ce31bd03f601c3fc13732def921c5bac282676" },{ "son_id": "1.33.2", "weight": 1, "signing_key": "TEST6xdp7MrEPnaNK9GuF3KTeTizgGN6JC5nPmxx81higFepSZ8N7r", "public_key": "09ee460834498a4ee361beb819470061b7381b49" },{ "son_id": "1.33.3", "weight": 1, "signing_key": "TEST55j32Up75gHCxJBPN18vEytL9anDgEVFtsaCii38keGQG71X22", "public_key": "6aefbd09209e1ee2e0a589d31e732f69b77713d2" },{ "son_id": "1.33.4", "weight": 1, "signing_key": "TEST68bX5bB16GkEAig6w2WTh9NbM9nHa66CemnDRx2njRY9bbWXhU", "public_key": "631e128b16f9adcf1bb6385112b1519c917d77a7" } ], "signatures": [[ "1.33.0", "{\n \"v\": \"1c\",\n \"r\": \"e79aa8a579b018aab4979b40b2076fc6b9e5d0dcf439ded436b3952e057ee2d8\",\n \"s\": \"43d27cd9b6f660f785f8c284683f8d669c42546642c41b183f6b2c233a2d3348\"\n}\n" ],[ "1.33.1", "{\n \"v\": \"1b\",\n \"r\": \"77b9cc4b6ffdedb5c16c2c8b4ac19796384d49f5bce2ac47130d2c16834ee5fd\",\n \"s\": \"5307190ef1da68d1010047b0031dd4451bfeb04bff494f37be3880181be17600\"\n}\n" ],[ "1.33.2", "{\n \"v\": \"1b\",\n \"r\": \"b4a2e007ed53b7e2714c377273a016bf445a6a52c788cd66196b65b939f2f5e7\",\n \"s\": \"4cdcecf9604f895cb0dfaba49b45d633f2259795fd40fdfaf8ab16374d59a7e2\"\n}\n" ],[ "1.33.3", "{\n \"v\": \"1b\",\n \"r\": \"5edb18a12464955ff04747f24c3907656d46ecd42ac16cfd06b74713020669d5\",\n \"s\": \"0d2b8e0a9ac9e69de7f42f6facc7b025b4bb23a7429908476bec9ffd5da4577f\"\n}\n" ],[ "1.33.4", "" ] ], "sidechain_transaction": "{\n \"result_array\": [\n {\n \"transaction\": \"0xe088747b0000000000000000000000005c79a9f5767e3c1b926f963fa24e21d8a04289ae00000000000000000000000000000000000000000000000000007d84f506840000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000006312E33372E300000000000000000000000000000000000000000000000000000\",\n \"sidechain_transaction\": \"{\\\"jsonrpc\\\":\\\"2.0\\\",\\\"id\\\":21739,\\\"result\\\":\\\"0xb20821baf2b8ec3b6883a4bd6d4584807bf3dd55b97b8dce11de65400b4200aa\\\"}\\n\",\n \"transaction_receipt\": \"0xb20821baf2b8ec3b6883a4bd6d4584807bf3dd55b97b8dce11de65400b4200aa\"\n }\n ]\n}\n", "total_weight": 5, "current_weight": 4, "threshold": 4, "status": "settled" } ] unlocked >>> ```
prandnum (Migrated from gitlab.com) closed this issue 2023-01-04 15:00:29 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Peerplays_Blockchain/peerplays_migrated#489
No description provided.