From ccc410e0dc1f03734214dfd17f6bf4f48c2af703 Mon Sep 17 00:00:00 2001 From: Sorawit Suriyakarn Date: Tue, 10 Sep 2024 15:14:59 +0700 Subject: [PATCH] Update more messages to proto --- doc.md | 47 ++++++++++++++++++++++++++++------------------- 1 file changed, 28 insertions(+), 19 deletions(-) diff --git a/doc.md b/doc.md index bd2fd29..0ca0109 100644 --- a/doc.md +++ b/doc.md @@ -35,14 +35,17 @@ Every $BAND token delegator has the ability to vote on which symbols should be i Users with delegating power can submit `MsgSubmitSignals` to BandChain at any time to express their preferences. The message structure is as follows: ``` -type Signal struct { - ID string - Power int64 +message Signal { + string id = 1; + int64 power = 2; } -type MsgSubmitSignals struct { - Delegator string - Signals []Signal +message MsgSubmitSignals { + signer = "delegator"; + name = "feeds/MsgSubmitSignals"; + + string delegator = 1; + repeated Signal signals = 2; } ``` @@ -74,23 +77,29 @@ This section discusses the process by which price data is collected from each va ## Validator's Price Data -Each validator must broadcast `MsgSubmitPrices` to submit individual price data for all symbols listed in the signaling hub according to the specified interval for each symbol. Failure to do so will result in the validator being deactivated and losing a portion of their revenue, as well as that of their delegators. +Each validator must broadcast `MsgSubmitSignalPrices` to submit individual price data for all symbols listed in the signaling hub according to the specified interval for each symbol. Failure to do so will result in the validator being deactivated and losing a portion of their revenue, as well as that of their delegators. ``` -type SignalPrice struct { - PriceStatus [ - AVAILABLE - | UNAVAILABLE - | UNSUPPORTED - ] - SignalID string - Price uint64 +enum PriceStatus { + PRICE_STATUS_UNSPECIFIED = 0; + PRICE_STATUS_UNSUPPORTED = 1; + PRICE_STATUS_UNAVAILABLE = 2; + PRICE_STATUS_AVAILABLE = 3; +} + +message SignalPrice { + PriceStatus price_status = 1; + string signal_id = 2; + uint64 price = 3; } -type MsgSubmitPrices struct { - Validator string - Timestamp int64 - Prices []SignalPrice +message MsgSubmitSignalPrices { + signer = "validator"; + name = "feeds/MsgSubmitSignalPrices"; + + string validator = 1; + int64 timestamp = 2; + repeated SignalPrice prices = 3; } ```