Closed p4u closed 1 week ago
what about naming the new field "signer" instead of "account"? it feels less generic, and with a clear relationship to "signature" above
$ curl -s "http://localhost:9090/v2/chain/transactions/680/0" | jq
{
"tx": {
"vote": {
"nonce": "KHl8qFtyysTnKTp5iSEq+NssO+zBZQDR2ZmaOPsAkO8=",
"processId": "ZMG4BptbgrvvqBgS2TbztwaQQJ2zYB56NokCAgAAAAA=",
"proof": {
"zkSnark": {
"circuitParametersIndex": 0,
...
"votePackage": "eyJ2b3RlcyI6WzBdfQ==",
"nullifier": "HoRsTiFdVaswwacpaNQ8tnjNhDYUp8qAbXDbwFlKVF4=",
"encryptionKeyIndexes": []
}
},
"txInfo": {
"transactionNumber": 40,
"transactionHash": "7d62251ef596ad3dedbd86c6d2efd6c7adbed7d925f54226ff41acf1a90a0146",
"blockHeight": 680,
"transactionIndex": 0,
"transactionType": "vote",
"transactionSubtype": ""
},
"signature": "",
"account": "0000000000000000000000000000000000000000"
}
how should we best handle the votes? both signature and account (or "signer") as present but empty fields, right? (i'll fix that 000000...)
The information returned by the transactions endpoint to get the details of a transaction, the API backend should add a new field "account" which points to the address signing the transaction.
Currently, we do return the signature, so we can extract the address.
Example with: https://api.vocdoni.io/v2/chain/transactions/2414592/0
This way, the explorer (@selankon), on each transaction, can show and link the account creating it.
Consider that some transactions (vote) won't have this information.