Function gcore::msg::reply_from_reservation
source · pub fn reply_from_reservation(
id: ReservationId,
payload: &[u8],
value: u128,
) -> Result<MessageId>
Expand description
Same as reply
, but it spends gas from a reservation instead of borrowing
it from the gas limit provided with the incoming message.
The first argument is the reservation identifier ReservationId
obtained
by calling the corresponding API. The second argument is the payload buffer.
The last argument is the value to be transferred from the current program
account to the reply message target account.
§Examples
use gcore::{exec, msg};
#[no_mangle]
extern "C" fn handle() {
let reservation_id = exec::reserve_gas(5_000_000, 100).expect("Unable to reserve");
msg::reply_from_reservation(reservation_id, b"PING", 0).unwrap();
}
§See also
send_from_reservation
function sends a new message to the program or user by using gas from a reservation.