(
&mut self,
sub_matches: &ArgMatches,
)
| 236 | } |
| 237 | |
| 238 | pub async fn handle_initiate_peg_in_command( |
| 239 | &mut self, |
| 240 | sub_matches: &ArgMatches, |
| 241 | ) -> io::Result<()> { |
| 242 | self.client.sync().await; |
| 243 | |
| 244 | let evm_address = sub_matches |
| 245 | .get_one::<String>("destination_address") |
| 246 | .unwrap(); |
| 247 | let input = self |
| 248 | .get_funding_utxo_input(sub_matches.get_one::<String>("utxo")) |
| 249 | .await?; |
| 250 | let peg_in_id = self.client.create_peg_in_graph(input, evm_address).await; |
| 251 | |
| 252 | self.client.flush().await; |
| 253 | |
| 254 | println!("Created peg-in graph with ID: {peg_in_id}"); |
| 255 | println!("Broadcasting deposit..."); |
| 256 | |
| 257 | if let Err(e) = self.client.broadcast_peg_in_deposit(&peg_in_id).await { |
| 258 | eprintln!("Failed to broadcast peg-in deposit: {e}"); |
| 259 | } |
| 260 | |
| 261 | Ok(()) |
| 262 | } |
| 263 | |
| 264 | pub fn get_create_peg_out_graph_command() -> Command { |
| 265 | Command::new("create-peg-out") |
no test coverage detected