Closed ripzery closed 4 years ago
Alright, so if you look at this function that builds a transaction’s outputs, you see that the fee is passed in along with the payments for the derivation of the “change” amount. So the “change” output takes into account the fee. If you look at the test suite, the deduction of the fees is also clearly covered in multiple tests (see : here. – it’s not explicit but you can conclude with some simple arithmetic) (edited)
Call to https://watcher-info.rinkeby.v1.omg.network/transaction.create with OMG fee:
Request Parameters:
{
"fee" : {"currency": "0x0000000000000000000000000000000000000000"},
"owner": "0x31bc9ea3093d5a4faeff8fdf24499cea3f7c1f92",
"payments": [
{
"amount": 1,
"currency": "0x0000000000000000000000000000000000000000",
"owner": "0xc139e1d7358e4faf76f0fcf792255016af5dc742"
}
]
}
Response:
...
"inputs": [
{
"amount": 49910000000000000,
"blknum": 138000,
"creating_txhash": "0xf9b02554e85ed7ed291c0a7657519d38de7ec2660db1e7e5bb0b8f0b435c0fc4",
"currency": "0x0000000000000000000000000000000000000000",
"inserted_at": "2020-10-29T14:20:53Z",
"oindex": 1,
"otype": 1,
"owner": "0x31bc9ea3093d5a4faeff8fdf24499cea3f7c1f92",
"spending_txhash": null,
"txindex": 0,
"updated_at": "2020-10-29T14:20:53Z",
"utxo_pos": 138000000000001
}
],
"metadata": null,
"outputs": [
{
"amount": 1,
"currency": "0x0000000000000000000000000000000000000000",
"owner": "0xc139e1d7358e4faf76f0fcf792255016af5dc742"
},
{
"amount": 49909999999999998,
"currency": "0x0000000000000000000000000000000000000000",
"owner": "0x31bc9ea3093d5a4faeff8fdf24499cea3f7c1f92"
}
]
...
The fee is clearly being deducted in the change output.
Above call was made with the same address as the inputs owner in the issue: "0x31bc9ea3093d5a4faeff8fdf24499cea3f7c1f92"
closing as this is indeed not a bug in the watcher but an implementation detail in the clients environment. (big number rounding)
Example response: