diff --git a/Cargo.lock b/Cargo.lock index 974c2f8fc..b5db9c6c3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4223,7 +4223,7 @@ dependencies = [ [[package]] name = "hydradx-runtime" -version = "196.0.0" +version = "197.0.0" dependencies = [ "cumulus-pallet-aura-ext", "cumulus-pallet-dmp-queue", @@ -7052,7 +7052,7 @@ dependencies = [ [[package]] name = "pallet-dca" -version = "1.3.1" +version = "1.3.2" dependencies = [ "cumulus-pallet-parachain-system", "cumulus-primitives-core", @@ -10791,7 +10791,7 @@ dependencies = [ [[package]] name = "runtime-integration-tests" -version = "1.16.5" +version = "1.16.6" dependencies = [ "cumulus-pallet-aura-ext", "cumulus-pallet-dmp-queue", diff --git a/integration-tests/Cargo.toml b/integration-tests/Cargo.toml index e8a6d0565..79c246076 100644 --- a/integration-tests/Cargo.toml +++ b/integration-tests/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "runtime-integration-tests" -version = "1.16.5" +version = "1.16.6" description = "Integration tests" authors = ["GalacticCouncil"] edition = "2021" diff --git a/integration-tests/src/dca.rs b/integration-tests/src/dca.rs index b5c230aff..adbb2b687 100644 --- a/integration-tests/src/dca.rs +++ b/integration-tests/src/dca.rs @@ -51,7 +51,11 @@ mod omnipool { let schedule1 = schedule_fake_with_buy_order(PoolType::Omnipool, HDX, DAI, 100 * UNITS, budget); //Act - assert_ok!(DCA::schedule(RuntimeOrigin::signed(ALICE.into()), schedule1, None)); + assert_ok!(DCA::schedule( + RuntimeOrigin::signed(ALICE.into()), + schedule1.clone(), + None + )); //Assert let schedule_id = 0; @@ -64,6 +68,9 @@ mod omnipool { expect_hydra_events(vec![pallet_dca::Event::Scheduled { id: 0, who: ALICE.into(), + period: schedule1.period.clone(), + total_amount: schedule1.total_amount.clone(), + order: schedule1.order.clone(), } .into()]); }); diff --git a/pallets/dca/Cargo.toml b/pallets/dca/Cargo.toml index 2b1b72b93..dd463bd29 100644 --- a/pallets/dca/Cargo.toml +++ b/pallets/dca/Cargo.toml @@ -1,6 +1,6 @@ [package] name = 'pallet-dca' -version = "1.3.1" +version = "1.3.2" description = 'A pallet to manage DCA scheduling' authors = ['GalacticCouncil'] edition = '2021' diff --git a/pallets/dca/src/lib.rs b/pallets/dca/src/lib.rs index 26a363004..e23b5ccae 100644 --- a/pallets/dca/src/lib.rs +++ b/pallets/dca/src/lib.rs @@ -289,7 +289,13 @@ pub mod pallet { ///The DCA execution is started ExecutionStarted { id: ScheduleId, block: BlockNumberFor }, ///The DCA is scheduled for next execution - Scheduled { id: ScheduleId, who: T::AccountId }, + Scheduled { + id: ScheduleId, + who: T::AccountId, + period: BlockNumberFor, + total_amount: Balance, + order: Order, + }, ///The DCA is planned for blocknumber ExecutionPlanned { id: ScheduleId, @@ -500,6 +506,9 @@ pub mod pallet { Self::deposit_event(Event::Scheduled { id: next_schedule_id, who, + period: schedule.period, + total_amount: schedule.total_amount, + order: schedule.order, }); Ok(()) diff --git a/pallets/dca/src/tests/schedule.rs b/pallets/dca/src/tests/schedule.rs index be1305e14..fe2f12c86 100644 --- a/pallets/dca/src/tests/schedule.rs +++ b/pallets/dca/src/tests/schedule.rs @@ -261,7 +261,11 @@ fn schedule_should_emit_necessary_events() { //Act set_block_number(500); - assert_ok!(DCA::schedule(RuntimeOrigin::signed(ALICE), schedule, Option::None)); + assert_ok!(DCA::schedule( + RuntimeOrigin::signed(ALICE), + schedule.clone(), + Option::None + )); //Assert let schedule_id = 0; @@ -275,6 +279,9 @@ fn schedule_should_emit_necessary_events() { Event::Scheduled { id: schedule_id, who: ALICE, + period: schedule.period, + total_amount: schedule.total_amount, + order: schedule.order, } .into(), ]); @@ -295,7 +302,11 @@ fn schedule_should_emit_necessary_events_when_multiple_schedules_are_created() { set_block_number(500); let schedule_id = 0; - assert_ok!(DCA::schedule(RuntimeOrigin::signed(ALICE), schedule, Option::None)); + assert_ok!(DCA::schedule( + RuntimeOrigin::signed(ALICE), + schedule.clone(), + Option::None + )); expect_events(vec![ Event::ExecutionPlanned { id: schedule_id, @@ -306,6 +317,9 @@ fn schedule_should_emit_necessary_events_when_multiple_schedules_are_created() { Event::Scheduled { id: schedule_id, who: ALICE, + period: schedule.period, + total_amount: schedule.total_amount, + order: schedule.order, } .into(), ]); @@ -314,7 +328,7 @@ fn schedule_should_emit_necessary_events_when_multiple_schedules_are_created() { assert_ok!(DCA::schedule( RuntimeOrigin::signed(ALICE), - schedule2, + schedule2.clone(), Option::Some(1000) )); expect_events(vec![ @@ -327,6 +341,9 @@ fn schedule_should_emit_necessary_events_when_multiple_schedules_are_created() { Event::Scheduled { id: schedule_id2, who: ALICE, + period: schedule2.period, + total_amount: schedule2.total_amount, + order: schedule2.order, } .into(), ]); diff --git a/runtime/hydradx/Cargo.toml b/runtime/hydradx/Cargo.toml index 9adf22497..00d925f43 100644 --- a/runtime/hydradx/Cargo.toml +++ b/runtime/hydradx/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hydradx-runtime" -version = "196.0.0" +version = "197.0.0" authors = ["GalacticCouncil"] edition = "2021" license = "Apache 2.0" diff --git a/runtime/hydradx/src/lib.rs b/runtime/hydradx/src/lib.rs index 798830fba..4de3aae3d 100644 --- a/runtime/hydradx/src/lib.rs +++ b/runtime/hydradx/src/lib.rs @@ -99,7 +99,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("hydradx"), impl_name: create_runtime_str!("hydradx"), authoring_version: 1, - spec_version: 196, + spec_version: 197, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 1,