Skip to content

Commit

Permalink
Merge branch 'hyperledger:main' into feat/soroban_print
Browse files Browse the repository at this point in the history
  • Loading branch information
salaheldinsoliman authored Aug 24, 2024
2 parents e163cbc + 25f06af commit c5e1e3f
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/codegen/polkadot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ impl RetCodeCheckBuilder<usize> {

impl RetCodeCheck {
/// Handles all cases from the [RetBlock] accordingly.
/// * On success, nothing is done and the execution continues at the success block.
/// On success, nothing is done and the execution continues at the success block.
/// If the callee reverted and output was supplied, it will be bubble up.
/// Otherwise, a revert without data will be inserted.
pub(crate) fn handle_cases(
Expand Down
10 changes: 3 additions & 7 deletions src/codegen/statements/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1208,9 +1208,7 @@ pub fn process_side_effects_expressions(
}

ast::Expression::Builtin {
kind: builtin_type, ..
} => match &builtin_type {
ast::Builtin::PayableSend
kind: ast::Builtin::PayableSend
| ast::Builtin::ArrayPush
| ast::Builtin::ArrayPop
// PayableTransfer, Revert, Require and SelfDestruct do not occur inside an expression
Expand All @@ -1229,12 +1227,10 @@ pub fn process_side_effects_expressions(
| ast::Builtin::WriteUint64LE
| ast::Builtin::WriteUint128LE
| ast::Builtin::WriteUint256LE
| ast::Builtin::WriteAddress => {
| ast::Builtin::WriteAddress, ..
} => {
let _ = expression(exp, ctx.cfg, ctx.contract_no, ctx.func, ctx.ns, ctx.vartab, ctx.opt);
false
}

_ => true,
},

_ => true,
Expand Down
2 changes: 1 addition & 1 deletion src/sema/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1281,7 +1281,7 @@ pub struct CallArgs {
/// This enum manages the accounts in an external call on Solana. There can be three options:
/// 1. The developer explicitly specifies there are not accounts for the call (`NoAccount`).
/// 2. The accounts call argument is absent, in which case we attempt to generate the AccountMetas
/// vector automatically (`AbsentArgumet`).
/// vector automatically (`AbsentArgumet`).
/// 3. There are accounts specified in the accounts call argument (Present).
#[derive(PartialEq, Eq, Clone, Debug, Default)]
pub enum ExternalCallAccounts<T> {
Expand Down
4 changes: 2 additions & 2 deletions src/sema/external_functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ fn check_statement(stmt: &Statement, call_list: &mut CallList) -> bool {
}
}
}
Statement::Return(_, exprs) => {
for e in exprs {
Statement::Return(_, expr) => {
if let Some(e) = expr {
e.recurse(call_list, check_expression);
}
}
Expand Down
4 changes: 2 additions & 2 deletions tests/solana.rs
Original file line number Diff line number Diff line change
Expand Up @@ -917,9 +917,9 @@ fn sol_log_data(
result
);

print!(" {}", hex::encode(&event));

events.push(event.to_vec());

print!(" {}", hex::encode(event));
}

println!();
Expand Down

0 comments on commit c5e1e3f

Please sign in to comment.