diff --git a/packages/chain/src/lib.rs b/packages/chain/src/lib.rs index 0302227..43d1bd0 100644 --- a/packages/chain/src/lib.rs +++ b/packages/chain/src/lib.rs @@ -2,13 +2,10 @@ mod bindings; pub mod module; pub use archway_proto; -use archway_proto::tendermint::abci::ExecTxResult; use cosmrs::proto::tendermint::abci::ResponseFinalizeBlock; use std::ffi::CString; use std::str::FromStr; -// TODO: add a with_module::(FnOnce(msg) -> Response) -> Response - use crate::bindings::SkipBlock; use base64::engine::general_purpose::STANDARD as BASE64_STANDARD; use base64::Engine; @@ -21,7 +18,6 @@ use test_tube::bindings::{ GetValidatorPrivateKey, IncreaseTime, InitAccount, InitTestEnv, Query, Simulate, }; use test_tube::cosmrs::crypto::secp256k1::SigningKey; -use test_tube::cosmrs::proto::tendermint::v0_37::abci::{Event, EventAttribute, ResponseDeliverTx}; use test_tube::cosmrs::tx::{Fee, SignerInfo}; use test_tube::cosmrs::{tx, AccountId}; use test_tube::runner::error::DecodeError; @@ -48,38 +44,6 @@ pub fn arch(amount: u128) -> Coin { aarch(amount * 10u128.pow(18)) } -fn convert_to_response_deliver_tx(res: ExecTxResult) -> ResponseDeliverTx { - let mut events = Vec::with_capacity(res.events.len()); - - for event in res.events { - let mut attrs = Vec::with_capacity(event.attributes.len()); - - for attr in event.attributes { - attrs.push(EventAttribute { - key: attr.key, - value: attr.value, - index: attr.index, - }) - } - - events.push(Event { - r#type: event.r#type.clone(), - attributes: attrs, - }) - } - - ResponseDeliverTx { - code: res.code, - data: res.data, - log: res.log, - info: res.info, - gas_wanted: res.gas_wanted, - gas_used: res.gas_used, - events, - codespace: res.codespace, - } -} - pub struct ArchwayApp { id: u64, fee_denom: String,