Skip to content

Commit

Permalink
Merge pull request #3 from metaplex-foundation/fix/expose-encoders
Browse files Browse the repository at this point in the history
Expose encoders
  • Loading branch information
ajamaica authored Sep 16, 2022
2 parents 0025f40 + e5061df commit 2085c70
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions Sources/Beet/Vendor/Borsh/BorshDecoder.swift
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import Foundation

struct BorshDecoder {
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)
}
public struct BorshDecoder {
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)
}
}
12 changes: 6 additions & 6 deletions Sources/Beet/Vendor/Borsh/BorshEncoder.swift
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import Foundation

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

0 comments on commit 2085c70

Please sign in to comment.