Skip to content

Commit 7819599

Browse files
committed
Use sats for walletsell
1 parent 5e58b4e commit 7819599

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

node/src/bin/space-cli.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,7 @@ async fn handle_commands(
681681
.wallet_sell(
682682
&cli.wallet,
683683
space,
684-
Amount::from_sat(price),
684+
price,
685685
).await?;
686686
println!("{}", serde_json::to_string_pretty(&result).expect("result"));
687687
}

node/src/rpc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ pub trait Rpc {
199199
&self,
200200
wallet: &str,
201201
space: String,
202-
amount: Amount,
202+
amount: u64,
203203
) -> Result<Listing, ErrorObjectOwned>;
204204

205205
#[method(name = "verifylisting")]
@@ -789,7 +789,7 @@ impl RpcServer for RpcServerImpl {
789789
.map_err(|error| ErrorObjectOwned::owned(-1, error.to_string(), None::<String>))
790790
}
791791

792-
async fn wallet_sell(&self, wallet: &str, space: String, amount: Amount) -> Result<Listing, ErrorObjectOwned> {
792+
async fn wallet_sell(&self, wallet: &str, space: String, amount: u64) -> Result<Listing, ErrorObjectOwned> {
793793
self.wallet(&wallet)
794794
.await?
795795
.send_sell(space, amount)

node/src/wallets.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ pub enum WalletCommand {
9393
},
9494
Sell {
9595
space: String,
96-
price: Amount,
96+
price: u64,
9797
resp: crate::rpc::Responder<anyhow::Result<Listing>>,
9898
},
9999
ListBidouts {
@@ -373,7 +373,7 @@ impl RpcWallet {
373373
_ = resp.send(Self::handle_buy(source, state, wallet, listing, skip_tx_check, fee_rate));
374374
}
375375
WalletCommand::Sell { space, price, resp } => {
376-
_ = resp.send(wallet.sell::<Sha256>(state, &space, price));
376+
_ = resp.send(wallet.sell::<Sha256>(state, &space, Amount::from_sat(price)));
377377
}
378378
}
379379
Ok(())
@@ -1162,7 +1162,7 @@ impl RpcWallet {
11621162
pub async fn send_sell(
11631163
&self,
11641164
space: String,
1165-
price: Amount,
1165+
price: u64,
11661166
) -> anyhow::Result<Listing> {
11671167
let (resp, resp_rx) = oneshot::channel();
11681168
self.sender

node/tests/integration_tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -991,7 +991,7 @@ async fn it_should_allow_buy_sell(rig: &TestRig) -> anyhow::Result<()> {
991991
let space = alice_spaces.owned.first().expect("alice should have at least 1 space");
992992

993993
let space_name = space.spaceout.space.as_ref().unwrap().name.to_string();
994-
let listing = rig.spaced.client.wallet_sell(ALICE, space_name.clone(), Amount::from_sat(5000)).await.expect("sell");
994+
let listing = rig.spaced.client.wallet_sell(ALICE, space_name.clone(), 5000).await.expect("sell");
995995

996996
println!("listing\n{}", serde_json::to_string_pretty(&listing).unwrap());
997997

0 commit comments

Comments
 (0)