@@ -1071,6 +1071,7 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
1071
1071
"bitcoin::bech32::u5" |"bech32::u5" => Some ( "crate::c_types::U5" ) ,
1072
1072
"u128" => Some ( "crate::c_types::U128" ) ,
1073
1073
"core::num::NonZeroU8" => Some ( "u8" ) ,
1074
+ "core::num::NonZeroU64" => Some ( "u64" ) ,
1074
1075
1075
1076
"secp256k1::PublicKey" |"bitcoin::secp256k1::PublicKey" => Some ( "crate::c_types::PublicKey" ) ,
1076
1077
"bitcoin::key::TweakedPublicKey" => Some ( "crate::c_types::TweakedPublicKey" ) ,
@@ -1113,21 +1114,21 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
1113
1114
if is_ref => Some ( "*const [u8; 32]" ) ,
1114
1115
1115
1116
// Newtypes that we just expose in their original form.
1116
- "bitcoin::hash_types::Txid" |"bitcoin::BlockHash" |"bitcoin::hash_types::BlockHash" |"bitcoin::hashes::sha256::Hash" |"bitcoin::blockdata::constants::ChainHash"
1117
+ "bitcoin::Txid" | "bitcoin:: hash_types::Txid" |"bitcoin::BlockHash" |"bitcoin::hash_types::BlockHash" |"bitcoin::hashes::sha256::Hash" |"bitcoin::blockdata::constants::ChainHash"
1117
1118
if is_ref => Some ( "*const [u8; 32]" ) ,
1118
- "bitcoin::hash_types::Txid" |"bitcoin::BlockHash" |"bitcoin::hash_types::BlockHash" |"bitcoin::hashes::sha256::Hash" |"bitcoin::blockdata::constants::ChainHash"
1119
+ "bitcoin::Txid" | "bitcoin:: hash_types::Txid" |"bitcoin::BlockHash" |"bitcoin::hash_types::BlockHash" |"bitcoin::hashes::sha256::Hash" |"bitcoin::blockdata::constants::ChainHash" | "bitcoin::hashes::sha256::Hash "
1119
1120
if !is_ref => Some ( "crate::c_types::ThirtyTwoBytes" ) ,
1120
1121
"bitcoin::secp256k1::Message" if !is_ref => Some ( "crate::c_types::ThirtyTwoBytes" ) ,
1121
1122
"bitcoin::secp256k1::Message" if is_ref => Some ( "*const [u8; 32]" ) ,
1122
- "lightning::ln::PaymentHash" |"lightning::ln::PaymentPreimage" |"lightning::ln::PaymentSecret"
1123
+ "lightning::ln::types::PaymentHash" |"lightning::ln::types::PaymentPreimage"
1124
+ |"lightning::ln::types::PaymentSecret"
1123
1125
|"lightning::ln::channelmanager::PaymentId" |"lightning::ln::channelmanager::InterceptId"
1124
1126
|"lightning::sign::KeyMaterial" |"lightning::chain::ClaimId"
1125
- |"lightning::ln::ChannelId" |"lightning::ln::channel_id::ChannelId"
1126
1127
if is_ref => Some ( "*const [u8; 32]" ) ,
1127
- "lightning::ln::PaymentHash" |"lightning::ln::PaymentPreimage" |"lightning::ln::PaymentSecret"
1128
+ "lightning::ln::types::PaymentHash" |"lightning::ln::types::PaymentPreimage"
1129
+ |"lightning::ln::types::PaymentSecret"
1128
1130
|"lightning::ln::channelmanager::PaymentId" |"lightning::ln::channelmanager::InterceptId"
1129
1131
|"lightning::sign::KeyMaterial" |"lightning::chain::ClaimId"
1130
- |"lightning::ln::ChannelId" |"lightning::ln::channel_id::ChannelId"
1131
1132
if !is_ref => Some ( "crate::c_types::ThirtyTwoBytes" ) ,
1132
1133
1133
1134
"lightning::io::Read" => Some ( "crate::c_types::u8slice" ) ,
@@ -1182,6 +1183,7 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
1182
1183
"bitcoin::bech32::u5" |"bech32::u5" => Some ( "" ) ,
1183
1184
"u128" => Some ( "" ) ,
1184
1185
"core::num::NonZeroU8" => Some ( "core::num::NonZeroU8::new(" ) ,
1186
+ "core::num::NonZeroU64" => Some ( "core::num::NonZeroU64::new(" ) ,
1185
1187
1186
1188
"bitcoin::secp256k1::PublicKey" |"secp256k1::PublicKey" if is_ref => Some ( "&" ) ,
1187
1189
"bitcoin::secp256k1::PublicKey" |"secp256k1::PublicKey" => Some ( "" ) ,
@@ -1231,21 +1233,21 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
1231
1233
Some ( "&bitcoin::hash_types::WScriptHash::from_raw_hash(bitcoin::hashes::Hash::from_byte_array(unsafe { *" ) ,
1232
1234
1233
1235
// Newtypes that we just expose in their original form.
1234
- "bitcoin::hash_types::Txid" if is_ref => Some ( "&::bitcoin::hash_types::Txid::from_slice(&unsafe { &*" ) ,
1235
- "bitcoin::hash_types::Txid" if !is_ref => Some ( "::bitcoin::hash_types::Txid::from_slice(&" ) ,
1236
+ "bitcoin::Txid" | "bitcoin:: hash_types::Txid" if is_ref => Some ( "&::bitcoin::hash_types::Txid::from_slice(&unsafe { &*" ) ,
1237
+ "bitcoin::Txid" | "bitcoin:: hash_types::Txid" if !is_ref => Some ( "::bitcoin::hash_types::Txid::from_slice(&" ) ,
1236
1238
"bitcoin::hash_types::BlockHash" |"bitcoin::BlockHash" => Some ( "::bitcoin::hash_types::BlockHash::from_slice(&" ) ,
1237
1239
"bitcoin::blockdata::constants::ChainHash" => Some ( "::bitcoin::blockdata::constants::ChainHash::from(&" ) ,
1238
- "lightning::ln::PaymentHash" if !is_ref => Some ( "::lightning::ln::PaymentHash(" ) ,
1239
- "lightning::ln::PaymentHash" if is_ref => Some ( "&::lightning::ln::PaymentHash(unsafe { *" ) ,
1240
- "lightning::ln::PaymentPreimage" if !is_ref => Some ( "::lightning::ln::PaymentPreimage(" ) ,
1241
- "lightning::ln::PaymentPreimage" if is_ref => Some ( "&::lightning::ln::PaymentPreimage(unsafe { *" ) ,
1242
- "lightning::ln::PaymentSecret" if !is_ref => Some ( "::lightning::ln::PaymentSecret(" ) ,
1240
+ "bitcoin::hashes::sha256::Hash" if is_ref => Some ( "&::bitcoin::hashes::sha256::Hash::from_slice(&unsafe { &*" ) ,
1241
+ "bitcoin::hashes::sha256::Hash" => Some ( "::bitcoin::hashes::sha256::Hash::from_slice(&" ) ,
1242
+ "lightning::ln::types::PaymentHash" if !is_ref => Some ( "::lightning::ln::types::PaymentHash(" ) ,
1243
+ "lightning::ln::types::PaymentHash" if is_ref => Some ( "&::lightning::ln::types::PaymentHash(unsafe { *" ) ,
1244
+ "lightning::ln::types::PaymentPreimage" if !is_ref => Some ( "::lightning::ln::types::PaymentPreimage(" ) ,
1245
+ "lightning::ln::types::PaymentPreimage" if is_ref => Some ( "&::lightning::ln::types::PaymentPreimage(unsafe { *" ) ,
1246
+ "lightning::ln::types::PaymentSecret" if !is_ref => Some ( "::lightning::ln::types::PaymentSecret(" ) ,
1243
1247
"lightning::ln::channelmanager::PaymentId" if !is_ref => Some ( "::lightning::ln::channelmanager::PaymentId(" ) ,
1244
1248
"lightning::ln::channelmanager::PaymentId" if is_ref=> Some ( "&::lightning::ln::channelmanager::PaymentId( unsafe { *" ) ,
1245
1249
"lightning::ln::channelmanager::InterceptId" if !is_ref => Some ( "::lightning::ln::channelmanager::InterceptId(" ) ,
1246
1250
"lightning::ln::channelmanager::InterceptId" if is_ref=> Some ( "&::lightning::ln::channelmanager::InterceptId( unsafe { *" ) ,
1247
- "lightning::ln::ChannelId" |"lightning::ln::channel_id::ChannelId" if !is_ref => Some ( "::lightning::ln::ChannelId(" ) ,
1248
- "lightning::ln::ChannelId" |"lightning::ln::channel_id::ChannelId" if is_ref => Some ( "&::lightning::ln::ChannelId(unsafe { *" ) ,
1249
1251
"lightning::sign::KeyMaterial" if !is_ref => Some ( "::lightning::sign::KeyMaterial(" ) ,
1250
1252
"lightning::sign::KeyMaterial" if is_ref=> Some ( "&::lightning::sign::KeyMaterial( unsafe { *" ) ,
1251
1253
"lightning::chain::ClaimId" if !is_ref => Some ( "::lightning::chain::ClaimId(" ) ,
@@ -1299,6 +1301,7 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
1299
1301
"bitcoin::bech32::u5" |"bech32::u5" => Some ( ".into()" ) ,
1300
1302
"u128" => Some ( ".into()" ) ,
1301
1303
"core::num::NonZeroU8" => Some ( ").expect(\" Value must be non-zero\" )" ) ,
1304
+ "core::num::NonZeroU64" => Some ( ").expect(\" Value must be non-zero\" )" ) ,
1302
1305
1303
1306
"bitcoin::secp256k1::PublicKey" |"secp256k1::PublicKey" => Some ( ".into_rust()" ) ,
1304
1307
"bitcoin::key::TweakedPublicKey" => Some ( ".into_rust()" ) ,
@@ -1337,19 +1340,20 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
1337
1340
if is_ref => Some ( " }.clone()))" ) ,
1338
1341
1339
1342
// Newtypes that we just expose in their original form.
1340
- "bitcoin::hash_types::Txid" if is_ref => Some ( " }[..]).unwrap()" ) ,
1341
- "bitcoin::hash_types::Txid" => Some ( ".data[..]).unwrap()" ) ,
1343
+ "bitcoin::Txid" | "bitcoin:: hash_types::Txid" if is_ref => Some ( " }[..]).unwrap()" ) ,
1344
+ "bitcoin::Txid" | "bitcoin:: hash_types::Txid" => Some ( ".data[..]).unwrap()" ) ,
1342
1345
"bitcoin::hash_types::BlockHash" |"bitcoin::BlockHash" if !is_ref => Some ( ".data[..]).unwrap()" ) ,
1343
1346
"bitcoin::blockdata::constants::ChainHash" if !is_ref => Some ( ".data)" ) ,
1344
- "lightning::ln::PaymentHash" |"lightning::ln::PaymentPreimage" |"lightning::ln::PaymentSecret"
1347
+ "bitcoin::hashes::sha256::Hash" => Some ( " }[..]).unwrap()" ) ,
1348
+ "lightning::ln::types::PaymentHash" |"lightning::ln::types::PaymentPreimage"
1349
+ |"lightning::ln::types::PaymentSecret"
1345
1350
|"lightning::ln::channelmanager::PaymentId" |"lightning::ln::channelmanager::InterceptId"
1346
1351
|"lightning::sign::KeyMaterial" |"lightning::chain::ClaimId"
1347
- |"lightning::ln::ChannelId" |"lightning::ln::channel_id::ChannelId"
1348
1352
if !is_ref => Some ( ".data)" ) ,
1349
- "lightning::ln::PaymentHash" |"lightning::ln::PaymentPreimage" |"lightning::ln::PaymentSecret"
1353
+ "lightning::ln::types::PaymentHash" |"lightning::ln::types::PaymentPreimage"
1354
+ |"lightning::ln::types::PaymentSecret"
1350
1355
|"lightning::ln::channelmanager::PaymentId" |"lightning::ln::channelmanager::InterceptId"
1351
1356
|"lightning::sign::KeyMaterial" |"lightning::chain::ClaimId"
1352
- |"lightning::ln::ChannelId" |"lightning::ln::channel_id::ChannelId"
1353
1357
if is_ref => Some ( " })" ) ,
1354
1358
1355
1359
// List of traits we map (possibly during processing of other files):
@@ -1389,6 +1393,7 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
1389
1393
"[u8; 16]" if !is_ref => Some ( "crate::c_types::SixteenBytes { data: " ) ,
1390
1394
"[u8; 12]" if !is_ref => Some ( "crate::c_types::TwelveBytes { data: " ) ,
1391
1395
"[u8; 4]" if !is_ref => Some ( "crate::c_types::FourBytes { data: " ) ,
1396
+ "[u8; 3]" if !is_ref => Some ( "crate::c_types::ThreeBytes { data: " ) ,
1392
1397
"[u8; 3]" if is_ref => Some ( "" ) ,
1393
1398
"[u16; 32]" if !is_ref => Some ( "crate::c_types::ThirtyTwoU16s { data: " ) ,
1394
1399
@@ -1418,6 +1423,7 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
1418
1423
1419
1424
"bitcoin::bech32::u5" |"bech32::u5" => Some ( "" ) ,
1420
1425
"u128" => Some ( "" ) ,
1426
+ "core::num::NonZeroU64" => Some ( "" ) ,
1421
1427
1422
1428
"bitcoin::secp256k1::PublicKey" |"secp256k1::PublicKey" => Some ( "crate::c_types::PublicKey::from_rust(&" ) ,
1423
1429
"bitcoin::key::TweakedPublicKey" => Some ( "crate::c_types::TweakedPublicKey::from_rust(&" ) ,
@@ -1457,21 +1463,21 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
1457
1463
if !is_ref => Some ( "crate::c_types::TwentyBytes { data: *" ) ,
1458
1464
1459
1465
// Newtypes that we just expose in their original form.
1460
- "bitcoin::hash_types::Txid" |"bitcoin::BlockHash" |"bitcoin::hash_types::BlockHash" |"bitcoin::hashes::sha256::Hash" |"bitcoin::blockdata::constants::ChainHash"
1466
+ "bitcoin::Txid" | "bitcoin:: hash_types::Txid" |"bitcoin::BlockHash" |"bitcoin::hash_types::BlockHash" |"bitcoin::hashes::sha256::Hash" |"bitcoin::blockdata::constants::ChainHash" | "bitcoin::hashes::sha256::Hash "
1461
1467
if is_ref => Some ( "" ) ,
1462
- "bitcoin::hash_types::Txid" |"bitcoin::BlockHash" |"bitcoin::hash_types::BlockHash" |"bitcoin::hashes::sha256::Hash" |"bitcoin::blockdata::constants::ChainHash"
1468
+ "bitcoin::Txid" | "bitcoin:: hash_types::Txid" |"bitcoin::BlockHash" |"bitcoin::hash_types::BlockHash" |"bitcoin::hashes::sha256::Hash" |"bitcoin::blockdata::constants::ChainHash" | "bitcoin::hashes::sha256::Hash "
1463
1469
if !is_ref => Some ( "crate::c_types::ThirtyTwoBytes { data: *" ) ,
1464
1470
"bitcoin::secp256k1::Message" if !is_ref => Some ( "crate::c_types::ThirtyTwoBytes { data: " ) ,
1465
1471
"bitcoin::secp256k1::Message" if is_ref => Some ( "" ) ,
1466
- "lightning::ln::PaymentHash" |"lightning::ln::PaymentPreimage" |"lightning::ln::PaymentSecret"
1472
+ "lightning::ln::types::PaymentHash" |"lightning::ln::types::PaymentPreimage"
1473
+ |"lightning::ln::types::PaymentSecret"
1467
1474
|"lightning::ln::channelmanager::PaymentId" |"lightning::ln::channelmanager::InterceptId"
1468
1475
|"lightning::sign::KeyMaterial" |"lightning::chain::ClaimId"
1469
- |"lightning::ln::ChannelId" |"lightning::ln::channel_id::ChannelId"
1470
1476
if is_ref => Some ( "&" ) ,
1471
- "lightning::ln::PaymentHash" |"lightning::ln::PaymentPreimage" |"lightning::ln::PaymentSecret"
1477
+ "lightning::ln::types::PaymentHash" |"lightning::ln::types::PaymentPreimage"
1478
+ |"lightning::ln::types::PaymentSecret"
1472
1479
|"lightning::ln::channelmanager::PaymentId" |"lightning::ln::channelmanager::InterceptId"
1473
1480
|"lightning::sign::KeyMaterial" |"lightning::chain::ClaimId"
1474
- |"lightning::ln::ChannelId" |"lightning::ln::channel_id::ChannelId"
1475
1481
if !is_ref => Some ( "crate::c_types::ThirtyTwoBytes { data: " ) ,
1476
1482
1477
1483
"lightning::io::Read" => Some ( "crate::c_types::u8slice::from_vec(&crate::c_types::reader_to_vec(" ) ,
@@ -1495,6 +1501,7 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
1495
1501
"[u8; 16]" if !is_ref => Some ( " }" ) ,
1496
1502
"[u8; 12]" if !is_ref => Some ( " }" ) ,
1497
1503
"[u8; 4]" if !is_ref => Some ( " }" ) ,
1504
+ "[u8; 3]" if !is_ref => Some ( " }" ) ,
1498
1505
"[u8; 3]" if is_ref => Some ( "" ) ,
1499
1506
"[u16; 32]" if !is_ref => Some ( " }" ) ,
1500
1507
@@ -1524,6 +1531,7 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
1524
1531
1525
1532
"bitcoin::bech32::u5" |"bech32::u5" => Some ( ".into()" ) ,
1526
1533
"u128" => Some ( ".into()" ) ,
1534
+ "core::num::NonZeroU64" => Some ( ".into()" ) ,
1527
1535
1528
1536
"bitcoin::secp256k1::PublicKey" |"secp256k1::PublicKey" => Some ( ")" ) ,
1529
1537
"bitcoin::key::TweakedPublicKey" => Some ( ")" ) ,
@@ -1559,21 +1567,21 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
1559
1567
if !is_ref => Some ( ".as_ref() }" ) ,
1560
1568
1561
1569
// Newtypes that we just expose in their original form.
1562
- "bitcoin::hash_types::Txid" |"bitcoin::BlockHash" |"bitcoin::hash_types::BlockHash" |"bitcoin::hashes::sha256::Hash" |"bitcoin::blockdata::constants::ChainHash"
1570
+ "bitcoin::Txid" | "bitcoin:: hash_types::Txid" |"bitcoin::BlockHash" |"bitcoin::hash_types::BlockHash" |"bitcoin::hashes::sha256::Hash" |"bitcoin::blockdata::constants::ChainHash" | "bitcoin::hashes::sha256::Hash "
1563
1571
if is_ref => Some ( ".as_ref()" ) ,
1564
- "bitcoin::hash_types::Txid" |"bitcoin::BlockHash" |"bitcoin::hash_types::BlockHash" |"bitcoin::hashes::sha256::Hash" |"bitcoin::blockdata::constants::ChainHash"
1572
+ "bitcoin::Txid" | "bitcoin:: hash_types::Txid" |"bitcoin::BlockHash" |"bitcoin::hash_types::BlockHash" |"bitcoin::hashes::sha256::Hash" |"bitcoin::blockdata::constants::ChainHash" | "bitcoin::hashes::sha256::Hash "
1565
1573
if !is_ref => Some ( ".as_ref() }" ) ,
1566
1574
"bitcoin::secp256k1::Message" if !is_ref => Some ( ".as_ref().clone() }" ) ,
1567
1575
"bitcoin::secp256k1::Message" if is_ref => Some ( ".as_ref()" ) ,
1568
- "lightning::ln::PaymentHash" |"lightning::ln::PaymentPreimage" |"lightning::ln::PaymentSecret"
1576
+ "lightning::ln::types::PaymentHash" |"lightning::ln::types::PaymentPreimage"
1577
+ |"lightning::ln::types::PaymentSecret"
1569
1578
|"lightning::ln::channelmanager::PaymentId" |"lightning::ln::channelmanager::InterceptId"
1570
1579
|"lightning::sign::KeyMaterial" |"lightning::chain::ClaimId"
1571
- |"lightning::ln::ChannelId" |"lightning::ln::channel_id::ChannelId"
1572
1580
if is_ref => Some ( ".0" ) ,
1573
- "lightning::ln::PaymentHash" |"lightning::ln::PaymentPreimage" |"lightning::ln::PaymentSecret"
1581
+ "lightning::ln::types::PaymentHash" |"lightning::ln::types::PaymentPreimage"
1582
+ |"lightning::ln::types::PaymentSecret"
1574
1583
|"lightning::ln::channelmanager::PaymentId" |"lightning::ln::channelmanager::InterceptId"
1575
1584
|"lightning::sign::KeyMaterial" |"lightning::chain::ClaimId"
1576
- |"lightning::ln::ChannelId" |"lightning::ln::channel_id::ChannelId"
1577
1585
if !is_ref => Some ( ".0 }" ) ,
1578
1586
1579
1587
"lightning::io::Read" => Some ( "))" ) ,
0 commit comments