| 121 | } |
| 122 | |
| 123 | pub fn to_check_tx(ret: CheckResponse) -> response::CheckTx { |
| 124 | // Putting the message `log` because only `log` appears in the `tx_sync` JSON-RPC response. |
| 125 | let message = ret |
| 126 | .info |
| 127 | .filter(|s| !s.is_empty()) |
| 128 | .unwrap_or_else(|| to_error_msg(ret.exit_code).to_owned()); |
| 129 | |
| 130 | response::CheckTx { |
| 131 | code: to_code(ret.exit_code), |
| 132 | log: message.clone(), |
| 133 | info: Default::default(), |
| 134 | data: Default::default(), |
| 135 | gas_wanted: ret.gas_limit.try_into().unwrap_or(i64::MAX), |
| 136 | sender: ret.sender.to_string(), |
| 137 | priority: ret.priority, |
| 138 | ..Default::default() |
| 139 | } |
| 140 | } |
| 141 | |
| 142 | /// Map the return values from cron operations. |
| 143 | pub fn to_begin_block(ret: AppliedMessage) -> response::BeginBlock { |