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: implement new RPCs getrawislock and getrawbestchainlock #6455

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

knst
Copy link
Collaborator

@knst knst commented Dec 6, 2024

it's a draft because I need a confirmation from pshenmic that it works as he expects.

Issue being fixed or feature implemented

#6391

To register an identity in the DashPlatform network, there is a required field of InstantLock or ChainLock buffer in IdentityCreateTransition. You first create and broadcast Core transaction, then wait for InstantLock or ChainLock, and then create and broadcast transaction in the Platform chain with that data.

What was done?

Implemented 2 new RPC getrawislock and getrawbestchainlock which output is similar to ZMQ output.

How Has This Been Tested?

See new asserts in functional test interface_zmq_dash.py

Breaking Changes

N/A

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have made corresponding changes to the documentation
  • I have assigned this pull request to a milestone

@knst knst added this to the 22.1 milestone Dec 6, 2024
@knst knst added the guix-build label Dec 6, 2024
@DashCoreAutoGuix
Copy link

Guix Automation has began to build this PR tagged as v22.1.0-devpr6455.a4256c92. A new comment will be made when the image is pushed.

@DashCoreAutoGuix
Copy link

Guix Automation has completed; a release should be present here: https://github.com/dashpay/dash-dev-branches/releases/tag/v22.1.0-devpr6455.a4256c92. The image should be on dockerhub soon.

for (const auto idx : irange::range(txids.size())) {
const uint256 txid(ParseHashV(txids[idx], "txid"));

LLMQContext& llmq_ctx = EnsureLLMQContext(node);
Copy link
Collaborator

@kwvg kwvg Dec 6, 2024

Choose a reason for hiding this comment

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

Consider defining llmq_ctx outside the loop

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I will wait feedback from pshenmic first

const uint256 txid(ParseHashV(txids[idx], "txid"));

LLMQContext& llmq_ctx = EnsureLLMQContext(node);
llmq::CInstantSendLockPtr islock = llmq_ctx.isman->GetInstantSendLockByTxid(txid);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Consider

if (auto islock = CHECK_NONFATAL(llmq_ctx.isman)->GetInstantSendLockByTxid(txid); islock != nullptr) {
    CDataStream ssTx(SER_NETWORK, PROTOCOL_VERSION);
    ssTx << *islock;
    result_arr.push_back(HexStr(ssTx));
} else {
    result_arr.push_back("None");
}

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

Successfully merging this pull request may close these issues.

3 participants