Skip to content

Commit 62686d9

Browse files
committed
Squashed commit of the following:
commit 2f090dd Merge: 0016aee 6cb1440 Author: Yaroslav <[email protected]> Date: Wed Mar 23 19:47:00 2022 +0300 Merge pull request #502 from skywinder/master commit 6cb1440 Merge: d6c0a4c 0016aee Author: Yaroslav <[email protected]> Date: Wed Mar 23 19:39:51 2022 +0300 Merge pull request #501 from skywinder/develop commit 0016aee Merge: 239887d 11517aa Author: Yaroslav <[email protected]> Date: Wed Mar 23 19:13:41 2022 +0300 Merge pull request #498 from mloit/feature/bug-fix-rollup commit d6c0a4c Author: Yaroslav <[email protected]> Date: Wed Mar 23 19:00:43 2022 +0300 Update podspec version. commit b6abf2e Merge: ff538e8 239887d Author: Yaroslav <[email protected]> Date: Wed Mar 23 18:58:00 2022 +0300 Merge pull request #500 from skywinder/develop commit 239887d Author: Yaroslav <[email protected]> Date: Wed Mar 23 18:11:18 2022 +0300 Update github action settings Try to fix ci/cd run cancelling issue. commit c781699 Merge: e1b0306 52002db Author: Yaroslav <[email protected]> Date: Wed Mar 23 15:56:32 2022 +0300 Merge pull request #496 from mloit/feature/remove-unused-file commit 52002db Author: mloit <[email protected]> Date: Wed Mar 23 07:59:50 2022 -0400 updated the xcode project file to reflect the file status change. commit e1b0306 Merge: e6f526e 17d7321 Author: Yaroslav <[email protected]> Date: Wed Mar 23 13:52:45 2022 +0300 Merge pull request #481 from mloit/fix-random-init commit e6f526e Merge: f85ab50 1edf2f6 Author: Yaroslav <[email protected]> Date: Wed Mar 23 13:26:38 2022 +0300 Merge pull request #490 from mloit/remove-dead-code commit 17d7321 Merge: cd5746d f85ab50 Author: Yaroslav <[email protected]> Date: Wed Mar 23 13:22:31 2022 +0300 Merge branch 'develop' into fix-random-init commit f85ab50 Merge: 5edab19 9d84b4a Author: Yaroslav <[email protected]> Date: Wed Mar 23 11:45:05 2022 +0300 Merge pull request #467 from mloit/tolerate1559 commit 11517aa Author: mloit <[email protected]> Date: Tue Mar 22 23:38:04 2022 -0400 fix unsafe forced unwrap in transaction signers commit 4774e99 Author: mloit <[email protected]> Date: Tue Mar 22 23:28:49 2022 -0400 fix typo in function name changed 'Signle' to 'Single' corrected all calling occurences commit 7fd2043 Author: mloit <[email protected]> Date: Tue Mar 22 23:26:46 2022 -0400 bugfix: if let makes no sense if the input won't produce an optional As it was it would throw a decode error instead of returning nil this was exposed when I fixed the coding key for callOnBlock, which typically isn't present commit b6000e9 Author: mloit <[email protected]> Date: Mon Mar 21 13:32:57 2022 -0400 fix TransactionOptions decoding of callOnBlock using incorrect key of .nonce commit 30711bb Author: mloit <[email protected]> Date: Mon Mar 21 13:30:45 2022 -0400 PR #440 bugfix, replace the fallthrough's with the desired action, as falling through caused erroneous decoding. commit e9b53c0 Author: mloit <[email protected]> Date: Mon Mar 21 13:28:38 2022 -0400 Restore failing #440 PR commit 9046350 Author: mloit <[email protected]> Date: Tue Mar 22 14:41:39 2022 -0400 File is empty and unused since 2018, I'm pretty sure we don't need it commit 1edf2f6 Author: Mark Loit <[email protected]> Date: Sun Mar 20 12:02:04 2022 -0400 more nil coalescing to clean up the original code commit 529d9ec Author: mloit <[email protected]> Date: Sun Mar 20 11:44:25 2022 -0400 nil coalescing commit df358d4 Author: Mark Loit <[email protected]> Date: Sun Mar 20 00:24:25 2022 -0400 refactored to work with Decodable stream commit dc0d85b Author: Mark Loit <[email protected]> Date: Sun Mar 20 00:23:12 2022 -0400 restoreWeb3+BrowserFunctions before proper refactor to remove reliance on the old json initializers in Transaction and TransactionOptions commit 482589d Author: Mark Loit <[email protected]> Date: Sat Mar 19 20:42:41 2022 -0400 Changed the parsing in TransactionInBlock to properly use the Decodable protocol instead of switching over to JSON parsing Removed all the old (now completely dead) JSON based parsing code. No point in keeping the JSON code as it duplicates the Decodable code, and makes code maintenance more difficult commit 9d84b4a Author: Mark Loit <[email protected]> Date: Wed Mar 16 15:32:14 2022 -0400 refactor to remove force unwraps commit cd5746d Author: Mark Loit <[email protected]> Date: Sun Mar 13 20:40:30 2022 -0400 fix buffer overrun issue (#470) where initialization with random bytes ignored the passed length and used a fixed length of 32 bytes. This results in only the first 32 bytes of larger objects being initialized, and overruns beyond the end for smaller objects. commit 051f94f Author: Mark Loit <[email protected]> Date: Thu Feb 10 00:11:30 2022 -0500 Provide basic tolerance to EIP-1559 data Test for the envelope 'type' if 0 or not present we assume legacy and can continue, otherwise abort as it is 1559 [or future] and we don't know its encoding Added some basic garbage-in garbage out checks to prevent calculations from generating an overflow. This will mean what comes out is garbage, but at least it didn't crash.
1 parent 2cce76a commit 62686d9

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Sources/web3swift/Web3/Web3+Structures.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ extension TransactionOptions: Decodable {
5050

5151
public init(from decoder: Decoder) throws {
5252
let container = try decoder.container(keyedBy: CodingKeys.self)
53+
5354
if let gasLimit = try decodeHexToBigUInt(container, key: .gas, allowOptional: true) {
5455
self.gasLimit = .manual(gasLimit)
5556
} else {
@@ -113,13 +114,11 @@ extension EthereumTransaction: Decodable {
113114
public init(from decoder: Decoder) throws {
114115
let options = try TransactionOptions(from: decoder)
115116
let container = try decoder.container(keyedBy: CodingKeys.self)
116-
117117
// test to see if it is a EIP-1559 wrapper
118118
if let envelope = try decodeHexToBigUInt(container, key: .type, allowOptional: true) {
119119
// if present and non-sero we are a new wrapper we can't decode
120120
if(envelope != BigInt(0)) { throw Web3Error.dataError }
121121
}
122-
123122
var data = try decodeHexToData(container, key: .data, allowOptional: true)
124123
if data != nil {
125124
self.data = data!

0 commit comments

Comments
 (0)