Skip to content

Commit 7d418fd

Browse files
committed
fix readme
1 parent d912de7 commit 7d418fd

File tree

1 file changed

+38
-38
lines changed

1 file changed

+38
-38
lines changed

x/feeds/README.md

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ This module is used in the BandChain.
3333
- [SignalTotalPowerByPowerIndex](#signaltotalpowerbypowerindex)
3434
- [Params](#params)
3535
- [Messages](#messages)
36+
- [MsgSubmitSignals](#msgsubmitsignals)
3637
- [MsgSubmitSignalPrices](#msgsubmitsignalprices)
3738
- [MsgUpdateReferenceSourceConfig](#msgupdatereferencesourceconfig)
3839
- [MsgUpdateParams](#msgupdateparams)
39-
- [MsgSubmitSignals](#msgsubmitsignals)
4040
- [End-Block](#end-block)
4141
- [Update Prices](#update-prices)
4242
- [Input](#input)
@@ -110,51 +110,51 @@ The On-chain Reference Source Config is the agreed-upon version of the reference
110110

111111
### ReferenceSourceConfig
112112

113-
ReferenceSourceConfig is stored in the global store `0x00` to hold Reference Source information.
113+
ReferenceSourceConfig is a single-value store that hold Reference Source information.
114114

115-
* ReferenceSourceConfig: `0x00 | []byte("ReferenceSourceConfig") -> ProtocolBuffer(ReferenceSourceConfig)`
115+
* ReferenceSourceConfig: `0x00 -> ProtocolBuffer(ReferenceSourceConfig)`
116116

117117
### CurrentFeeds
118118

119-
CurrentFeeds is stored in the global store `0x00` to hold the list of currently supported feeds.
119+
CurrentFeeds is a single-value store that hold currently supported feeds.
120120

121-
* CurrentFeeds: `0x00 | []byte("CurrentFeeds") -> ProtocolBuffer(CurrentFeeds)`
121+
* CurrentFeeds: `0x01 -> ProtocolBuffer(CurrentFeeds)`
122122

123123
### ValidatorPriceList
124124

125125
The ValidatorPrice is a space for holding the current lists of validator prices.
126126

127-
* ValidatorPrice: `0x01 -> ProtocolBuffer(ValidatorPriceList)`
127+
* ValidatorPrice: `0x10 -> ProtocolBuffer(ValidatorPriceList)`
128128

129129
### Price
130130

131131
The Price is a space for holding the current price information of signals.
132132

133-
* Price: `0x02 -> ProtocolBuffer(Price)`
133+
* Price: `0x11 -> ProtocolBuffer(Price)`
134134

135135
### DelegatorSignals
136136

137137
The DelegatorSignals is a space for holding current Delegator Signals information of delegators.
138138

139-
* DelegatorSignals: `0x03 -> ProtocolBuffer(DelegatorSignals)`
139+
* DelegatorSignals: `0x12 -> ProtocolBuffer(DelegatorSignals)`
140140

141141
### SignalTotalPower
142142

143143
The SignalTotalPower is a space for holding the total power of signals.
144144

145-
* SignalTotalPower: `0x04 -> ProtocolBuffer(Signal)`
145+
* SignalTotalPower: `0x13 -> ProtocolBuffer(Signal)`
146146

147147
#### SignalTotalPowerByPowerIndex
148148

149149
`SignalTotalPowerByPowerIndex` allow to retrieve SignalTotalPower by power:
150-
`0x20| BigEndian(Power) | SignalIDLen (1 byte) | SignalID -> SignalID`
150+
`0x80| BigEndian(Power) | SignalIDLen (1 byte) | SignalID -> SignalID`
151151

152152
### Params
153153

154154
The feeds module stores its params in state with the prefix of `0x10`,
155155
it can be updated with governance proposal or the address with authority.
156156

157-
* Params: `0x10 | ProtocolBuffer(Params)`
157+
* Params: `0x90 | ProtocolBuffer(Params)`
158158

159159
```protobuf
160160
// Params is the data structure that keeps the parameters of the feeds module.
@@ -204,6 +204,33 @@ message Params {
204204

205205
In this section, we describe the processing of the `feeds` messages and the corresponding updates to the state. All created/modified state objects specified by each message are defined within the [state](#state) section.
206206

207+
### MsgSubmitSignals
208+
209+
Delegator Signals are submitted as a batch using the MsgSubmitSignals message.
210+
211+
Batched Signals replace the previous Signals of the same delegator as a batch.
212+
Signals are registered, and their power is added to the SignalTotalPower of the same SignalID.
213+
214+
```protobuf
215+
// MsgSubmitSignals is the transaction message to submit signals
216+
message MsgSubmitSignals {
217+
option (cosmos.msg.v1.signer) = "delegator";
218+
option (amino.name) = "feeds/MsgSubmitSignals";
219+
220+
// Delegator is the address of the delegator that want to submit signals
221+
string delegator = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
222+
// Signals is a list of submitted signal
223+
repeated Signal signals = 2 [(gogoproto.nullable) = false];
224+
}
225+
```
226+
227+
The message handling can fail if:
228+
229+
* The delegator's address is not correct.
230+
* The delegator has less delegation than the sum of the Powers.
231+
* The signal is not valid. (e.g. too long signal ID, power is a negative value).
232+
* The size of the list of signal is too large.
233+
207234
### MsgSubmitSignalPrices
208235

209236
Validator Prices are submitted using the `MsgSubmitSignalPrices` message.
@@ -282,33 +309,6 @@ The message handling can fail if:
282309

283310
* signer is not the authority defined in the feeds keeper (usually the gov module account).
284311

285-
### MsgSubmitSignals
286-
287-
Delegator Signals are submitted as a batch using the MsgSubmitSignals message.
288-
289-
Batched Signals replace the previous Signals of the same delegator as a batch.
290-
Signals are registered, and their power is added to the SignalTotalPower of the same SignalID.
291-
292-
```protobuf
293-
// MsgSubmitSignals is the transaction message to submit signals
294-
message MsgSubmitSignals {
295-
option (cosmos.msg.v1.signer) = "delegator";
296-
option (amino.name) = "feeds/MsgSubmitSignals";
297-
298-
// Delegator is the address of the delegator that want to submit signals
299-
string delegator = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
300-
// Signals is a list of submitted signal
301-
repeated Signal signals = 2 [(gogoproto.nullable) = false];
302-
}
303-
```
304-
305-
The message handling can fail if:
306-
307-
* The delegator's address is not correct.
308-
* The delegator has less delegation than the sum of the Powers.
309-
* The signal is not valid. (e.g. too long signal ID, power is a negative value).
310-
* The size of the list of signal is too large.
311-
312312
## End-Block
313313

314314
Each abci end block call, the operations to update prices.

0 commit comments

Comments
 (0)