You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To make the use of the mock oracle price flag way more clear, we first
rename it to correctly represent its usage.
We then also make sure a minimum value is set, otherwise one asset unit
would just cost too much and cause issues when trying to send them over
the network.
To make it easier to express what one unit should cost, we also add a
second price flag that can specify the number of satoshis per asset
unit, which will make it easier for users that want to represent
something that doesn't have an official exchange rate.
// MinAssetsPerBTC is the minimum number of asset units that one BTC
12
+
// should cost. If the value is lower, then one asset unit would cost
13
+
// too much to be able to represent small amounts of satoshis. With this
14
+
// value, one asset unit would still cost 1k sats.
15
+
MinAssetsPerBTC=100_000
10
16
)
11
17
12
18
// CliConfig is a struct that holds tapd cli configuration options for the RFQ
@@ -18,18 +24,21 @@ type CliConfig struct {
18
24
19
25
SkipAcceptQuotePriceCheckbool`long:"skipacceptquotepricecheck" description:"Accept any price quote returned by RFQ peer, skipping price validation"`
20
26
21
-
MockOracleCentPerSatuint64`long:"mockoraclecentpersat" description:"Mock price oracle static USD cent per sat rate"`
27
+
MockOracleAssetsPerBTCuint64`long:"mockoracleassetsperbtc" description:"Mock price oracle static asset units per BTC rate (for example number of USD cents per BTC if one asset unit represents a USD cent); whole numbers only, use either this or mockoraclesatsperasset depending on required precision"`
28
+
29
+
MockOracleSatsPerAssetuint64`long:"mockoraclesatsperasset" description:"Mock price oracle static satoshis per asset unit rate (for example number of satoshis to pay for one USD cent if one asset unit represents a USD cent); whole numbers only, use either this or mockoracleassetsperbtc depending on required precision"`
22
30
}
23
31
24
32
// Validate returns an error if the configuration is invalid.
25
33
func (c*CliConfig) Validate() error {
26
34
// If the user has specified a mock oracle USD per BTC rate but the
27
35
// price oracle address is not the mock price oracle service address,
0 commit comments