Skip to content

Commit

Permalink
GH-3365 fix typed data issue
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitryBespalov committed Dec 18, 2023
1 parent b9b0b58 commit 6793ee2
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions Multisig/Logic/Models/EIP712Transformer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ struct TDDomain: Codable {
struct TDSafeTx_pre_1_0_0: Codable {
var to: AddressString
var value: UInt256String
var data: DataString
var data: String
var operation: SCGModels.Operation
var safeTxGas: UInt256String
var dataGas: UInt256String
Expand Down Expand Up @@ -75,7 +75,12 @@ extension TDSafeTx_pre_1_0_0 {
init(tx: Transaction) {
to = tx.to
value = tx.value
data = tx.data ?? DataString(Data())
// MetaMask workaround
if let d = tx.data, !d.data.isEmpty {
data = d.description
} else {
data = ""
}
operation = tx.operation
safeTxGas = tx.safeTxGas
dataGas = tx.baseGas
Expand All @@ -90,7 +95,7 @@ extension TDSafeTx_pre_1_0_0 {
struct TDSafeTx: Codable {
var to: AddressString
var value: UInt256String
var data: DataString
var data: String
var operation: SCGModels.Operation
var safeTxGas: UInt256String
var baseGas: UInt256String
Expand Down Expand Up @@ -120,7 +125,12 @@ extension TDSafeTx {
init(tx: Transaction) {
to = tx.to
value = tx.value
data = tx.data ?? DataString(Data())
// MetaMask workaround
if let d = tx.data, !d.data.isEmpty {
data = d.description
} else {
data = ""
}
operation = tx.operation
safeTxGas = tx.safeTxGas
baseGas = tx.baseGas
Expand Down

0 comments on commit 6793ee2

Please sign in to comment.