-
Notifications
You must be signed in to change notification settings - Fork 132
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
Jcli make transaction #3230
Jcli make transaction #3230
Conversation
This is related to #3216 |
pub fn add_account( | ||
account: interfaces::Address, | ||
value: interfaces::Value, | ||
transaction: &mut Staging, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is Staging
defined in jcli
? If so, this can be done into Staging::account
and this would be much cleaner.
EDIT: now I see that this is common approach in this crate and we should make a note for future us to refactor that.
Ok((sk, address)) | ||
} | ||
|
||
#[allow(clippy::too_many_arguments)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clippy has got a point here :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It has indeed but is what is needed. Even if splitting it would have to receive such data. I'll try to do something to reduce that anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could refactor things inside in some smaller sections maybe. But the grouping function would still need to receive that. At the end we need all we have in the cli input to compute :/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
grep
-ing (or rg
-ing for fellow Rustaceans) still shows notions of faucet and "simplified transactions".
Definitely not how errors should be reported.
UPD: wait, this happening even for |
The help itself is fine and accessible via |
The failing test looks not related. |
It works 👍. Here are my concerns:
|
@eugene-babichenko how about?:
Maybe add flag to enable disable it?
Didn't understand this. Could you elaborate?
Definetly. Can you point me to the values please?
wtf...it actually works with |
Just remove IMO.
Everything under
Uhm, well, I guess we don't have defaults for them, or I still did not wake up. Will need to ask. |
pub fee: common::CommonFees, | ||
|
||
#[structopt(flatten)] | ||
rest_args: RestArgs, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They need to be removed since we don't do transaction sending here anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is still needed to query some account data.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oopsie, sorry.
Added request fees from rest api |
541c731
to
3e6b31e
Compare
block0_hash.to_string(), | ||
sk_file_path, | ||
staging_file, | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we also make sure the transaction was successfully casted?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is internally asserted in the make_transaction
method.
Added make witness
Missing account....
Refactored keys+address methods
Removed send transaction Store transaction instead
Adapt tests
Add test for fees handling
Added test for post fragment
4c6909a
to
227e1a4
Compare
I'm starting this as a draft. It is a close example of what jcli path to being a lib should lead to.
The simplified transaction command uses several of the other transaction commands.
I started extracting the common code into external functions. Also stripping some functionality like reading and writing to files that shouldn't be within the reusable computations.