Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: client API first iteration #2093

Merged
merged 44 commits into from
Sep 10, 2024
Merged

Conversation

b-zee
Copy link
Contributor

@b-zee b-zee commented Sep 5, 2024

Initial implementation of high level API

Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

devskim found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

@b-zee b-zee force-pushed the feat-client-api-skeleton branch from bdafe04 to 297c14c Compare September 6, 2024 11:58
@b-zee b-zee enabled auto-merge September 6, 2024 11:58
@b-zee b-zee force-pushed the feat-client-api-skeleton branch 2 times, most recently from 5bb7fd2 to 23dc3c2 Compare September 6, 2024 15:05
@b-zee b-zee force-pushed the feat-client-api-skeleton branch from f7dccb5 to d2e3984 Compare September 9, 2024 08:36
let StoragePaymentResult { skipped_chunks, .. } =
self.pay(xor_names.into_iter(), wallet).await?;

// TODO: Upload in parallel

Check notice

Code scanning / devskim

A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note

Suspicious comment
for content_addr in content_addrs {
let network = self.network.clone();
tasks.spawn(async move {
// TODO: retry, but where?

Check notice

Code scanning / devskim

A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note

Suspicious comment

let addr = client.put(data, wallet).await?;

// TODO: Set created_at and modified_at

Check notice

Code scanning / devskim

A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note

Suspicious comment
}

fn build_client_and_run_swarm(local: bool) -> (Network, Receiver<NetworkEvent>) {
// TODO: `root_dir` is only used for nodes. `NetworkBuilder` should not require it.

Check notice

Code scanning / devskim

A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note

Suspicious comment
let root_dir = std::env::temp_dir();
let network_builder = NetworkBuilder::new(Keypair::generate_ed25519(), local, root_dir);

// TODO: Re-export `Receiver<T>` from `sn_networking`. Else users need to keep their `tokio` dependency in sync.

Check notice

Code scanning / devskim

A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note

Suspicious comment
let network_builder = NetworkBuilder::new(Keypair::generate_ed25519(), local, root_dir);

// TODO: Re-export `Receiver<T>` from `sn_networking`. Else users need to keep their `tokio` dependency in sync.
// TODO: Think about handling the mDNS error here.

Check notice

Code scanning / devskim

A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note

Suspicious comment
}
}

// TODO: Handle closing of network events sender

Check notice

Code scanning / devskim

A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note

Suspicious comment
}
}

// TODO: as WASM can not save a wallet state to disk or load from disk -- we need to provide a wallet state manually.

Check notice

Code scanning / devskim

A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note

Suspicious comment
.insert(spend);
}

// TODO: should we verify if the transfer is valid and destined for this wallet?

Check notice

Code scanning / devskim

A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note

Suspicious comment
Copy link
Contributor

@joshuef joshuef left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@b-zee b-zee added this pull request to the merge queue Sep 10, 2024
Merged via the queue into maidsafe:main with commit b421ef7 Sep 10, 2024
40 checks passed
@b-zee b-zee deleted the feat-client-api-skeleton branch September 10, 2024 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants