Skip to content

Commit

Permalink
rusk-wallet: Clear up status messages
Browse files Browse the repository at this point in the history
  • Loading branch information
moCello committed Oct 22, 2024
1 parent 39e8f05 commit 1cb0e2d
Showing 1 changed file with 0 additions and 32 deletions.
32 changes: 0 additions & 32 deletions rusk-wallet/src/clients.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,9 +251,6 @@ impl State {
&self,
pk: &BlsPublicKey,
) -> Result<AccountData, Error> {
let status = self.status;
status("Fetching account-data...");

// the target type of the deserialization has to match the return type
// of the contract-query
let account: AccountData = rkyv::from_bytes(
Expand All @@ -264,8 +261,6 @@ impl State {
)
.map_err(|_| Error::Rkyv)?;

status("account-data received!");

Ok(account)
}

Expand All @@ -278,9 +273,6 @@ impl State {

/// Fetch the current root of the state.
pub(crate) async fn fetch_root(&self) -> Result<BlsScalar, Error> {
let status = self.status;
status("Fetching root...");

// the target type of the deserialization has to match the return type
// of the contract-query
let root: BlsScalar = rkyv::from_bytes(
Expand All @@ -291,8 +283,6 @@ impl State {
)
.map_err(|_| Error::Rkyv)?;

status("root received!");

Ok(root)
}

Expand All @@ -301,9 +291,6 @@ impl State {
&self,
pk: &BlsPublicKey,
) -> Result<Option<StakeData>, Error> {
let status = self.status;
status("Fetching stake...");

// the target type of the deserialization has to match the return type
// of the contract-query
let stake_data: Option<StakeData> = rkyv::from_bytes(
Expand All @@ -314,10 +301,6 @@ impl State {
)
.map_err(|_| Error::Rkyv)?;

status("Stake received!");

println!("Staking address: {}", Address::Public(*pk));

Ok(stake_data)
}

Expand All @@ -326,9 +309,6 @@ impl State {
}

pub(crate) async fn fetch_chain_id(&self) -> Result<u8, Error> {
let status = self.status;
status("Fetching chain_id...");

// the target type of the deserialization has to match the return type
// of the contract-query
let chain_id: u8 = rkyv::from_bytes(
Expand All @@ -343,16 +323,11 @@ impl State {
)
.map_err(|_| Error::Rkyv)?;

status("Chain id received!");

Ok(chain_id)
}

/// Queries the node to find the merkle-tree opening for a specific note.
async fn fetch_opening(&self, note: &Note) -> Result<NoteOpening, Error> {
let status = self.status;
status("Fetching note opening...");

// the target type of the deserialization has to match the return type
// of the contract-query
let opening: Option<NoteOpening> = rkyv::from_bytes(
Expand All @@ -370,16 +345,11 @@ impl State {
// return an error here if the note opening couldn't be fetched
let opening = opening.ok_or(Error::NoteNotFound)?;

status("Note opening received!");

Ok(opening)
}

/// Queries the transfer contract for the number of notes.
pub async fn fetch_num_notes(&self) -> Result<u64, Error> {
let status = self.status;
status("Fetching note count...");

// the target type of the deserialization has to match the return type
// of the contract-query
let note_count: u64 = rkyv::from_bytes(
Expand All @@ -394,8 +364,6 @@ impl State {
)
.map_err(|_| Error::Rkyv)?;

status("Latest note count received!");

Ok(note_count)
}

Expand Down

0 comments on commit 1cb0e2d

Please sign in to comment.