From 06b2df5fad7a6d52cb5f6b50362bc5e2eeac9699 Mon Sep 17 00:00:00 2001 From: Warren He Date: Tue, 26 Apr 2022 16:01:31 -0700 Subject: [PATCH] floating --- runtime-sdk/src/dispatcher.rs | 10 +++++----- runtime-sdk/src/types/in_msg.rs | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/runtime-sdk/src/dispatcher.rs b/runtime-sdk/src/dispatcher.rs index 1de5f143f5..bcaa8ac070 100644 --- a/runtime-sdk/src/dispatcher.rs +++ b/runtime-sdk/src/dispatcher.rs @@ -362,7 +362,7 @@ impl Dispatcher { R::Modules::execute_in_msg(ctx, in_msg, data, tx)?; if let Some(tx) = tx { let tx_size = match data - .ut + .tx .as_ref() .unwrap_or_else(|| panic!("incoming message {} has tx but no ut", in_msg.id)) .len() @@ -561,7 +561,7 @@ impl transaction::dispatcher::Dispatcher for Dispatche warn!(ctx.get_logger("dispatcher"), "incoming message data malformed"; "id" => in_msg.id, "err" => ?err); IncomingMessageData::noop() }); - let tx = data.ut.as_ref().and_then(|ut| Self::decode_tx(ctx, ut).map_err(|err| { + let tx = data.tx.as_ref().and_then(|tx| Self::decode_tx(ctx, tx).map_err(|err| { warn!(ctx.get_logger("dispatcher"), "incoming message transaction malformed"; "id" => in_msg.id, "err" => ?err); }).ok()); if prefetch_enabled { @@ -629,9 +629,9 @@ impl transaction::dispatcher::Dispatcher for Dispatche warn!(ctx.get_logger("dispatcher"), "incoming message data malformed"; "id" => in_msg.id, "err" => ?err); IncomingMessageData::noop() }); - let tx = match data.ut.as_ref() { - Some(ut) => { - match Self::decode_tx(ctx, ut) { + let tx = match data.tx.as_ref() { + Some(tx) => { + match Self::decode_tx(ctx, tx) { Ok(tx) => { let remaining_gas = R::Core::remaining_in_msgs_gas(ctx); if remaining_gas < cfg.min_remaining_gas { diff --git a/runtime-sdk/src/types/in_msg.rs b/runtime-sdk/src/types/in_msg.rs index 15c9155d43..390d63fee9 100644 --- a/runtime-sdk/src/types/in_msg.rs +++ b/runtime-sdk/src/types/in_msg.rs @@ -17,16 +17,16 @@ pub enum Error { pub struct IncomingMessageData { #[cbor(rename = "v")] pub version: u16, - /// An embedded transaction (UnverifiedTransaction). + /// An embedded transaction (UnverifiedTransaction in runtimes using this SDK). /// The transaction doesn't need to be from the same account that sent the message. - pub ut: Option>, + pub tx: Option>, } impl IncomingMessageData { pub fn noop() -> Self { Self { version: LATEST_INCOMING_MESSAGE_VERSION, - ut: None, + tx: None, } }