mirror of
https://github.com/jwinterm/grin-wallet.git
synced 2026-12-04 04:43:58 +01:00
Merge upstream staging (#755 multi-LMDB backend) into contracts
Reconcile the contract feature with #755, which replaced the WalletBackend trait with a concrete WalletBackend<C,K> struct (libwallet/src/backend.rs) and removed impls/src/backends/lmdb.rs. - Port the contract module and contract API entry points from the trait form (T: WalletBackend<'a,C,K>) to the concrete struct. - Re-home next_child_for and a parent_id+log_id get_tx_log_entry onto backend.rs. - Re-apply the self-spend tx-log filters, cancel-loop, v5 payment-proof fields, and Context contract fields onto staging's rewritten files. - Adapt to fallible iter()/tx_log_iter() and self-consuming batch commit. Full suite green (53 binaries / 191 tests).
This commit is contained in:
+12
-26
@@ -39,10 +39,11 @@ grin_wallet_config = { path = "../config", version = "5.4.0-alpha.1" }
|
||||
##### Grin Imports
|
||||
|
||||
# For Release
|
||||
grin_core = "5.4.0"
|
||||
grin_keychain = "5.4.0"
|
||||
grin_util = "5.4.0"
|
||||
grin_api = "5.4.0"
|
||||
#grin_core = "5.4.0"
|
||||
#grin_keychain = "5.4.0"
|
||||
#grin_util = "5.4.0"
|
||||
#grin_api = "5.4.0"
|
||||
#grin_chain = "5.4.0"
|
||||
|
||||
# For beta release
|
||||
|
||||
@@ -50,39 +51,24 @@ grin_api = "5.4.0"
|
||||
# grin_keychain = { git = "https://github.com/mimblewimble/grin", tag = "v5.2.0-beta.3" }
|
||||
# grin_util = { git = "https://github.com/mimblewimble/grin", tag = "v5.2.0-beta.3" }
|
||||
# grin_api = { git = "https://github.com/mimblewimble/grin", tag = "v5.2.0-beta.3" }
|
||||
# grin_chain = { git = "https://github.com/mimblewimble/grin", tag = "v5.2.0-beta.3" }
|
||||
|
||||
# For bleeding edge
|
||||
# grin_core = { git = "https://github.com/mimblewimble/grin", branch = "master" }
|
||||
# grin_keychain = { git = "https://github.com/mimblewimble/grin", branch = "master" }
|
||||
# grin_util = { git = "https://github.com/mimblewimble/grin", branch = "master" }
|
||||
# grin_api = { git = "https://github.com/mimblewimble/grin", branch = "master" }
|
||||
grin_core = { git = "https://github.com/mimblewimble/grin", rev = "cf2ed3f3becd62b5e754ec964fd90e332b9a021f" }
|
||||
grin_keychain = { git = "https://github.com/mimblewimble/grin", rev = "cf2ed3f3becd62b5e754ec964fd90e332b9a021f" }
|
||||
grin_util = { git = "https://github.com/mimblewimble/grin", rev = "cf2ed3f3becd62b5e754ec964fd90e332b9a021f" }
|
||||
grin_api = { git = "https://github.com/mimblewimble/grin", rev = "cf2ed3f3becd62b5e754ec964fd90e332b9a021f" }
|
||||
grin_chain = { git = "https://github.com/mimblewimble/grin", rev = "cf2ed3f3becd62b5e754ec964fd90e332b9a021f" }
|
||||
|
||||
# For local testing
|
||||
# grin_core = { path = "../../grin/core"}
|
||||
# grin_keychain = { path = "../../grin/keychain"}
|
||||
# grin_util = { path = "../../grin/util"}
|
||||
# grin_api = { path = "../../grin/api"}
|
||||
# grin_chain = { path = "../../grin/chain"}
|
||||
|
||||
#####
|
||||
|
||||
[dev-dependencies]
|
||||
ed25519-dalek = "1.0.0-pre.4"
|
||||
remove_dir_all = "0.7"
|
||||
|
||||
##### Grin Imports
|
||||
|
||||
# For Release
|
||||
grin_chain = "5.4.0"
|
||||
|
||||
# For beta release
|
||||
|
||||
# grin_chain = { git = "https://github.com/mimblewimble/grin", tag = "v5.2.0-beta.3" }
|
||||
|
||||
# For bleeding edge
|
||||
# grin_chain = { git = "https://github.com/mimblewimble/grin", branch = "master" }
|
||||
|
||||
# For local testing
|
||||
# grin_chain = { path = "../../grin/chain"}
|
||||
|
||||
#####
|
||||
|
||||
|
||||
@@ -152,6 +152,7 @@ pub fn txs(
|
||||
table.set_titles(row![
|
||||
bMG->"Id",
|
||||
bMG->"Type",
|
||||
bMG->"State",
|
||||
bMG->"Shared Transaction Id",
|
||||
bMG->"Creation Time",
|
||||
bMG->"TTL Cutoff Height",
|
||||
@@ -174,6 +175,10 @@ pub fn txs(
|
||||
Some(m) => format!("{}", m),
|
||||
None => "None".to_owned(),
|
||||
};
|
||||
let slate_state = match t.tx_slate_state.as_ref() {
|
||||
Some(m) => format!("{}", m),
|
||||
None => "None".to_owned(),
|
||||
};
|
||||
let entry_type = format!("{}", t.tx_type);
|
||||
let creation_ts = format!("{}", t.creation_ts.format("%Y-%m-%d %H:%M:%S"));
|
||||
let ttl_cutoff_height = match t.ttl_cutoff_height {
|
||||
@@ -220,6 +225,7 @@ pub fn txs(
|
||||
table.add_row(row![
|
||||
bFC->id,
|
||||
bFC->entry_type,
|
||||
bFC->slate_state,
|
||||
bFC->slate_id,
|
||||
bFB->creation_ts,
|
||||
bFB->ttl_cutoff_height,
|
||||
|
||||
@@ -104,7 +104,7 @@ pub fn create_wallet_proxy(
|
||||
test_dir: &str,
|
||||
) -> WalletProxy<
|
||||
'_,
|
||||
DefaultLCProvider<'_, LocalWalletClient, ExtKeychain>,
|
||||
DefaultLCProvider<LocalWalletClient, ExtKeychain>,
|
||||
LocalWalletClient,
|
||||
ExtKeychain,
|
||||
> {
|
||||
@@ -123,7 +123,7 @@ pub fn create_local_wallet(
|
||||
Box<
|
||||
dyn WalletInst<
|
||||
'static,
|
||||
DefaultLCProvider<'static, LocalWalletClient, ExtKeychain>,
|
||||
DefaultLCProvider<LocalWalletClient, ExtKeychain>,
|
||||
LocalWalletClient,
|
||||
ExtKeychain,
|
||||
>,
|
||||
@@ -135,7 +135,7 @@ pub fn create_local_wallet(
|
||||
let mut wallet = Box::new(DefaultWalletImpl::<LocalWalletClient>::new(client).unwrap())
|
||||
as Box<
|
||||
dyn WalletInst<
|
||||
DefaultLCProvider<'static, LocalWalletClient, ExtKeychain>,
|
||||
DefaultLCProvider<LocalWalletClient, ExtKeychain>,
|
||||
LocalWalletClient,
|
||||
ExtKeychain,
|
||||
>,
|
||||
@@ -162,7 +162,7 @@ pub fn open_local_wallet(
|
||||
Box<
|
||||
dyn WalletInst<
|
||||
'static,
|
||||
DefaultLCProvider<'static, LocalWalletClient, ExtKeychain>,
|
||||
DefaultLCProvider<LocalWalletClient, ExtKeychain>,
|
||||
LocalWalletClient,
|
||||
ExtKeychain,
|
||||
>,
|
||||
@@ -174,7 +174,7 @@ pub fn open_local_wallet(
|
||||
let mut wallet = Box::new(DefaultWalletImpl::<LocalWalletClient>::new(client).unwrap())
|
||||
as Box<
|
||||
dyn WalletInst<
|
||||
DefaultLCProvider<'static, LocalWalletClient, ExtKeychain>,
|
||||
DefaultLCProvider<LocalWalletClient, ExtKeychain>,
|
||||
LocalWalletClient,
|
||||
ExtKeychain,
|
||||
>,
|
||||
@@ -200,7 +200,7 @@ pub fn create_wallets(
|
||||
Box<
|
||||
dyn WalletInst<
|
||||
'static,
|
||||
DefaultLCProvider<'static, LocalWalletClient, ExtKeychain>,
|
||||
DefaultLCProvider<LocalWalletClient, ExtKeychain>,
|
||||
LocalWalletClient,
|
||||
ExtKeychain,
|
||||
>,
|
||||
|
||||
@@ -53,7 +53,7 @@ pub fn create_wallets(
|
||||
Box<
|
||||
dyn WalletInst<
|
||||
'static,
|
||||
DefaultLCProvider<'static, LocalWalletClient, ExtKeychain>,
|
||||
DefaultLCProvider<LocalWalletClient, ExtKeychain>,
|
||||
LocalWalletClient,
|
||||
ExtKeychain,
|
||||
>,
|
||||
@@ -187,7 +187,7 @@ pub fn create_wallets(
|
||||
// test_dir: &'static str,
|
||||
// // wallet_proxy: WalletProxy<
|
||||
// // 'static,
|
||||
// // DefaultLCProvider<'static, LocalWalletClient, ExtKeychain>,
|
||||
// // DefaultLCProvider<LocalWalletClient, ExtKeychain>,
|
||||
// // LocalWalletClient,
|
||||
// // ExtKeychain,
|
||||
// // >,
|
||||
@@ -197,7 +197,7 @@ pub fn create_wallets(
|
||||
// Box<
|
||||
// dyn WalletInst<
|
||||
// 'static,
|
||||
// DefaultLCProvider<'static, LocalWalletClient, ExtKeychain>,
|
||||
// DefaultLCProvider<LocalWalletClient, ExtKeychain>,
|
||||
// LocalWalletClient,
|
||||
// ExtKeychain,
|
||||
// >,
|
||||
|
||||
@@ -41,7 +41,7 @@ type Wallet = Arc<
|
||||
Box<
|
||||
dyn WalletInst<
|
||||
'static,
|
||||
DefaultLCProvider<'static, LocalWalletClient, ExtKeychain>,
|
||||
DefaultLCProvider<LocalWalletClient, ExtKeychain>,
|
||||
LocalWalletClient,
|
||||
ExtKeychain,
|
||||
>,
|
||||
|
||||
@@ -45,7 +45,7 @@ fn test_wallet_tx_filtering(
|
||||
Box<
|
||||
dyn WalletInst<
|
||||
'static,
|
||||
DefaultLCProvider<'static, LocalWalletClient, ExtKeychain>,
|
||||
DefaultLCProvider<LocalWalletClient, ExtKeychain>,
|
||||
LocalWalletClient,
|
||||
ExtKeychain,
|
||||
>,
|
||||
|
||||
Reference in New Issue
Block a user