Coin payment premium 12%
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
adda3a4e3a
commit
c9dd900b16
3 files changed
+6
-4
No files matched your search
@@ -493,8 +493,8 @@ internal static class Program
|
||||
var w = new Wallet { Address = "t" };
|
||||
Check(CoinPayment.AssetFor("FACTION_BLACK_MARKET") == Assets.CRT && CoinPayment.AssetFor("FACTION_SECURITY") == null, "派系对应的币");
|
||||
double q = CoinPayment.Receive(w, Assets.CRT, 200, 0.5, 40);
|
||||
Check(Near(q, 400, 1e-9) && Near(w.Get(Assets.CRT), 400, 1e-9), "按币价换算数量");
|
||||
Check(Near(w.Taint, 80, 1e-9) && Near(w.Basis, 200, 1e-9), "污点 = 货值 × 热度%,成本 = 货值");
|
||||
Check(Near(q, 400 * (1 + Tuning.CoinPayPremium), 1e-9) && Near(w.Get(Assets.CRT), q, 1e-9), "按币价换算数量,含溢价");
|
||||
Check(Near(w.Taint, 80, 1e-9) && Near(w.Basis, 200, 1e-9), "污点 = 货值 × 热度%,成本 = 货值(溢价不带污点)");
|
||||
Check(CoinPayment.Receive(w, Assets.CRC, 0, 1, 10) == 0, "零金额不收");
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user