Skip to content

Commit

Permalink
unified syntax - sync_call_readonly + NotPayable fix
Browse files Browse the repository at this point in the history
  • Loading branch information
andrei-marinica committed Jul 5, 2024
1 parent d7c01c8 commit 76d706b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ pub trait ForwarderRawSync: super::forwarder_raw_common::ForwarderRawCommon {
.gas(half_gas)
.raw_call(endpoint_name)
.arguments_raw(args.to_arg_buffer())
.payment(NotPayable) // `()` and `NotPayable` both work
.returns(ReturnsRawResult)
.sync_call_readonly();

Expand Down
5 changes: 3 additions & 2 deletions framework/base/src/types/interaction/tx_exec/tx_exec_sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use crate::{
tuple_util::NestedTupleFlatten,
types::{
decode_result, BackTransfers, ManagedBuffer, ManagedVec, OriginalResultMarker, RHListExec,
Tx, TxDataFunctionCall, TxGas, TxPayment, TxScEnv, TxToSpecified,
Tx, TxDataFunctionCall, TxGas, TxNoPayment, TxPayment, TxScEnv, TxToSpecified,
},
};

Expand Down Expand Up @@ -93,10 +93,11 @@ where
}
}

impl<Api, To, Gas, FC, RH> Tx<TxScEnv<Api>, (), To, (), Gas, FC, RH>
impl<Api, To, Payment, Gas, FC, RH> Tx<TxScEnv<Api>, (), To, Payment, Gas, FC, RH>
where
Api: CallTypeApi,
To: TxToSpecified<TxScEnv<Api>>,
Payment: TxNoPayment<TxScEnv<Api>>,
Gas: TxGas<TxScEnv<Api>>,
FC: TxDataFunctionCall<TxScEnv<Api>>,
RH: RHListExec<SyncCallRawResult<Api>, TxScEnv<Api>>,
Expand Down
2 changes: 1 addition & 1 deletion framework/snippets/src/interactor_tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ mod interactor_exec_deploy;
mod interactor_exec_env;
mod interactor_exec_step;
mod interactor_exec_transf;
mod interactor_exec_upgrade;
mod interactor_prepare_async;
mod interactor_query_call;
mod interactor_query_env;
mod interactor_query_step;
mod interactor_exec_upgrade;

pub use interactor_exec_env::InteractorEnvExec;
pub use interactor_exec_step::InteractorExecStep;
Expand Down

0 comments on commit 76d706b

Please sign in to comment.