Skip to content

Commit

Permalink
fix: Fix failing tests
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitry Murzin <[email protected]>
  • Loading branch information
dima74 committed Jul 4, 2024
1 parent d1d9c95 commit f5d7726
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 23 deletions.
2 changes: 1 addition & 1 deletion client/tests/integration/upgrade.rs
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ fn migration_should_cause_upgrade_event() {
fn define_custom_parameter() -> Result<()> {
use executor_custom_data_model::parameters::DomainLimits;

let (_rt, _peer, client) = <PeerBuilder>::new().with_port(10_996).start_with_runtime();
let (_rt, _peer, client) = <PeerBuilder>::new().with_port(11_325).start_with_runtime();
wait_for_genesis_committed(&vec![client.clone()], 0);

let long_domain_name = "0".repeat(2_usize.pow(5)).parse::<DomainId>()?;
Expand Down
Binary file modified configs/swarm/executor.wasm
Binary file not shown.
4 changes: 3 additions & 1 deletion core/src/queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,9 @@ pub mod tests {
time_source: &TimeSource,
) -> AcceptedTransaction {
let chain_id = ChainId::from("00000000-0000-0000-0000-000000000000");
let fail_isi = Unregister::domain("dummy".parse().unwrap());
// Random name needed so all transactions will be different
let domain_name = format!("dummy{}", rand::random::<u64>());
let fail_isi = Unregister::domain(domain_name.parse().unwrap());
let instructions = [fail_isi];
let tx =
TransactionBuilder::new_with_time_source(chain_id.clone(), account_id, time_source)
Expand Down
10 changes: 4 additions & 6 deletions core/src/smartcontracts/isi/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -333,12 +333,10 @@ mod tests {
.is_none());

let mut store = Metadata::default();
store
.insert(
Name::from_str("Bytes").expect("Valid"),
vec![1_u32, 2_u32, 3_u32],
)
.unwrap();
store.insert(
Name::from_str("Bytes").expect("Valid"),
vec![1_u32, 2_u32, 3_u32],
);
let asset_id = AssetId::new(asset_definition_id, account.id().clone());
let asset = Asset::new(asset_id, AssetValue::Store(store));

Expand Down
2 changes: 0 additions & 2 deletions default_executor/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ extern crate alloc;
#[cfg(not(test))]
extern crate panic_halt;

use alloc::borrow::ToOwned as _;

use iroha_executor::{debug::dbg_panic, prelude::*, DataModelBuilder};
use lol_alloc::{FreeListAllocator, LockedAllocator};

Expand Down
2 changes: 1 addition & 1 deletion tools/parity_scale_cli/samples/domain.bin
Original file line number Diff line number Diff line change
@@ -1 +1 @@
(wonderland�/ipfs/Qme7ss3ARVgxv6rXqVPiikMJ8u2NLgmgszg13pYrDKEoiuPIs_Jabberwocky_alive4{"Bool":true}
(wonderland�/ipfs/Qme7ss3ARVgxv6rXqVPiikMJ8u2NLgmgszg13pYrDKEoiuPIs_Jabberwocky_alivetrue
4 changes: 1 addition & 3 deletions tools/parity_scale_cli/samples/domain.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
"id": "wonderland",
"logo": "/ipfs/Qme7ss3ARVgxv6rXqVPiikMJ8u2NLgmgszg13pYrDKEoiu",
"metadata": {
"Is_Jabberwocky_alive": {
"Bool": true
}
"Is_Jabberwocky_alive": true
}
}
14 changes: 5 additions & 9 deletions tools/parity_scale_cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -314,12 +314,10 @@ mod tests {
#[test]
fn decode_account_sample() {
let mut metadata = Metadata::default();
metadata
.insert(
"hat".parse().expect("Valid"),
"white".parse::<JsonString>().expect("Valid"),
)
.expect("Valid");
metadata.insert(
"hat".parse().expect("Valid"),
"white".parse::<JsonString>().expect("Valid"),
);
let account = Account::new(ALICE_ID.clone()).with_metadata(metadata);

decode_sample("account.bin", String::from("NewAccount"), &account);
Expand All @@ -328,9 +326,7 @@ mod tests {
#[test]
fn decode_domain_sample() {
let mut metadata = Metadata::default();
metadata
.insert("Is_Jabberwocky_alive".parse().expect("Valid"), true)
.expect("Valid");
metadata.insert("Is_Jabberwocky_alive".parse().expect("Valid"), true);
let domain = Domain::new("wonderland".parse().expect("Valid"))
.with_logo(
IpfsPath::from_str("/ipfs/Qme7ss3ARVgxv6rXqVPiikMJ8u2NLgmgszg13pYrDKEoiu")
Expand Down

0 comments on commit f5d7726

Please sign in to comment.