Skip to content

Commit a51dec9

Browse files
committed
Backend: rename .OriginAddress to .OriginMainAddress
This way, if a non-segwit capable version of geewallet tries to deserialize a transaction proposal, it will error out complaining about version mismatch instead of crashing with a weird error.
1 parent b8c6bf4 commit a51dec9

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

src/GWallet.Backend/Account.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ module Account =
223223
else
224224
transactionProposal.Amount.ValueToSend + fee.FeeValue
225225
Caching.Instance.StoreOutgoingTransaction
226-
transactionProposal.OriginAddress
226+
transactionProposal.OriginMainAddress
227227
transactionProposal.Amount.Currency
228228
fee.Currency
229229
txId
@@ -445,7 +445,7 @@ module Account =
445445

446446
let transactionProposal =
447447
{
448-
OriginAddress = baseAccount.PublicAddress
448+
OriginMainAddress = baseAccount.PublicAddress
449449
Amount = amount
450450
DestinationAddress = destination
451451
}

src/GWallet.Backend/Ether/EtherAccount.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ module internal Account =
487487

488488
let txDetails =
489489
{
490-
OriginAddress = signer.GetSenderAddress signedTransaction.RawTransaction
490+
OriginMainAddress = signer.GetSenderAddress signedTransaction.RawTransaction
491491
Amount = UnitConversion.Convert.FromWei (IntTypeDecoder().DecodeBigInteger tx.Value)
492492
Currency = getTransactionCurrency tx
493493
DestinationAddress = destAddress

src/GWallet.Backend/Transaction.fs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
11
namespace GWallet.Backend
22

33
type ITransactionDetails =
4-
abstract member OriginAddress: string
4+
abstract member OriginMainAddress: string
55
abstract member Amount: decimal
66
abstract member Currency: Currency
77
abstract member DestinationAddress: string
88

99
type internal SignedTransactionDetails =
1010
{
11-
OriginAddress: string
11+
OriginMainAddress: string
1212
Amount: decimal
1313
Currency: Currency
1414
DestinationAddress: string
1515
}
1616
interface ITransactionDetails with
17-
member self.OriginAddress = self.OriginAddress
17+
member self.OriginMainAddress = self.OriginMainAddress
1818
member self.Amount = self.Amount
1919
member self.Currency = self.Currency
2020
member self.DestinationAddress = self.DestinationAddress
2121

2222
type UnsignedTransactionProposal =
2323
{
24-
OriginAddress: string;
24+
OriginMainAddress: string
2525
Amount: TransferAmount;
2626
DestinationAddress: string;
2727
}
2828
interface ITransactionDetails with
29-
member self.OriginAddress = self.OriginAddress
29+
member self.OriginMainAddress = self.OriginMainAddress
3030
member self.Amount = self.Amount.ValueToSend
3131
member self.Currency = self.Amount.Currency
3232
member self.DestinationAddress = self.DestinationAddress

src/GWallet.Backend/UtxoCoin/UtxoCoinAccount.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,7 @@ module Account =
759759
failwith "expected a single destination address"
760760

761761
{
762-
OriginAddress = (account :> IAccount).PublicAddress
762+
OriginMainAddress = (account :> IAccount).PublicAddress
763763
DestinationAddress = destinationAddress.ToString()
764764
Amount = value.ToDecimal MoneyUnit.BTC
765765
Currency = currency

0 commit comments

Comments
 (0)