@@ -863,7 +863,8 @@ fn initial_clonable_types() -> HashSet<String> {
863
863
res. insert ( "crate::c_types::WitnessVersion" . to_owned ( ) ) ;
864
864
res. insert ( "crate::c_types::TxIn" . to_owned ( ) ) ;
865
865
res. insert ( "crate::c_types::TxOut" . to_owned ( ) ) ;
866
- res. insert ( "crate::c_types::Signature" . to_owned ( ) ) ;
866
+ res. insert ( "crate::c_types::ECDSASignature" . to_owned ( ) ) ;
867
+ res. insert ( "crate::c_types::SchnorrSignature" . to_owned ( ) ) ;
867
868
res. insert ( "crate::c_types::RecoverableSignature" . to_owned ( ) ) ;
868
869
res. insert ( "crate::c_types::BigEndianScalar" . to_owned ( ) ) ;
869
870
res. insert ( "crate::c_types::Bech32Error" . to_owned ( ) ) ;
@@ -1030,10 +1031,10 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
1030
1031
"[u8; 12]" if !is_ref => Some ( "crate::c_types::TwelveBytes" ) ,
1031
1032
"[u8; 4]" if !is_ref => Some ( "crate::c_types::FourBytes" ) ,
1032
1033
"[u8; 3]" if !is_ref => Some ( "crate::c_types::ThreeBytes" ) , // Used for RGB values
1033
- "[u16; 8 ]" if !is_ref => Some ( "crate::c_types::EightU16s " ) ,
1034
+ "[u16; 32 ]" if !is_ref => Some ( "crate::c_types::ThirtyTwoU16s " ) ,
1034
1035
1035
1036
"str" if is_ref => Some ( "crate::c_types::Str" ) ,
1036
- "alloc::string::String" |"String" => Some ( "crate::c_types::Str" ) ,
1037
+ "alloc::string::String" |"String" | "std::path::PathBuf" => Some ( "crate::c_types::Str" ) ,
1037
1038
1038
1039
"bitcoin::Address" => Some ( "crate::c_types::Str" ) ,
1039
1040
@@ -1057,7 +1058,8 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
1057
1058
"core::num::NonZeroU8" => Some ( "u8" ) ,
1058
1059
1059
1060
"secp256k1::PublicKey" |"bitcoin::secp256k1::PublicKey" => Some ( "crate::c_types::PublicKey" ) ,
1060
- "bitcoin::secp256k1::ecdsa::Signature" => Some ( "crate::c_types::Signature" ) ,
1061
+ "bitcoin::secp256k1::ecdsa::Signature" => Some ( "crate::c_types::ECDSASignature" ) ,
1062
+ "bitcoin::secp256k1::schnorr::Signature" => Some ( "crate::c_types::SchnorrSignature" ) ,
1061
1063
"bitcoin::secp256k1::ecdsa::RecoverableSignature" => Some ( "crate::c_types::RecoverableSignature" ) ,
1062
1064
"bitcoin::secp256k1::SecretKey" if is_ref => Some ( "*const [u8; 32]" ) ,
1063
1065
"bitcoin::secp256k1::SecretKey" if !is_ref => Some ( "crate::c_types::SecretKey" ) ,
@@ -1102,10 +1104,12 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
1102
1104
"lightning::ln::PaymentHash" |"lightning::ln::PaymentPreimage" |"lightning::ln::PaymentSecret"
1103
1105
|"lightning::ln::channelmanager::PaymentId" |"lightning::ln::channelmanager::InterceptId"
1104
1106
|"lightning::sign::KeyMaterial" |"lightning::chain::ClaimId"
1107
+ |"lightning::ln::ChannelId" |"lightning::ln::channel_id::ChannelId"
1105
1108
if is_ref => Some ( "*const [u8; 32]" ) ,
1106
1109
"lightning::ln::PaymentHash" |"lightning::ln::PaymentPreimage" |"lightning::ln::PaymentSecret"
1107
1110
|"lightning::ln::channelmanager::PaymentId" |"lightning::ln::channelmanager::InterceptId"
1108
1111
|"lightning::sign::KeyMaterial" |"lightning::chain::ClaimId"
1112
+ |"lightning::ln::ChannelId" |"lightning::ln::channel_id::ChannelId"
1109
1113
if !is_ref => Some ( "crate::c_types::ThirtyTwoBytes" ) ,
1110
1114
1111
1115
"lightning::io::Read" => Some ( "crate::c_types::u8slice" ) ,
@@ -1134,13 +1138,13 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
1134
1138
"[u8; 12]" if !is_ref => Some ( "" ) ,
1135
1139
"[u8; 4]" if !is_ref => Some ( "" ) ,
1136
1140
"[u8; 3]" if !is_ref => Some ( "" ) ,
1137
- "[u16; 8 ]" if !is_ref => Some ( "" ) ,
1141
+ "[u16; 32 ]" if !is_ref => Some ( "" ) ,
1138
1142
1139
1143
"[u8]" if is_ref => Some ( "" ) ,
1140
1144
"[usize]" if is_ref => Some ( "" ) ,
1141
1145
1142
1146
"str" if is_ref => Some ( "" ) ,
1143
- "alloc::string::String" |"String" => Some ( "" ) ,
1147
+ "alloc::string::String" |"String" | "std::path::PathBuf" => Some ( "" ) ,
1144
1148
"std::io::Error" |"lightning::io::Error" |"lightning::io::ErrorKind" => Some ( "" ) ,
1145
1149
// Note that we'll panic for String if is_ref, as we only have non-owned memory, we
1146
1150
// cannot create a &String.
@@ -1162,12 +1166,12 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
1162
1166
1163
1167
"bitcoin::secp256k1::PublicKey" |"secp256k1::PublicKey" if is_ref => Some ( "&" ) ,
1164
1168
"bitcoin::secp256k1::PublicKey" |"secp256k1::PublicKey" => Some ( "" ) ,
1165
- "bitcoin::secp256k1::ecdsa::Signature" if is_ref => Some ( "&" ) ,
1166
- "bitcoin::secp256k1::ecdsa::Signature" => Some ( "" ) ,
1169
+ "bitcoin::secp256k1::ecdsa::Signature" | "bitcoin::secp256k1::schnorr::Signature" if is_ref => Some ( "&" ) ,
1170
+ "bitcoin::secp256k1::ecdsa::Signature" | "bitcoin::secp256k1::schnorr::Signature" => Some ( "" ) ,
1167
1171
"bitcoin::secp256k1::ecdsa::RecoverableSignature" => Some ( "" ) ,
1168
1172
"bitcoin::secp256k1::SecretKey" if is_ref => Some ( "&::bitcoin::secp256k1::SecretKey::from_slice(&unsafe { *" ) ,
1169
1173
"bitcoin::secp256k1::SecretKey" if !is_ref => Some ( "" ) ,
1170
- "bitcoin::secp256k1::KeyPair" if !is_ref => Some ( "::bitcoin::secp256k1::KeyPair::new( " ) ,
1174
+ "bitcoin::secp256k1::KeyPair" if !is_ref => Some ( "::bitcoin::secp256k1::KeyPair::from_secret_key(&secp256k1::global::SECP256K1, & " ) ,
1171
1175
"bitcoin::secp256k1::Scalar" if is_ref => Some ( "&" ) ,
1172
1176
"bitcoin::secp256k1::Scalar" if !is_ref => Some ( "" ) ,
1173
1177
"bitcoin::secp256k1::ecdh::SharedSecret" if !is_ref => Some ( "::bitcoin::secp256k1::ecdh::SharedSecret::from_bytes(" ) ,
@@ -1217,6 +1221,8 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
1217
1221
"lightning::ln::channelmanager::PaymentId" if is_ref=> Some ( "&::lightning::ln::channelmanager::PaymentId( unsafe { *" ) ,
1218
1222
"lightning::ln::channelmanager::InterceptId" if !is_ref => Some ( "::lightning::ln::channelmanager::InterceptId(" ) ,
1219
1223
"lightning::ln::channelmanager::InterceptId" if is_ref=> Some ( "&::lightning::ln::channelmanager::InterceptId( unsafe { *" ) ,
1224
+ "lightning::ln::ChannelId" |"lightning::ln::channel_id::ChannelId" if !is_ref => Some ( "::lightning::ln::ChannelId(" ) ,
1225
+ "lightning::ln::ChannelId" |"lightning::ln::channel_id::ChannelId" if is_ref => Some ( "&::lightning::ln::ChannelId(unsafe { *" ) ,
1220
1226
"lightning::sign::KeyMaterial" if !is_ref => Some ( "::lightning::sign::KeyMaterial(" ) ,
1221
1227
"lightning::sign::KeyMaterial" if is_ref=> Some ( "&::lightning::sign::KeyMaterial( unsafe { *" ) ,
1222
1228
"lightning::chain::ClaimId" if !is_ref => Some ( "::lightning::chain::ClaimId(" ) ,
@@ -1244,13 +1250,14 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
1244
1250
"[u8; 12]" if !is_ref => Some ( ".data" ) ,
1245
1251
"[u8; 4]" if !is_ref => Some ( ".data" ) ,
1246
1252
"[u8; 3]" if !is_ref => Some ( ".data" ) ,
1247
- "[u16; 8 ]" if !is_ref => Some ( ".data" ) ,
1253
+ "[u16; 32 ]" if !is_ref => Some ( ".data" ) ,
1248
1254
1249
1255
"[u8]" if is_ref => Some ( ".to_slice()" ) ,
1250
1256
"[usize]" if is_ref => Some ( ".to_slice()" ) ,
1251
1257
1252
1258
"str" if is_ref => Some ( ".into_str()" ) ,
1253
1259
"alloc::string::String" |"String" => Some ( ".into_string()" ) ,
1260
+ "std::path::PathBuf" => Some ( ".into_pathbuf()" ) ,
1254
1261
"std::io::Error" |"lightning::io::Error" => Some ( ".to_rust()" ) ,
1255
1262
"lightning::io::ErrorKind" => Some ( ".to_rust_kind()" ) ,
1256
1263
@@ -1270,7 +1277,7 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
1270
1277
"core::num::NonZeroU8" => Some ( ").expect(\" Value must be non-zero\" )" ) ,
1271
1278
1272
1279
"bitcoin::secp256k1::PublicKey" |"secp256k1::PublicKey" => Some ( ".into_rust()" ) ,
1273
- "bitcoin::secp256k1::ecdsa::Signature" => Some ( ".into_rust()" ) ,
1280
+ "bitcoin::secp256k1::ecdsa::Signature" | "bitcoin::secp256k1::schnorr::Signature" => Some ( ".into_rust()" ) ,
1274
1281
"bitcoin::secp256k1::ecdsa::RecoverableSignature" => Some ( ".into_rust()" ) ,
1275
1282
"bitcoin::secp256k1::SecretKey" if !is_ref => Some ( ".into_rust()" ) ,
1276
1283
"bitcoin::secp256k1::SecretKey" if is_ref => Some ( "}[..]).unwrap()" ) ,
@@ -1311,10 +1318,12 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
1311
1318
"lightning::ln::PaymentHash" |"lightning::ln::PaymentPreimage" |"lightning::ln::PaymentSecret"
1312
1319
|"lightning::ln::channelmanager::PaymentId" |"lightning::ln::channelmanager::InterceptId"
1313
1320
|"lightning::sign::KeyMaterial" |"lightning::chain::ClaimId"
1321
+ |"lightning::ln::ChannelId" |"lightning::ln::channel_id::ChannelId"
1314
1322
if !is_ref => Some ( ".data)" ) ,
1315
1323
"lightning::ln::PaymentHash" |"lightning::ln::PaymentPreimage" |"lightning::ln::PaymentSecret"
1316
1324
|"lightning::ln::channelmanager::PaymentId" |"lightning::ln::channelmanager::InterceptId"
1317
1325
|"lightning::sign::KeyMaterial" |"lightning::chain::ClaimId"
1326
+ |"lightning::ln::ChannelId" |"lightning::ln::channel_id::ChannelId"
1318
1327
if is_ref => Some ( " })" ) ,
1319
1328
1320
1329
// List of traits we map (possibly during processing of other files):
@@ -1355,13 +1364,13 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
1355
1364
"[u8; 12]" if !is_ref => Some ( "crate::c_types::TwelveBytes { data: " ) ,
1356
1365
"[u8; 4]" if !is_ref => Some ( "crate::c_types::FourBytes { data: " ) ,
1357
1366
"[u8; 3]" if is_ref => Some ( "" ) ,
1358
- "[u16; 8 ]" if !is_ref => Some ( "crate::c_types::EightU16s { data: " ) ,
1367
+ "[u16; 32 ]" if !is_ref => Some ( "crate::c_types::ThirtyTwoU16s { data: " ) ,
1359
1368
1360
1369
"[u8]" if is_ref => Some ( "local_" ) ,
1361
1370
"[usize]" if is_ref => Some ( "local_" ) ,
1362
1371
1363
1372
"str" if is_ref => Some ( "" ) ,
1364
- "alloc::string::String" |"String" => Some ( "" ) ,
1373
+ "alloc::string::String" |"String" | "std::path::PathBuf" => Some ( "" ) ,
1365
1374
1366
1375
"bitcoin::Address" => Some ( "alloc::string::ToString::to_string(&" ) ,
1367
1376
@@ -1385,7 +1394,8 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
1385
1394
"u128" => Some ( "" ) ,
1386
1395
1387
1396
"bitcoin::secp256k1::PublicKey" |"secp256k1::PublicKey" => Some ( "crate::c_types::PublicKey::from_rust(&" ) ,
1388
- "bitcoin::secp256k1::ecdsa::Signature" => Some ( "crate::c_types::Signature::from_rust(&" ) ,
1397
+ "bitcoin::secp256k1::ecdsa::Signature" => Some ( "crate::c_types::ECDSASignature::from_rust(&" ) ,
1398
+ "bitcoin::secp256k1::schnorr::Signature" => Some ( "crate::c_types::SchnorrSignature::from_rust(&" ) ,
1389
1399
"bitcoin::secp256k1::ecdsa::RecoverableSignature" => Some ( "crate::c_types::RecoverableSignature::from_rust(&" ) ,
1390
1400
"bitcoin::secp256k1::SecretKey" if is_ref => Some ( "" ) ,
1391
1401
"bitcoin::secp256k1::SecretKey" if !is_ref => Some ( "crate::c_types::SecretKey::from_rust(" ) ,
@@ -1429,10 +1439,12 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
1429
1439
"lightning::ln::PaymentHash" |"lightning::ln::PaymentPreimage" |"lightning::ln::PaymentSecret"
1430
1440
|"lightning::ln::channelmanager::PaymentId" |"lightning::ln::channelmanager::InterceptId"
1431
1441
|"lightning::sign::KeyMaterial" |"lightning::chain::ClaimId"
1442
+ |"lightning::ln::ChannelId" |"lightning::ln::channel_id::ChannelId"
1432
1443
if is_ref => Some ( "&" ) ,
1433
1444
"lightning::ln::PaymentHash" |"lightning::ln::PaymentPreimage" |"lightning::ln::PaymentSecret"
1434
1445
|"lightning::ln::channelmanager::PaymentId" |"lightning::ln::channelmanager::InterceptId"
1435
1446
|"lightning::sign::KeyMaterial" |"lightning::chain::ClaimId"
1447
+ |"lightning::ln::ChannelId" |"lightning::ln::channel_id::ChannelId"
1436
1448
if !is_ref => Some ( "crate::c_types::ThirtyTwoBytes { data: " ) ,
1437
1449
1438
1450
"lightning::io::Read" => Some ( "crate::c_types::u8slice::from_vec(&crate::c_types::reader_to_vec(" ) ,
@@ -1456,14 +1468,14 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
1456
1468
"[u8; 12]" if !is_ref => Some ( " }" ) ,
1457
1469
"[u8; 4]" if !is_ref => Some ( " }" ) ,
1458
1470
"[u8; 3]" if is_ref => Some ( "" ) ,
1459
- "[u16; 8 ]" if !is_ref => Some ( " }" ) ,
1471
+ "[u16; 32 ]" if !is_ref => Some ( " }" ) ,
1460
1472
1461
1473
"[u8]" if is_ref => Some ( "" ) ,
1462
1474
"[usize]" if is_ref => Some ( "" ) ,
1463
1475
1464
1476
"str" if is_ref => Some ( ".into()" ) ,
1465
- "alloc::string::String" |"String" if is_ref => Some ( ".as_str().into()" ) ,
1466
- "alloc::string::String" |"String" => Some ( ".into()" ) ,
1477
+ "alloc::string::String" |"String" | "std::path::PathBuf" if is_ref => Some ( ".as_str().into()" ) ,
1478
+ "alloc::string::String" |"String" | "std::path::PathBuf" => Some ( ".into()" ) ,
1467
1479
1468
1480
"bitcoin::Address" => Some ( ").into()" ) ,
1469
1481
@@ -1486,7 +1498,7 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
1486
1498
"u128" => Some ( ".into()" ) ,
1487
1499
1488
1500
"bitcoin::secp256k1::PublicKey" |"secp256k1::PublicKey" => Some ( ")" ) ,
1489
- "bitcoin::secp256k1::ecdsa::Signature" => Some ( ")" ) ,
1501
+ "bitcoin::secp256k1::ecdsa::Signature" | "bitcoin::secp256k1::schnorr::Signature" => Some ( ")" ) ,
1490
1502
"bitcoin::secp256k1::ecdsa::RecoverableSignature" => Some ( ")" ) ,
1491
1503
"bitcoin::secp256k1::SecretKey" if !is_ref => Some ( ")" ) ,
1492
1504
"bitcoin::secp256k1::SecretKey" if is_ref => Some ( ".as_ref()" ) ,
@@ -1528,10 +1540,12 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
1528
1540
"lightning::ln::PaymentHash" |"lightning::ln::PaymentPreimage" |"lightning::ln::PaymentSecret"
1529
1541
|"lightning::ln::channelmanager::PaymentId" |"lightning::ln::channelmanager::InterceptId"
1530
1542
|"lightning::sign::KeyMaterial" |"lightning::chain::ClaimId"
1543
+ |"lightning::ln::ChannelId" |"lightning::ln::channel_id::ChannelId"
1531
1544
if is_ref => Some ( ".0" ) ,
1532
1545
"lightning::ln::PaymentHash" |"lightning::ln::PaymentPreimage" |"lightning::ln::PaymentSecret"
1533
1546
|"lightning::ln::channelmanager::PaymentId" |"lightning::ln::channelmanager::InterceptId"
1534
1547
|"lightning::sign::KeyMaterial" |"lightning::chain::ClaimId"
1548
+ |"lightning::ln::ChannelId" |"lightning::ln::channel_id::ChannelId"
1535
1549
if !is_ref => Some ( ".0 }" ) ,
1536
1550
1537
1551
"lightning::io::Read" => Some ( "))" ) ,
0 commit comments