-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
34 changed files
with
606 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
Tzkt.Sync/Protocols/Handlers/Proto8/Activation/ProtoActivator.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace Tzkt.Sync.Protocols.Proto8 | ||
{ | ||
class ProtoActivator : Proto7.ProtoActivator | ||
{ | ||
public ProtoActivator(ProtocolHandler proto) : base(proto) { } | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
Tzkt.Sync/Protocols/Handlers/Proto8/Commits/BakerCycleCommit.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace Tzkt.Sync.Protocols.Proto8 | ||
{ | ||
class BakerCycleCommit : Proto6.BakerCycleCommit | ||
{ | ||
public BakerCycleCommit(ProtocolHandler protocol) : base(protocol) { } | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
Tzkt.Sync/Protocols/Handlers/Proto8/Commits/BakingRightsCommit.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace Tzkt.Sync.Protocols.Proto8 | ||
{ | ||
class BakingRightsCommit : Proto3.BakingRightsCommit | ||
{ | ||
public BakingRightsCommit(ProtocolHandler protocol) : base(protocol) { } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace Tzkt.Sync.Protocols.Proto8 | ||
{ | ||
class BlockCommit : Proto1.BlockCommit | ||
{ | ||
public BlockCommit(ProtocolHandler protocol) : base(protocol) { } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace Tzkt.Sync.Protocols.Proto8 | ||
{ | ||
class CycleCommit : Proto1.CycleCommit | ||
{ | ||
public CycleCommit(ProtocolHandler protocol) : base(protocol) { } | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
Tzkt.Sync/Protocols/Handlers/Proto8/Commits/DeactivationCommit.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace Tzkt.Sync.Protocols.Proto8 | ||
{ | ||
class DeactivationCommit : Proto2.DeactivationCommit | ||
{ | ||
public DeactivationCommit(ProtocolHandler protocol) : base(protocol) { } | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
Tzkt.Sync/Protocols/Handlers/Proto8/Commits/DelegatorCycleCommit.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace Tzkt.Sync.Protocols.Proto8 | ||
{ | ||
class DelegatorCycleCommit : Proto3.DelegatorCycleCommit | ||
{ | ||
public DelegatorCycleCommit(ProtocolHandler protocol) : base(protocol) { } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace Tzkt.Sync.Protocols.Proto8 | ||
{ | ||
class FreezerCommit : Proto6.FreezerCommit | ||
{ | ||
public FreezerCommit(ProtocolHandler protocol) : base(protocol) { } | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
Tzkt.Sync/Protocols/Handlers/Proto8/Commits/Operations/ActivationsCommit.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace Tzkt.Sync.Protocols.Proto8 | ||
{ | ||
class ActivationsCommit : Proto5.ActivationsCommit | ||
{ | ||
public ActivationsCommit(ProtocolHandler protocol) : base(protocol) { } | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
Tzkt.Sync/Protocols/Handlers/Proto8/Commits/Operations/BallotsCommit.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace Tzkt.Sync.Protocols.Proto8 | ||
{ | ||
class BallotsCommit : Proto3.BallotsCommit | ||
{ | ||
public BallotsCommit(ProtocolHandler protocol) : base(protocol) { } | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
Tzkt.Sync/Protocols/Handlers/Proto8/Commits/Operations/DelegationsCommit.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace Tzkt.Sync.Protocols.Proto8 | ||
{ | ||
class DelegationsCommit : Proto1.DelegationsCommit | ||
{ | ||
public DelegationsCommit(ProtocolHandler protocol) : base(protocol) { } | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
Tzkt.Sync/Protocols/Handlers/Proto8/Commits/Operations/DoubleBakingCommit.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace Tzkt.Sync.Protocols.Proto8 | ||
{ | ||
class DoubleBakingCommit : Proto2.DoubleBakingCommit | ||
{ | ||
public DoubleBakingCommit(ProtocolHandler protocol) : base(protocol) { } | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
Tzkt.Sync/Protocols/Handlers/Proto8/Commits/Operations/DoubleEndorsingCommit.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace Tzkt.Sync.Protocols.Proto8 | ||
{ | ||
class DoubleEndorsingCommit : Proto4.DoubleEndorsingCommit | ||
{ | ||
public DoubleEndorsingCommit(ProtocolHandler protocol) : base(protocol) { } | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
Tzkt.Sync/Protocols/Handlers/Proto8/Commits/Operations/EndorsementsCommit.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace Tzkt.Sync.Protocols.Proto8 | ||
{ | ||
class EndorsementsCommit : Proto1.EndorsementsCommit | ||
{ | ||
public EndorsementsCommit(ProtocolHandler protocol) : base(protocol) { } | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
Tzkt.Sync/Protocols/Handlers/Proto8/Commits/Operations/NonceRevelationsCommit.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace Tzkt.Sync.Protocols.Proto8 | ||
{ | ||
class NonceRevelationsCommit : Proto1.NonceRevelationsCommit | ||
{ | ||
public NonceRevelationsCommit(ProtocolHandler protocol) : base(protocol) { } | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
Tzkt.Sync/Protocols/Handlers/Proto8/Commits/Operations/OriginationsCommit.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace Tzkt.Sync.Protocols.Proto8 | ||
{ | ||
class OriginationsCommit : Proto5.OriginationsCommit | ||
{ | ||
public OriginationsCommit(ProtocolHandler protocol) : base(protocol) { } | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
Tzkt.Sync/Protocols/Handlers/Proto8/Commits/Operations/ProposalsCommit.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace Tzkt.Sync.Protocols.Proto8 | ||
{ | ||
class ProposalsCommit : Proto3.ProposalsCommit | ||
{ | ||
public ProposalsCommit(ProtocolHandler protocol) : base(protocol) { } | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
Tzkt.Sync/Protocols/Handlers/Proto8/Commits/Operations/RevealsCommit.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace Tzkt.Sync.Protocols.Proto8 | ||
{ | ||
class RevealsCommit : Proto1.RevealsCommit | ||
{ | ||
public RevealsCommit(ProtocolHandler protocol) : base(protocol) { } | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
Tzkt.Sync/Protocols/Handlers/Proto8/Commits/Operations/TransactionsCommit.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace Tzkt.Sync.Protocols.Proto8 | ||
{ | ||
class TransactionsCommit : Proto5.TransactionsCommit | ||
{ | ||
public TransactionsCommit(ProtocolHandler protocol) : base(protocol) { } | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
Tzkt.Sync/Protocols/Handlers/Proto8/Commits/RevelationPenaltyCommit.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace Tzkt.Sync.Protocols.Proto8 | ||
{ | ||
class RevelationPenaltyCommit : Proto6.RevelationPenaltyCommit | ||
{ | ||
public RevelationPenaltyCommit(ProtocolHandler protocol) : base(protocol) { } | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
Tzkt.Sync/Protocols/Handlers/Proto8/Commits/SnapshotBalanceCommit.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace Tzkt.Sync.Protocols.Proto8 | ||
{ | ||
class SnapshotBalanceCommit : Proto4.SnapshotBalanceCommit | ||
{ | ||
public SnapshotBalanceCommit(ProtocolHandler protocol) : base(protocol) { } | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
Tzkt.Sync/Protocols/Handlers/Proto8/Commits/SoftwareCommit.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace Tzkt.Sync.Protocols.Proto8 | ||
{ | ||
class SoftwareCommit : Proto5.SoftwareCommit | ||
{ | ||
public SoftwareCommit(ProtocolHandler protocol) : base(protocol) { } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace Tzkt.Sync.Protocols.Proto8 | ||
{ | ||
class StateCommit : Proto1.StateCommit | ||
{ | ||
public StateCommit(ProtocolHandler protocol) : base(protocol) { } | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
Tzkt.Sync/Protocols/Handlers/Proto8/Commits/StatisticsCommit.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace Tzkt.Sync.Protocols.Proto8 | ||
{ | ||
class StatisticsCommit : Proto1.StatisticsCommit | ||
{ | ||
public StatisticsCommit(ProtocolHandler protocol) : base(protocol) { } | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
Tzkt.Sync/Protocols/Handlers/Proto8/Commits/VotingCommit.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
using System; | ||
using Tzkt.Data.Models; | ||
|
||
namespace Tzkt.Sync.Protocols.Proto8 | ||
{ | ||
class VotingCommit : Proto5.VotingCommit | ||
{ | ||
public VotingCommit(ProtocolHandler protocol) : base(protocol) { } | ||
|
||
// new voting period | ||
protected override ProposalStatus GetProposalStatus(Proposal proposal, VotingPeriod period) | ||
{ | ||
if (period.Status == PeriodStatus.Success) | ||
return period.Kind == PeriodKind.Adoption | ||
? ProposalStatus.Accepted | ||
: ProposalStatus.Active; | ||
|
||
if (period.Status == PeriodStatus.NoSupermajority) | ||
return ProposalStatus.Rejected; | ||
|
||
return ProposalStatus.Skipped; | ||
} | ||
|
||
// new voting period | ||
protected override VotingPeriod StartNextPeriod(Block block, VotingPeriod current) | ||
{ | ||
switch (current.Kind) | ||
{ | ||
case PeriodKind.Proposal: | ||
return StartBallotPeriod(block, current, PeriodKind.Exploration); | ||
case PeriodKind.Exploration: | ||
return StartWaitingPeriod(block, current, PeriodKind.Testing); | ||
case PeriodKind.Testing: | ||
return StartBallotPeriod(block, current, PeriodKind.Promotion); | ||
case PeriodKind.Promotion: | ||
return StartWaitingPeriod(block, current, PeriodKind.Adoption); | ||
case PeriodKind.Adoption: | ||
return StartProposalPeriod(block, current); | ||
default: | ||
throw new Exception("Invalid voting period kind"); | ||
} | ||
} | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
Tzkt.Sync/Protocols/Handlers/Proto8/Diagnostics/Diagnostics.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using Tzkt.Data; | ||
|
||
namespace Tzkt.Sync.Protocols.Proto8 | ||
{ | ||
class Diagnostics : Proto5.Diagnostics | ||
{ | ||
public Diagnostics(TzktContext db, IRpc rpc) : base(db, rpc) { } | ||
} | ||
} |
Oops, something went wrong.