darkfi_deployooor_contract/client/lock_v1.rs
1/* This file is part of DarkFi (https://dark.fi)
2 *
3 * Copyright (C) 2020-2025 Dyne.org foundation
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU Affero General Public License as
7 * published by the Free Software Foundation, either version 3 of the
8 * License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Affero General Public License for more details.
14 *
15 * You should have received a copy of the GNU Affero General Public License
16 * along with this program. If not, see <https://www.gnu.org/licenses/>.
17 */
18
19use darkfi::Result;
20use darkfi_sdk::crypto::Keypair;
21use log::debug;
22
23use crate::model::LockParamsV1;
24
25pub struct LockCallDebris {
26 pub params: LockParamsV1,
27}
28
29/// Struct holding necessary information to build a `Deployooor::LockV1` contract call.
30pub struct LockCallBuilder {
31 /// Contract deploy keypair
32 pub deploy_keypair: Keypair,
33}
34
35impl LockCallBuilder {
36 pub fn build(&self) -> Result<LockCallDebris> {
37 debug!(target: "contract::deployooor::client::lock", "Building Deployooor::LockV1 contract call");
38
39 let params = LockParamsV1 { public_key: self.deploy_keypair.public };
40 let debris = LockCallDebris { params };
41
42 Ok(debris)
43 }
44}