Skip to content

Commit

Permalink
Merge pull request #4 from metaplex-foundation/fix/init-decoders
Browse files Browse the repository at this point in the history
Init decoders
  • Loading branch information
ajamaica authored Sep 16, 2022
2 parents 2085c70 + d5ebe8d commit 0873ff2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions Sources/Beet/Vendor/Borsh/BorshDecoder.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Foundation

public struct BorshDecoder {
public init() {}
public func decode<T>(_ type: T.Type, from data: Data) throws -> T where T: BorshDeserializable {
var reader = BinaryReader(bytes: [UInt8](data))
return try T.init(from: &reader)
Expand Down
1 change: 1 addition & 0 deletions Sources/Beet/Vendor/Borsh/BorshEncoder.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Foundation

public struct BorshEncoder {
public init() {}
public func encode<T>(_ value: T) throws -> Data where T: BorshSerializable {
var writer = Data()
try value.serialize(to: &writer)
Expand Down

0 comments on commit 0873ff2

Please sign in to comment.