Skip to content

Commit a59b699

Browse files
committed
Edit CommitTask
1 parent fde008f commit a59b699

File tree

7 files changed

+180
-15
lines changed

7 files changed

+180
-15
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ magicblock-core = { path = "./magicblock-core" }
127127
magicblock-delegation-program = { git = "https://github.com/magicblock-labs/delegation-program.git", rev = "5fb8d20", features = [
128128
"no-entrypoint",
129129
] }
130+
#magicblock-delegation-program = { path="../delegation-program", features = ["no-entrypoint"] }
130131
magicblock-geyser-plugin = { path = "./magicblock-geyser-plugin" }
131132
magicblock-ledger = { path = "./magicblock-ledger" }
132133
magicblock-metrics = { path = "./magicblock-metrics" }

magicblock-committor-service/src/tasks/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ dyn_clone::clone_trait_object!(BaseTask);
102102
pub struct CommitTask {
103103
pub commit_id: u64,
104104
pub allow_undelegation: bool,
105+
pub commit_diff: bool,
105106
pub committed_account: CommittedAccount,
106107
}
107108

magicblock-committor-service/src/tasks/task_builder.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,16 @@ impl TasksBuilder for TaskBuilderImpl {
6262
Box::new(task) as Box<dyn BaseTask>
6363
})
6464
.collect();
65-
6665
return Ok(tasks);
6766
}
68-
MagicBaseIntent::Commit(t) => (t.get_committed_accounts(), false),
69-
MagicBaseIntent::CommitAndUndelegate(t) => {
70-
(t.commit_action.get_committed_accounts(), true)
67+
MagicBaseIntent::Commit(t) => {
68+
(t.get_committed_accounts(), false, t.is_commit_diff())
7169
}
70+
MagicBaseIntent::CommitAndUndelegate(t) => (
71+
t.commit_action.get_committed_accounts(),
72+
true,
73+
t.commit_action.is_commit_diff(),
74+
),
7275
};
7376

7477
let committed_pubkeys = accounts
@@ -96,6 +99,7 @@ impl TasksBuilder for TaskBuilderImpl {
9699
let task = ArgsTaskType::Commit(CommitTask {
97100
commit_id,
98101
allow_undelegation,
102+
commit_diff,
99103
committed_account: account.clone(),
100104
});
101105

programs/magicblock/src/magic_scheduled_base_intent.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,14 @@ impl CommitType {
430430
}
431431
}
432432

433+
pub fn is_commit_diff(&self) -> bool {
434+
if let Self::StandaloneDiff(_) = self {
435+
true
436+
} else {
437+
false
438+
}
439+
}
440+
433441
pub fn get_committed_accounts(&self) -> &Vec<CommittedAccount> {
434442
match self {
435443
Self::Standalone(committed_accounts) => committed_accounts,

test-integration/Cargo.lock

Lines changed: 147 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)