8000 Fix proposal management by rtb-12 · Pull Request #1285 · calimero-network/core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix proposal management #1285

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

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

rtb-12
Copy link
Contributor
@rtb-12 rtb-12 commented May 27, 2025

Add proposal management capabilities to interactive CLI

Description

This PR adds support for proposal management operations to the node's interactive CLI by implementing a ProposalManager that provides a clean interface for proposal-related operations.
Fixes #1071

Key changes:

  • Added a ProposalManager struct that wraps ContextManager for proposal operations
  • Created methods that correspond to the API endpoints:
    • get_number_of_proposal_approvals
    • get_proposal_approvers
    • get_active_proposals_count
    • get_proposals
    • get_proposal
  • Implemented the proxy command in the interactive CLI to expose these operations to users

This implementation follows the same pattern as other commands in the CLI and provides consistent error handling and output formatting.

Test plan

Tested by manually running the commands in the interactive CLI:

Documentation update

The internal documentation for the node CLI should be updated to include the new proxy command and its subcommands.

@rtb-12
Copy link
Contributor Author
rtb-12 commented May 27, 2025

Hi @miraclx , I had closed the previous PR due to multiple changes in the main codebase , so I had made this new PR kindly look into it and review

miraclx
miraclx previously approved these changes May 27, 2025
@miraclx miraclx dismissed their stale review May 27, 2025 12:15

not yet ready

@rtb-12 rtb-12 requested a review from miraclx May 27, 2025 14:03
@rtb-12 rtb-12 requested a review from miraclx May 28, 2025 19:28
@rtb-12 rtb-12 requested a review from miraclx May 29, 2025 05:42
@rtb-12 rtb-12 requested a review from miraclx May 29, 2025 12:03
Comment on lines 220 to 240
let _ = self
.get_proposal_approvers(
environment,
multiaddr,
&client,
&config.identity,
context_id,
proposal_id,
)
.await;

let _ = self
.get_number_of_proposal_approvals(
environment,
multiaddr,
&client,
&config.identity,
context_id,
proposal_id,
)
.await;
Copy link
Member

Choose a reason for hiding this comment

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

aren't these results?

don't use let _ =

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was calling these functions along with the results that there result also gets printed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have updated it now though kindly check

@rtb-12 rtb-12 requested a review from miraclx May 29, 2025 12:47
Comment on lines +215 to +237
Ok(_) => {
self.get_proposal_approvers(
environment,
multiaddr,
&client,
&config.identity,
context_id,
proposal_id,
)
.await?;

self.get_number_of_proposal_approvals(
environment,
multiaddr,
&client,
&config.identity,
context_id,
proposal_id,
)
.await?;

Ok(())
}
Copy link
Member

Choose a reason for hiding this comment

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

what is this supposed to do? it's way too complicated for such a simple thing

according to the logic of the methods you're calling, you shouldn't need a match here at all

get_proposal(..)?;
get_proposal_approvers(..)?;

but can you actually test this? you can use the app from https://github.com/calimero-network/demo-blockchain-integrations/releases/tag/pre-release-f0b2a9ec577e15f85f08526d46d32b5b9db06f1f

please include screenshots of what this looks like, this is required for this to get merged

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I didn't knew what all things exactly required to be displayed so I just included whatever make sense to me .

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi , @miraclx can you tell like how to text them exactly like I have installed the above app , build its logic and use that wasm to create application and then creating context but I am not getting proposals output from it .

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Screenshot 2025-05-29 at 7 32 03 PM
Can you tell the way proposals are made for a context then I can test like I have never did that part .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Expose proposal management to the CLIs
3 participants
0