MCPcopy Create free account
hub / github.com/bitcoindevkit/bdk-cli / wallet_exec

Method wallet_exec

tests/integration.rs:151–173  ·  view source on GitHub ↗

Execute bdk-cli wallet commands with given args

(&self, args: &[&str])

Source from the content-addressed store, hash-verified

149
150 /// Execute bdk-cli wallet commands with given args
151 fn wallet_exec(&self, args: &[&str]) -> Result<Value, IntTestError> {
152 // Check if data directory is specified
153 let mut wallet_args = if let Some(datadir) = &self.node_datadir {
154 let datadir = datadir.as_os_str().to_str().unwrap();
155 ["--network", &self.network, "--datadir", datadir, "wallet"].to_vec()
156 } else {
157 ["--network", &self.network, "wallet"].to_vec()
158 };
159
160 if self.verbosity {
161 wallet_args.push("-v");
162 }
163
164 wallet_args.push("-d");
165 wallet_args.push(self.recv_desc.as_ref().unwrap());
166 wallet_args.push("-c");
167 wallet_args.push(self.chang_desc.as_ref().unwrap());
168
169 for arg in args {
170 wallet_args.push(arg);
171 }
172 run_cmd_with_args(&self.target, &wallet_args)
173 }
174
175 /// Execute bdk-cli key commands with given args
176 fn key_exec(&self, args: &[&str]) -> Result<Value, IntTestError> {

Callers 1

basic_wallet_opsFunction · 0.80

Calls 1

run_cmd_with_argsFunction · 0.85

Tested by

no test coverage detected