Skip to content

Commit 7591bbe

Browse files
committed
return a new instance of Data in decodeSingleType
1 parent 2357868 commit 7591bbe

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Sources/Web3Core/EthereumABI/ABIDecoding.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ extension ABIDecoder {
7070
case .bytes(let length):
7171
guard elementItself.count >= 32 else {break}
7272
let dataSlice = elementItself[0 ..< length]
73-
return (dataSlice, type.memoryUsage)
73+
return (Data(dataSlice), type.memoryUsage)
7474
case .string:
7575
guard elementItself.count >= 32 else {break}
7676
var dataSlice = elementItself[0 ..< 32]
@@ -85,7 +85,7 @@ extension ABIDecoder {
8585
let length = UInt64(BigUInt(dataSlice))
8686
guard elementItself.count >= 32+length else {break}
8787
dataSlice = elementItself[32 ..< 32 + length]
88-
return (dataSlice, nextElementPointer)
88+
return (Data(dataSlice), nextElementPointer)
8989
case .array(type: let subType, length: let length):
9090
switch type.arraySize {
9191
case .dynamicSize:

0 commit comments

Comments
 (0)