Skip to content

Commit

Permalink
Merge pull request #2 from WalletConnect/feature/eip-155-constant-revert
Browse files Browse the repository at this point in the history
EIP-155 constant revert
  • Loading branch information
flypaper0 authored Nov 28, 2022
2 parents 5042fbd + df4a2b1 commit 569255a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Sources/Core/Transaction/EthereumPrivateKey.swift
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ public final class EthereumPrivateKey {
throw Error.internalError
}

return (v: UInt(recid + 27), r: Array(output64[0..<32]), s: Array(output64[32..<64]))
return (v: UInt(recid), r: Array(output64[0..<32]), s: Array(output64[32..<64]))
}

/**
Expand Down
9 changes: 1 addition & 8 deletions Sources/Core/Transaction/EthereumPublicKey.swift
Original file line number Diff line number Diff line change
Expand Up @@ -142,14 +142,7 @@ public final class EthereumPublicKey {
guard let vUInt = v.quantity.makeBytes().bigEndianUInt, vUInt <= Int32.max else {
throw Error.signatureMalformed
}
var v = Int32(vUInt)
if v >= 27 && v <= 30 {
v -= 27
} else if v >= 31 && v <= 34 {
v -= 31
} else if v >= 35 && v <= 38 {
v -= 35
}
let v = Int32(vUInt)

for _ in 0..<(32 - r.count) {
r.insert(0, at: 0)
Expand Down
2 changes: 1 addition & 1 deletion WalletConnectWeb3.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'WalletConnectWeb3'
s.version = '1.0.1'
s.version = '1.0.2'
s.summary = 'Web3 library for Swift. Sign transactions and interact with Smart Contracts in the Ethereum Network.'

s.description = <<-DESC
Expand Down

0 comments on commit 569255a

Please sign in to comment.