Joystream / Joystream/joystream

Make encode_proposal take a reference to the encoded extrinsics instead of moving

Open
#2,161 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

tech-debt
Dominant language
Rust
Stars
1.4k
Forks
116
PR merge metrics
No merged PRs in 30d

Description

Since ProposalEncoder::encode_proposal takes ownership of proposal_details it makes impossible to use the value without cloning and afterwards emits an event using that value.

The goal of this task is to make the encode_proposal trait function borrow the value instead of owning it and adapt every implementation correspondingly.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with ProposalEncoder::encode_proposal in runtime-modules/proposals/codex/src/types.rs and inspect its call sites in runtime-modules/proposals/codex/src/lib.rs, especially the references around lines 471, 502, and 511. Adapt every implementation to borrow the encoded extrinsics, preserving the later value use and event emission.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
blockchain
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.