Skip to content

Commit

Permalink
tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffwashington committed Dec 7, 2022
1 parent 9b41c9d commit 4d19518
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 13 deletions.
6 changes: 3 additions & 3 deletions programs/sbf/c/src/invoked/invoked.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ extern uint64_t entrypoint(const uint8_t *input) {
sol_assert(accounts[ARGUMENT_INDEX].data_len == 100);
sol_assert(accounts[ARGUMENT_INDEX].is_signer);
sol_assert(accounts[ARGUMENT_INDEX].is_writable);
sol_assert(accounts[ARGUMENT_INDEX].rent_epoch == 18446744073709551615ul);
sol_assert(accounts[ARGUMENT_INDEX].rent_epoch == ULLONG_MAX);
sol_assert(!accounts[ARGUMENT_INDEX].executable);
for (int i = 0; i < accounts[ARGUMENT_INDEX].data_len; i++) {
sol_assert(accounts[ARGUMENT_INDEX].data[i] == i);
Expand All @@ -57,7 +57,7 @@ extern uint64_t entrypoint(const uint8_t *input) {
sol_assert(accounts[INVOKED_ARGUMENT_INDEX].data_len == 10);
sol_assert(accounts[INVOKED_ARGUMENT_INDEX].is_signer);
sol_assert(accounts[INVOKED_ARGUMENT_INDEX].is_writable);
sol_assert(accounts[INVOKED_ARGUMENT_INDEX].rent_epoch == 18446744073709551615ul);
sol_assert(accounts[INVOKED_ARGUMENT_INDEX].rent_epoch == ULLONG_MAX);
sol_assert(!accounts[INVOKED_ARGUMENT_INDEX].executable);

sol_assert(
Expand All @@ -66,7 +66,7 @@ extern uint64_t entrypoint(const uint8_t *input) {
&sbf_loader_id));
sol_assert(!accounts[INVOKED_PROGRAM_INDEX].is_signer);
sol_assert(!accounts[INVOKED_PROGRAM_INDEX].is_writable);
sol_assert(accounts[INVOKED_PROGRAM_INDEX].rent_epoch == 18446744073709551615ul);
sol_assert(accounts[INVOKED_PROGRAM_INDEX].rent_epoch == ULLONG_MAX);
sol_assert(accounts[INVOKED_PROGRAM_INDEX].executable);

sol_assert(SolPubkey_same(accounts[INVOKED_PROGRAM_INDEX].key,
Expand Down
12 changes: 3 additions & 9 deletions programs/sbf/rust/invoked/src/processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ fn process_instruction(
assert_eq!(accounts[ARGUMENT_INDEX].data_len(), 100);
assert!(accounts[ARGUMENT_INDEX].is_signer);
assert!(accounts[ARGUMENT_INDEX].is_writable);
assert_eq!(accounts[ARGUMENT_INDEX].rent_epoch, 18446744073709551615);
assert_eq!(accounts[ARGUMENT_INDEX].rent_epoch, u64::MAX);
assert!(!accounts[ARGUMENT_INDEX].executable);
{
let data = accounts[ARGUMENT_INDEX].try_borrow_data()?;
Expand All @@ -65,20 +65,14 @@ fn process_instruction(
assert_eq!(accounts[INVOKED_ARGUMENT_INDEX].data_len(), 10);
assert!(accounts[INVOKED_ARGUMENT_INDEX].is_signer);
assert!(accounts[INVOKED_ARGUMENT_INDEX].is_writable);
assert_eq!(
accounts[INVOKED_ARGUMENT_INDEX].rent_epoch,
18446744073709551615
);
assert_eq!(accounts[INVOKED_ARGUMENT_INDEX].rent_epoch, u64::MAX);
assert!(!accounts[INVOKED_ARGUMENT_INDEX].executable);

assert_eq!(accounts[INVOKED_PROGRAM_INDEX].key, program_id);
assert_eq!(accounts[INVOKED_PROGRAM_INDEX].owner, &bpf_loader::id());
assert!(!accounts[INVOKED_PROGRAM_INDEX].is_signer);
assert!(!accounts[INVOKED_PROGRAM_INDEX].is_writable);
assert_eq!(
accounts[INVOKED_PROGRAM_INDEX].rent_epoch,
18446744073709551615
);
assert_eq!(accounts[INVOKED_PROGRAM_INDEX].rent_epoch, u64::MAX);
assert!(accounts[INVOKED_PROGRAM_INDEX].executable);

assert_eq!(
Expand Down
2 changes: 1 addition & 1 deletion runtime/src/accounts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1634,7 +1634,7 @@ mod tests {
ka: &[TransactionAccount],
error_counters: &mut TransactionErrorMetrics,
) -> Vec<TransactionLoadResult> {
load_accounts_with_excluded_features(tx, ka, error_counters, None)
load_accounts_with_fee(tx, ka, 0, error_counters)
}

fn load_accounts_with_excluded_features(
Expand Down

0 comments on commit 4d19518

Please sign in to comment.