Skip to content

Commit

Permalink
Implement missing members
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielbosio committed Aug 20, 2024
1 parent 5450e63 commit 2680a08
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
11 changes: 11 additions & 0 deletions account_inclusion/src/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,17 @@ fn option_zk_app_account_to_bytes(zk_app_account: &Option<Box<ZkAppAccount>>) ->
ret.extend(option_verification_key_to_bytes(
&zk_app_account.verification_key,
));
ret.extend(zk_app_account.zkapp_version.to_be_bytes());
ret.extend(
zk_app_account
.action_state
.iter()
.flat_map(|fp| fp.to_bytes())
.collect::<Vec<_>>(),
);
ret.extend(zk_app_account.last_action_slot.as_u32().to_be_bytes());
ret.push(if zk_app_account.proved_state { 1 } else { 0 });
ret.extend(string_to_bytes(&zk_app_account.zkapp_uri));
}
None => ret.push(0),
}
Expand Down
3 changes: 1 addition & 2 deletions account_inclusion/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ use std::process;

#[tokio::main]
async fn main() {
for _ in 0..10 {
for _ in 0..100 {
let rand_account = Account::rand();
dbg!(&rand_account.zkapp.is_some());
let rand_account_bytes = account::to_bytes(&rand_account);
dbg!(rand_account_bytes.len());
}
Expand Down

0 comments on commit 2680a08

Please sign in to comment.