hashgraph / hedera-exchange-rate-tool

Hedera Exchange Rate Tool to send median of HBAR/USD exchange rate from various Exchanges to Hedera Network
Apache License 2.0
2 stars 4 forks source link

Update ERT logs to print accurate json #196

Open beeradb opened 1 year ago

beeradb commented 1 year ago

Currently when the ERT fails due to EXCHANGE_RATE_CHANGE_LIMIT_EXCEEDED it provides a message such as:

proposed rate : [{"CurrentRate":{"hbarEquiv":30000,"centEquiv":205406,"expirationTime":1674770400},"NextRate":{"hbarEquiv":30000,"centEquiv":202643,"expirationTime":1674774000}}]

There are several differences between what is printed and what the network accepts. Here's this same value reformatted as the network expects it:

{
  "currentRate" : {
    "hbarEquiv" : 30000,
    "centEquiv" : 205406,
    "expiry" : 1674770400
  },
  "nextRate" : {
    "hbarEquiv" : 30000,
    "centEquiv" : 202643,
    "expiry" : 1674774000
  }
}

The key differences are:

It would be useful for troubleshooting if ERT logs would output these values in the same format used by the network.