Skip to content

Commit 4943412

Browse files
Revert "Merge pull request #440 from jimmyneutront/develop"
This reverts commit 55c8c93, reversing changes made to cbaea38.
1 parent ec6775e commit 4943412

File tree

1 file changed

+1
-19
lines changed

1 file changed

+1
-19
lines changed

Sources/web3swift/EthereumABI/ABIDecoding.swift

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -173,25 +173,7 @@ extension ABIDecoder {
173173
let (v, c) = decodeSignleType(type: subTypes[i], data: elementItself, pointer: consumed)
174174
guard let valueUnwrapped = v, let consumedUnwrapped = c else {return (nil, nil)}
175175
toReturn.append(valueUnwrapped)
176-
/*
177-
When decoding a tuple that is not static or an array with a subtype that is not static, the second value in the tuple returned by decodeSignleType is a pointer to the next element, NOT the length of the consumed element. So when decoding such an element, consumed should be set to consumedUnwrapped, NOT incremented by consumedUnwrapped.
178-
*/
179-
switch subTypes[i] {
180-
case .array(type: let subType, length: _):
181-
if !subType.isStatic {
182-
consumed = consumedUnwrapped
183-
} else {
184-
fallthrough
185-
}
186-
case .tuple(types: _):
187-
if !subTypes[i].isStatic {
188-
consumed = consumedUnwrapped
189-
} else {
190-
fallthrough
191-
}
192-
default:
193-
consumed = consumed + consumedUnwrapped
194-
}
176+
consumed = consumed + consumedUnwrapped
195177
}
196178
// print("Tuple element is: \n" + String(describing: toReturn))
197179
if type.isStatic {

0 commit comments

Comments
 (0)