--- Log opened Thu May 09 00:00:09 2019 00:32 -!- Dean_Guss [~dean@gateway/tor-sasl/deanguss] has joined #rust-bitcoin 00:49 -!- ccdle12 [~ccdle12@103.5.140.189] has joined #rust-bitcoin 00:55 -!- TamasBlummer1 [~Thunderbi@p200300DD67196B296506B7C4D522E0CB.dip0.t-ipconnect.de] has joined #rust-bitcoin 00:57 -!- TamasBlummer [~Thunderbi@p200300DD67196B436506B7C4D522E0CB.dip0.t-ipconnect.de] has quit [Ping timeout: 264 seconds] 00:57 -!- TamasBlummer1 is now known as TamasBlummer 00:58 -!- willpiers [~willpiers@38.75.231.30] has joined #rust-bitcoin 00:59 -!- ccdle12 [~ccdle12@103.5.140.189] has quit [Ping timeout: 248 seconds] 00:59 -!- ccdle12 [~ccdle12@103.5.140.189] has joined #rust-bitcoin 01:02 -!- willpiers [~willpiers@38.75.231.30] has quit [Ping timeout: 245 seconds] 01:52 -!- ccdle12_ [~ccdle12@103.5.140.189] has joined #rust-bitcoin 01:52 -!- ccdle12 [~ccdle12@103.5.140.189] has quit [Read error: Connection reset by peer] 02:24 -!- mauz555 [~mauz555@bny93-8-88-171-29-234.fbx.proxad.net] has joined #rust-bitcoin 02:28 -!- ccdle12_ [~ccdle12@103.5.140.189] has quit [Remote host closed the connection] 02:31 -!- mauz555 [~mauz555@bny93-8-88-171-29-234.fbx.proxad.net] has quit [Ping timeout: 255 seconds] 02:35 < stevenroose> nickler: they are floats currently 02:36 < stevenroose> so f64 it would be instead of i64. unless you propose having a `serde(with = "")` serde module that converts floats to signed ints, but that sounds crazy 02:37 < stevenroose> andytoshi: you thinking `SignedAmount(Amount, bool)` that just forwards as much of the logic possible to Amount (like parsing by taking the minus out etc..) or a full duplicate `SignedAmount(i64)` that will have quite some code duplication? 02:38 < stevenroose> > `i64` is a bit annoying because of the decimal serialization 02:38 < stevenroose> andytoshi: what do you mean with that? 02:56 -!- mauz555 [~mauz555@2a01:e35:8ab1:dea0:6885:497e:1dd2:7ee3] has joined #rust-bitcoin 03:01 -!- mauz555 [~mauz555@2a01:e35:8ab1:dea0:6885:497e:1dd2:7ee3] has quit [Ping timeout: 258 seconds] 03:21 < stevenroose> just a random Rust question: if you have to fulfill a trait that lets you take &self (no mut), but you want to mutate your internal state, you can just put that state in a `Mutex`. Because `Mutex::lock(&self) -> Result<&mut T>` (note the &self -> &mut T). Is this not kind of a hack against Rust's `mut` keyword protecting immutability? 03:22 < stevenroose> I think an Arc can do the same thing. A Rc can't for some reason. Neither can a Box for a more obvious reason. 03:23 < stevenroose> It seems like there is not way to do it without the overhead of a Mutex. (Arc is even more overhead probably) F.e. if the object you're doing this in is already protected by a mutex upstream, it's a bit unfortunate to have an extra Mutex inside. 04:42 < sgeisler> stevenroose: what do you want to do? Does it have something to do with caching/initializing some internal data structure if used? If so a `OnceCell` from https://docs.rs/once_cell/0.2.0/once_cell/ might do the trick. 04:48 < stevenroose> sgeisler: f.e. we have an API client that uses an HTTP client internally so all methods take &self. I implemented a dummy version of the client for testing purposes. Now in order to mimick the API trait from a Rust dummy, it needs to keep some state (like store a tx when a send is done and return history when a fetch is made) 04:48 < stevenroose> So it would be quite silly to have to change the entire interface of the trait to &mut self just because a test dummy version excists. 04:48 < stevenroose> exists* 04:49 < stevenroose> Same goes with a DB dummies f.e. A RocksDB takes &self, so your DB type that has an inner RocksDB::DB will take &self. If you want to quick and dirty DummyDB that implements the same interface but just stores in memory, you'd need &mut self. 04:50 < stevenroose> Are you still on Rocket, I have an example on Github. 05:40 -!- ccdle12 [~ccdle12@p1482011-ipngn9101sapodori.hokkaido.ocn.ne.jp] has joined #rust-bitcoin 05:52 -!- ccdle12 [~ccdle12@p1482011-ipngn9101sapodori.hokkaido.ocn.ne.jp] has quit [Read error: Connection reset by peer] 05:53 -!- ccdle12 [~ccdle12@p1482011-ipngn9101sapodori.hokkaido.ocn.ne.jp] has joined #rust-bitcoin 06:22 -!- willpiers [~willpiers@38.75.231.30] has joined #rust-bitcoin 06:27 -!- willpiers [~willpiers@38.75.231.30] has quit [Ping timeout: 258 seconds] 06:56 -!- ccdle12_ [~ccdle12@p1482011-ipngn9101sapodori.hokkaido.ocn.ne.jp] has joined #rust-bitcoin 06:57 -!- ccdle12 [~ccdle12@p1482011-ipngn9101sapodori.hokkaido.ocn.ne.jp] has quit [Read error: Connection reset by peer] 06:58 < nickler> stevenroose: I have no idea really how serde works really, or how the integration is supposed to look like ... will look into that 07:25 -!- willpiers [~willpiers@38.75.231.30] has joined #rust-bitcoin 07:27 -!- willpiers [~willpiers@38.75.231.30] has quit [Remote host closed the connection] 07:28 -!- willpiers [~willpiers@38.75.231.30] has joined #rust-bitcoin 07:32 -!- willpiers [~willpiers@38.75.231.30] has quit [Ping timeout: 258 seconds] 07:40 -!- michaelsdunn1 [~michaelsd@unaffiliated/michaelsdunn1] has joined #rust-bitcoin 07:42 -!- ccdle12_ [~ccdle12@p1482011-ipngn9101sapodori.hokkaido.ocn.ne.jp] has quit [Remote host closed the connection] 07:54 -!- ccdle12 [~ccdle12@p1482011-ipngn9101sapodori.hokkaido.ocn.ne.jp] has joined #rust-bitcoin 08:01 < stevenroose> nickler: amounts are floats now, fwiw 08:17 -!- ccdle12 [~ccdle12@p1482011-ipngn9101sapodori.hokkaido.ocn.ne.jp] has quit [Remote host closed the connection] 08:28 -!- willpiers [~willpiers@107-1-237-234-ip-static.hfc.comcastbusiness.net] has joined #rust-bitcoin 09:31 -!- Dean_Guss [~dean@gateway/tor-sasl/deanguss] has quit [Ping timeout: 256 seconds] 09:52 -!- CubicEarth [~CubicEart@c-67-168-1-172.hsd1.wa.comcast.net] has quit [Ping timeout: 268 seconds] 10:03 -!- willpiers [~willpiers@107-1-237-234-ip-static.hfc.comcastbusiness.net] has quit [Remote host closed the connection] 10:05 -!- willpiers [~willpiers@107-1-237-234-ip-static.hfc.comcastbusiness.net] has joined #rust-bitcoin 10:05 -!- CubicEarth [~CubicEart@c-67-168-1-172.hsd1.wa.comcast.net] has joined #rust-bitcoin 10:47 -!- willpiers [~willpiers@107-1-237-234-ip-static.hfc.comcastbusiness.net] has quit [Remote host closed the connection] 10:48 -!- willpiers [~willpiers@107-1-237-234-ip-static.hfc.comcastbusiness.net] has joined #rust-bitcoin 10:50 -!- willpiers [~willpiers@107-1-237-234-ip-static.hfc.comcastbusiness.net] has quit [Remote host closed the connection] 11:00 -!- willpiers [~willpiers@107-1-237-234-ip-static.hfc.comcastbusiness.net] has joined #rust-bitcoin 11:28 -!- gribble [~gribble@unaffiliated/nanotube/bot/gribble] has quit [Remote host closed the connection] 11:38 -!- gribble [~gribble@unaffiliated/nanotube/bot/gribble] has joined #rust-bitcoin 11:39 -!- instagibbs [~instagibb@pool-100-15-135-248.washdc.fios.verizon.net] has quit [Ping timeout: 258 seconds] 11:46 -!- instagibbs [~instagibb@pool-100-15-135-248.washdc.fios.verizon.net] has joined #rust-bitcoin 12:09 -!- willpiers [~willpiers@107-1-237-234-ip-static.hfc.comcastbusiness.net] has quit [Remote host closed the connection] 12:12 -!- willpiers [~willpiers@107-1-237-234-ip-static.hfc.comcastbusiness.net] has joined #rust-bitcoin 12:32 -!- willpiers [~willpiers@107-1-237-234-ip-static.hfc.comcastbusiness.net] has quit [Remote host closed the connection] 13:00 -!- willpiers [~willpiers@107-1-237-234-ip-static.hfc.comcastbusiness.net] has joined #rust-bitcoin 13:41 -!- michaelsdunn1 [~michaelsd@unaffiliated/michaelsdunn1] has quit [Remote host closed the connection] 14:34 -!- willpiers [~willpiers@107-1-237-234-ip-static.hfc.comcastbusiness.net] has quit [Remote host closed the connection] 14:37 -!- willpier_ [~willpiers@107-1-237-234-ip-static.hfc.comcastbusiness.net] has joined #rust-bitcoin 14:41 -!- willpier_ [~willpiers@107-1-237-234-ip-static.hfc.comcastbusiness.net] has quit [Ping timeout: 248 seconds] 14:49 -!- willpiers [~willpiers@107-1-237-234-ip-static.hfc.comcastbusiness.net] has joined #rust-bitcoin 15:04 -!- willpiers [~willpiers@107-1-237-234-ip-static.hfc.comcastbusiness.net] has quit [Remote host closed the connection] 15:05 -!- willpiers [~willpiers@107-1-237-234-ip-static.hfc.comcastbusiness.net] has joined #rust-bitcoin 15:10 -!- willpiers [~willpiers@107-1-237-234-ip-static.hfc.comcastbusiness.net] has quit [Ping timeout: 246 seconds] 15:47 -!- willpiers [~willpiers@38.75.231.30] has joined #rust-bitcoin 16:40 -!- ccdle12 [~ccdle12@p1482011-ipngn9101sapodori.hokkaido.ocn.ne.jp] has joined #rust-bitcoin 17:19 -!- ccdle12 [~ccdle12@p1482011-ipngn9101sapodori.hokkaido.ocn.ne.jp] has quit [Remote host closed the connection] 17:43 -!- ccdle12 [~ccdle12@p1482011-ipngn9101sapodori.hokkaido.ocn.ne.jp] has joined #rust-bitcoin 17:47 -!- ccdle12 [~ccdle12@p1482011-ipngn9101sapodori.hokkaido.ocn.ne.jp] has quit [Ping timeout: 245 seconds] 18:13 -!- schmidty [~schmidty@unaffiliated/schmidty] has quit [Ping timeout: 244 seconds] 18:24 -!- schmidty [~schmidty@104-7-216-111.lightspeed.austtx.sbcglobal.net] has joined #rust-bitcoin 18:24 -!- schmidty [~schmidty@104-7-216-111.lightspeed.austtx.sbcglobal.net] has quit [Changing host] 18:24 -!- schmidty [~schmidty@unaffiliated/schmidty] has joined #rust-bitcoin 18:29 < andytoshi> stevenroose: within a thread use `RefCell` rather than `Mutex` 18:29 < andytoshi> this is "internal mutability" and yes it morally evades rust's immutability guarantees, but does so in a safe way 18:29 < andytoshi> re "i64 is annoying", what i mean is that we can't impl Deserialize and Serialize on i64 cuz it's not our type 18:41 -!- belcher [~belcher@unaffiliated/belcher] has quit [Quit: Leaving] 19:04 -!- willpiers [~willpiers@38.75.231.30] has quit [Remote host closed the connection] 19:04 -!- willpiers [~willpiers@38.75.231.30] has joined #rust-bitcoin 19:06 -!- willpiers [~willpiers@38.75.231.30] has quit [Remote host closed the connection] 19:06 -!- willpiers [~willpiers@38.75.231.30] has joined #rust-bitcoin 19:19 -!- willpiers [~willpiers@38.75.231.30] has quit [Remote host closed the connection] 19:20 -!- willpiers [~willpiers@38.75.231.30] has joined #rust-bitcoin 19:22 -!- Dean_Guss [~dean@gateway/tor-sasl/deanguss] has joined #rust-bitcoin 19:24 -!- willpiers [~willpiers@38.75.231.30] has quit [Ping timeout: 248 seconds] 20:16 -!- willpiers [~willpiers@38.75.231.30] has joined #rust-bitcoin 21:15 -!- willpiers [~willpiers@38.75.231.30] has quit [Remote host closed the connection] 21:15 -!- willpiers [~willpiers@38.75.231.30] has joined #rust-bitcoin 21:20 -!- willpiers [~willpiers@38.75.231.30] has quit [Ping timeout: 268 seconds] 21:40 -!- willpiers [~willpiers@38.75.231.30] has joined #rust-bitcoin 21:57 -!- ccdle12_ [~ccdle12@103.5.140.188] has joined #rust-bitcoin 22:15 -!- ccdle12_ [~ccdle12@103.5.140.188] has quit [Remote host closed the connection] 22:16 -!- willpiers [~willpiers@38.75.231.30] has quit [Remote host closed the connection] 22:41 -!- willpiers [~willpiers@38.75.231.30] has joined #rust-bitcoin 22:43 -!- willpiers [~willpiers@38.75.231.30] has quit [Remote host closed the connection] 22:43 -!- willpiers [~willpiers@38.75.231.30] has joined #rust-bitcoin 22:45 -!- willpiers [~willpiers@38.75.231.30] has quit [Remote host closed the connection] 22:46 -!- willpiers [~willpiers@38.75.231.30] has joined #rust-bitcoin 22:50 -!- willpiers [~willpiers@38.75.231.30] has quit [Ping timeout: 245 seconds] --- Log closed Fri May 10 00:00:11 2019