From 434666fb1091041ac8326372342d2c9bdcd3039e Mon Sep 17 00:00:00 2001 From: webwarrior Date: Mon, 22 Jul 2024 10:40:05 +0200 Subject: [PATCH 1/2] Backend,Frontend(Console,XF),Tests: remove SAI Completely remove SAI currency. --- img/sai_grey_120x120.png | Bin 1737 -> 0 bytes img/sai_grey_60x60.png | Bin 866 -> 0 bytes img/sai_red_120x120.png | Bin 1740 -> 0 bytes img/sai_red_60x60.png | Bin 870 -> 0 bytes .../CompoundBalanceCaching.fs | 4 +- src/GWallet.Backend.Tests/Deserialization.fs | 20 ++++----- .../GWallet.Backend.Tests-legacy.fsproj | 4 +- .../GWallet.Backend.Tests.fsproj | 4 +- src/GWallet.Backend.Tests/MarshallingData.fs | 40 +++++++++--------- src/GWallet.Backend.Tests/Serialization.fs | 16 +++---- .../signedAndFormattedBtcTransaction.json | 10 ++--- ... => signedAndFormattedDaiTransaction.json} | 12 +++--- .../unsignedAndFormattedBtcTransaction.json | 10 ++--- ...> unsignedAndFormattedDaiTransaction.json} | 12 +++--- src/GWallet.Backend/Account.fs | 4 -- src/GWallet.Backend/BlockExplorer.fs | 4 +- src/GWallet.Backend/Currency.fs | 7 +-- src/GWallet.Backend/Ether/EtherAccount.fs | 4 +- src/GWallet.Backend/Ether/TokenManager.fs | 1 - src/GWallet.Backend/FiatValueEstimation.fs | 10 +---- .../UserInteraction.fs | 9 +--- src/GWallet.Frontend.XF/FrontendHelpers.fs | 12 +----- .../GWallet.Frontend.XF.fsproj | 12 ------ 23 files changed, 77 insertions(+), 118 deletions(-) delete mode 100644 img/sai_grey_120x120.png delete mode 100644 img/sai_grey_60x60.png delete mode 100644 img/sai_red_120x120.png delete mode 100644 img/sai_red_60x60.png rename src/GWallet.Backend.Tests/data/{signedAndFormattedSaiTransaction.json => signedAndFormattedDaiTransaction.json} (92%) rename src/GWallet.Backend.Tests/data/{unsignedAndFormattedSaiTransaction.json => unsignedAndFormattedDaiTransaction.json} (90%) diff --git a/img/sai_grey_120x120.png b/img/sai_grey_120x120.png deleted file mode 100644 index 374971ce3ecead887f0973b6a703c1871bc3255d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1737 zcmV;)1~&PLP)53+#S_s=Dj)QElO?Zu%&!$ju(TS3ve@P3R(IPp!E7E z<-crp8|*@WFJT`6HdVBv0O%D4Xf3e3q4j{cOQx`u&<1%K1u)E6pAn3PhZub?LeH&r zK-d&urz-B)0Cd3y80N9h5tQRLWqT1~9<2jp?N1m;NnFOt98W&8S$o8_ee5g2`Row$ z=b5i1Q0)nK0=QC=-Ane&#{ewxfIBy*H^FTcwyoZv?eGG_-1b?#I>$4#A-)oAF3iHt z#i*B9n{vHC11z|Bk+tCRMowl<+AGN1|;cGYVg3>fCQZ_@5T<42cy zvhIL8GN<1%&kY`SG30yO6|bZvu0`drLiMlu+9pdS_H7Ra-UeCr#sT%UW!srPKjgovR@z|n#qkeNyAU|QqkT0*n0JcAo8ebDN{2Y zSan|7BUr9$2V8X-{1_uH!Avec9pawBgtNC1_b5B_rdx4@GWlv2CycVU4Xy>7!@X<{ znS3>iHIwXZi+dbvCYfBB#Z?(RjR;pU%H;C1)r}?kAtGFE$Pcx^@YsYbGF(o`85my8 z;QL5%IU(QI0na1G<$^q~1cv*)Y2>&ZkW;X{$l$TyvOykK0Z#>&4f1IQ!%oSO;Ics; zf$1TGCxXikd2$Rq7F>47<741VaM>YeSb?$PQbYa(hD~*`;okbm1`^2DHbIoVp>X^9 zWCI1{%mSy8;jVjZeC)_+f?xz49JlAj$BaBqV#SRGdB{F^aNG!x2kV2;;4()}6T#(; zoCq#&t-U>2LTx%Pu4;JL`xWW72 z=#c~C?)zX3-}vu<|L@*jAtSh_VcJ!fgRCL<@3PP2A#h7m48W|B2g1Do-XdrVcE|(b z9!yK%cO-4X261%@$;nH&_@1;wVxEi$w=nJXPgMr*8xvvMq0eMQxEF@!z%NMK5G^t?+zZ1KV3XRp!uyCm zbjS#Cb1=M`!8U#&u7+rk5#mo|Evlxv7r?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120.png deleted file mode 100644 index d1b265b3f40962be4825677aee4765335e056129..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1740 zcmV;-1~d7IP)X7Id= z4HUG5&V(wN2#a*x|3Y#n*rR{P&G}+h~TEBXgP{WQK>!*x>>2 zZw7rY!2P365fsj&fiDMuHvn$1Hv-%p6*BYA9P<{X)^|WDUz_9EVDALD88yW$z4uUh zU6k_gklhA57vO8y2ZT)(@5m8)MFCn1Y}n9xK-^`Zu%*xjc^L&T&RL%bjE098eJ^~^ zt+hwk6k(?-?${u79t<$fW1k`@$8E~?!pA&Xd&t^vIFORKj+HqcU1qa(hzot}3&Z*B z5cB7mt0hqF2zP?GQj+aU_RPfqEOCH4H>X#@Z57Z~uh@2UfpKp8Bwn543EPlfi8dDo zuyZl$CDx`~FUSB3E?s0TxM3qFH{vb@*J;de?UVHlxN{j$c?($eT6+V=dG4#UyVv;I zWuB}%;Ev4chs<-m2P}qsX}jW;w8RC}5LT%ERv+7Bxx}IE(ZJat3vL{6Ut5O$3>Nvn zGDObMp#Kt$xBOm08mwS8yfXZuo!Q=M)Rwr=5Wkq0=F*WUQ)K9mKiS-7v@Ow3A>u+{ zBXKL&sqGY1TVyZyDUsD2l4&M4PMs3V>)l0>9_hakTABM=Irlm|B z=)kJ;(jLQdT|3~a%ixC?aT#WE@#zrz3}&3YjkqV-xof%=$0(C4vp5MTd)wdw*c|U= zhmgsYS*!!e-nO`>u?{4YOS8BvgQpSUs(>=N_-u7!iN22rH#Fq?T3~!^LKYcrNXQu) zR%Y;Bq_`m=-_-%nBgPE{d0q;P_j}XGaYH~((ef&T$ATLS^0*9mD!9QQpJy=clpG0e zFvue`J!bGkaDzjhoC1#pH#p?+DR3sZ!69cmD1QI&zv27(si-?YZ$OBaf3K1kwN zqBG^-LFzsRS%N$eZULMNa+tVan<#(lqJr!f7h>moB}jJvz)GEZ3wjyTVw*bXO_uj%@$<# zxM!C7;sXCu^q#cCVxCM0H#hC|M_C3R8k1n#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EU=usRB z)&YPOIt~dN0y+*2s|}5D_z!21EJSk&f3dl+<_dgZR;Q$0Uk&#L+9#7k;QSP!J=4}4 zfr}26gdorz783;mZ#tGwRG~YroHo8D9R!+TnV3h^(Qm_Z2t_PLGr*QGwhy~mn&Xs= zn5LNu04qBzJu!`q9h$M)v1POi@vnxja>-)ejIdbnzur$gmW)=|S<}qB5X-7eD>J-% zw%*XpuqCm*2d2H3IrDtu3@xy~G`Ej6RqYRR`m&Qx3&6hlZr$QRV%xG&(?UCkca5th z+A+^Gp@m?xs-ua=mWL1K-w8KyXd&1aVmK`E)R-9hvDC4pU0pggG8^DWk1d5fm{tn( z>whp!30gf8T-@Q(Ry8f^Xecz1aZFIdwt0K&A|6cwW1*1c9ePN!McY68zXIS0J~Nka w$zu=ta<1`Iz@Ps`t%gvBzTT^=cz*>L01mDKBW!|AVE_OC07*qoM6N<$f(=Q39{>OV diff --git a/src/GWallet.Backend.Tests/CompoundBalanceCaching.fs b/src/GWallet.Backend.Tests/CompoundBalanceCaching.fs index 043a3c829..7e354c242 100644 --- a/src/GWallet.Backend.Tests/CompoundBalanceCaching.fs +++ b/src/GWallet.Backend.Tests/CompoundBalanceCaching.fs @@ -291,12 +291,12 @@ type CompoundBalanceCaching() = File.Delete cacheFiles.ServerStats.FullName [] - member __.``substracting both currency X(e.g. SAI) and the currency Y(e.g.ETH) where fees are spent``() = + member __.``substracting both currency X(e.g. DAI) and the currency Y(e.g.ETH) where fees are spent``() = let cache,cacheFiles = SpawnNewCacheInstanceToTest high_expiration_span_because_this_test_doesnt_involve_timing try - let someTokenCurrency = Currency.SAI + let someTokenCurrency = Currency.DAI let someTokenBalance = 10m let someEthCurrency = Currency.ETH let someEthBalance = 5m diff --git a/src/GWallet.Backend.Tests/Deserialization.fs b/src/GWallet.Backend.Tests/Deserialization.fs index 7420db877..15c9bf761 100644 --- a/src/GWallet.Backend.Tests/Deserialization.fs +++ b/src/GWallet.Backend.Tests/Deserialization.fs @@ -179,10 +179,10 @@ type Deserialization() = Is.EqualTo(2)) [] - member __.``unsigned SAI transaction import``() = + member __.``unsigned DAI transaction import``() = let deserializedUnsignedTrans: UnsignedTransaction = Account.ImportUnsignedTransactionFromJson - MarshallingData.UnsignedSaiTransactionExampleInJson + MarshallingData.UnsignedDaiTransactionExampleInJson Assert.That(deserializedUnsignedTrans, Is.Not.Null) Assert.That(deserializedUnsignedTrans.Proposal, Is.Not.Null) @@ -192,16 +192,16 @@ type Deserialization() = Assert.That(deserializedUnsignedTrans.Proposal.Amount.ValueToSend, Is.EqualTo(1m)) Assert.That(deserializedUnsignedTrans.Proposal.Amount.BalanceAtTheMomentOfSending, Is.EqualTo 7.08m) - Assert.That(deserializedUnsignedTrans.Proposal.Amount.Currency, Is.EqualTo Currency.SAI) + Assert.That(deserializedUnsignedTrans.Proposal.Amount.Currency, Is.EqualTo Currency.DAI) Assert.That(deserializedUnsignedTrans.Proposal.DestinationAddress, Is.EqualTo("0xDb0381B1a380d8db2724A9Ca2d33E0C6C044bE3b")) Assert.That(deserializedUnsignedTrans.Proposal.OriginMainAddress, Is.EqualTo("0xba766d6d13E2Cc921Bf6e896319D32502af9e37E")) - let saiTxMetadata = deserializedUnsignedTrans.Metadata :?> Ether.TransactionMetadata - Assert.That(saiTxMetadata.TransactionCount, Is.EqualTo(7)) - Assert.That(saiTxMetadata.Fee.Currency, Is.EqualTo(Currency.ETH)) - Assert.That(saiTxMetadata.Fee.GasPriceInWei, Is.EqualTo(3343750000L)) + let daiTxMetadata = deserializedUnsignedTrans.Metadata :?> Ether.TransactionMetadata + Assert.That(daiTxMetadata.TransactionCount, Is.EqualTo(7)) + Assert.That(daiTxMetadata.Fee.Currency, Is.EqualTo(Currency.ETH)) + Assert.That(daiTxMetadata.Fee.GasPriceInWei, Is.EqualTo(3343750000L)) Assert.That(deserializedUnsignedTrans.Metadata.FeeEstimationTime, Is.EqualTo MarshallingData.SomeDate) @@ -209,11 +209,11 @@ type Deserialization() = Assert.That(deserializedUnsignedTrans.Cache.UsdPrice.Count, Is.EqualTo(5)) [] - member __.``signed SAI transaction import``() = + member __.``signed DAI transaction import``() = let deserializedSignedTrans: SignedTransaction = Account.ImportSignedTransactionFromJson - MarshallingData.SignedSaiTransactionExampleInJson + MarshallingData.SignedDaiTransactionExampleInJson Assert.That(deserializedSignedTrans, Is.Not.Null) @@ -230,7 +230,7 @@ type Deserialization() = Assert.That(deserializedSignedTrans.TransactionInfo.Proposal.Amount.BalanceAtTheMomentOfSending, Is.EqualTo 7.08m) Assert.That(deserializedSignedTrans.TransactionInfo.Proposal.Amount.Currency, - Is.EqualTo Currency.SAI) + Is.EqualTo Currency.DAI) Assert.That(deserializedSignedTrans.TransactionInfo.Proposal.DestinationAddress, Is.EqualTo("0xDb0381B1a380d8db2724A9Ca2d33E0C6C044bE3b")) Assert.That(deserializedSignedTrans.TransactionInfo.Proposal.OriginMainAddress, diff --git a/src/GWallet.Backend.Tests/GWallet.Backend.Tests-legacy.fsproj b/src/GWallet.Backend.Tests/GWallet.Backend.Tests-legacy.fsproj index a5ddab212..62f96a6fa 100644 --- a/src/GWallet.Backend.Tests/GWallet.Backend.Tests-legacy.fsproj +++ b/src/GWallet.Backend.Tests/GWallet.Backend.Tests-legacy.fsproj @@ -63,8 +63,8 @@ - - + + diff --git a/src/GWallet.Backend.Tests/GWallet.Backend.Tests.fsproj b/src/GWallet.Backend.Tests/GWallet.Backend.Tests.fsproj index 7614dd914..d291c3772 100644 --- a/src/GWallet.Backend.Tests/GWallet.Backend.Tests.fsproj +++ b/src/GWallet.Backend.Tests/GWallet.Backend.Tests.fsproj @@ -43,12 +43,12 @@ - + - + diff --git a/src/GWallet.Backend.Tests/MarshallingData.fs b/src/GWallet.Backend.Tests/MarshallingData.fs index 4dd651417..8a0ee8caf 100644 --- a/src/GWallet.Backend.Tests/MarshallingData.fs +++ b/src/GWallet.Backend.Tests/MarshallingData.fs @@ -56,11 +56,11 @@ module MarshallingData = Fsdk.Misc.ExtractEmbeddedResourceFileContents resourceName |> Sanitize - let UnsignedSaiTransactionExampleInJson = - ReadEmbeddedResource "unsignedAndFormattedSaiTransaction.json" + let UnsignedDaiTransactionExampleInJson = + ReadEmbeddedResource "unsignedAndFormattedDaiTransaction.json" - let SignedSaiTransactionExampleInJson = - ReadEmbeddedResource "signedAndFormattedSaiTransaction.json" + let SignedDaiTransactionExampleInJson = + ReadEmbeddedResource "signedAndFormattedDaiTransaction.json" let BasicExceptionExampleInJson = ReadEmbeddedResource "basicException.json" @@ -196,13 +196,13 @@ module MarshallingData = (Currency.LTC.ToString(), 173.592m); (Currency.ETH.ToString(), 691.52m); (Currency.ETC.ToString(), 19.8644m); - (Currency.SAI.ToString(), 1.00376m) ] + (Currency.DAI.ToString(), 1.00376m) ] |> Map.ofSeq let private realAddressesSample = Map.empty.Add("3Buz1evVsQeHtDfQAmwfAKQsUzAt3f4TuR",[Currency.BTC.ToString()]) .Add("0xba766d6d13E2Cc921Bf6e896319D32502af9e37E",[Currency.ETH.ToString(); - Currency.SAI.ToString() + Currency.DAI.ToString() Currency.ETC.ToString()]) .Add("MJ88KYLTpXVigiwJGevzyxfGogmKx7WiWm",[Currency.LTC.ToString()]) @@ -210,7 +210,7 @@ module MarshallingData = Map.empty.Add(Currency.BTC.ToString(), 0.0m) .Add(Currency.ETH.ToString(), 7.08m) .Add(Currency.ETC.ToString(), 8.0m) - .Add(Currency.SAI.ToString(), 1.0m) + .Add(Currency.DAI.ToString(), 1.0m) .Add(Currency.LTC.ToString(), 0.0m) let private realCachingDataExample = @@ -253,36 +253,36 @@ module MarshallingData = Metadata = someEtherTxMetadata; } - let private someEtherMinerFeeForSaiTransfer = Ether.MinerFee(37298L, + let private someEtherMinerFeeForDaiTransfer = Ether.MinerFee(37298L, 3343750000L, SomeDate, Currency.ETH) - let private someSaiTxMetadata = + let private someDaiTxMetadata = { - Fee = someEtherMinerFeeForSaiTransfer + Fee = someEtherMinerFeeForDaiTransfer TransactionCount = int64 7; } - let private someUnsignedSaiTransactionProposal = + let private someUnsignedDaiTransactionProposal = { OriginMainAddress = "0xba766d6d13E2Cc921Bf6e896319D32502af9e37E"; - Amount = TransferAmount(1m, 7.08m, Currency.SAI) + Amount = TransferAmount(1m, 7.08m, Currency.DAI) DestinationAddress = "0xDb0381B1a380d8db2724A9Ca2d33E0C6C044bE3b"; } - let UnsignedSaiTransactionExample = + let UnsignedDaiTransactionExample = { - Proposal = someUnsignedSaiTransactionProposal + Proposal = someUnsignedDaiTransactionProposal Cache = realCachingDataExample; - Metadata = someSaiTxMetadata + Metadata = someDaiTxMetadata } - let someSaiTransactionInfo = + let someDaiTransactionInfo = { - Proposal = someUnsignedSaiTransactionProposal + Proposal = someUnsignedDaiTransactionProposal Cache = realCachingDataExample; - Metadata = someSaiTxMetadata + Metadata = someDaiTxMetadata } - let SignedSaiTransactionExample = + let SignedDaiTransactionExample = { - TransactionInfo = someSaiTransactionInfo + TransactionInfo = someDaiTransactionInfo RawTransaction = "f8a80784c74d93708291b29489d24a6b4ccb1b6faa2625fe562bdd9a2326035980b844a9059cbb000000000000000000000000db0381b1a380d8db2724a9ca2d33e0c6c044be3b0000000000000000000000000000000000000000000000000de0b6b3a764000026a072cdeb03affd5977c76366efbc1405fbb4fa997ce72c1e4554ba9ec5ef772ddca069d522ea304efebd2537330870bc1ca9e9a6fe3eb5f8d8f66c1b82d9fc27a4bf"; } diff --git a/src/GWallet.Backend.Tests/Serialization.fs b/src/GWallet.Backend.Tests/Serialization.fs index 9a4aeb861..923f75e99 100644 --- a/src/GWallet.Backend.Tests/Serialization.fs +++ b/src/GWallet.Backend.Tests/Serialization.fs @@ -71,26 +71,26 @@ type Serialization() = Is.EqualTo MarshallingData.SignedEtherTransactionExampleInJson) [] - member __.``unsigned SAI transaction export``() = + member __.``unsigned DAI transaction export``() = let json = Account.ExportUnsignedTransactionToJson - MarshallingData.UnsignedSaiTransactionExample + MarshallingData.UnsignedDaiTransactionExample Assert.That(json, Is.Not.Null) Assert.That(json, Is.Not.Empty) Assert.That(json |> MarshallingData.Sanitize, - Is.EqualTo MarshallingData.UnsignedSaiTransactionExampleInJson) + Is.EqualTo MarshallingData.UnsignedDaiTransactionExampleInJson) [] - member __.``signed SAI transaction export``() = - let json = Account.ExportUnsignedTransactionToJson MarshallingData.SignedSaiTransactionExample + member __.``signed DAI transaction export``() = + let json = Account.ExportUnsignedTransactionToJson MarshallingData.SignedDaiTransactionExample Assert.That(json, Is.Not.Null) Assert.That(json, Is.Not.Empty) Assert.That(json|> MarshallingData.Sanitize, - Is.EqualTo MarshallingData.SignedSaiTransactionExampleInJson) + Is.EqualTo MarshallingData.SignedDaiTransactionExampleInJson) [] member __.``can serialize exceptions``() = - let json = Account.ExportUnsignedTransactionToJson MarshallingData.SignedSaiTransactionExample + let json = Account.ExportUnsignedTransactionToJson MarshallingData.SignedDaiTransactionExample Assert.That(json, Is.Not.Null) Assert.That(json, Is.Not.Empty) Assert.That(json|> MarshallingData.Sanitize, - Is.EqualTo MarshallingData.SignedSaiTransactionExampleInJson) + Is.EqualTo MarshallingData.SignedDaiTransactionExampleInJson) diff --git a/src/GWallet.Backend.Tests/data/signedAndFormattedBtcTransaction.json b/src/GWallet.Backend.Tests/data/signedAndFormattedBtcTransaction.json index 05ec34f6b..19caef311 100644 --- a/src/GWallet.Backend.Tests/data/signedAndFormattedBtcTransaction.json +++ b/src/GWallet.Backend.Tests/data/signedAndFormattedBtcTransaction.json @@ -34,15 +34,15 @@ "Cache": { "UsdPrice": { "BTC": 9156.19, + "DAI": 1.00376, "ETC": 19.8644, "ETH": 691.52, - "LTC": 173.592, - "SAI": 1.00376 + "LTC": 173.592 }, "Addresses": { "0xba766d6d13E2Cc921Bf6e896319D32502af9e37E": [ "ETH", - "SAI", + "DAI", "ETC" ], "3Buz1evVsQeHtDfQAmwfAKQsUzAt3f4TuR": [ @@ -54,10 +54,10 @@ }, "Balances": { "BTC": 0.0, + "DAI": 1.0, "ETC": 8.0, "ETH": 7.08, - "LTC": 0.0, - "SAI": 1.0 + "LTC": 0.0 } } }, diff --git a/src/GWallet.Backend.Tests/data/signedAndFormattedSaiTransaction.json b/src/GWallet.Backend.Tests/data/signedAndFormattedDaiTransaction.json similarity index 92% rename from src/GWallet.Backend.Tests/data/signedAndFormattedSaiTransaction.json rename to src/GWallet.Backend.Tests/data/signedAndFormattedDaiTransaction.json index 70e6e14c1..f1f9565a6 100644 --- a/src/GWallet.Backend.Tests/data/signedAndFormattedSaiTransaction.json +++ b/src/GWallet.Backend.Tests/data/signedAndFormattedDaiTransaction.json @@ -9,7 +9,7 @@ "ValueToSend": 1.0, "BalanceAtTheMomentOfSending": 7.08, "Currency": { - "Case": "SAI" + "Case": "DAI" } }, "DestinationAddress": "0xDb0381B1a380d8db2724A9Ca2d33E0C6C044bE3b" @@ -28,15 +28,15 @@ "Cache": { "UsdPrice": { "BTC": 9156.19, + "DAI": 1.00376, "ETC": 19.8644, "ETH": 691.52, - "LTC": 173.592, - "SAI": 1.00376 + "LTC": 173.592 }, "Addresses": { "0xba766d6d13E2Cc921Bf6e896319D32502af9e37E": [ "ETH", - "SAI", + "DAI", "ETC" ], "3Buz1evVsQeHtDfQAmwfAKQsUzAt3f4TuR": [ @@ -48,10 +48,10 @@ }, "Balances": { "BTC": 0.0, + "DAI": 1.0, "ETC": 8.0, "ETH": 7.08, - "LTC": 0.0, - "SAI": 1.0 + "LTC": 0.0 } } }, diff --git a/src/GWallet.Backend.Tests/data/unsignedAndFormattedBtcTransaction.json b/src/GWallet.Backend.Tests/data/unsignedAndFormattedBtcTransaction.json index 35781105e..0b7acc338 100644 --- a/src/GWallet.Backend.Tests/data/unsignedAndFormattedBtcTransaction.json +++ b/src/GWallet.Backend.Tests/data/unsignedAndFormattedBtcTransaction.json @@ -33,15 +33,15 @@ "Cache": { "UsdPrice": { "BTC": 9156.19, + "DAI": 1.00376, "ETC": 19.8644, "ETH": 691.52, - "LTC": 173.592, - "SAI": 1.00376 + "LTC": 173.592 }, "Addresses": { "0xba766d6d13E2Cc921Bf6e896319D32502af9e37E": [ "ETH", - "SAI", + "DAI", "ETC" ], "3Buz1evVsQeHtDfQAmwfAKQsUzAt3f4TuR": [ @@ -53,10 +53,10 @@ }, "Balances": { "BTC": 0.0, + "DAI": 1.0, "ETC": 8.0, "ETH": 7.08, - "LTC": 0.0, - "SAI": 1.0 + "LTC": 0.0 } } } diff --git a/src/GWallet.Backend.Tests/data/unsignedAndFormattedSaiTransaction.json b/src/GWallet.Backend.Tests/data/unsignedAndFormattedDaiTransaction.json similarity index 90% rename from src/GWallet.Backend.Tests/data/unsignedAndFormattedSaiTransaction.json rename to src/GWallet.Backend.Tests/data/unsignedAndFormattedDaiTransaction.json index 3b3e067c2..0c7ddf3ae 100644 --- a/src/GWallet.Backend.Tests/data/unsignedAndFormattedSaiTransaction.json +++ b/src/GWallet.Backend.Tests/data/unsignedAndFormattedDaiTransaction.json @@ -8,7 +8,7 @@ "ValueToSend": 1.0, "BalanceAtTheMomentOfSending": 7.08, "Currency": { - "Case": "SAI" + "Case": "DAI" } }, "DestinationAddress": "0xDb0381B1a380d8db2724A9Ca2d33E0C6C044bE3b" @@ -27,15 +27,15 @@ "Cache": { "UsdPrice": { "BTC": 9156.19, + "DAI": 1.00376, "ETC": 19.8644, "ETH": 691.52, - "LTC": 173.592, - "SAI": 1.00376 + "LTC": 173.592 }, "Addresses": { "0xba766d6d13E2Cc921Bf6e896319D32502af9e37E": [ "ETH", - "SAI", + "DAI", "ETC" ], "3Buz1evVsQeHtDfQAmwfAKQsUzAt3f4TuR": [ @@ -47,10 +47,10 @@ }, "Balances": { "BTC": 0.0, + "DAI": 1.0, "ETC": 8.0, "ETH": 7.08, - "LTC": 0.0, - "SAI": 1.0 + "LTC": 0.0 } } } diff --git a/src/GWallet.Backend/Account.fs b/src/GWallet.Backend/Account.fs index 6f39dc7d4..940afeba7 100644 --- a/src/GWallet.Backend/Account.fs +++ b/src/GWallet.Backend/Account.fs @@ -68,10 +68,6 @@ module Account = | Some (balance,imminentIncomingPayment) -> - if account.Currency = Currency.SAI && balance > 0m then - Infrastructure.ReportWarningMessage ("Some user is still using SAI (informative telemetry to avoid phasing out this currency too early)") - |> ignore - let compoundBalance,_ = Caching.Instance.RetrieveAndUpdateLastCompoundBalance account.PublicAddress account.Currency diff --git a/src/GWallet.Backend/BlockExplorer.fs b/src/GWallet.Backend/BlockExplorer.fs index 9f63decf4..bad14530b 100644 --- a/src/GWallet.Backend/BlockExplorer.fs +++ b/src/GWallet.Backend/BlockExplorer.fs @@ -21,7 +21,7 @@ module BlockExplorer = | Currency.ETC -> // maybe blockscout is better? minergate.com seems to only show blocks, not addresses "https://etcblockexplorer.com/address/addr/" - | Currency.SAI | Currency.DAI -> + | Currency.DAI -> SPrintF1 "https://etherscan.io/token/%s?a=" (TokenManager.GetTokenContractAddress account.Currency) Uri(baseUrl + account.PublicAddress) @@ -36,6 +36,6 @@ module BlockExplorer = "https://etherscan.io/tx/" | Currency.ETC -> "https://etcblockexplorer.com/tx/" - | Currency.DAI | Currency.SAI -> + | Currency.DAI -> "https://etherscan.io/tx/" Uri(baseUrl + txHash) diff --git a/src/GWallet.Backend/Currency.fs b/src/GWallet.Backend/Currency.fs index 89b874e88..f0a6db1a1 100644 --- a/src/GWallet.Backend/Currency.fs +++ b/src/GWallet.Backend/Currency.fs @@ -14,7 +14,6 @@ type Currency = | ETH | ETC | DAI - | SAI // #if STRICTER_COMPILATION_BUT_WITH_REFLECTION_AT_RUNTIME @@ -33,7 +32,6 @@ type Currency = yield ETH yield ETC yield DAI - yield SAI } #endif @@ -43,7 +41,7 @@ type Currency = member self.IsEther() = self = Currency.ETC || self = Currency.ETH member self.IsEthToken() = - self = Currency.DAI || self = Currency.SAI + self = Currency.DAI member self.IsEtherBased() = self.IsEther() || self.IsEthToken() member self.IsUtxo() = @@ -54,7 +52,7 @@ type Currency = 8 elif self.IsEther() then 18 - elif self = Currency.SAI || self = Currency.DAI then + elif self = Currency.DAI then 18 else failwith <| SPrintF1 "Unable to determine decimal places for %A" self @@ -70,7 +68,6 @@ type Currency = | LTC -> "LTC" | ETH -> "ETH" | ETC -> "ETC" - | SAI -> "SAI" | DAI -> "DAI" #endif diff --git a/src/GWallet.Backend/Ether/EtherAccount.fs b/src/GWallet.Backend/Ether/EtherAccount.fs index e64496bae..d081f0a0e 100644 --- a/src/GWallet.Backend/Ether/EtherAccount.fs +++ b/src/GWallet.Backend/Ether/EtherAccount.fs @@ -224,7 +224,7 @@ module internal Account = let baseCurrency = match account.Currency with - | DAI | SAI -> ETH + | DAI -> ETH | _ -> failwith <| SPrintF1 "Unknown token %A" account.Currency let! tokenTransferFee = Ether.Server.EstimateTokenTransferFee account amount destination @@ -467,7 +467,7 @@ module internal Account = let GetSignedTransactionDetails (signedTransaction: SignedTransaction<'T>): ITransactionDetails = match signedTransaction.TransactionInfo.Proposal.Amount.Currency with - | SAI | DAI -> + | DAI -> // FIXME: derive the transaction details from the raw transaction so that we can remove the proposal from // the SignedTransaction type (as it's redundant); and when we remove it, we can also rename // IBlockchainFeeInfo's Currency to "FeeCurrency", or change "Metadata" members whose type is diff --git a/src/GWallet.Backend/Ether/TokenManager.fs b/src/GWallet.Backend/Ether/TokenManager.fs index ed00b7f22..319153c89 100644 --- a/src/GWallet.Backend/Ether/TokenManager.fs +++ b/src/GWallet.Backend/Ether/TokenManager.fs @@ -15,7 +15,6 @@ module TokenManager = let GetTokenContractAddress currency = match currency with | Currency.DAI -> "0x6B175474E89094C44Da98b954EedeAC495271d0F" - | Currency.SAI -> "0x89d24A6b4CcB1B6fAA2625fE562bDD9a23260359" | _ -> raise <| invalidOp (SPrintF1 "%A has no contract address" currency) type TokenServiceWrapper(web3, currency: Currency) = diff --git a/src/GWallet.Backend/FiatValueEstimation.fs b/src/GWallet.Backend/FiatValueEstimation.fs index 0683a30e9..d62010612 100644 --- a/src/GWallet.Backend/FiatValueEstimation.fs +++ b/src/GWallet.Backend/FiatValueEstimation.fs @@ -1011,8 +1011,7 @@ module FiatValueEstimation = | Currency.BTC,_ -> "bitcoin" | Currency.LTC,_ -> "litecoin" - // NOTE: don't worry, a second calculation will be performed for SAI, see https://github.com/nblockchain/geewallet/commit/bb7f59271b21d1ab278e4d4dcd9e12a3bdd49ba9 - | Currency.ETH,_ | Currency.SAI,_ -> "ethereum" + | Currency.ETH,_ -> "ethereum" | Currency.ETC,_ -> "ethereum-classic" | Currency.DAI,PriceProvider.CoinCap -> "multi-collateral-dai" @@ -1195,12 +1194,7 @@ module FiatValueEstimation = let realResult = match result with | Some price -> - let realPrice = - if currency = Currency.SAI then - let ethMultiplied = price * 0.0053m - ethMultiplied - else - price + let realPrice = price Caching.Instance.StoreLastFiatUsdPrice(currency, realPrice) realPrice |> Some | None -> None diff --git a/src/GWallet.Frontend.Console/UserInteraction.fs b/src/GWallet.Frontend.Console/UserInteraction.fs index c39b6db4a..5fbe7d4ca 100644 --- a/src/GWallet.Frontend.Console/UserInteraction.fs +++ b/src/GWallet.Frontend.Console/UserInteraction.fs @@ -228,13 +228,7 @@ module UserInteraction = (maybeBalance: MaybeCached) maybeUsdValue : seq = - match account.Currency, maybeBalance with - | Currency.SAI, NotFresh (Cached (0m, _time)) -> - Seq.empty - | Currency.SAI, Fresh 0m -> - Seq.empty - | _ -> - DisplayAccountStatusInner accountNumber account maybeBalance maybeUsdValue + DisplayAccountStatusInner accountNumber account maybeBalance maybeUsdValue let private GetAccountBalanceInner (account: IAccount) (showProgress: bool): Async*MaybeCached> = async { @@ -324,7 +318,6 @@ module UserInteraction = for KeyValue(currency, balance) in currenciesToBalances do match currency, balance with | _, None -> () - | SAI, Some (0m, _) -> () | _, Some (onlineBalance, maybeUsdValue) -> match maybeUsdValue with | NotFresh(NotAvailable) -> yield None, None diff --git a/src/GWallet.Frontend.XF/FrontendHelpers.fs b/src/GWallet.Frontend.XF/FrontendHelpers.fs index e44a94079..33a0edf07 100644 --- a/src/GWallet.Frontend.XF/FrontendHelpers.fs +++ b/src/GWallet.Frontend.XF/FrontendHelpers.fs @@ -102,16 +102,14 @@ module FrontendHelpers = match currency with | Currency.BTC -> Color.FromRgb(245, 146, 47) - // looks very similar to BTC (orangish)... so let's use SAI color when we phase it out? - | Currency.DAI -> Color.FromRgb(250, 176, 28) + | Currency.DAI -> Color.FromRgb(254, 205, 83) - | Currency.SAI -> Color.FromRgb(254, 205, 83) | Currency.ETC -> Color.FromRgb(14, 119, 52) | Currency.ETH -> Color.FromRgb(130, 131, 132) | Currency.LTC -> Color.FromRgb(54, 94, 155) let UpdateBalance (balance: MaybeCached) currency usdRate - (maybeFrame: Option) (balanceLabel: Label) (fiatBalanceLabel: Label) + (_maybeFrame: Option) (balanceLabel: Label) (fiatBalanceLabel: Label) (cryptoSubUnit: Option) : MaybeCached = let maybeBalanceAmount = @@ -121,12 +119,6 @@ module FrontendHelpers = | NotFresh(Cached(amount,_)) -> Some amount | Fresh(amount) -> - match maybeFrame, currency, amount with - | Some frame, Currency.SAI, 0m -> - MainThread.BeginInvokeOnMainThread(fun _ -> - frame.IsVisible <- false - ) - | _ -> () Some amount let balanceAmountStr,fiatAmount,fiatAmountStr = match maybeBalanceAmount with diff --git a/src/GWallet.Frontend.XF/GWallet.Frontend.XF.fsproj b/src/GWallet.Frontend.XF/GWallet.Frontend.XF.fsproj index 6fa6d61ba..7d6e1587c 100644 --- a/src/GWallet.Frontend.XF/GWallet.Frontend.XF.fsproj +++ b/src/GWallet.Frontend.XF/GWallet.Frontend.XF.fsproj @@ -37,18 +37,6 @@ img\dai_red_120x120.png - - img\sai_grey_60x60.png - - - img\sai_grey_120x120.png - - - img\sai_red_60x60.png - - - img\sai_red_120x120.png - img\etc_grey_60x60.png From 06f0099609ddc7d0d4188a232bcc05135fdddba5 Mon Sep 17 00:00:00 2001 From: webwarrior Date: Mon, 22 Jul 2024 10:42:45 +0200 Subject: [PATCH 2/2] Backend,Frontend: introduce LUSD currency Added LUSD value to Currency enum and made relevant code changes. Also added icons for LUSD. --- img/lusd_grey_120x120.png | Bin 0 -> 4847 bytes img/lusd_grey_60x60.png | Bin 0 -> 2367 bytes img/lusd_red_120x120.png | Bin 0 -> 5116 bytes img/lusd_red_60x60.png | Bin 0 -> 2505 bytes src/GWallet.Backend/BlockExplorer.fs | 4 ++-- src/GWallet.Backend/Currency.fs | 7 +++++-- src/GWallet.Backend/Ether/EtherAccount.fs | 4 ++-- src/GWallet.Backend/Ether/TokenManager.fs | 1 + src/GWallet.Backend/FiatValueEstimation.fs | 1 + src/GWallet.Frontend.XF/FrontendHelpers.fs | 1 + .../GWallet.Frontend.XF.fsproj | 12 ++++++++++++ 11 files changed, 24 insertions(+), 6 deletions(-) create mode 100644 img/lusd_grey_120x120.png create mode 100644 img/lusd_grey_60x60.png create mode 100644 img/lusd_red_120x120.png create mode 100644 img/lusd_red_60x60.png diff --git a/img/lusd_grey_120x120.png b/img/lusd_grey_120x120.png new file mode 100644 index 0000000000000000000000000000000000000000..b920b1ec6ee36034807bf39f662c71902478d4b7 GIT binary patch literal 4847 zcmXAt2{csi8^`aAZR}eiS;xL)jbzI*p((|XEZG@b_OWHjnn6fLOxB^1-AINALxc>n zuRoNsWJ`pJ^qv$HEVmd-nwSR_(X&g%I`SZQ?Zgz0ehY? zx^B|Lpr5{L!>@+rD;%hybyZ>fAnrYZ9xaJCGG{oq!W~t@y^@wvGv&2i73p_=2HjuQ zwz;VD$Z`~QWztkGw0U!@w>zFeTCfqwS9{ujy~o62H>nK01}8SGJ=f*dNPxY z%Z$jPPUrWJUwz0FUUJtcO0BpTCzi1ya2>Wrqk%=cgdEg-0x!!$HGOjJLv5-t4-3#S z{x(zl&J0$mtz6bJO;=)>fm>3g=FWW<^lhNLVe)tmVpn-z_$TFbyUaM#fjiVGpVOHE zI49(ZK^y_$45ahG!qt|5{Ug=ot&~E!!kb~nj340594L_04vD-aJKfr27rY96#~R03DXHZudAkxwnoSm9Q4ED}(RwntQ7pXFsijkohGU>xc`uFpqOW zUL=A00)>JFJlHK_Od$dx0&Dch7}J%R#HBo%NrJOd-jdj_)nB(yT2J5m~$quz$cFa z0@@gyA8EN7h;v2shWvLyp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NZTt5q@maMs4GmZs(WqAOYBtGcUvW__V1IU zp8L)pO?y|Y7M>7&ugNAJdnD!#=rWO5kTFWdBgObxKRy&l!#=qsmOc(7l4YXpuw_~5 zey~NVp;NjJrw|kp=DhFn90i&7{>0o9E6QhS22* zs4vXYIz7h(JuVmc`i#~_aV{I-AeDH`e;Kv1I2>*d2_#@te(YR|MHw9h>wN|GqU%Y#Lh3}=jTtuWjak^#;$y7&&S9r0K*J1T8w3p_~iKk)x2zE zzQssy?W>IG64^W%0^%?~Au`{VOtsj{JPb22K^eOzku)tA=I``U;%Z!0eWvRjJDV{- zLlY;Cl-`sJ47jOW!oRx@QO?5d8vO~8uYAr1ZRICf&lCN(?B?ZI43@gA?;mP~{rWz6 zZGC5_NFTOD$ARkF5jhryw$8q;iBQUgb($LRhO6#{-v_mDk`x8{u(F97+1OXm5(AGH z{iRQ_;dUz6n!(b#5U~K^pG03pS^}ZHy}c5Lb7tZ!q+R9%T;H>@>fy>hLXk!O^M}w0 zN-bW9ZU;Z3x6<&1m)am}jO=HC10YOzP$$~Jd{<-u_an6tgMM!N{Fmlq^Ro39yr=J9 zQbSVxW1HHK9lETx1M)eDj*|DG>iPdk6_12b6*cGIRt|yZIG8x}m*#`TR)$FnSc$q> O1>CrP8&+rF6#qXgb0%;A literal 0 HcmV?d00001 diff --git a/img/lusd_grey_60x60.png b/img/lusd_grey_60x60.png new file mode 100644 index 0000000000000000000000000000000000000000..243cb63a994436abc29f4f858e2f4871cd2bc5e5 GIT binary patch literal 2367 zcmV-F3BdM=P)1$;NSfKp2Jt)9FuJs|lTRvw(%b z$-uEd0IUH%-AGqe?{Ut}1^%Y04~fYA*4n{V`qz?xE0s#OsxDF0bAjUkX@brIi$!EH zaD#L15#V}j?P?%t*4L&29vB#yF)}jp72w-7M_Y{oqi@Q|&bilsA6aXE4OH_Inw)wP zMbXlck&#z{l}t~tlkt8=M|^V>MT_#1cn4fAm*>TC{G^E73>=Wxa1)p-BKJAx?im~$ z^nTD@0Xyf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P{vWUlMPuhE+omVX5vBuQ}K9l8vHumBTA!)<{vO3HlqL z;+HOBU<1O*Zq8riZO>RAxWy{#On)W&K`I|yE}~5WtN3W9`6dya?-qjN-JJhITq6~| z)so5un}G$H`WaJ2^kNbHDloAUn}g5=tQFN;Q|;L&Z0=nThpN1{ly2X!4Ok2;Zkdvr z9;!JD9 literal 0 HcmV?d00001 diff --git a/src/GWallet.Backend/BlockExplorer.fs b/src/GWallet.Backend/BlockExplorer.fs index bad14530b..7bb1b1348 100644 --- a/src/GWallet.Backend/BlockExplorer.fs +++ b/src/GWallet.Backend/BlockExplorer.fs @@ -21,7 +21,7 @@ module BlockExplorer = | Currency.ETC -> // maybe blockscout is better? minergate.com seems to only show blocks, not addresses "https://etcblockexplorer.com/address/addr/" - | Currency.DAI -> + | Currency.LUSD | Currency.DAI -> SPrintF1 "https://etherscan.io/token/%s?a=" (TokenManager.GetTokenContractAddress account.Currency) Uri(baseUrl + account.PublicAddress) @@ -36,6 +36,6 @@ module BlockExplorer = "https://etherscan.io/tx/" | Currency.ETC -> "https://etcblockexplorer.com/tx/" - | Currency.DAI -> + | Currency.DAI | Currency.LUSD -> "https://etherscan.io/tx/" Uri(baseUrl + txHash) diff --git a/src/GWallet.Backend/Currency.fs b/src/GWallet.Backend/Currency.fs index f0a6db1a1..56a6202f1 100644 --- a/src/GWallet.Backend/Currency.fs +++ b/src/GWallet.Backend/Currency.fs @@ -14,6 +14,7 @@ type Currency = | ETH | ETC | DAI + | LUSD // #if STRICTER_COMPILATION_BUT_WITH_REFLECTION_AT_RUNTIME @@ -32,6 +33,7 @@ type Currency = yield ETH yield ETC yield DAI + yield LUSD } #endif @@ -41,7 +43,7 @@ type Currency = member self.IsEther() = self = Currency.ETC || self = Currency.ETH member self.IsEthToken() = - self = Currency.DAI + self = Currency.DAI || self = Currency.LUSD member self.IsEtherBased() = self.IsEther() || self.IsEthToken() member self.IsUtxo() = @@ -52,7 +54,7 @@ type Currency = 8 elif self.IsEther() then 18 - elif self = Currency.DAI then + elif self = Currency.LUSD || self = Currency.DAI then 18 else failwith <| SPrintF1 "Unable to determine decimal places for %A" self @@ -68,6 +70,7 @@ type Currency = | LTC -> "LTC" | ETH -> "ETH" | ETC -> "ETC" + | LUSD -> "LUSD" | DAI -> "DAI" #endif diff --git a/src/GWallet.Backend/Ether/EtherAccount.fs b/src/GWallet.Backend/Ether/EtherAccount.fs index d081f0a0e..2593e18a5 100644 --- a/src/GWallet.Backend/Ether/EtherAccount.fs +++ b/src/GWallet.Backend/Ether/EtherAccount.fs @@ -224,7 +224,7 @@ module internal Account = let baseCurrency = match account.Currency with - | DAI -> ETH + | DAI | LUSD -> ETH | _ -> failwith <| SPrintF1 "Unknown token %A" account.Currency let! tokenTransferFee = Ether.Server.EstimateTokenTransferFee account amount destination @@ -467,7 +467,7 @@ module internal Account = let GetSignedTransactionDetails (signedTransaction: SignedTransaction<'T>): ITransactionDetails = match signedTransaction.TransactionInfo.Proposal.Amount.Currency with - | DAI -> + | LUSD | DAI -> // FIXME: derive the transaction details from the raw transaction so that we can remove the proposal from // the SignedTransaction type (as it's redundant); and when we remove it, we can also rename // IBlockchainFeeInfo's Currency to "FeeCurrency", or change "Metadata" members whose type is diff --git a/src/GWallet.Backend/Ether/TokenManager.fs b/src/GWallet.Backend/Ether/TokenManager.fs index 319153c89..c543aa480 100644 --- a/src/GWallet.Backend/Ether/TokenManager.fs +++ b/src/GWallet.Backend/Ether/TokenManager.fs @@ -15,6 +15,7 @@ module TokenManager = let GetTokenContractAddress currency = match currency with | Currency.DAI -> "0x6B175474E89094C44Da98b954EedeAC495271d0F" + | Currency.LUSD -> "0x5f98805A4E8be255a32880FDeC7F6728C6568bA0" | _ -> raise <| invalidOp (SPrintF1 "%A has no contract address" currency) type TokenServiceWrapper(web3, currency: Currency) = diff --git a/src/GWallet.Backend/FiatValueEstimation.fs b/src/GWallet.Backend/FiatValueEstimation.fs index d62010612..67206ce34 100644 --- a/src/GWallet.Backend/FiatValueEstimation.fs +++ b/src/GWallet.Backend/FiatValueEstimation.fs @@ -1016,6 +1016,7 @@ module FiatValueEstimation = | Currency.ETC,_ -> "ethereum-classic" | Currency.DAI,PriceProvider.CoinCap -> "multi-collateral-dai" | Currency.DAI,_ -> "dai" + | Currency.LUSD,_ -> "liquity-usd" try let baseUrl = diff --git a/src/GWallet.Frontend.XF/FrontendHelpers.fs b/src/GWallet.Frontend.XF/FrontendHelpers.fs index 33a0edf07..f114bdcfb 100644 --- a/src/GWallet.Frontend.XF/FrontendHelpers.fs +++ b/src/GWallet.Frontend.XF/FrontendHelpers.fs @@ -104,6 +104,7 @@ module FrontendHelpers = | Currency.DAI -> Color.FromRgb(254, 205, 83) + | Currency.LUSD -> Color.FromRgb(46, 182, 234) | Currency.ETC -> Color.FromRgb(14, 119, 52) | Currency.ETH -> Color.FromRgb(130, 131, 132) | Currency.LTC -> Color.FromRgb(54, 94, 155) diff --git a/src/GWallet.Frontend.XF/GWallet.Frontend.XF.fsproj b/src/GWallet.Frontend.XF/GWallet.Frontend.XF.fsproj index 7d6e1587c..dac3a15e8 100644 --- a/src/GWallet.Frontend.XF/GWallet.Frontend.XF.fsproj +++ b/src/GWallet.Frontend.XF/GWallet.Frontend.XF.fsproj @@ -37,6 +37,18 @@ img\dai_red_120x120.png + + img\lusd_grey_60x60.png + + + img\lusd_grey_120x120.png + + + img\lusd_red_60x60.png + + + img\lusd_red_120x120.png + img\etc_grey_60x60.png