--- Log opened Thu May 21 00:00:29 2020 00:09 -!- jonatack [~jon@2a01:e0a:53c:a200:bb54:3be5:c3d0:9ce5] has quit [Ping timeout: 252 seconds] 00:10 -!- jonatack [~jon@2a01:e0a:53c:a200:bb54:3be5:c3d0:9ce5] has joined #rust-bitcoin 00:58 -!- jonatack [~jon@2a01:e0a:53c:a200:bb54:3be5:c3d0:9ce5] has quit [Ping timeout: 260 seconds] 00:58 -!- jonatack [~jon@37.170.253.61] has joined #rust-bitcoin 01:12 -!- DeanWeen [~dean@gateway/tor-sasl/deanguss] has joined #rust-bitcoin 01:14 -!- Dean_Guss [~dean@gateway/tor-sasl/deanguss] has quit [Ping timeout: 240 seconds] 01:53 -!- jonatack_ [~jon@37.167.18.204] has joined #rust-bitcoin 01:57 -!- jonatack [~jon@37.170.253.61] has quit [Ping timeout: 256 seconds] 02:02 -!- jonatack_ [~jon@37.167.18.204] has quit [Quit: jonatack_] 02:02 -!- jonatack [~jon@37.167.18.204] has joined #rust-bitcoin 03:04 -!- Alda63Bednar [~Alda63Bed@static.57.1.216.95.clients.your-server.de] has joined #rust-bitcoin 03:16 -!- surja795 [~surja795@c-24-61-194-104.hsd1.ma.comcast.net] has joined #rust-bitcoin 04:19 -!- DeanWeen [~dean@gateway/tor-sasl/deanguss] has quit [Ping timeout: 240 seconds] 04:53 -!- belcher [~belcher@unaffiliated/belcher] has joined #rust-bitcoin 06:31 -!- DeanWeen [~dean@gateway/tor-sasl/deanguss] has joined #rust-bitcoin 08:26 -!- Alda63Bednar [~Alda63Bed@static.57.1.216.95.clients.your-server.de] has quit [Ping timeout: 260 seconds] 08:33 -!- fiatjaf [~fiatjaf@2804:7f2:2a81:6c39:ea40:f2ff:fe85:d2dc] has quit [Ping timeout: 240 seconds] 08:35 -!- fiatjaf [~fiatjaf@2804:7f2:2a81:6c39:ea40:f2ff:fe85:d2dc] has joined #rust-bitcoin 08:58 -!- ghost43 [~daer@gateway/tor-sasl/daer] has joined #rust-bitcoin 09:38 -!- vindard [~vindard@190.83.165.233] has quit [Ping timeout: 264 seconds] 10:10 -!- vindard [~vindard@190.83.165.233] has joined #rust-bitcoin 11:59 -!- ghost43 [~daer@gateway/tor-sasl/daer] has quit [Remote host closed the connection] 12:01 -!- ghost43 [~daer@gateway/tor-sasl/daer] has joined #rust-bitcoin 12:17 -!- jonatack_ [~jon@184.75.221.203] has joined #rust-bitcoin 12:18 -!- jonatack [~jon@37.167.18.204] has quit [Ping timeout: 256 seconds] 12:20 -!- vindard [~vindard@190.83.165.233] has quit [Ping timeout: 265 seconds] 12:23 -!- jonatack_ [~jon@184.75.221.203] has quit [Quit: jonatack_] 12:23 -!- vindard [~vindard@190.83.165.233] has joined #rust-bitcoin 12:24 -!- jonatack [~jon@2a01:e0a:53c:a200:bb54:3be5:c3d0:9ce5] has joined #rust-bitcoin 12:48 -!- mauz555 [~mauz555@2a01:e0a:56d:9090:9022:9cd8:7ebb:fd32] has quit [Remote host closed the connection] 14:40 -!- shesek [~shesek@unaffiliated/shesek] has quit [Ping timeout: 260 seconds] 14:42 < BlueMatt> is there a reason we dont have an `as_inner()` for bitcoin_hashes::Hash? 14:42 < BlueMatt> maybe andytoshi or elichai2? 14:43 < BlueMatt> like, what if I have a hash and I want a *const [u8; 32] to it? 14:43 -!- shesek [~shesek@185.3.145.28] has joined #rust-bitcoin 14:43 < elichai2> You could AsRef or index into it 14:44 < BlueMatt> no, [u8; 32], not [u8] 14:44 < BlueMatt> i think technically you can .as_ref().try_into().unwrap(), but, uh, I'm doing this programatically in a c bindings wrapper generator, so, thats, ummmmmmm, hard 14:44 < elichai2> Hmm 14:44 < elichai2> I actually think there is 14:45 < elichai2> into_inner() 14:45 < BlueMatt> no, as_inner() 14:45 < elichai2> As part of the Hash trait 14:45 < BlueMatt> into consumes it, i want a reference to it 14:45 < elichai2> Arghh that's highly specific 14:45 < BlueMatt> right. but as_ref() would handle it just fine. 14:45 < elichai2> Why do you need a raw pointer to the *array*? 14:46 < BlueMatt> err, as_inner() 14:46 < BlueMatt> and, its also not unreasonable. like, we shouldnt need to do as_ref().into() everywhere we want a reference to the 32 bytes without making a fat-pointer 14:46 < BlueMatt> why not? I mean its the same as a reference to the first element, sure, but its nice to define it in the method signature so its clear. 14:47 < elichai2> (you could also cast it to a raw pointer, like `h.as_ref() as *const [u8] as *const [u8; 32]` but it won't bound check for you in case the hash is shorter 14:47 < elichai2> Not saying why not, it's just that this is a copy type so into_inner is natural 14:47 < BlueMatt> *const [u8] != *const [u8; 32] 14:47 < BlueMatt> *const [u8; 32] == *const u8 14:47 < BlueMatt> right, its kinda natural in rust 14:47 < BlueMatt> but its not natural in c binding wrappers 14:48 < elichai2> Right. A fat pointer is still castable to a light one, but if you prefer feel free to open the PR 14:48 < BlueMatt> like, you cant return the reference to a copy 14:48 < BlueMatt> rust will figure it out for you cause borrowck, but, like, bad 14:48 < BlueMatt> my point is its a bit different - i like specifying the length in the method signature 14:49 < BlueMatt> (i know, c people hate it, but, like, its nice to see it staring you in the face and gcc will warn) 14:50 < elichai2> I'm actually the same :) 14:50 < elichai2> https://github.com/rust-lang/rust-bindgen/pull/1564 14:51 < BlueMatt> elichai2: if you want to have some fun, I've been working on c bindings wrapper generator that creates cbindgen-C (not C++) compatible wrappers for traits :) https://github.com/rust-bitcoin/rust-lightning/pull/618 14:51 < BlueMatt> (that is, creates structs which are a void poiner and a list of fn pointers for traits, and then does the work to impl the trait for that new struct) 14:51 < elichai2> Hmm interesting 14:52 < elichai2> I'll definitely give it a look tomorrow 14:52 < BlueMatt> and also generally just creates useful wrappers for all the crap we have in rust-ightning 14:52 < BlueMatt> without, like, having to make everything in the library C-native 14:52 < BlueMatt> its a ways from complete, but its getting there. 14:52 < BlueMatt> still working on Option<>s today. 14:54 < elichai2> I love doing unsafe scary things in rust :P 14:54 < BlueMatt> I'm sure you'll find 10 cases of UB in it 14:54 < BlueMatt> its pretty rough 14:54 < BlueMatt> though I'd appreciate you taking a look and finding the UB :p 14:54 < elichai2> Hehe, will do, playing with trait fn pointers really sounds fun 14:55 < BlueMatt> sadly, that was the easy part. its all the damn type conversions that are insane 14:56 < BlueMatt> and mapping rust idioms to C in a semi-sensible way 14:56 < BlueMatt> or at least a consistent way, you're not *really* suppose to use the C bindings directly, they're more for us to write other language bindings on top of, but still 15:00 -!- mauz555 [~mauz555@2a01:e0a:56d:9090:9022:9cd8:7ebb:fd32] has joined #rust-bitcoin 15:03 < BlueMatt> elichai2: https://github.com/rust-bitcoin/bitcoin_hashes/pull/82 15:08 < BlueMatt> elichai2: also, if you can quick-glance https://github.com/rust-bitcoin/rust-bitcoin/pull/425 its test-only sooo 15:10 < elichai2> The fuzz targets aren't subject to MSRV, right? 15:10 < BlueMatt> i dont think we usually care 15:10 < BlueMatt> *I* certainly dont ever care :p 15:10 < BlueMatt> (and rust-lightning's dont, they use like "dyn" and stuff) 15:11 < elichai2> K, will actually put a review tomorrow, ok? (it's 1am here) 15:11 < BlueMatt> oh, right, get some sleep 15:16 -!- shesek [~shesek@185.3.145.28] has quit [Changing host] 15:16 -!- shesek [~shesek@unaffiliated/shesek] has joined #rust-bitcoin 15:34 -!- mauz555 [~mauz555@2a01:e0a:56d:9090:9022:9cd8:7ebb:fd32] has quit [Read error: Connection reset by peer] 15:50 < andytoshi> BlueMatt: oh, i totally overlooked this usecase 15:50 < andytoshi> my thought was `as_inner` is no use because [u8; 32] is small and Copy 15:51 < andytoshi> but you're right, there's no way to get a pointer to the underlying data is there 15:51 < andytoshi> at least, not as a *[u8;32] 15:53 < BlueMatt> i mean i think you can with [..].as_ptr() or something 15:53 < BlueMatt> but thats annoying 16:02 < BlueMatt> andytoshi: care2merge https://github.com/rust-bitcoin/rust-bitcoin/pull/425 ? 16:17 < andytoshi> BlueMatt: sure, done 16:17 < BlueMatt> thanks <3 16:18 -!- Dean_Guss [~dean@gateway/tor-sasl/deanguss] has joined #rust-bitcoin 16:19 -!- DeanWeen [~dean@gateway/tor-sasl/deanguss] has quit [Ping timeout: 240 seconds] 17:20 -!- CubicEarth [~CubicEart@c-67-168-1-172.hsd1.wa.comcast.net] has quit [Ping timeout: 272 seconds] 17:22 -!- CubicEarth [~CubicEart@c-67-168-1-172.hsd1.wa.comcast.net] has joined #rust-bitcoin 19:31 -!- mauz555 [~mauz555@2a01:e0a:56d:9090:9022:9cd8:7ebb:fd32] has joined #rust-bitcoin 19:36 -!- mauz555 [~mauz555@2a01:e0a:56d:9090:9022:9cd8:7ebb:fd32] has quit [Ping timeout: 260 seconds] 20:01 -!- surja795 [~surja795@c-24-61-194-104.hsd1.ma.comcast.net] has quit [Remote host closed the connection] 20:05 -!- surja795 [~surja795@c-24-61-194-104.hsd1.ma.comcast.net] has joined #rust-bitcoin 20:10 -!- surja795 [~surja795@c-24-61-194-104.hsd1.ma.comcast.net] has quit [Ping timeout: 260 seconds] --- Log closed Fri May 22 00:00:28 2020