3 public class BestBlock {
5 public internal(set) var cOpaqueStruct: LDKBestBlock?;
7 /* DEFAULT_CONSTRUCTOR_START */
8 public init(block_hash: [UInt8], height: UInt32) {
10 self.cOpaqueStruct = BestBlock_new(Bindings.new_LDKThirtyTwoBytes(array: block_hash), height)
12 /* DEFAULT_CONSTRUCTOR_END */
14 public init(pointer: LDKBestBlock){
15 self.cOpaqueStruct = pointer
18 /* STRUCT_METHODS_START */
20 public func clone(orig: BestBlock) -> BestBlock {
22 return withUnsafePointer(to: orig.cOpaqueStruct!) { (origPointer: UnsafePointer<LDKBestBlock>) in
23 BestBlock(pointer: BestBlock_clone(origPointer))
27 public func block_hash() -> [UInt8] {
29 return Bindings.LDKThirtyTwoBytes_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_argPointer: UnsafePointer<LDKBestBlock>) in
30 BestBlock_block_hash(this_argPointer)
34 public func height() -> UInt32 {
36 return withUnsafePointer(to: self.cOpaqueStruct!) { (this_argPointer: UnsafePointer<LDKBestBlock>) in
37 BestBlock_height(this_argPointer)
43 if self.cOpaqueStruct?.is_owned == false {
47 BestBlock_free(self.cOpaqueStruct!)
53 /* STRUCT_METHODS_END */