--- Log opened Sun May 26 00:00:23 2019 00:30 -!- TamasBlummer1 [~Thunderbi@p200300DD67196B106463A7695EBC9787.dip0.t-ipconnect.de] has joined #rust-bitcoin 00:31 -!- TamasBlummer [~Thunderbi@p200300DD67196B90DC334847ED0B623E.dip0.t-ipconnect.de] has quit [Ping timeout: 264 seconds] 00:31 -!- TamasBlummer1 is now known as TamasBlummer 04:56 -!- ccdle12 [~ccdle12@pcd537031.netvigator.com] has joined #rust-bitcoin 05:08 -!- willpiers [~willpiers@38.75.231.30] has joined #rust-bitcoin 05:13 -!- willpiers [~willpiers@38.75.231.30] has quit [Ping timeout: 258 seconds] 05:15 < andytoshi> stevenroose: so, nickler has a WIP pr to the liquid integration tests that uses Amount and it's really inelegant. we can't have `const` amount values, everything requires `.as_sat() as u64` to use 05:16 < andytoshi> i think maybe we should make Amount a trait that we impl on both u64 and i64, and put the sat/btc conversions and serde stuff on that trait 05:18 < andytoshi> but the current impl seems to infect tons of code with core's rpc bullshit which is the opposite of what we want 06:00 -!- ccdle12 [~ccdle12@pcd537031.netvigator.com] has quit [Remote host closed the connection] 06:00 -!- DeanGuss [~dean@gateway/tor-sasl/deanguss] has quit [Ping timeout: 256 seconds] 06:22 -!- instagibbs [~instagibb@pool-100-15-135-248.washdc.fios.verizon.net] has quit [Ping timeout: 245 seconds] 06:32 -!- ccdle12 [~ccdle12@pcd537031.netvigator.com] has joined #rust-bitcoin 07:34 -!- ccdle12 [~ccdle12@pcd537031.netvigator.com] has quit [Remote host closed the connection] 09:10 -!- willpiers [~willpiers@38.75.231.30] has joined #rust-bitcoin 09:15 -!- willpiers [~willpiers@38.75.231.30] has quit [Ping timeout: 272 seconds] 10:17 < stevenroose> andytoshi: what specifically are the const values for? 10:18 < stevenroose> If we `pub` the internal `i64`, they can be generated const. 10:40 -!- willpiers [~willpiers@38.75.231.30] has joined #rust-bitcoin 10:40 -!- willpiers [~willpiers@38.75.231.30] has quit [Remote host closed the connection] 10:41 -!- willpiers [~willpiers@38.75.231.30] has joined #rust-bitcoin 10:45 -!- willpiers [~willpiers@38.75.231.30] has quit [Ping timeout: 246 seconds] 10:54 < andytoshi> stevenroose: things like maximum fees, etc 10:54 < andytoshi> ok, sure, but then we're still using i64 which sucks 10:54 < andytoshi> so you basically need to reason _everywhere_ about things potentially being negative that shouldn't 10:55 < andytoshi> you can't use checked_sub to verify that fees are positive, etc 10:55 < andytoshi> and like, i don't even use any of the RPCs that return negative amounts.. 10:58 < stevenroose> I understand. 10:58 < stevenroose> So SignedAmount isn't such a bad idea 10:59 < stevenroose> Just pushed an extra commit with [try_]from_usat and [try_]to_usat. 10:59 < stevenroose> But it seemed that SignedAmount is a better option. 10:59 < andytoshi> yeah, i think with SignedAmount a lot of the trouble would go away 11:00 < andytoshi> and i would like the inner value to be public 11:00 < stevenroose> I would even just have SignedAmount in the most lazy way possible just for RPC. 11:00 < andytoshi> would make it easier to integrate with rust-elements 11:00 < stevenroose> SignedAmount(bool, Amount) or something and just a getter for sign and inner amount. 11:00 < stevenroose> And not have it in rust-bitcoin, just in bitcoincore-rpc 11:00 < andytoshi> i also feel like we could define a minimal trait and then do everything in terms of the trait functions 11:01 < andytoshi> :grimacing: i dunno about having a signed magnitude like that 11:01 < stevenroose> Traits are very painful when using structs 11:01 < andytoshi> i64 is way more ergonomic 11:01 < andytoshi> ? 11:01 < andytoshi> you'd never generalize over them 11:01 < andytoshi> the trait is just to reuse code 11:01 < andytoshi> you'd actually use u64 or i64 in your code 11:01 < andytoshi> which would both implement the Amount trait 11:04 < stevenroose> u64 or i64 or f64 (RPC) 11:04 < andytoshi> i think they could all impl Amount 11:04 < andytoshi> so Amount would basically have four functions 11:04 < andytoshi> to_btc(&self) -> f64; from_btc(f64) -> Self 11:05 < andytoshi> to_sat(&self) -> u64, from_btc(u64) -> Self 11:05 < andytoshi> oh, six functions 11:05 < stevenroose> Then somehow you need to *imply* that u64 is satoshi and f64 is btc f.e. 11:05 < andytoshi> i mean, u64 is already always satoshi 11:05 < nickler> `.as_sat() as u64` in my code doesn't seem like a problem because it's only used when creating bitcoin TxOuts and elements::Value::Explicit. Both could take Amounts 11:06 < andytoshi> so rust-elements would need to use the rust-bitcoin Amount type? feels like too strong a coupling 11:06 < andytoshi> maybe if Amount were in bitcoin-constants instead.. 11:06 < stevenroose> Why would that be too strong coupling? 11:07 < stevenroose> They are both CAmount's no? :) 11:07 < andytoshi> they both have a type with the same name, yes 11:07 < andytoshi> even though they're separate projects 11:07 < andytoshi> maybe that's OK for C++ 11:07 < andytoshi> but none of the rust-elements concrete types even contain bitcoin types 11:07 < andytoshi> oh except bitcoin::Script 11:07 < andytoshi> which is wrong because elements has way more opcodes 11:08 < stevenroose> I agree that bitcoin::Script is wrong. 11:08 < andytoshi> the consensus::Encodable stuff will need to be replaced when BlueMatt's changes to rust-bitcoin go through 11:08 < stevenroose> Amount less so. 11:08 < andytoshi> amounts in elements are also completely different 11:08 < andytoshi> we have the elements::confidential::Value type 11:08 < BlueMatt> yea, sorry for the delay, I dunno whats up with the fuzzer there 11:08 < BlueMatt> and will have to wait till I'm in the office wed to work on it more 11:08 < andytoshi> no worries. may need a separate PR to just drop the number of iterations :( 11:09 < BlueMatt> true, that works as a temp fix, but I'm worried it indicates some perf issue hiding somewhere in the new code 11:09 < BlueMatt> so it needs digging 11:09 < andytoshi> yeah, true, it does seem like only your PR is affected 11:09 < andytoshi> (though there are CI failures on like half the open PRs...they all seem like differenth things tho) 11:13 < stevenroose> So even with from_usat and to_usat, Amount(u64) seems to make more sense? :D 11:13 < andytoshi> yeah 11:13 < BlueMatt> well carl's addition of a top-level fuzzer for all network message things is also borked 11:13 < stevenroose> That's the 4th time or so I change that. I don't really mind, I want the type to be useful mainly. 11:14 < andytoshi> heh yeah, sorry 11:14 < andytoshi> i think we want both Amount(pub u64) and SignedAmount(pub i64) 11:15 < andytoshi> we also need checked_sub for Amount 11:17 < andytoshi> on further thought i don't really mind rust-elements using bitcoin::Amount, at least initially 11:17 < nickler> I've been an Amount(pub u64)-guy all along 11:29 < stevenroose> Hmm, SignedAmount part of rust-bitcoin? 11:29 < andytoshi> yeah i think so 11:29 < stevenroose> Any suggestions to reduce code duplication? 11:29 < andytoshi> use a trait :P 11:30 < stevenroose> :D 12:16 -!- gmaxwell [gmaxwell@wikimedia/KatWalsh/x-0001] has left #rust-bitcoin [] 12:17 -!- willpiers [~willpiers@38.75.231.30] has joined #rust-bitcoin 12:22 -!- willpiers [~willpiers@38.75.231.30] has quit [Ping timeout: 268 seconds] 14:16 -!- mangoicedtea [~mangoiced@2601:583:c201:7520::4] has joined #rust-bitcoin 15:12 -!- instagibbs [~instagibb@pool-100-15-135-248.washdc.fios.verizon.net] has joined #rust-bitcoin 15:15 -!- mangoicedtea [~mangoiced@2601:583:c201:7520::4] has quit [Remote host closed the connection] 15:15 -!- mangoicedtea [~mangoiced@2601:583:c201:7520::4] has joined #rust-bitcoin 15:34 -!- mangoicedtea [~mangoiced@2601:583:c201:7520::4] has quit [Ping timeout: 248 seconds] 16:03 -!- mauz555 [~mauz555@2a01:e35:8ab1:dea0:dc13:eb9c:4a69:7a8d] has joined #rust-bitcoin 16:06 -!- ccdle12 [~ccdle12@pcd537031.netvigator.com] has joined #rust-bitcoin 16:14 -!- mauz555 [~mauz555@2a01:e35:8ab1:dea0:dc13:eb9c:4a69:7a8d] has quit [Remote host closed the connection] 16:14 -!- mauz555 [~mauz555@2a01:e35:8ab1:dea0:dc13:eb9c:4a69:7a8d] has joined #rust-bitcoin 16:19 -!- mauz555 [~mauz555@2a01:e35:8ab1:dea0:dc13:eb9c:4a69:7a8d] has quit [Ping timeout: 252 seconds] 16:19 -!- willpiers [~willpiers@38.75.231.30] has joined #rust-bitcoin 16:24 -!- willpiers [~willpiers@38.75.231.30] has quit [Ping timeout: 272 seconds] 17:40 -!- ccdle12 [~ccdle12@pcd537031.netvigator.com] has quit [Remote host closed the connection] 18:13 -!- ccdle12 [~ccdle12@pcd537031.netvigator.com] has joined #rust-bitcoin 18:24 -!- DeanGuss [~dean@gateway/tor-sasl/deanguss] has joined #rust-bitcoin 19:25 -!- willpiers [~willpiers@38.75.231.30] has joined #rust-bitcoin 19:44 -!- ccdle12 [~ccdle12@pcd537031.netvigator.com] has quit [Remote host closed the connection] 20:33 -!- ccdle12 [~ccdle12@pcd537031.netvigator.com] has joined #rust-bitcoin 20:53 -!- willpiers [~willpiers@38.75.231.30] has quit [Remote host closed the connection] 20:53 -!- DeanGuss [~dean@gateway/tor-sasl/deanguss] has quit [Remote host closed the connection] 20:53 -!- willpiers [~willpiers@38.75.231.30] has joined #rust-bitcoin 20:58 -!- willpiers [~willpiers@38.75.231.30] has quit [Ping timeout: 248 seconds] 21:07 -!- DeanGuss [~dean@gateway/tor-sasl/deanguss] has joined #rust-bitcoin 21:46 -!- ccdle12 [~ccdle12@pcd537031.netvigator.com] has quit [Remote host closed the connection] 21:49 -!- ccdle12 [~ccdle12@pcd537031.netvigator.com] has joined #rust-bitcoin 21:51 -!- ccdle12 [~ccdle12@pcd537031.netvigator.com] has quit [Read error: Connection reset by peer] 21:51 -!- ccdle12 [~ccdle12@pcd537031.netvigator.com] has joined #rust-bitcoin 22:05 -!- willpiers [~willpiers@38.75.231.30] has joined #rust-bitcoin 22:40 -!- ccdle12 [~ccdle12@pcd537031.netvigator.com] has quit [Remote host closed the connection] 22:41 -!- ccdle12 [~ccdle12@pcd537031.netvigator.com] has joined #rust-bitcoin 22:41 -!- ccdle12 [~ccdle12@pcd537031.netvigator.com] has quit [Remote host closed the connection] 23:12 -!- willpiers [~willpiers@38.75.231.30] has quit [Remote host closed the connection] 23:13 -!- willpiers [~willpiers@38.75.231.30] has joined #rust-bitcoin 23:17 -!- willpiers [~willpiers@38.75.231.30] has quit [Ping timeout: 258 seconds] --- Log closed Mon May 27 00:00:25 2019