diff --git a/Tzkt.Sync/Protocols/Handlers/Proto1/Commits/Operations/DelegationsCommit.cs b/Tzkt.Sync/Protocols/Handlers/Proto1/Commits/Operations/DelegationsCommit.cs index 0b99287cc..c3e23f5a6 100644 --- a/Tzkt.Sync/Protocols/Handlers/Proto1/Commits/Operations/DelegationsCommit.cs +++ b/Tzkt.Sync/Protocols/Handlers/Proto1/Commits/Operations/DelegationsCommit.cs @@ -497,12 +497,19 @@ void UpgradeUser(DelegationOperation delegation) if (op.Sender?.Id == user.Id) op.Sender = delegat; - if (op.Manager?.Id == user.Id) - op.Manager = delegat; - if (op.Initiator?.Id == user.Id) op.Initiator = delegat; + if (op.Manager?.Id == user.Id) + op.Manager = delegat; + + touched.Add((op, entry.State)); + } + break; + case RegisterConstantOperation op: + if (op.Sender?.Id == user.Id) + { + op.Sender = delegat; touched.Add((op, entry.State)); } break; @@ -513,18 +520,88 @@ void UpgradeUser(DelegationOperation delegation) touched.Add((op, entry.State)); } break; + case SetDepositsLimitOperation op: + if (op.Sender?.Id == user.Id) + { + op.Sender = delegat; + touched.Add((op, entry.State)); + } + break; case TransactionOperation op: if (op.Sender?.Id == user.Id || op.Target?.Id == user.Id || op.Initiator?.Id == user.Id) { if (op.Sender?.Id == user.Id) op.Sender = delegat; - if (op.Target?.Id == user.Id) - op.Target = delegat; - if (op.Initiator?.Id == user.Id) op.Initiator = delegat; + if (op.Target?.Id == user.Id) + op.Target = delegat; + + touched.Add((op, entry.State)); + } + break; + case TransferTicketOperation op: + if (op.Sender?.Id == user.Id) + { + op.Sender = delegat; + touched.Add((op, entry.State)); + } + break; + case TxRollupCommitOperation op: + if (op.Sender?.Id == user.Id) + { + op.Sender = delegat; + touched.Add((op, entry.State)); + } + break; + case TxRollupDispatchTicketsOperation op: + if (op.Sender?.Id == user.Id) + { + op.Sender = delegat; + touched.Add((op, entry.State)); + } + break; + case TxRollupFinalizeCommitmentOperation op: + if (op.Sender?.Id == user.Id) + { + op.Sender = delegat; + touched.Add((op, entry.State)); + } + break; + case TxRollupOriginationOperation op: + if (op.Sender?.Id == user.Id) + { + op.Sender = delegat; + touched.Add((op, entry.State)); + } + break; + case TxRollupRejectionOperation op: + if (op.Sender?.Id == user.Id) + { + op.Sender = delegat; + touched.Add((op, entry.State)); + } + break; + case TxRollupRemoveCommitmentOperation op: + if (op.Sender?.Id == user.Id) + { + op.Sender = delegat; + touched.Add((op, entry.State)); + } + break; + case TxRollupReturnBondOperation op: + if (op.Sender?.Id == user.Id) + { + op.Sender = delegat; + touched.Add((op, entry.State)); + } + break; + case TxRollupSubmitBatchOperation op: + if (op.Sender?.Id == user.Id) + { + op.Sender = delegat; touched.Add((op, entry.State)); } break; @@ -623,12 +700,12 @@ void DowngradeDelegate(DelegationOperation delegation) if (op.Sender?.Id == delegat.Id) op.Sender = user; - if (op.Delegate?.Id == delegat.Id) - op.Delegate = null; - if (op.Initiator?.Id == delegat.Id) op.Initiator = user; + if (op.Delegate?.Id == delegat.Id) + op.Delegate = null; + if (op.PrevDelegate?.Id == delegat.Id) op.PrevDelegate = null; @@ -641,15 +718,22 @@ void DowngradeDelegate(DelegationOperation delegation) if (op.Sender?.Id == delegat.Id) op.Sender = user; + if (op.Initiator?.Id == delegat.Id) + op.Initiator = user; + if (op.Manager?.Id == delegat.Id) op.Manager = user; if (op.Delegate?.Id == delegat.Id) op.Delegate = null; - if (op.Initiator?.Id == delegat.Id) - op.Initiator = user; - + touched.Add((op, entry.State)); + } + break; + case RegisterConstantOperation op: + if (op.Sender?.Id == delegat.Id) + { + op.Sender = user; touched.Add((op, entry.State)); } break; @@ -660,18 +744,88 @@ void DowngradeDelegate(DelegationOperation delegation) touched.Add((op, entry.State)); } break; + case SetDepositsLimitOperation op: + if (op.Sender?.Id == delegat.Id) + { + op.Sender = user; + touched.Add((op, entry.State)); + } + break; case TransactionOperation op: if (op.Sender?.Id == delegat.Id || op.Target?.Id == delegat.Id || op.Initiator?.Id == delegat.Id) { if (op.Sender?.Id == delegat.Id) op.Sender = user; - if (op.Target?.Id == delegat.Id) - op.Target = user; - if (op.Initiator?.Id == delegat.Id) op.Initiator = user; + if (op.Target?.Id == delegat.Id) + op.Target = user; + + touched.Add((op, entry.State)); + } + break; + case TransferTicketOperation op: + if (op.Sender?.Id == delegat.Id) + { + op.Sender = user; + touched.Add((op, entry.State)); + } + break; + case TxRollupCommitOperation op: + if (op.Sender?.Id == delegat.Id) + { + op.Sender = user; + touched.Add((op, entry.State)); + } + break; + case TxRollupDispatchTicketsOperation op: + if (op.Sender?.Id == delegat.Id) + { + op.Sender = user; + touched.Add((op, entry.State)); + } + break; + case TxRollupFinalizeCommitmentOperation op: + if (op.Sender?.Id == delegat.Id) + { + op.Sender = user; + touched.Add((op, entry.State)); + } + break; + case TxRollupOriginationOperation op: + if (op.Sender?.Id == delegat.Id) + { + op.Sender = user; + touched.Add((op, entry.State)); + } + break; + case TxRollupRejectionOperation op: + if (op.Sender?.Id == delegat.Id) + { + op.Sender = user; + touched.Add((op, entry.State)); + } + break; + case TxRollupRemoveCommitmentOperation op: + if (op.Sender?.Id == delegat.Id) + { + op.Sender = user; + touched.Add((op, entry.State)); + } + break; + case TxRollupReturnBondOperation op: + if (op.Sender?.Id == delegat.Id) + { + op.Sender = user; + touched.Add((op, entry.State)); + } + break; + case TxRollupSubmitBatchOperation op: + if (op.Sender?.Id == delegat.Id) + { + op.Sender = user; touched.Add((op, entry.State)); } break;