diff --git a/Cargo.lock b/Cargo.lock index 03f0cd7..e778b99 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -25,19 +25,21 @@ dependencies = [ [[package]] name = "aluvm" -version = "0.10.3" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6385af946e0be015f5e1ca29c5e69c1ed455e6d955e0ba05db8537e666c144ea" +checksum = "f3856ee4be23c8a4b44c4119656e92aeb654c69244290c4c81feb467d49354ce" dependencies = [ "amplify 4.0.0", "baid58", + "getrandom", "half", - "paste 1.0.13", + "paste 1.0.14", "ripemd", "serde", "sha2", - "strict_encoding 2.4.2", + "strict_encoding 2.5.0", "strict_types", + "wasm-bindgen", ] [[package]] @@ -180,9 +182,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.71" +version = "1.0.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" +checksum = "3b13c32d80ecc7ab747b80c3784bce54ee8a7a0cc4fbda9bf4cda2cf6fe90854" [[package]] name = "arrayref" @@ -207,9 +209,9 @@ dependencies = [ [[package]] name = "atk" -version = "0.15.1" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c3d816ce6f0e2909a96830d6911c2aff044370b1ef92d7f267b43bae5addedd" +checksum = "39991bc421ddf72f70159011b323ff49b0f783cc676a7287c59453da2e2531cf" dependencies = [ "atk-sys", "bitflags 1.3.2", @@ -219,9 +221,9 @@ dependencies = [ [[package]] name = "atk-sys" -version = "0.15.1" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58aeb089fb698e06db8089971c7ee317ab9644bade33383f63631437b03aafb6" +checksum = "11ad703eb64dc058024f0e57ccfa069e15a413b98dbd50a1a950e743b7f11148" dependencies = [ "glib-sys", "gobject-sys", @@ -296,9 +298,9 @@ dependencies = [ [[package]] name = "bitcoin" -version = "0.30.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b36f4c848f6bd9ff208128f08751135846cc23ae57d66ab10a22efff1c675f3c" +checksum = "4e99ff7289b20a7385f66a0feda78af2fc119d28fb56aea8886a9cd0a4abdd75" dependencies = [ "bech32", "bitcoin-private", @@ -428,9 +430,9 @@ dependencies = [ [[package]] name = "bp-core" -version = "0.10.4" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20eee52cf1c0d1fb6820436cd73b709483a14257fcb66753b0002d5f61151d88" +checksum = "d41afe7b8aa5dd71d257ca38e5bc922bd3024e0cca9e2ad52a076f2bdeddb901" dependencies = [ "amplify 4.0.0", "bp-dbc", @@ -439,15 +441,15 @@ dependencies = [ "commit_verify", "serde", "single_use_seals", - "strict_encoding 2.4.2", + "strict_encoding 2.5.0", "strict_types", ] [[package]] name = "bp-dbc" -version = "0.10.4" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e93be8147fe47376f1144a78b6e4cf11999efa8328fcca1b25b7f030491bb27" +checksum = "1bd7e637529d70db7881fcaf2aaa6a09ae8ee1a1e6ca499dbbf041e032ff3f73" dependencies = [ "amplify 4.0.0", "baid58", @@ -455,28 +457,28 @@ dependencies = [ "commit_verify", "secp256k1 0.27.0", "serde", - "strict_encoding 2.4.2", + "strict_encoding 2.5.0", ] [[package]] name = "bp-primitives" -version = "0.10.4" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52baa67a14cf94e4e35c1f279b2b8bdac342e2a6a3e57afd8887d46855d8d0b9" +checksum = "8786660637d2ad9e6da09f55d2e67992eb39c0edb52333b478bb3c03e377218e" dependencies = [ "amplify 4.0.0", "commit_verify", "secp256k1 0.27.0", "serde", - "strict_encoding 2.4.2", + "strict_encoding 2.5.0", "strict_types", ] [[package]] name = "bp-seals" -version = "0.10.4" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f5b4ab2ba908733c37d4259474920c87b31d69453c3acd59298bf1d69e59392" +checksum = "15f5f82a3813921ffd1d668dbcfd17bcb7c90a08de7af76dffb7b9e77c72c7d0" dependencies = [ "amplify 4.0.0", "baid58", @@ -486,13 +488,13 @@ dependencies = [ "rand", "serde", "single_use_seals", - "strict_encoding 2.4.2", + "strict_encoding 2.5.0", ] [[package]] name = "bpro" -version = "0.4.0" -source = "git+https://github.com/pandora-prime/bpro#acb59fe7395c04233371656d43b1a1665746cdec" +version = "0.5.0" +source = "git+https://github.com/pandora-prime/bpro?branch=v0.5#9d151d4ba11701a9e399ef93dea74040fd773ba6" dependencies = [ "amplify 3.14.2", "bitcoin 0.29.2", @@ -508,7 +510,7 @@ dependencies = [ "serde", "serde_with 2.3.3", "strict_encoding 0.9.0", - "strict_encoding 2.4.2", + "strict_encoding 2.5.0", ] [[package]] @@ -525,22 +527,23 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "cairo-rs" -version = "0.15.12" +version = "0.16.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c76ee391b03d35510d9fa917357c7f1855bd9a6659c95a1b392e33f49b3369bc" +checksum = "f3125b15ec28b84c238f6f476c6034016a5f6cc0221cb514ca46c532139fc97d" dependencies = [ "bitflags 1.3.2", "cairo-sys-rs", "glib", "libc", + "once_cell", "thiserror", ] [[package]] name = "cairo-sys-rs" -version = "0.15.1" +version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c55d429bef56ac9172d25fecb85dc8068307d17acd74b377866b7a1ef25d3c8" +checksum = "7c48f4af05fabdcfa9658178e1326efa061853f040ce7d72e33af6885196f421" dependencies = [ "glib-sys", "libc", @@ -650,16 +653,16 @@ dependencies = [ [[package]] name = "commit_verify" -version = "0.10.3" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "395d2cf275f1359bf36f26e15f68d2be5edc16fe0b210bc47ad9d6cefc1a3c5f" +checksum = "1459c7274450984c0f2dbe89a250817f2275c02001b1cf3da4a6e8e74bc56421" dependencies = [ "amplify 4.0.0", "commit_encoding_derive", "rand", "serde", "sha2", - "strict_encoding 2.4.2", + "strict_encoding 2.5.0", "strict_types", ] @@ -721,12 +724,12 @@ dependencies = [ [[package]] name = "darling" -version = "0.20.1" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0558d22a7b463ed0241e993f76f09f30b126687447751a8638587b864e4b3944" +checksum = "0209d94da627ab5605dcccf08bb18afa5009cfbef48d8a8b7d7bdbc79be25c5e" dependencies = [ - "darling_core 0.20.1", - "darling_macro 0.20.1", + "darling_core 0.20.3", + "darling_macro 0.20.3", ] [[package]] @@ -745,16 +748,16 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.20.1" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab8bfa2e259f8ee1ce5e97824a3c55ec4404a0d772ca7fa96bf19f0752a046eb" +checksum = "177e3443818124b357d8e76f53be906d60937f0d3a90773a664fa63fa253e621" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", "strsim", - "syn 2.0.25", + "syn 2.0.27", ] [[package]] @@ -770,13 +773,13 @@ dependencies = [ [[package]] name = "darling_macro" -version = "0.20.1" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29a358ff9f12ec09c3e61fef9b5a9902623a695a46a917b07f269bff1445611a" +checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" dependencies = [ - "darling_core 0.20.1", + "darling_core 0.20.3", "quote", - "syn 2.0.25", + "syn 2.0.27", ] [[package]] @@ -861,7 +864,7 @@ version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06bd24afe8bbe869220a7f03ff413dcb9c4824a663e8f06f3cbd7f1c75126d21" dependencies = [ - "bitcoin 0.30.0", + "bitcoin 0.30.1", "bitcoin-private", "byteorder", "libc", @@ -983,15 +986,6 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "fragile" -version = "1.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7464c5c4a3f014d9b2ec4073650e5c06596f385060af740fc45ad5a19f959e8" -dependencies = [ - "fragile 2.0.0", -] - [[package]] name = "fragile" version = "2.0.0" @@ -1030,6 +1024,17 @@ version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" +[[package]] +name = "futures-macro" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.27", +] + [[package]] name = "futures-task" version = "0.3.28" @@ -1043,6 +1048,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" dependencies = [ "futures-core", + "futures-macro", "futures-task", "pin-project-lite", "pin-utils", @@ -1051,9 +1057,9 @@ dependencies = [ [[package]] name = "gdk" -version = "0.15.4" +version = "0.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6e05c1f572ab0e1f15be94217f0dc29088c248b14f792a5ff0af0d84bcda9e8" +checksum = "aa9cb33da481c6c040404a11f8212d193889e9b435db2c14fd86987f630d3ce1" dependencies = [ "bitflags 1.3.2", "cairo-rs", @@ -1067,9 +1073,9 @@ dependencies = [ [[package]] name = "gdk-pixbuf" -version = "0.15.11" +version = "0.16.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad38dd9cc8b099cceecdf41375bb6d481b1b5a7cd5cd603e10a69a9383f8619a" +checksum = "c3578c60dee9d029ad86593ed88cb40f35c1b83360e12498d055022385dd9a05" dependencies = [ "bitflags 1.3.2", "gdk-pixbuf-sys", @@ -1080,9 +1086,9 @@ dependencies = [ [[package]] name = "gdk-pixbuf-sys" -version = "0.15.10" +version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "140b2f5378256527150350a8346dbdb08fadc13453a7a2d73aecd5fab3c402a7" +checksum = "3092cf797a5f1210479ea38070d9ae8a5b8e9f8f1be9f32f4643c529c7d70016" dependencies = [ "gio-sys", "glib-sys", @@ -1093,9 +1099,9 @@ dependencies = [ [[package]] name = "gdk-sys" -version = "0.15.1" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32e7a08c1e8f06f4177fb7e51a777b8c1689f743a7bc11ea91d44d2226073a88" +checksum = "d76354f97a913e55b984759a997b693aa7dc71068c9e98bcce51aa167a0a5c5a" dependencies = [ "cairo-sys-rs", "gdk-pixbuf-sys", @@ -1133,26 +1139,29 @@ dependencies = [ [[package]] name = "gio" -version = "0.15.12" +version = "0.16.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68fdbc90312d462781a395f7a16d96a2b379bb6ef8cd6310a2df272771c4283b" +checksum = "2a1c84b4534a290a29160ef5c6eff2a9c95833111472e824fc5cb78b513dd092" dependencies = [ "bitflags 1.3.2", "futures-channel", "futures-core", "futures-io", + "futures-util", "gio-sys", "glib", "libc", "once_cell", + "pin-project-lite", + "smallvec", "thiserror", ] [[package]] name = "gio-sys" -version = "0.15.10" +version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32157a475271e2c4a023382e9cab31c4584ee30a97da41d3c4e9fdd605abcf8d" +checksum = "e9b693b8e39d042a95547fc258a7b07349b1f0b48f4b2fa3108ba3c51c0b5229" dependencies = [ "glib-sys", "gobject-sys", @@ -1162,20 +1171,20 @@ dependencies = [ ] [[package]] -name = "gladis" -version = "2.1.2" +name = "glade" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e2b848fece14930348cbe3eec83929625bbc3975a77acc32fd938b4732ae927" +checksum = "c9b18e52739d74c741795601ad974f08fd31bb7b3c9161eccc37e5d422682f3f" dependencies = [ - "gladis_proc_macro", + "glade_derive", "gtk", ] [[package]] -name = "gladis_proc_macro" -version = "2.1.2" +name = "glade_derive" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87c2b04f80ecf03778e562d0f6365da705b35fa0d28819417f4d36ba021bcd83" +checksum = "7276a7363bd38688a2a71fbbaf248cc990650bd2bf0f79c21fd35df9e87684f1" dependencies = [ "quote", "syn 1.0.109", @@ -1183,15 +1192,17 @@ dependencies = [ [[package]] name = "glib" -version = "0.15.12" +version = "0.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edb0306fbad0ab5428b0ca674a23893db909a98582969c9b537be4ced78c505d" +checksum = "16aa2475c9debed5a32832cb5ff2af5a3f9e1ab9e69df58eaadc1ab2004d6eba" dependencies = [ "bitflags 1.3.2", "futures-channel", "futures-core", "futures-executor", "futures-task", + "futures-util", + "gio-sys", "glib-macros", "glib-sys", "gobject-sys", @@ -1203,9 +1214,9 @@ dependencies = [ [[package]] name = "glib-macros" -version = "0.15.13" +version = "0.16.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10c6ae9f6fa26f4fb2ac16b528d138d971ead56141de489f8111e259b9df3c4a" +checksum = "fb1a9325847aa46f1e96ffea37611b9d51fc4827e67f79e7de502a297560a67b" dependencies = [ "anyhow", "heck", @@ -1218,9 +1229,9 @@ dependencies = [ [[package]] name = "glib-sys" -version = "0.15.10" +version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef4b192f8e65e9cf76cbf4ea71fa8e3be4a0e18ffe3d68b8da6836974cc5bad4" +checksum = "c61a4f46316d06bfa33a7ac22df6f0524c8be58e3db2d9ca99ccb1f357b62a65" dependencies = [ "libc", "system-deps", @@ -1228,9 +1239,9 @@ dependencies = [ [[package]] name = "gobject-sys" -version = "0.15.10" +version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d57ce44246becd17153bd035ab4d32cfee096a657fc01f2231c9278378d1e0a" +checksum = "3520bb9c07ae2a12c7f2fbb24d4efc11231c8146a86956413fb1a79bb760a0f1" dependencies = [ "glib-sys", "libc", @@ -1239,9 +1250,9 @@ dependencies = [ [[package]] name = "gtk" -version = "0.15.5" +version = "0.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92e3004a2d5d6d8b5057d2b57b3712c9529b62e82c77f25c1fecde1fd5c23bd0" +checksum = "e4d3507d43908c866c805f74c9dd593c0ce7ba5c38e576e41846639cdcd4bee6" dependencies = [ "atk", "bitflags 1.3.2", @@ -1262,9 +1273,9 @@ dependencies = [ [[package]] name = "gtk-sys" -version = "0.15.3" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5bc2f0587cba247f60246a0ca11fe25fb733eabc3de12d1965fc07efab87c84" +checksum = "89b5f8946685d5fe44497007786600c2f368ff6b1e61a16251c89f72a97520a3" dependencies = [ "atk-sys", "cairo-sys-rs", @@ -1280,9 +1291,9 @@ dependencies = [ [[package]] name = "gtk3-macros" -version = "0.15.6" +version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "684c0456c086e8e7e9af73ec5b84e35938df394712054550e81558d21c44ab0d" +checksum = "096eb63c6fedf03bafe65e5924595785eaf1bcb7200dac0f2cbe9c9738f05ad8" dependencies = [ "anyhow", "proc-macro-crate", @@ -1479,9 +1490,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.8" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b02a5381cc465bd3041d84623d0fa3b66738b52b8e2fc3bab8ad63ab032f4a" +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] name = "js-sys" @@ -1636,7 +1647,7 @@ dependencies = [ "descriptor-wallet", "electrum-client 0.14.1", "embed-resource", - "gladis", + "glade", "gtk", "hwi", "miniscript", @@ -1656,9 +1667,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" dependencies = [ "autocfg", ] @@ -1677,11 +1688,12 @@ checksum = "4d5d9eb14b174ee9aa2ef96dc2b94637a2d4b6e7cb873c7e171f0c20c6cf3eac" [[package]] name = "pango" -version = "0.15.10" +version = "0.16.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22e4045548659aee5313bde6c582b0d83a627b7904dd20dc2d9ef0895d414e4f" +checksum = "cdff66b271861037b89d028656184059e03b0b6ccb36003820be19f7200b1e94" dependencies = [ "bitflags 1.3.2", + "gio", "glib", "libc", "once_cell", @@ -1690,9 +1702,9 @@ dependencies = [ [[package]] name = "pango-sys" -version = "0.15.10" +version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2a00081cde4661982ed91d80ef437c20eacaf6aa1a5962c0279ae194662c3aa" +checksum = "9e134909a9a293e04d2cc31928aa95679c5e4df954d0b85483159bd20d8f047f" dependencies = [ "glib-sys", "gobject-sys", @@ -1737,9 +1749,9 @@ dependencies = [ [[package]] name = "paste" -version = "1.0.13" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4b27ab7be369122c218afc2079489cdcb4b517c0a3fc386ff11e1fedfcc2b35" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" [[package]] name = "paste-impl" @@ -1822,9 +1834,9 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" [[package]] name = "proc-macro2" -version = "1.0.64" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78803b62cbf1f46fde80d7c0e803111524b9877184cfe7c3033659490ac7a7da" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" dependencies = [ "unicode-ident", ] @@ -1898,9 +1910,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.29" +version = "1.0.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "573015e8ab27661678357f27dc26460738fd2b6c86e46f386fde94cb5d913105" +checksum = "5fe8a65d69dd0808184ebb5f836ab526bb259db23c657efa38711b1072ee47f0" dependencies = [ "proc-macro2", ] @@ -1958,9 +1970,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83d3daa6976cffb758ec878f108ba0e062a45b2d6ca3a2cca965338855476caf" +checksum = "39354c10dd07468c2e73926b23bb9c2caca74c5501e38a35da70406f1d923310" dependencies = [ "aho-corasick", "memchr", @@ -1969,18 +1981,18 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ab07dc67230e4a4718e70fd5c20055a4334b121f1f9db8fe63ef39ce9b8c846" +checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2" [[package]] name = "relm" -version = "0.23.0" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "709c2349be8301f7dd8742a6ba2c467392de00bd6f2ae91cbc8791d643f8b2d2" +checksum = "031126cd60d39b0b42d02b9c9ee7870372ea926c9278131484b86f8798b1bb59" dependencies = [ "cairo-rs", - "fragile 1.2.2", + "fragile", "glib", "glib-sys", "gobject-sys", @@ -1991,9 +2003,9 @@ dependencies = [ [[package]] name = "relm-derive" -version = "0.23.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13ddcba187f220c59b698fa4b30e618688193fc6562a6dfb0ead751dc5f15b8c" +checksum = "1b7ffb79cebb8a9d0c9f85dda4ebe38e820cb8f2b00ff0f9b0c949364c6c9fe1" dependencies = [ "lazy_static", "proc-macro2", @@ -2003,12 +2015,13 @@ dependencies = [ [[package]] name = "rgb-contracts" -version = "0.10.0-beta.2" -source = "git+https://github.com/RGB-WG/rgb#32dbfac0b3d0e028a2aece66f679ad3d1a1e5aa7" +version = "0.10.0-rc.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7449326909378abc94f2e627984dd839f20fa58d073f2684420a1248b9b77ffb" dependencies = [ "amplify 4.0.0", "baid58", - "bitcoin 0.30.0", + "bitcoin 0.30.1", "bp-core", "commit_verify", "electrum-client 0.15.1", @@ -2024,8 +2037,9 @@ dependencies = [ [[package]] name = "rgb-core" -version = "0.10.4" -source = "git+https://github.com/RGB-WG/rgb-core#8e09cad6199aeba6963176bc719b43ea201d1c83" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ee6f3eb3d437e8ac1f80dcc5e5ee9b1e70d33b81bd423e8391e376986befd74" dependencies = [ "aluvm", "amplify 4.0.0", @@ -2033,12 +2047,11 @@ dependencies = [ "bp-core", "commit_verify", "getrandom", - "half", "mime", "secp256k1-zkp", "serde", "single_use_seals", - "strict_encoding 2.4.2", + "strict_encoding 2.5.0", "strict_types", "wasm-bindgen", ] @@ -2046,17 +2059,19 @@ dependencies = [ [[package]] name = "rgb-persist-fs" version = "0.10.0" -source = "git+https://github.com/RGB-WG/rgb#32dbfac0b3d0e028a2aece66f679ad3d1a1e5aa7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d56de85517eb858c8fc46075032212d964be44a6d90c86eddeea6f5cb30c64a" dependencies = [ "amplify 4.0.0", "rgb-std", - "strict_encoding 2.4.2", + "strict_encoding 2.5.0", ] [[package]] name = "rgb-std" -version = "0.10.2" -source = "git+https://github.com/RGB-WG/rgb-wallet#11fc461b38bf2de693501bb5d51bdb83d10f6367" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dc78835a03d99c91c1f190df971589ea195a4dce933cf00ba5efe163c082413" dependencies = [ "amplify 4.0.0", "baid58", @@ -2066,19 +2081,20 @@ dependencies = [ "getrandom", "rgb-core", "serde", - "strict_encoding 2.4.2", + "strict_encoding 2.5.0", "strict_types", "wasm-bindgen", ] [[package]] name = "rgb-wallet" -version = "0.10.2" -source = "git+https://github.com/RGB-WG/rgb-wallet#11fc461b38bf2de693501bb5d51bdb83d10f6367" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9231c9e20558f36616a9ae84e2e943146acff88649f1f95ec132738f0237a3d0" dependencies = [ "amplify 4.0.0", "baid58", - "bitcoin 0.30.0", + "bitcoin 0.30.1", "bp-core", "chrono", "commit_verify", @@ -2088,7 +2104,7 @@ dependencies = [ "percent-encoding", "rgb-core", "rgb-std", - "strict_encoding 2.4.2", + "strict_encoding 2.5.0", "wasm-bindgen", ] @@ -2127,9 +2143,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.3" +version = "0.38.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac5ffa1efe7548069688cd7028f32591853cd7b5b756d41bcffd2353e4fc75b4" +checksum = "0a962918ea88d644592894bc6dc55acc6c0956488adcebbfb6e273506b7fd6e5" dependencies = [ "bitflags 2.3.3", "errno", @@ -2184,15 +2200,15 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe232bdf6be8c8de797b22184ee71118d63780ea42ac85b61d1baa6d3b782ae9" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" [[package]] name = "scopeguard" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "sct" @@ -2261,9 +2277,9 @@ dependencies = [ [[package]] name = "secp256k1-zkp-sys" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4237cd927cb5b153fb764b766ced70a7df76d0dacdbaabb49e75bdab03b49c26" +checksum = "d03ab1ca75a18e1899e8d9b8d28b5998ae1ddcb42fec5956769718543293c723" dependencies = [ "cc", "secp256k1-sys 0.8.1", @@ -2271,35 +2287,35 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" +checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" [[package]] name = "serde" -version = "1.0.171" +version = "1.0.174" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30e27d1e4fd7659406c492fd6cfaf2066ba8773de45ca75e855590f856dc34a9" +checksum = "3b88756493a5bd5e5395d53baa70b194b05764ab85b59e43e4b8f4e1192fa9b1" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.171" +version = "1.0.174" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "389894603bd18c46fa56231694f8d827779c0951a667087194cf9de94ed24682" +checksum = "6e5c3a298c7f978e53536f95a63bdc4c4a64550582f31a0359a9afda6aede62e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.27", ] [[package]] name = "serde_json" -version = "1.0.100" +version = "1.0.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f1e14e89be7aa4c4b78bdbdc9eb5bf8517829a600ae8eaa39a6e1d960b5185c" +checksum = "d03b412469450d4404fe8499a268edd7f8b79fecb074b0d812ad64ca21f4031b" dependencies = [ "itoa", "ryu", @@ -2370,17 +2386,17 @@ version = "2.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "881b6f881b17d13214e5d494c939ebab463d01264ce1811e9d4ac3a882e7695f" dependencies = [ - "darling 0.20.1", + "darling 0.20.3", "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.27", ] [[package]] name = "serde_yaml" -version = "0.9.22" +version = "0.9.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "452e67b9c20c37fa79df53201dc03839651086ed9bbe92b3ca585ca9fdaa7d85" +checksum = "1a49e178e4452f45cb61d0cd8cebc1b0fafd3e41929e996cef79aa3aca91f574" dependencies = [ "indexmap 2.0.0", "itoa", @@ -2469,9 +2485,9 @@ dependencies = [ [[package]] name = "strict_encoding" -version = "2.4.2" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "127000718020d3da8bb1a0b64854e49107607463cb0fd6df9960e0642ef53095" +checksum = "23b1c91b79e62afc09025d828fa0b8dbf4105513de38f126a017919c09bca472" dependencies = [ "amplify 4.0.0", "half", @@ -2506,9 +2522,9 @@ dependencies = [ [[package]] name = "strict_types" -version = "1.4.2" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e3b226d85e2961fee06594323a1a98bc79987aa44b9e977d2f834e52eb0361a" +checksum = "75574939fc4c5a13ab4f49d06e965a9d4bd0aa1deff4e227a2afb6dbebff1249" dependencies = [ "amplify 4.0.0", "baid58", @@ -2520,7 +2536,7 @@ dependencies = [ "serde_with 2.3.3", "serde_yaml", "sha2", - "strict_encoding 2.4.2", + "strict_encoding 2.5.0", "toml 0.7.6", ] @@ -2530,7 +2546,7 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff63080f492dd4d289ffcaed8d7ece38adfb423db910eb342c0e04d409536a7a" dependencies = [ - "paste 1.0.13", + "paste 1.0.14", "serde_str_helpers", ] @@ -2559,9 +2575,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.25" +version = "2.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15e3fc8c0c74267e2df136e5e5fb656a464158aa57624053375eb9c8c6e25ae2" +checksum = "b60f673f44a8255b9c8c657daf66a596d435f2da81a555b06dc644d080ba45e0" dependencies = [ "proc-macro2", "quote", @@ -2583,9 +2599,9 @@ dependencies = [ [[package]] name = "target-lexicon" -version = "0.12.8" +version = "0.12.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b1c7f239eb94671427157bd93b3694320f3668d4e1eff08c7285366fd777fac" +checksum = "1d2faeef5759ab89935255b1a4cd98e0baf99d1085e37d36599c625dac49ae8e" [[package]] name = "termcolor" @@ -2604,22 +2620,22 @@ checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" [[package]] name = "thiserror" -version = "1.0.43" +version = "1.0.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a35fc5b8971143ca348fa6df4f024d4d55264f3468c71ad1c2f365b0a4d58c42" +checksum = "611040a08a0439f8248d1990b111c95baa9c704c805fa1f62104b39655fd7f90" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.43" +version = "1.0.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "463fe12d7993d3b327787537ce8dd4dfa058de32fc2b195ef3cde03dc4771e8f" +checksum = "090198534930841fab3a5d1bb637cde49e339654e606195f8d9c76eeb081dc96" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.27", ] [[package]] @@ -2707,9 +2723,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.19.12" +version = "0.19.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c500344a19072298cd05a7224b3c0c629348b78692bf48466c5238656e315a78" +checksum = "f8123f27e969974a3dfba720fdb560be359f57b44302d280ba72e76a74480e8a" dependencies = [ "indexmap 2.0.0", "serde", @@ -2732,9 +2748,9 @@ checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22049a19f4a68748a168c0fc439f9516686aa045927ff767eca0a85101fb6e73" +checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" [[package]] name = "unicode-normalization" @@ -2753,9 +2769,9 @@ checksum = "e1766d682d402817b5ac4490b3c3002d91dfa0d22812f341609f97b08757359c" [[package]] name = "unsafe-libyaml" -version = "0.2.8" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1865806a559042e51ab5414598446a5871b561d21b6764f2eabb0dd481d880a6" +checksum = "f28467d3e1d3c6586d8f25fa243f544f5800fec42d97032474e17222c2b75cfa" [[package]] name = "untrusted" @@ -2863,7 +2879,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.27", "wasm-bindgen-shared", ] @@ -2885,7 +2901,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.27", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -3042,9 +3058,9 @@ checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" [[package]] name = "winnow" -version = "0.4.9" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81a2094c43cc94775293eaa0e499fbc30048a6d824ac82c0351a8c0bf9112529" +checksum = "81fac9742fd1ad1bd9643b991319f72dd031016d44b77039a26977eb667141e7" dependencies = [ "memchr", ] diff --git a/Cargo.toml b/Cargo.toml index 2c75cf4..2f49ac5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,10 +27,10 @@ path = "src/bin/mcw.rs" required-features = ["cli"] [dependencies] -gtk = "0.15.5" -relm = "0.23.0" -relm-derive = "0.23.0" -gladis = "2.1.2" +gtk = "0.16.2" +relm = "0.24.1" +relm-derive = "0.24.0" +glade = "2.2.0" once_cell = "1.10.0" chrono = "0.4.19" urlencoding = "2.1.0" @@ -45,7 +45,7 @@ rgb-contracts = { version = "0.10.0-beta.2", features = ["electrum"] } bitcoin_scripts = "0.10.0" bitcoin_blockchain = "0.10.0" descriptor-wallet = { version = "0.10.0", features = ["miniscript", "keygen", "hwi", "construct"] } -bpro = { version = "0.4.0", features = ["electrum"] } +bpro = { version = "0.5.0", features = ["electrum"] } hwi = "0.6.0" electrum-client = "0.14.0" @@ -67,8 +67,4 @@ serde = ["serde_with", "serde_yaml", "amplify/serde", "chrono/serde", "bitcoin/serde", "miniscript/serde", "descriptor-wallet/serde"] [patch.crates-io] -rgb-core = { git = "https://github.com/RGB-WG/rgb-core" } -rgb-std = { git = "https://github.com/RGB-WG/rgb-wallet" } -rgb-wallet = { git = "https://github.com/RGB-WG/rgb-wallet" } -rgb-contracts = { git = "https://github.com/RGB-WG/rgb" } -bpro = { git = "https://github.com/pandora-prime/bpro" } +bpro = { git = "https://github.com/pandora-prime/bpro", branch = "v0.5" } diff --git a/src/lib.rs b/src/lib.rs index 847c9b9..e063d82 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -23,6 +23,8 @@ extern crate relm_derive; #[cfg(feature = "serde")] extern crate serde_crate as serde; +extern crate glade as gladis; + pub mod model; #[cfg(feature = "ui")] pub mod view; diff --git a/src/view/devices/device_row/view_model.rs b/src/view/devices/device_row/view_model.rs index 35c882e..8e09254 100644 --- a/src/view/devices/device_row/view_model.rs +++ b/src/view/devices/device_row/view_model.rs @@ -118,13 +118,7 @@ impl ObjectImpl for DeviceDataInner { PROPERTIES.as_ref() } - fn set_property( - &self, - _obj: &Self::Type, - _id: usize, - value: &glib::Value, - pspec: &glib::ParamSpec, - ) { + fn set_property(&self, _id: usize, value: &glib::Value, pspec: &glib::ParamSpec) { match pspec.name() { "name" => { let name = value @@ -160,7 +154,7 @@ impl ObjectImpl for DeviceDataInner { } } - fn property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { + fn property(&self, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { match pspec.name() { "name" => self.name.borrow().to_value(), "fingerprint" => self.fingerprint.borrow().to_value(), @@ -189,7 +183,6 @@ impl DeviceData { ("xpub", &xpub.to_string()), ("account", &account), ]) - .expect("Failed to create row data") } pub fn fingerprint(&self) -> Fingerprint { @@ -213,9 +206,9 @@ impl ObjectSubclass for DeviceModelInner { impl ObjectImpl for DeviceModelInner {} impl ListModelImpl for DeviceModelInner { - fn item_type(&self, _list_model: &Self::Type) -> glib::Type { DeviceData::static_type() } - fn n_items(&self, _list_model: &Self::Type) -> u32 { self.0.borrow().len() as u32 } - fn item(&self, _list_model: &Self::Type, position: u32) -> Option { + fn item_type(&self) -> glib::Type { DeviceData::static_type() } + fn n_items(&self) -> u32 { self.0.borrow().len() as u32 } + fn item(&self, position: u32) -> Option { self.0 .borrow() .get(position as usize) @@ -230,7 +223,7 @@ glib::wrapper! { impl DeviceModel { #[allow(clippy::new_without_default)] - pub fn new() -> DeviceModel { glib::Object::new(&[]).expect("Failed to create DeviceModel") } + pub fn new() -> DeviceModel { glib::Object::new(&[]) } pub fn refresh(&self, devices: &HardwareList) { self.clear(); diff --git a/src/view/psbt/sign_row/view_model.rs b/src/view/psbt/sign_row/view_model.rs index 9689906..5fd6781 100644 --- a/src/view/psbt/sign_row/view_model.rs +++ b/src/view/psbt/sign_row/view_model.rs @@ -101,13 +101,7 @@ impl ObjectImpl for SigningInner { PROPERTIES.as_ref() } - fn set_property( - &self, - _obj: &Self::Type, - _id: usize, - value: &glib::Value, - pspec: &glib::ParamSpec, - ) { + fn set_property(&self, _id: usize, value: &glib::Value, pspec: &glib::ParamSpec) { match pspec.name() { "name" => { let value = value @@ -149,7 +143,7 @@ impl ObjectImpl for SigningInner { } } - fn property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { + fn property(&self, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { match pspec.name() { "name" => self.name.borrow().to_value(), "master-fp" => self.master_fp.borrow().to_value(), @@ -188,7 +182,6 @@ impl Signing { ("sigs-required", &sigs_required), ("signable", &(sigs_present < sigs_required)), ]) - .expect("Failed to create row data") } pub fn master_fp(&self) -> Fingerprint { @@ -214,9 +207,9 @@ impl ObjectSubclass for SigningModelInner { impl ObjectImpl for SigningModelInner {} impl ListModelImpl for SigningModelInner { - fn item_type(&self, _list_model: &Self::Type) -> glib::Type { Signing::static_type() } - fn n_items(&self, _list_model: &Self::Type) -> u32 { self.0.borrow().len() as u32 } - fn item(&self, _list_model: &Self::Type, position: u32) -> Option { + fn item_type(&self) -> glib::Type { Signing::static_type() } + fn n_items(&self) -> u32 { self.0.borrow().len() as u32 } + fn item(&self, position: u32) -> Option { self.0 .borrow() .get(position as usize) @@ -234,7 +227,7 @@ impl Default for SigningModel { } impl SigningModel { - pub fn new() -> SigningModel { glib::Object::new(&[]).expect("Failed to create SigningModel") } + pub fn new() -> SigningModel { glib::Object::new(&[]) } pub fn append(&self, obj: &Signing) { let imp = self.imp(); diff --git a/src/view/psbt/sign_row/widget.rs b/src/view/psbt/sign_row/widget.rs index b7aaacf..3af56e9 100644 --- a/src/view/psbt/sign_row/widget.rs +++ b/src/view/psbt/sign_row/widget.rs @@ -73,10 +73,7 @@ impl RowWidgets { .build(); signing .bind_property("master-fp", &self.fingerprint_lbl, "label") - .transform_to(|_, value| { - let s: String = value.clone().get().expect("non-string fingerprint"); - Some(format!("[{}]", s).to_value()) - }) + .transform_to(|_, s: String| Some(format!("[{}]", s).to_value())) .flags(flags_ro) .build(); signing diff --git a/src/view/settings/spending_row/view_model.rs b/src/view/settings/spending_row/view_model.rs index 3846b14..b8b9599 100644 --- a/src/view/settings/spending_row/view_model.rs +++ b/src/view/settings/spending_row/view_model.rs @@ -215,13 +215,7 @@ impl ObjectImpl for ConditionInner { PROPERTIES.as_ref() } - fn set_property( - &self, - _obj: &Self::Type, - _id: usize, - value: &glib::Value, - pspec: &glib::ParamSpec, - ) { + fn set_property(&self, _id: usize, value: &glib::Value, pspec: &glib::ParamSpec) { match pspec.name() { "sigs-all" => { let value = value @@ -329,7 +323,7 @@ impl ObjectImpl for ConditionInner { } } - fn property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { + fn property(&self, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { match pspec.name() { "sigs-all" => self.sigs_all.borrow().to_value(), "sigs-at-least" => self.sigs_at_least.borrow().to_value(), @@ -374,7 +368,7 @@ glib::wrapper! { } impl Default for Condition { - fn default() -> Self { glib::Object::new(&[]).expect("Failed to create row data") } + fn default() -> Self { glib::Object::new(&[]) } } impl From<&Condition> for SpendingCondition { @@ -423,9 +417,9 @@ impl ObjectSubclass for SpendingModelInner { impl ObjectImpl for SpendingModelInner {} impl ListModelImpl for SpendingModelInner { - fn item_type(&self, _list_model: &Self::Type) -> glib::Type { Condition::static_type() } - fn n_items(&self, _list_model: &Self::Type) -> u32 { self.conditions.borrow().len() as u32 } - fn item(&self, _list_model: &Self::Type, position: u32) -> Option { + fn item_type(&self) -> glib::Type { Condition::static_type() } + fn n_items(&self) -> u32 { self.conditions.borrow().len() as u32 } + fn item(&self, position: u32) -> Option { self.conditions .borrow() .get(position as usize) @@ -440,9 +434,7 @@ glib::wrapper! { impl SpendingModel { #[allow(clippy::new_without_default)] - pub fn new() -> SpendingModel { - glib::Object::new(&[]).expect("Failed to create SpendingModel") - } + pub fn new() -> SpendingModel { glib::Object::new(&[]) } pub fn refresh(&self, signers: BTreeSet) { let imp = self.imp(); diff --git a/src/view/settings/spending_row/widget.rs b/src/view/settings/spending_row/widget.rs index f2507e0..4e7fe46 100644 --- a/src/view/settings/spending_row/widget.rs +++ b/src/view/settings/spending_row/widget.rs @@ -172,8 +172,8 @@ impl RowWidgets { condition .bind_property("sigs-all", &self.sig_lbl, "label") .flags(flags_ro) - .transform_to(|_, val| { - if val.get().unwrap() { + .transform_to(|_, val: bool| { + if val { Some("All signatures".to_value()) } else { None @@ -183,8 +183,8 @@ impl RowWidgets { condition .bind_property("sigs-any", &self.sig_lbl, "label") .flags(flags_ro) - .transform_to(|_, val| { - if val.get().unwrap() { + .transform_to(|_, val: bool| { + if val { Some("Any signature".to_value()) } else { None @@ -194,8 +194,8 @@ impl RowWidgets { condition .bind_property("sigs-at-least", &self.sig_lbl, "label") .flags(flags_ro) - .transform_to(|_, val| { - if val.get().unwrap() { + .transform_to(|_, val: bool| { + if val { Some("At least".to_value()) } else { None @@ -251,8 +251,8 @@ impl RowWidgets { condition .bind_property("lock-none", &self.lock_lbl, "label") .flags(flags_ro) - .transform_to(|_, val| { - if val.get().unwrap() { + .transform_to(|_, val: bool| { + if val { Some("at any time".to_value()) } else { None @@ -262,19 +262,21 @@ impl RowWidgets { condition .bind_property("lock-after", &self.lock_lbl, "label") .flags(flags_ro) - .transform_to(|_, val| { - if val.get().unwrap() { - Some("after".to_value()) - } else { - None - } - }) + .transform_to( + |_, val: bool| { + if val { + Some("after".to_value()) + } else { + None + } + }, + ) .build(); condition .bind_property("lock-older", &self.lock_lbl, "label") .flags(flags_ro) - .transform_to(|_, val| { - if val.get().unwrap() { + .transform_to(|_, val: bool| { + if val { Some("starting from".to_value()) } else { None @@ -305,8 +307,8 @@ impl RowWidgets { condition .bind_property("period-years", &self.period_lbl, "label") .flags(flags_ro) - .transform_to(|_, val| { - if val.get().unwrap() { + .transform_to(|_, val: bool| { + if val { Some("year(s)".to_value()) } else { None @@ -316,8 +318,8 @@ impl RowWidgets { condition .bind_property("period-weeks", &self.period_lbl, "label") .flags(flags_ro) - .transform_to(|_, val| { - if val.get().unwrap() { + .transform_to(|_, val: bool| { + if val { Some("week(s)".to_value()) } else { None @@ -327,8 +329,8 @@ impl RowWidgets { condition .bind_property("period-months", &self.period_lbl, "label") .flags(flags_ro) - .transform_to(|_, val| { - if val.get().unwrap() { + .transform_to(|_, val: bool| { + if val { Some("month(s)".to_value()) } else { None @@ -338,13 +340,15 @@ impl RowWidgets { condition .bind_property("period-days", &self.period_lbl, "label") .flags(flags_ro) - .transform_to(|_, val| { - if val.get().unwrap() { - Some("day(s)".to_value()) - } else { - None - } - }) + .transform_to( + |_, val: bool| { + if val { + Some("day(s)".to_value()) + } else { + None + } + }, + ) .build(); condition @@ -353,8 +357,7 @@ impl RowWidgets { .build(); condition .bind_property("after-month", &self.calendar, "month") - .transform_to(|_, value| { - let month: u32 = value.get().unwrap(); + .transform_to(|_, month: u32| { let month = month as i32 - 1; Some(month.to_value()) }) diff --git a/src/view/settings/widget.rs b/src/view/settings/widget.rs index ff89e7d..0e59c7a 100644 --- a/src/view/settings/widget.rs +++ b/src/view/settings/widget.rs @@ -445,11 +445,14 @@ impl Widgets { pub fn update_network(&self) { let network = self.network(); - self.devices_btn.set_tooltip_text(if network.is_testnet() { - Some("Hardware signers can be only used on mainnet") - } else { - None - }); + WidgetExt::set_tooltip_text( + &self.devices_btn, + if network.is_testnet() { + Some("Hardware signers can be only used on mainnet") + } else { + None + }, + ); } pub fn electrum_server(&self) -> String { self.electrum_fld.text().to_string() } diff --git a/src/view/wallet/asset_row/view_model.rs b/src/view/wallet/asset_row/view_model.rs index 6be15dc..56dbbc3 100644 --- a/src/view/wallet/asset_row/view_model.rs +++ b/src/view/wallet/asset_row/view_model.rs @@ -79,13 +79,7 @@ impl ObjectImpl for AssetInner { PROPERTIES.as_ref() } - fn set_property( - &self, - _obj: &Self::Type, - _id: usize, - value: &glib::Value, - pspec: &glib::ParamSpec, - ) { + fn set_property(&self, _id: usize, value: &glib::Value, pspec: &glib::ParamSpec) { match pspec.name() { "name" => { let name = value @@ -115,7 +109,7 @@ impl ObjectImpl for AssetInner { } } - fn property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { + fn property(&self, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { match pspec.name() { "name" => self.name.borrow().to_value(), "amount" => self.amount.borrow().to_value(), @@ -146,7 +140,6 @@ impl AssetInfo { ("ticker", &ticker), ("contract", &contract_name), ]) - .expect("Failed to create row data") } pub fn name(&self) -> String { self.property::("name") } @@ -173,9 +166,9 @@ impl ObjectSubclass for AssetModelInner { impl ObjectImpl for AssetModelInner {} impl ListModelImpl for AssetModelInner { - fn item_type(&self, _list_model: &Self::Type) -> glib::Type { AssetInfo::static_type() } - fn n_items(&self, _list_model: &Self::Type) -> u32 { self.0.borrow().len() as u32 } - fn item(&self, _list_model: &Self::Type, position: u32) -> Option { + fn item_type(&self) -> glib::Type { AssetInfo::static_type() } + fn n_items(&self) -> u32 { self.0.borrow().len() as u32 } + fn item(&self, position: u32) -> Option { self.0 .borrow() .get(position as usize) @@ -190,7 +183,7 @@ glib::wrapper! { impl AssetModel { #[allow(clippy::new_without_default)] - pub fn new() -> AssetModel { glib::Object::new(&[]).expect("Failed to create AssetModel") } + pub fn new() -> AssetModel { glib::Object::new(&[]) } pub fn append(&self, obj: &AssetInfo) { let imp = self.imp(); diff --git a/src/view/wallet/pay/beneficiary_row/view_model.rs b/src/view/wallet/pay/beneficiary_row/view_model.rs index 76a9733..177f375 100644 --- a/src/view/wallet/pay/beneficiary_row/view_model.rs +++ b/src/view/wallet/pay/beneficiary_row/view_model.rs @@ -77,13 +77,7 @@ impl ObjectImpl for BeneficiaryInner { PROPERTIES.as_ref() } - fn set_property( - &self, - _obj: &Self::Type, - _id: usize, - value: &glib::Value, - pspec: &glib::ParamSpec, - ) { + fn set_property(&self, _id: usize, value: &glib::Value, pspec: &glib::ParamSpec) { match pspec.name() { "address" => { let address = value @@ -107,7 +101,7 @@ impl ObjectImpl for BeneficiaryInner { } } - fn property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { + fn property(&self, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { match pspec.name() { "address" => self.address.borrow().to_value(), "amount" => self.amount.borrow().to_value(), @@ -124,14 +118,12 @@ glib::wrapper! { impl Default for Beneficiary { fn default() -> Self { glib::Object::new(&[("address", &""), ("amount", &0u64), ("max", &false)]) - .expect("Failed to create row data") } } impl Beneficiary { pub fn new_max(address: AddressCompat) -> Beneficiary { glib::Object::new(&[("address", &address.to_string()), ("amount", &true)]) - .expect("Failed to create row data") } pub fn with(address: AddressCompat, amount: u64) -> Beneficiary { @@ -140,7 +132,6 @@ impl Beneficiary { ("amount", &amount), ("new", &false), ]) - .expect("Failed to create row data") } pub fn address(&self) -> Result { @@ -176,9 +167,9 @@ impl ObjectSubclass for BeneficiaryModelInner { impl ObjectImpl for BeneficiaryModelInner {} impl ListModelImpl for BeneficiaryModelInner { - fn item_type(&self, _list_model: &Self::Type) -> glib::Type { Beneficiary::static_type() } - fn n_items(&self, _list_model: &Self::Type) -> u32 { self.0.borrow().len() as u32 } - fn item(&self, _list_model: &Self::Type, position: u32) -> Option { + fn item_type(&self) -> glib::Type { Beneficiary::static_type() } + fn n_items(&self) -> u32 { self.0.borrow().len() as u32 } + fn item(&self, position: u32) -> Option { self.0 .borrow() .get(position as usize) @@ -193,9 +184,7 @@ glib::wrapper! { impl BeneficiaryModel { #[allow(clippy::new_without_default)] - pub fn new() -> BeneficiaryModel { - glib::Object::new(&[]).expect("Failed to create BeneficiaryModel") - } + pub fn new() -> BeneficiaryModel { glib::Object::new(&[]) } pub fn append(&self, obj: &Beneficiary) { let imp = self.imp(); diff --git a/src/view/wallet/pay/beneficiary_row/widget.rs b/src/view/wallet/pay/beneficiary_row/widget.rs index aabc284..c83ca34 100644 --- a/src/view/wallet/pay/beneficiary_row/widget.rs +++ b/src/view/wallet/pay/beneficiary_row/widget.rs @@ -100,8 +100,8 @@ impl RowWidgets { beneficiary .bind_property("amount", &self.address_fld, "primary_icon_name") - .transform_to(move |_binding, value| { - if value.get::().unwrap() == 0 { + .transform_to(move |_binding, value: u64| { + if value == 0 { Some("dialog-error-symbolic".to_value()) } else { None @@ -111,8 +111,8 @@ impl RowWidgets { .build(); beneficiary .bind_property("amount", &self.address_fld, "primary_icon_tooltip_text") - .transform_to(move |_binding, value| { - if value.get::().unwrap() == 0 { + .transform_to(move |_binding, value: u64| { + if value == 0 { Some("Payment without beneficiary address".to_value()) } else { None @@ -122,7 +122,7 @@ impl RowWidgets { .build(); self.address_fld .bind_property("text", beneficiary, "address") - .transform_to(move |binding, value| { + .transform_to(move |binding, value: String| { let address_fld: Entry = binding.source().unwrap().downcast().unwrap(); let addr_str = address_fld.text(); @@ -153,16 +153,15 @@ impl RowWidgets { }; address_fld.set_primary_icon_name(icon); address_fld.set_primary_icon_tooltip_text(msg.as_deref()); - Some(value.clone()) + Some(value) }) .flags(rw_flags) .build(); self.amount_fld .bind_property("text", beneficiary, "amount") - .transform_to(move |binding, value| { + .transform_to(move |binding, amount_str: &str| { let amount_fld: Entry = binding.source().unwrap().downcast().unwrap(); - let amount_str = value.get::<&str>().unwrap(); let (icon, msg, amount) = match f64::from_str(amount_str) { _ if amount_str.is_empty() => (None, None, 0u64), Err(err) => ( @@ -192,8 +191,7 @@ impl RowWidgets { amount_fld.set_primary_icon_tooltip_text(msg.as_deref()); Some(amount.to_value()) }) - .transform_from(move |_binding, value| { - let btc = value.get::().unwrap(); + .transform_from(move |_binding, btc: u64| { if btc == 0 { Some("".to_value()) } else { @@ -206,8 +204,7 @@ impl RowWidgets { let saved_amount = Arc::new(Mutex::new(0u64)); beneficiary .bind_property("max", &self.amount_fld, "editable") - .transform_to(move |binding, value| { - let active = value.get::().unwrap(); + .transform_to(move |binding, active: bool| { let amount_fld: Entry = binding.target().unwrap().downcast().unwrap(); if active { amount_fld.set_primary_icon_name(None); @@ -219,11 +216,7 @@ impl RowWidgets { .build(); self.max_btn .bind_property("active", beneficiary, "max") - .transform_to(move |binding, value| { - let active = value - .get::() - .expect("toggle button value is not bool"); - + .transform_to(move |binding, active: bool| { let item: Beneficiary = binding.target().unwrap().downcast().unwrap(); if active { *saved_amount.lock().unwrap() = item.property::("amount"); @@ -231,7 +224,7 @@ impl RowWidgets { } else { item.set_property("amount", *saved_amount.lock().unwrap()); } - Some(value.clone()) + Some(active) }) .flags(rw_flags) .build();