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(node): make spend and cash_note reason field configurable #1650

Merged
merged 4 commits into from
Apr 30, 2024

Conversation

maqi
Copy link
Member

@maqi maqi commented Apr 25, 2024

Description

reviewpad:summary

@maqi maqi changed the title feat(node): make spend and cash_note reason field configurable WIP feat(node): make spend and cash_note reason field configurable Apr 25, 2024
@maqi maqi force-pushed the spend_reason branch 2 times, most recently from c39bee9 to 4db5135 Compare April 25, 2024 20:25
@@ -105,11 +105,13 @@
let root_dir = std::env::temp_dir();
trace!("Starting Kad swarm in client mode..{root_dir:?}.");

// TODO: shall client bearing owner's discord user name, to be reflected in the cash_notes?

Check notice

Code scanning / devskim

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

Suspicious comment
@maqi maqi force-pushed the spend_reason branch 4 times, most recently from a3934b0 to 80db435 Compare April 26, 2024 12:19
@maqi maqi changed the title WIP feat(node): make spend and cash_note reason field configurable feat(node): make spend and cash_note reason field configurable Apr 29, 2024
@maqi maqi removed the DoNotMerge label Apr 29, 2024
Comment on lines +550 to +552
/// Specify the owner(readable discord user name).
#[clap(long)]
owner: Option<String>,
Copy link
Member

Choose a reason for hiding this comment

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

This is just for a local network and I assue we might need to pass in the onwer inside the Add arg to enable this for service nodes.

Copy link
Member Author

Choose a reason for hiding this comment

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

as discussed, this can be addressed in follow up PR

@@ -286,8 +296,31 @@ pub async fn run_node(
launcher: &dyn Launcher,
rpc_client: &dyn RpcActions,
) -> Result<NodeServiceData> {
let user = match get_username() {
Copy link
Member

Choose a reason for hiding this comment

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

get_username() will at most cases return our OS's user account name. We can just use that. I'm not sure if we might ever have a failure here. Also since this is just for a local network, should we want to pass in the owner via CLI? It is just for testing right?

Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure if we might ever have a failure here

If we do have a failure, we can use a default value like "owner" since it is a local network.

Copy link
Member Author

Choose a reason for hiding this comment

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

as discussed, this can be addressed in follow up PR

Comment on lines 141 to 142
/// For what purpose this cash_note was created
pub reason: String,
Copy link
Member

Choose a reason for hiding this comment

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

This can be removed on a followup PR as discussed.

Comment on lines 72 to 74
/// The reason this cash_note created for
/// eg. `store cost pay to...`, `network royalty`, `change to self`, `payment transfer`, ...
pub reason: String,
Copy link
Member

Choose a reason for hiding this comment

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

This can be removed on a followup PR as discussed.

@RolandSherwin RolandSherwin enabled auto-merge April 30, 2024 14:24
@RolandSherwin RolandSherwin added this pull request to the merge queue Apr 30, 2024
Merged via the queue into maidsafe:main with commit 5252242 Apr 30, 2024
51 checks passed
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.

2 participants