static BallotContent UnforgeBallot(ForgedReader reader)
 {
     return(new BallotContent
     {
         Source = reader.ReadTzAddress(),
         Period = reader.ReadInt32(),
         Proposal = reader.ReadBase58(Lengths.P.Decoded, Prefix.P),
         Ballot = (Ballot)reader.ReadByte()
     });
 }
예제 #2
0
        static OperationContent UnforgeOperation(ForgedReader reader)
        {
            var operation = (OperationTag)reader.ReadByte();

            switch (operation)
            {
            case OperationTag.Endorsement:
                return(UnforgeEndorsement(reader));

            case OperationTag.Preendorsement:
                return(UnforgePreendorsement(reader));

            case OperationTag.Ballot:
                return(UnforgeBallot(reader));

            case OperationTag.Proposals:
                return(UnforgeProposals(reader));

            case OperationTag.Activation:
                return(UnforgeActivation(reader));

            case OperationTag.DoubleBaking:
                return(UnforgeDoubleBaking(reader));

            case OperationTag.DoubleEndorsement:
                return(UnforgeDoubleEndorsement(reader));

            case OperationTag.DoublePreendorsement:
                return(UnforgeDoublePreendorsement(reader));

            case OperationTag.SeedNonceRevelation:
                return(UnforgeSeedNonceRevelaion(reader));

            case OperationTag.VdfRevelation:
                return(UnforgeVdfRevelaion(reader));

            case OperationTag.Delegation:
                return(UnforgeDelegation(reader));

            case OperationTag.Origination:
                return(UnforgeOrigination(reader));

            case OperationTag.Transaction:
                return(UnforgeTransaction(reader));

            case OperationTag.Reveal:
                return(UnforgeReveal(reader));

            case OperationTag.RegisterConstant:
                return(UnforgeRegisterConstant(reader));

            case OperationTag.SetDepositsLimit:
                return(UnforgeSetDepositsLimit(reader));

            case OperationTag.IncreasePaidStorage:
                return(UnforgeIncreasePaidStorage(reader));

            case OperationTag.FailingNoop:
                return(UnforgeFailingNoop(reader));

            case OperationTag.TransferTicket:
                return(UnforgeTransferTicket(reader));

            case OperationTag.TxRollupCommit:
                return(UnforgeTxRollupCommit(reader));

            case OperationTag.TxRollupDispatchTickets:
                return(UnforgeTxRollupDispatchTickets(reader));

            case OperationTag.TxRollupFinalizeCommitment:
                return(UnforgeTxRollupFinalizeCommitment(reader));

            case OperationTag.TxRollupOrigination:
                return(UnforgeTxRollupOrigination(reader));

            case OperationTag.TxRollupRejection:
                return(UnforgeTxRollupRejection(reader));

            case OperationTag.TxRollupRemoveCommitment:
                return(UnforgeTxRollupRemoveCommitment(reader));

            case OperationTag.TxRollupReturnBond:
                return(UnforgeTxRollupReturnBond(reader));

            case OperationTag.TxRollupSubmitBatch:
                return(UnforgeTxRollupSubmitBatch(reader));

            default:
                throw new ArgumentException($"Invalid operation: {operation}");
            }
        }