-
Notifications
You must be signed in to change notification settings - Fork 11.4k
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
[fastx client] TX Operations From CLI Fail #316
Conversation
let (address, key) = get_key_pair(); | ||
pub fn new( | ||
address: FastPayAddress, | ||
key: KeyPair, |
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.
Do we have an issue opened to replace this with a trait that happens to provide the sign
public_key
, verify
functions we might need?
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 will add that in together with refactoring of the CLI, #341
value_per_obj, | ||
initial_state_config_path, | ||
} => { | ||
let num_accounts: u32 = num; | ||
let num_of_addresses: u32 = num; | ||
let mut init_state_cfg: InitialStateConfig = InitialStateConfig::new(); | ||
|
||
for _ in 0..num_accounts { | ||
for _ in 0..num_of_addresses { | ||
let (address, key) = get_key_pair(); |
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.
We should not own the public key assignment for those accounts, it should be left to the user to provide public keys (or better, addresses) for ownership ...
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.
these code are for demo only, not intended for production use, I will move it out of CLI client in this issue #341
* Fixed bug in benchmark caused by change of TransferOrder's response, transfer now returns OrderInfoResponse
9b8d41b
to
0c5fd99
Compare
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.
Mostly nits, thanks!
Some(OrderInfoResponse { | ||
signed_order: Some(order), | ||
.. | ||
}) => { | ||
confirmed.insert(*order.order.object_id()); | ||
acc + 1 | ||
} | ||
None => acc, | ||
_ => acc, |
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.
Very nice 🤩
fastpay/src/server.rs
Outdated
for initial_state_cfg_entry in &initial_accounts_config.config { | ||
let address = &initial_state_cfg_entry.address; | ||
for (object_id, _, _) in &initial_state_cfg_entry.object_refs { | ||
let object = Object::with_id_owner_for_testing(*object_id, *address); | ||
|
||
for object in &initial_state_cfg_entry.objects { | ||
state.init_order_lock(object.to_object_reference()).await; | ||
state.insert_object(object).await; | ||
state.insert_object(object.clone()).await; |
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.
Here you are in a constructor and own initial_accounts_config
, which you created. I think it's a good place to try using into_iter
to consume the values in both of these iterators, thereby possibly eliminating the final clone.
@patrickkuo how did you verify this fix?
|
@oxade this is cause by the path of the client db, https://github.com/MystenLabs/fastnft/blob/da973ca2871717132953d10d6f4f1c572eca44f8/fastpay/src/client.rs#L479-L481 this resolve into the same location every time, the cli will keep adding to the db without removing it for new demo run. |
Right |
Fix cli errors due to checks of actual object digest in authorities
Fixed bug in benchmark caused by change of TransferOrder's response, transfer now returns OrderInfoResponse
this PR fixes #277