From 17da41b559c5d06959050608b7c89d55f0d757da Mon Sep 17 00:00:00 2001 From: Zhichao Link Date: Thu, 1 Feb 2024 12:32:03 +0800 Subject: [PATCH] fix solana message from bug --- Sources/SolanaSwift/Extensions/Data+Extensions.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/SolanaSwift/Extensions/Data+Extensions.swift b/Sources/SolanaSwift/Extensions/Data+Extensions.swift index a560396e3..f7dd41221 100644 --- a/Sources/SolanaSwift/Extensions/Data+Extensions.swift +++ b/Sources/SolanaSwift/Extensions/Data+Extensions.swift @@ -18,12 +18,12 @@ public extension Data { } mutating func decodeLength() -> Int { - var len: UInt8 = 0 - var size: UInt8 = 0 + var len: Int = 0 + var size: Int = 0 while true { guard let elem = bytes.first else { break } _ = popFirst() - len |= (elem & 0x7F) << (size * 7) + len |= (Int(elem) & 0x7F) << (size * 7) size += 1 if elem & 0x80 == 0 { break