everstake / oasis-explorer-back

Apache License 2.0
6 stars 8 forks source link

Validators have empty commission rates instead of being at 0 #29

Open Esya opened 3 years ago

Esya commented 3 years ago

Original issue here : https://github.com/oasisprotocol/oasis-wallet-web/issues/235

Originally the validators had a default commission schedule showing a 0% fee - but they are now empty in the JSON response. Is this breaking change intentional or is it a bug?

Thanks

Messer4 commented 3 years ago

We use oasis-core resp model for CommissionSchedule and it contains omitting of empty fields. If commission never was setted CommissionSchedule will be empty Could you add default value for CommissionSchedule object according to API scheme? Or I can add Rates and Bounds fields as mandatory and response object will looks like: {"rates" : [], bounds : []}. But Rates and Bounds still will be empty

Esya commented 3 years ago

Are you sure ? On the previous version, fee worked, and it is here in the swagger : https://github.com/everstake/oasis-explorer/blob/master/swagger/swagger.yml#L956

On my local, older version of oasis-explorer it works :

{
"account_id": "oasis1qqyrlc85h0mz4g00gj7r8pmxsas9yqc4nupaxy4a",
"node_id": "oasis1qpqf5qrpstm5wktkzmmpeshfsnzqku7mfugmnpyr",
"fee": 0,
"escrow_balance": 0,
"escrow_shares": 0,
"general_balance": 1000000000000000,
"delegations_balance": 0,
"day_uptime": 1,
"total_uptime": 3.9389064926399855e-16,
"validate_since": 1631644605,
"media_info": null,
"status": "active",
"blocks_count": 7267,
"signatures_count": 7266
}

But here https://testnet-api.oasismonitor.com/data/validators no validators have this property

Messer4 commented 3 years ago

Got it. You mean fee field in validator struct. Yeah, now we fully index validator fee history and return it in commission_schedule field. Fee field is deprecated Actual tag v1.0.1 https://github.com/everstake/oasis-explorer/releases/tag/v1.0.1