Skip to content

Allow to sign transaction without relaying #3934

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 2 commits into
base: master
Choose a base branch
from

Conversation

yupasik
Copy link

@yupasik yupasik commented May 8, 2025

Description

Allow to sign transaction without relaying to the network
Suitable for two-phase transaction sending

Fixes # (issue)

Type of change

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

How Has This Been Tested?

Test Configuration:

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@@ -29,6 +31,7 @@ public static JObject TransactionToJson(Transaction tx, ProtocolSettings setting
JObject json = tx.ToJson(settings);
json["sysfee"] = tx.SystemFee.ToString();
json["netfee"] = tx.NetworkFee.ToString();
json["raw"] = Convert.ToBase64String(tx.ToArray());
Copy link
Contributor

Choose a reason for hiding this comment

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

NACK. This changes the behavior of existing APIs for no real reason.

@@ -306,7 +307,13 @@ protected internal virtual JToken SendFrom(JArray _params)
tx.NetworkFee = calFee;
}
(tx.NetworkFee <= settings.MaxFee).True_Or(RpcError.WalletFeeLimit);
return SignAndRelay(snapshot, tx);
if (relay) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Code format issue?

Copy link
Author

Choose a reason for hiding this comment

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

tried to fix

@Wi1l-B0t
Copy link
Contributor

Wi1l-B0t commented May 8, 2025

Why add this ?

Can you add more details?

Copy link
Member

@cschuchardt88 cschuchardt88 left a comment

Choose a reason for hiding this comment

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

more information

@shargon
Copy link
Member

shargon commented May 9, 2025

The information is clear, but maybe it's better to add a new endPoint

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.

5 participants