Expose a 12-byte array instead of 10-byte as OnionV2 has changed
authorMatt Corallo <git@bluematt.me>
Sat, 18 Dec 2021 02:02:10 +0000 (02:02 +0000)
committerMatt Corallo <git@bluematt.me>
Sun, 19 Dec 2021 23:58:04 +0000 (23:58 +0000)
c-bindings-gen/src/types.rs
lightning-c-bindings/src/c_types/mod.rs

index f5417010aeafa4aae98a5ba82b7d0ee9375a4924..0b3aaf32ca6a3f2b74a50ff4788709eb667b2dcd 100644 (file)
@@ -874,7 +874,7 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
                        "[u8; 32]" if !is_ref => Some("crate::c_types::ThirtyTwoBytes"),
                        "[u8; 20]" if !is_ref => Some("crate::c_types::TwentyBytes"),
                        "[u8; 16]" if !is_ref => Some("crate::c_types::SixteenBytes"),
                        "[u8; 32]" if !is_ref => Some("crate::c_types::ThirtyTwoBytes"),
                        "[u8; 20]" if !is_ref => Some("crate::c_types::TwentyBytes"),
                        "[u8; 16]" if !is_ref => Some("crate::c_types::SixteenBytes"),
-                       "[u8; 10]" if !is_ref => Some("crate::c_types::TenBytes"),
+                       "[u8; 12]" if !is_ref => Some("crate::c_types::TwelveBytes"),
                        "[u8; 4]" if !is_ref => Some("crate::c_types::FourBytes"),
                        "[u8; 3]" if !is_ref => Some("crate::c_types::ThreeBytes"), // Used for RGB values
 
                        "[u8; 4]" if !is_ref => Some("crate::c_types::FourBytes"),
                        "[u8; 3]" if !is_ref => Some("crate::c_types::ThreeBytes"), // Used for RGB values
 
@@ -949,7 +949,7 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
                        "[u8; 32]" if !is_ref => Some(""),
                        "[u8; 20]" if !is_ref => Some(""),
                        "[u8; 16]" if !is_ref => Some(""),
                        "[u8; 32]" if !is_ref => Some(""),
                        "[u8; 20]" if !is_ref => Some(""),
                        "[u8; 16]" if !is_ref => Some(""),
-                       "[u8; 10]" if !is_ref => Some(""),
+                       "[u8; 12]" if !is_ref => Some(""),
                        "[u8; 4]" if !is_ref => Some(""),
                        "[u8; 3]" if !is_ref => Some(""),
 
                        "[u8; 4]" if !is_ref => Some(""),
                        "[u8; 3]" if !is_ref => Some(""),
 
@@ -1031,7 +1031,7 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
                        "[u8; 32]" if !is_ref => Some(".data"),
                        "[u8; 20]" if !is_ref => Some(".data"),
                        "[u8; 16]" if !is_ref => Some(".data"),
                        "[u8; 32]" if !is_ref => Some(".data"),
                        "[u8; 20]" if !is_ref => Some(".data"),
                        "[u8; 16]" if !is_ref => Some(".data"),
-                       "[u8; 10]" if !is_ref => Some(".data"),
+                       "[u8; 12]" if !is_ref => Some(".data"),
                        "[u8; 4]" if !is_ref => Some(".data"),
                        "[u8; 3]" if !is_ref => Some(".data"),
 
                        "[u8; 4]" if !is_ref => Some(".data"),
                        "[u8; 3]" if !is_ref => Some(".data"),
 
@@ -1115,7 +1115,7 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
                        "[u8; 32]" if is_ref => Some(""),
                        "[u8; 20]" if !is_ref => Some("crate::c_types::TwentyBytes { data: "),
                        "[u8; 16]" if !is_ref => Some("crate::c_types::SixteenBytes { data: "),
                        "[u8; 32]" if is_ref => Some(""),
                        "[u8; 20]" if !is_ref => Some("crate::c_types::TwentyBytes { data: "),
                        "[u8; 16]" if !is_ref => Some("crate::c_types::SixteenBytes { data: "),
-                       "[u8; 10]" if !is_ref => Some("crate::c_types::TenBytes { data: "),
+                       "[u8; 12]" if !is_ref => Some("crate::c_types::TwelveBytes { data: "),
                        "[u8; 4]" if !is_ref => Some("crate::c_types::FourBytes { data: "),
                        "[u8; 3]" if is_ref => Some(""),
 
                        "[u8; 4]" if !is_ref => Some("crate::c_types::FourBytes { data: "),
                        "[u8; 3]" if is_ref => Some(""),
 
@@ -1185,7 +1185,7 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
                        "[u8; 32]" if is_ref => Some(""),
                        "[u8; 20]" if !is_ref => Some(" }"),
                        "[u8; 16]" if !is_ref => Some(" }"),
                        "[u8; 32]" if is_ref => Some(""),
                        "[u8; 20]" if !is_ref => Some(" }"),
                        "[u8; 16]" if !is_ref => Some(" }"),
-                       "[u8; 10]" if !is_ref => Some(" }"),
+                       "[u8; 12]" if !is_ref => Some(" }"),
                        "[u8; 4]" if !is_ref => Some(" }"),
                        "[u8; 3]" if is_ref => Some(""),
 
                        "[u8; 4]" if !is_ref => Some(" }"),
                        "[u8; 3]" if is_ref => Some(""),
 
index 98e964ff6efb5b7d20ec7fe419103ee25f98c6f0..472d4d0d15482e30c031720f0ee4de708d53daef 100644 (file)
@@ -404,8 +404,8 @@ pub struct ThreeBytes { /** The three bytes */ pub data: [u8; 3], }
 pub struct FourBytes { /** The four bytes */ pub data: [u8; 4], }
 #[derive(Clone)]
 #[repr(C)]
 pub struct FourBytes { /** The four bytes */ pub data: [u8; 4], }
 #[derive(Clone)]
 #[repr(C)]
-/// A 10-byte byte array.
-pub struct TenBytes { /** The ten bytes */ pub data: [u8; 10], }
+/// A 12-byte byte array.
+pub struct TwelveBytes { /** The twelve bytes */ pub data: [u8; 12], }
 #[derive(Clone)]
 #[repr(C)]
 /// A 16-byte byte array.
 #[derive(Clone)]
 #[repr(C)]
 /// A 16-byte byte array.