From 4bce6c8e0b1819e6744c157aef63b2bd306f0745 Mon Sep 17 00:00:00 2001 From: AntonAndell Date: Fri, 5 Jan 2024 13:25:12 +0100 Subject: [PATCH 01/12] feat: Edit tendermint proto files to comply with non wasm clients --- contracts/javascore/ibc/build.gradle | 2 + .../core/integration/IBCIntegrationTest.java | 24 +- .../main/java/ibc/ics02/client/IBCClient.java | 6 +- .../ibc/ics03/connection/IBCConnection.java | 18 +- .../ics04/channel/IBCChannelHandshake.java | 16 +- .../java/ibc/ics04/channel/IBCPacket.java | 13 +- .../java/ibc/ics05/port/ModuleManager.java | 2 +- .../java/ibc/ics23/commitment/Compress.java | 2 +- .../main/java/ibc/ics23/commitment/Ics23.java | 2 +- .../main/java/ibc/ics23/commitment/Ops.java | 4 +- .../main/java/ibc/ics23/commitment/Proof.java | 2 +- .../ibc/ics23/commitment/types/Merkle.java | 4 +- .../main/java/ibc/ics24/host/IBCStore.java | 6 +- .../java/ibc/ics25/handler/IBCHandler.java | 2 +- .../ibc/ics25/handler/IBCHandlerChannel.java | 6 +- .../ibc/ics25/handler/IBCHandlerClient.java | 6 +- .../ics25/handler/IBCHandlerConnection.java | 10 +- .../ibc/ics25/handler/IBCHandlerPacket.java | 12 +- .../java/ibc/ics02/client/ClientTest.java | 10 +- .../ibc/ics03/connection/ConnectionTest.java | 12 +- .../ics04/channel/ChannelHandshakeTest.java | 16 +- .../java/ibc/ics04/channel/PacketTest.java | 17 +- .../java/ibc/ics23/commitment/Ics23Test.java | 2 +- .../ibc/ics23/commitment/LoadOpsTestData.java | 3 +- .../ics23/commitment/LoadProofTestData.java | 2 +- .../ics23/commitment/LoadVectorTestData.java | 3 +- .../java/ibc/ics23/commitment/ProofTest.java | 2 +- .../ics23/commitment/types/MerkleTest.java | 4 +- .../ibc/ics25/handler/IBCHandlerTest.java | 8 +- .../ibc/ics25/handler/IBCHandlerTestBase.java | 10 +- contracts/javascore/lib/build.gradle | 8 - .../ibc}/enums/clientstate/Status.java | 2 +- .../ibc}/interfaces/IIBCChannelHandshake.java | 4 +- .../ibc}/interfaces/IIBCClient.java | 6 +- .../ibc}/interfaces/IIBCConnection.java | 12 +- .../ibc}/interfaces/IIBCHandler.java | 2 +- .../ibc}/interfaces/IIBCHost.java | 2 +- .../ibc}/interfaces/IIBCModule.java | 2 +- .../ibc}/interfaces/IIBCPacket.java | 10 +- .../ibc}/interfaces/ILightClient.java | 2 +- .../messages/MsgChannelCloseConfirm.java | 2 +- .../structs/messages/MsgChannelCloseInit.java | 2 +- .../structs/messages/MsgChannelOpenAck.java | 2 +- .../messages/MsgChannelOpenConfirm.java | 2 +- .../structs/messages/MsgChannelOpenInit.java | 2 +- .../structs/messages/MsgChannelOpenTry.java | 2 +- .../messages/MsgConnectionOpenAck.java | 6 +- .../messages/MsgConnectionOpenConfirm.java | 2 +- .../messages/MsgConnectionOpenInit.java | 2 +- .../messages/MsgConnectionOpenTry.java | 2 +- .../structs/messages/MsgCreateClient.java | 2 +- .../messages/MsgPacketAcknowledgement.java | 2 +- .../ibc}/structs/messages/MsgPacketRecv.java | 2 +- .../structs/messages/MsgPacketTimeout.java | 4 +- .../messages/MsgRequestTimeoutPacket.java | 2 +- .../structs/messages/MsgUpdateClient.java | 2 +- .../messages/UpdateClientResponse.java | 4 +- .../proto/clients/tendermint/BlockIDFlag.java | 11 - .../clients/tendermint/SignedMsgType.java | 11 - .../icon/lightclient/v1/BlockUpdate.java | 43 - .../icon/lightclient/v1/ClientState.java | 130 - .../icon/lightclient/v1/ConsensusState.java | 42 - .../icon/proto/icon/types/v1/BTPHeader.java | 198 - .../proto/icon/types/v1/SignedHeader.java | 61 - .../lightclients/mockclient/build.gradle | 1 + .../main/java/ibc/mockclient/MockClient.java | 5 +- .../lightclients/tendermint/build.gradle | 3 + .../main/java/ibc/tendermint/Tendermint.java | 6 +- .../java/ibc/tendermint/TendermintHelper.java | 52 +- .../ibc/tendermint/TendermintLightClient.java | 45 +- .../java/ibc/tendermint/LightClientTest.java | 64 +- .../ibc/tendermint/LightClientTestBase.java | 48 +- .../ibc/tendermint/light/TendermintLight.java | 11972 ---------------- .../test/proto/amino/AminoProto.java | 161 + .../proto/cosmos/ics23/v1/BatchEntry.java | 447 + .../cosmos/ics23/v1/BatchEntryOrBuilder.java | 33 + .../proto/cosmos/ics23/v1/BatchProof.java | 390 + .../cosmos/ics23/v1/BatchProofOrBuilder.java | 23 + .../cosmos/ics23/v1/CommitmentProof.java | 649 + .../ics23/v1/CommitmentProofOrBuilder.java | 55 + .../cosmos/ics23/v1/CompressedBatchEntry.java | 447 + .../v1/CompressedBatchEntryOrBuilder.java | 33 + .../cosmos/ics23/v1/CompressedBatchProof.java | 582 + .../v1/CompressedBatchProofOrBuilder.java | 37 + .../ics23/v1/CompressedExistenceProof.java | 590 + .../v1/CompressedExistenceProofOrBuilder.java | 61 + .../ics23/v1/CompressedNonExistenceProof.java | 453 + .../CompressedNonExistenceProofOrBuilder.java | 41 + .../proto/cosmos/ics23/v1/ExistenceProof.java | 631 + .../ics23/v1/ExistenceProofOrBuilder.java | 46 + .../test/proto/cosmos/ics23/v1/HashOp.java | 155 + .../test/proto/cosmos/ics23/v1/InnerOp.java | 417 + .../cosmos/ics23/v1/InnerOpOrBuilder.java | 32 + .../test/proto/cosmos/ics23/v1/InnerSpec.java | 803 ++ .../cosmos/ics23/v1/InnerSpecOrBuilder.java | 91 + .../test/proto/cosmos/ics23/v1/LeafOp.java | 657 + .../cosmos/ics23/v1/LeafOpOrBuilder.java | 64 + .../test/proto/cosmos/ics23/v1/LengthOp.java | 237 + .../cosmos/ics23/v1/NonExistenceProof.java | 465 + .../ics23/v1/NonExistenceProofOrBuilder.java | 41 + .../test/proto/cosmos/ics23/v1/ProofSpec.java | 609 + .../cosmos/ics23/v1/ProofSpecOrBuilder.java | 61 + .../proto/cosmos/ics23/v1/ProofsProto.java | 16 + .../CancelSoftwareUpgradeProposal.java | 474 + ...ancelSoftwareUpgradeProposalOrBuilder.java | 49 + .../cosmos/upgrade/v1beta1/ModuleVersion.java | 411 + .../v1beta1/ModuleVersionOrBuilder.java | 39 + .../proto/cosmos/upgrade/v1beta1/Plan.java | 937 ++ .../cosmos/upgrade/v1beta1/PlanOrBuilder.java | 127 + .../v1beta1/SoftwareUpgradeProposal.java | 612 + .../SoftwareUpgradeProposalOrBuilder.java | 68 + .../cosmos/upgrade/v1beta1/UpgradeProto.java | 16 + .../test/proto/cosmos_proto/CosmosProto.java | 140 + .../cosmos_proto/InterfaceDescriptor.java | 510 + .../InterfaceDescriptorOrBuilder.java | 57 + .../proto/cosmos_proto/ScalarDescriptor.java | 949 ++ .../ScalarDescriptorOrBuilder.java | 123 + .../test/proto/cosmos_proto/ScalarType.java | 103 + .../test/proto/gogoproto/GogoProto.java | 1325 ++ .../core/client/v1/ClientConsensusStates.java | 623 + .../v1/ClientConsensusStatesOrBuilder.java | 55 + .../proto/ibc/core/client/v1/ClientProto.java | 16 + .../core/client/v1/ClientUpdateProposal.java | 760 + .../v1/ClientUpdateProposalOrBuilder.java | 91 + .../client/v1/ConsensusStateWithHeight.java | 469 + .../v1/ConsensusStateWithHeightOrBuilder.java | 47 + .../test/proto/ibc/core/client/v1/Height.java | 366 + .../ibc/core/client/v1/HeightOrBuilder.java | 29 + .../core/client/v1/IdentifiedClientState.java | 470 + .../v1/IdentifiedClientStateOrBuilder.java | 48 + .../test/proto/ibc/core/client/v1/Params.java | 486 + .../ibc/core/client/v1/ParamsOrBuilder.java | 58 + .../ibc/core/client/v1/UpgradeProposal.java | 677 + .../client/v1/UpgradeProposalOrBuilder.java | 73 + .../core/commitment/v1/CommitmentProto.java | 16 + .../ibc/core/commitment/v1/MerklePath.java | 382 + .../commitment/v1/MerklePathOrBuilder.java | 34 + .../ibc/core/commitment/v1/MerklePrefix.java | 252 + .../commitment/v1/MerklePrefixOrBuilder.java | 15 + .../ibc/core/commitment/v1/MerkleProof.java | 398 + .../commitment/v1/MerkleProofOrBuilder.java | 23 + .../ibc/core/commitment/v1/MerkleRoot.java | 250 + .../commitment/v1/MerkleRootOrBuilder.java | 15 + .../tendermint/v1/ClientState.java | 1927 +++ .../tendermint/v1/ClientStateOrBuilder.java | 244 + .../tendermint/v1/ConsensusState.java | 536 + .../v1/ConsensusStateOrBuilder.java | 55 + .../lightclients/tendermint/v1/Fraction.java | 304 + .../tendermint/v1/FractionOrBuilder.java | 21 + .../lightclients/tendermint/v1/Header.java | 590 + .../tendermint/v1/HeaderOrBuilder.java | 53 + .../tendermint/v1/Misbehaviour.java | 540 + .../tendermint/v1/MisbehaviourOrBuilder.java | 55 + .../tendermint/v1/TendermintLightProto.java | 16 + .../icon/lightclient/v1/BlockUpdate.java | 277 + .../lightclient/v1/BlockUpdateOrBuilder.java | 20 + .../icon/lightclient/v1/ClientState.java | 612 + .../lightclient/v1/ClientStateOrBuilder.java | 57 + .../icon/lightclient/v1/ConsensusState.java | 297 + .../v1/ConsensusStateOrBuilder.java | 21 + .../proto/icon/lightclient/v1/LightProto.java | 16 + .../icon/lightclient/v1/Misbehaviour.java | 470 + .../lightclient/v1/MisbehaviourOrBuilder.java | 43 + .../proto/icon/lightclient/v1/TrustLevel.java | 294 + .../lightclient/v1/TrustLevelOrBuilder.java | 21 + .../icon/proto/core/channel/Channel.java | 3249 +++++ .../proto/core/channel/ChannelOrBuilder.java | 131 + .../icon/proto/core/channel/ChannelProto.java | 16 + .../proto/icon/proto/core/channel/Packet.java | 1133 ++ .../proto/core/channel/PacketOrBuilder.java | 140 + .../icon/proto/core/channel/PacketState.java | 634 + .../core/channel/PacketStateOrBuilder.java | 69 + .../icon/proto/core/client/ClientProto.java | 16 + .../proto/icon/proto/core/client/Height.java | 364 + .../proto/core/client/HeightOrBuilder.java | 29 + .../proto/core/commitment/BatchEntry.java | 447 + .../core/commitment/BatchEntryOrBuilder.java | 33 + .../proto/core/commitment/BatchProof.java | 390 + .../core/commitment/BatchProofOrBuilder.java | 23 + .../core/commitment/CommitmentProof.java | 649 + .../commitment/CommitmentProofOrBuilder.java | 55 + .../core/commitment/CommitmentProto.java | 16 + .../core/commitment/CompressedBatchEntry.java | 447 + .../CompressedBatchEntryOrBuilder.java | 33 + .../core/commitment/CompressedBatchProof.java | 582 + .../CompressedBatchProofOrBuilder.java | 37 + .../commitment/CompressedExistenceProof.java | 590 + .../CompressedExistenceProofOrBuilder.java | 61 + .../CompressedNonExistenceProof.java | 453 + .../CompressedNonExistenceProofOrBuilder.java | 41 + .../proto/core/commitment/ExistenceProof.java | 631 + .../commitment/ExistenceProofOrBuilder.java | 46 + .../icon/proto/core/commitment/HashOp.java | 155 + .../icon/proto/core/commitment/InnerOp.java | 417 + .../core/commitment/InnerOpOrBuilder.java | 32 + .../icon/proto/core/commitment/InnerSpec.java | 803 ++ .../core/commitment/InnerSpecOrBuilder.java | 91 + .../icon/proto/core/commitment/LeafOp.java | 657 + .../core/commitment/LeafOpOrBuilder.java | 64 + .../icon/proto/core/commitment/LengthOp.java | 237 + .../proto/core/commitment/MerklePath.java | 382 + .../core/commitment/MerklePathOrBuilder.java | 34 + .../proto/core/commitment/MerklePrefix.java | 252 + .../commitment/MerklePrefixOrBuilder.java | 15 + .../proto/core/commitment/MerkleProof.java | 398 + .../core/commitment/MerkleProofOrBuilder.java | 23 + .../proto/core/commitment/MerkleRoot.java | 250 + .../core/commitment/MerkleRootOrBuilder.java | 15 + .../core/commitment/NonExistenceProof.java | 465 + .../NonExistenceProofOrBuilder.java | 41 + .../icon/proto/core/commitment/ProofSpec.java | 700 + .../core/commitment/ProofSpecOrBuilder.java | 73 + .../proto/core/commitment/ProofsProto.java | 16 + .../proto/core/connection/ConnectionEnd.java | 1154 ++ .../connection/ConnectionEndOrBuilder.java | 108 + .../core/connection/ConnectionProto.java | 16 + .../proto/core/connection/Counterparty.java | 626 + .../connection/CounterpartyOrBuilder.java | 72 + .../icon/proto/core/connection/Version.java | 591 + .../core/connection/VersionOrBuilder.java | 70 + .../test/proto/icon/types/v1/BTPHeader.java | 972 ++ .../icon/types/v1/BTPHeaderOrBuilder.java | 88 + .../test/proto/icon/types/v1/BlockIDFlag.java | 116 + .../test/proto/icon/types/v1/MerkleNode.java | 296 + .../icon/types/v1/MerkleNodeOrBuilder.java | 21 + .../proto/icon/types/v1/MerkleProofs.java | 382 + .../icon/types/v1/MerkleProofsOrBuilder.java | 23 + .../proto/icon/types/v1/SignedHeader.java | 619 + .../icon/types/v1/SignedHeaderOrBuilder.java | 60 + .../proto/icon/types/v1/SignedMsgType.java | 132 + .../test/proto/icon/types/v1/TypesProto.java | 16 + .../proto/tendermint/crypto/DominoOp.java | 478 + .../tendermint/crypto/DominoOpOrBuilder.java | 45 + .../proto/tendermint/crypto/KeysProto.java | 16 + .../test/proto/tendermint/crypto/Proof.java | 494 + .../test/proto/tendermint/crypto/ProofOp.java | 408 + .../tendermint/crypto/ProofOpOrBuilder.java | 33 + .../proto/tendermint/crypto/ProofOps.java | 390 + .../tendermint/crypto/ProofOpsOrBuilder.java | 23 + .../tendermint/crypto/ProofOrBuilder.java | 44 + .../proto/tendermint/crypto/ProofProto.java | 16 + .../proto/tendermint/crypto/PublicKey.java | 399 + .../tendermint/crypto/PublicKeyOrBuilder.java | 33 + .../test/proto/tendermint/crypto/ValueOp.java | 402 + .../tendermint/crypto/ValueOpOrBuilder.java | 38 + .../test/proto/tendermint/types/BlockID.java | 342 + .../proto/tendermint/types/BlockIDFlag.java | 116 + .../tendermint/types/BlockIDOrBuilder.java | 26 + .../proto/tendermint/types/BlockMeta.java | 482 + .../tendermint/types/BlockMetaOrBuilder.java | 43 + .../test/proto/tendermint/types/Commit.java | 595 + .../tendermint/types/CommitOrBuilder.java | 46 + .../proto/tendermint/types/CommitSig.java | 489 + .../tendermint/types/CommitSigOrBuilder.java | 43 + .../test/proto/tendermint/types/Data.java | 418 + .../proto/tendermint/types/DataOrBuilder.java | 44 + .../test/proto/tendermint/types/Header.java | 1445 ++ .../tendermint/types/HeaderOrBuilder.java | 166 + .../proto/tendermint/types/LightBlock.java | 371 + .../tendermint/types/LightBlockOrBuilder.java | 31 + .../test/proto/tendermint/types/Part.java | 390 + .../proto/tendermint/types/PartOrBuilder.java | 32 + .../proto/tendermint/types/PartSetHeader.java | 304 + .../types/PartSetHeaderOrBuilder.java | 21 + .../test/proto/tendermint/types/Proposal.java | 683 + .../tendermint/types/ProposalOrBuilder.java | 66 + .../proto/tendermint/types/SignedHeader.java | 371 + .../types/SignedHeaderOrBuilder.java | 31 + .../proto/tendermint/types/SignedMsgType.java | 132 + .../tendermint/types/SimpleValidator.java | 333 + .../types/SimpleValidatorOrBuilder.java | 26 + .../test/proto/tendermint/types/TxProof.java | 400 + .../tendermint/types/TxProofOrBuilder.java | 32 + .../proto/tendermint/types/TypesProto.java | 16 + .../proto/tendermint/types/Validator.java | 445 + .../tendermint/types/ValidatorOrBuilder.java | 38 + .../tendermint/types/ValidatorProto.java | 16 + .../proto/tendermint/types/ValidatorSet.java | 532 + .../types/ValidatorSetOrBuilder.java | 40 + .../test/proto/tendermint/types/Vote.java | 794 + .../proto/tendermint/types/VoteOrBuilder.java | 80 + .../test/proto/tendermint/version/App.java | 349 + .../tendermint/version/AppOrBuilder.java | 27 + .../proto/tendermint/version/Consensus.java | 306 + .../version/ConsensusOrBuilder.java | 21 + .../proto/tendermint/version/TypesProto.java | 16 + .../javascore/modules/mockapp/build.gradle | 1 + .../src/main/java/ibc/mockapp/MockApp.java | 4 +- contracts/javascore/proto-lib/build.gradle | 17 + .../java/cosmos/ics23/v1}/BatchEntry.java | 2 +- .../java/cosmos/ics23/v1}/BatchProof.java | 2 +- .../cosmos/ics23/v1}/CommitmentProof.java | 2 +- .../ics23/v1}/CompressedBatchEntry.java | 2 +- .../ics23/v1}/CompressedBatchProof.java | 2 +- .../ics23/v1}/CompressedExistenceProof.java | 2 +- .../v1}/CompressedNonExistenceProof.java | 2 +- .../java/cosmos/ics23/v1}/ExistenceProof.java | 2 +- .../main/java/cosmos/ics23/v1}/HashOp.java | 10 +- .../main/java/cosmos/ics23/v1}/InnerOp.java | 2 +- .../main/java/cosmos/ics23/v1}/InnerSpec.java | 2 +- .../main/java/cosmos/ics23/v1}/LeafOp.java | 2 +- .../main/java/cosmos/ics23/v1}/LengthOp.java | 2 +- .../cosmos/ics23/v1}/NonExistenceProof.java | 2 +- .../main/java/cosmos/ics23/v1}/ProofSpec.java | 2 +- .../CancelSoftwareUpgradeProposal.java | 60 + .../cosmos/upgrade/v1beta1/ModuleVersion.java | 61 + .../java/cosmos/upgrade/v1beta1/Plan.java | 114 + .../v1beta1/SoftwareUpgradeProposal.java | 77 + .../src/main/java/google/protobuf/Any.java} | 26 +- .../main/java/google/protobuf}/Duration.java | 2 +- .../main/java/google/protobuf}/Timestamp.java | 2 +- .../core/client/v1/ClientConsensusStates.java | 62 + .../core/client/v1/ClientUpdateProposal.java | 94 + .../client/v1/ConsensusStateWithHeight.java | 60 + .../main/java/ibc/core/client/v1/Height.java | 60 + .../core/client/v1/IdentifiedClientState.java | 61 + .../main/java/ibc/core/client/v1/Params.java | 45 + .../ibc/core/client/v1/UpgradeProposal.java | 96 + .../ibc/core/commitment/v1}/MerklePath.java | 2 +- .../ibc/core/commitment/v1}/MerklePrefix.java | 2 +- .../ibc/core/commitment/v1}/MerkleProof.java | 5 +- .../ibc/core/commitment/v1}/MerkleRoot.java | 2 +- .../tendermint/v1}/ClientState.java | 80 +- .../tendermint/v1}/ConsensusState.java | 12 +- .../lightclients/tendermint/v1}/Fraction.java | 2 +- .../lightclients/tendermint/v1/Header.java} | 34 +- .../tendermint}/v1/Misbehaviour.java | 18 +- .../java/icon/proto/core/channel/Channel.java | 0 .../java/icon/proto/core/channel/Packet.java | 4 +- .../icon/proto/core/channel/PacketState.java | 0 .../java/icon/proto/core/client/Height.java | 0 .../proto/core/connection/ConnectionEnd.java | 0 .../proto/core/connection/Counterparty.java | 5 +- .../icon/proto/core/connection/Version.java | 0 .../main/java/tendermint/crypto/DominoOp.java | 77 + .../main/java/tendermint/crypto/Proof.java | 96 + .../main/java/tendermint/crypto/ProofOp.java | 77 + .../java/tendermint/crypto/ProofOps.java} | 22 +- .../java/tendermint/crypto}/PublicKey.java | 21 +- .../main/java/tendermint/crypto/ValueOp.java | 59 + .../java/tendermint/types/ABCIParams.java | 43 + .../src/main/java/tendermint/types/Block.java | 93 + .../main/java/tendermint/types}/BlockID.java | 2 +- .../java/tendermint/types}/BlockIDFlag.java | 2 +- .../main/java/tendermint/types/BlockMeta.java | 94 + .../java/tendermint/types/BlockParams.java | 60 + .../tendermint/types}/CanonicalBlockID.java | 2 +- .../types}/CanonicalPartSetHeader.java | 2 +- .../tendermint/types/CanonicalProposal.java | 148 + .../java/tendermint/types}/CanonicalVote.java | 15 +- .../types/CanonicalVoteExtension.java | 95 + .../main/java/tendermint/types}/Commit.java | 2 +- .../java/tendermint/types}/CommitSig.java | 7 +- .../tendermint/types/ConsensusParams.java | 110 + .../src/main/java/tendermint/types/Data.java} | 24 +- .../types/DuplicateVoteEvidence.java | 112 + .../tendermint/types/EventDataRoundState.java | 78 + .../main/java/tendermint/types/Evidence.java | 59 + .../java/tendermint/types/EvidenceList.java} | 24 +- .../java/tendermint/types/EvidenceParams.java | 78 + .../java/tendermint/types/ExtendedCommit.java | 96 + .../tendermint/types/ExtendedCommitSig.java | 129 + .../java/tendermint/types/HashedParams.java | 60 + .../main/java/tendermint/types/Header.java} | 18 +- .../java/tendermint/types/LightBlock.java | 59 + .../types/LightClientAttackEvidence.java | 114 + .../src/main/java/tendermint/types/Part.java | 78 + .../java/tendermint/types}/PartSetHeader.java | 2 +- .../main/java/tendermint/types/Proposal.java | 147 + .../java/tendermint/types}/SignedHeader.java | 10 +- .../java/tendermint/types}/SignedMsgType.java | 2 +- .../tendermint/types}/SimpleValidator.java | 7 +- .../main/java/tendermint/types/TxProof.java | 77 + .../java/tendermint/types}/Validator.java | 7 +- .../tendermint/types/ValidatorParams.java | 45 + .../java/tendermint/types}/ValidatorSet.java | 2 +- .../java/tendermint/types/VersionParams.java | 43 + .../src/main/java/tendermint/types}/Vote.java | 43 +- .../src/main/java/tendermint/version/App.java | 61 + .../java/tendermint/version}/Consensus.java | 2 +- .../main/java/icon/score/proto/ProtoGen.java | 75 +- .../main/java/ibc/icon/score/util/Proto.java | 24 +- contracts/javascore/settings.gradle | 1 + .../javascore/xcall-connection/build.gradle | 2 + .../ibc/xcall/connection/IBCConnection.java | 2 +- .../xcall/connection/IBCConnectionTest.java | 2 +- .../connection/IBCConnectionTestBase.java | 6 +- .../clients/tendermint/TendermintLight.proto | 206 - proto/core/03-connection/Connection.proto | 7 +- proto/core/23-commitment/commitment.proto | 39 - proto/core/23-commitment/proofs.proto | 237 - scripts/generate_java_proto.sh | 29 + 392 files changed, 63811 insertions(+), 13442 deletions(-) rename contracts/javascore/lib/src/main/java/{ibc/icon => icon/ibc}/enums/clientstate/Status.java (66%) rename contracts/javascore/lib/src/main/java/{ibc/icon => icon/ibc}/interfaces/IIBCChannelHandshake.java (97%) rename contracts/javascore/lib/src/main/java/{ibc/icon => icon/ibc}/interfaces/IIBCClient.java (88%) rename contracts/javascore/lib/src/main/java/{ibc/icon => icon/ibc}/interfaces/IIBCConnection.java (76%) rename contracts/javascore/lib/src/main/java/{ibc/icon => icon/ibc}/interfaces/IIBCHandler.java (96%) rename contracts/javascore/lib/src/main/java/{ibc/icon => icon/ibc}/interfaces/IIBCHost.java (98%) rename contracts/javascore/lib/src/main/java/{ibc/icon => icon/ibc}/interfaces/IIBCModule.java (99%) rename contracts/javascore/lib/src/main/java/{ibc/icon => icon/ibc}/interfaces/IIBCPacket.java (90%) rename contracts/javascore/lib/src/main/java/{ibc/icon => icon/ibc}/interfaces/ILightClient.java (99%) rename contracts/javascore/lib/src/main/java/{ibc/icon => icon/ibc}/structs/messages/MsgChannelCloseConfirm.java (95%) rename contracts/javascore/lib/src/main/java/{ibc/icon => icon/ibc}/structs/messages/MsgChannelCloseInit.java (91%) rename contracts/javascore/lib/src/main/java/{ibc/icon => icon/ibc}/structs/messages/MsgChannelOpenAck.java (97%) rename contracts/javascore/lib/src/main/java/{ibc/icon => icon/ibc}/structs/messages/MsgChannelOpenConfirm.java (95%) rename contracts/javascore/lib/src/main/java/{ibc/icon => icon/ibc}/structs/messages/MsgChannelOpenInit.java (91%) rename contracts/javascore/lib/src/main/java/{ibc/icon => icon/ibc}/structs/messages/MsgChannelOpenTry.java (96%) rename contracts/javascore/lib/src/main/java/{ibc/icon => icon/ibc}/structs/messages/MsgConnectionOpenAck.java (98%) rename contracts/javascore/lib/src/main/java/{ibc/icon => icon/ibc}/structs/messages/MsgConnectionOpenConfirm.java (94%) rename contracts/javascore/lib/src/main/java/{ibc/icon => icon/ibc}/structs/messages/MsgConnectionOpenInit.java (95%) rename contracts/javascore/lib/src/main/java/{ibc/icon => icon/ibc}/structs/messages/MsgConnectionOpenTry.java (98%) rename contracts/javascore/lib/src/main/java/{ibc/icon => icon/ibc}/structs/messages/MsgCreateClient.java (96%) rename contracts/javascore/lib/src/main/java/{ibc/icon => icon/ibc}/structs/messages/MsgPacketAcknowledgement.java (95%) rename contracts/javascore/lib/src/main/java/{ibc/icon => icon/ibc}/structs/messages/MsgPacketRecv.java (94%) rename contracts/javascore/lib/src/main/java/{ibc/icon => icon/ibc}/structs/messages/MsgPacketTimeout.java (95%) rename contracts/javascore/lib/src/main/java/{ibc/icon => icon/ibc}/structs/messages/MsgRequestTimeoutPacket.java (94%) rename contracts/javascore/lib/src/main/java/{ibc/icon => icon/ibc}/structs/messages/MsgUpdateClient.java (92%) rename contracts/javascore/lib/src/main/java/{ibc/icon => icon/ibc}/structs/messages/UpdateClientResponse.java (96%) delete mode 100644 contracts/javascore/lib/src/main/java/icon/proto/clients/tendermint/BlockIDFlag.java delete mode 100644 contracts/javascore/lib/src/main/java/icon/proto/clients/tendermint/SignedMsgType.java delete mode 100644 contracts/javascore/lib/src/main/java/icon/proto/icon/lightclient/v1/BlockUpdate.java delete mode 100644 contracts/javascore/lib/src/main/java/icon/proto/icon/lightclient/v1/ClientState.java delete mode 100644 contracts/javascore/lib/src/main/java/icon/proto/icon/lightclient/v1/ConsensusState.java delete mode 100644 contracts/javascore/lib/src/main/java/icon/proto/icon/types/v1/BTPHeader.java delete mode 100644 contracts/javascore/lib/src/main/java/icon/proto/icon/types/v1/SignedHeader.java delete mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/light/TendermintLight.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/amino/AminoProto.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/BatchEntry.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/BatchEntryOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/BatchProof.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/BatchProofOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/CommitmentProof.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/CommitmentProofOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/CompressedBatchEntry.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/CompressedBatchEntryOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/CompressedBatchProof.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/CompressedBatchProofOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/CompressedExistenceProof.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/CompressedExistenceProofOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/CompressedNonExistenceProof.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/CompressedNonExistenceProofOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/ExistenceProof.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/ExistenceProofOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/HashOp.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/InnerOp.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/InnerOpOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/InnerSpec.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/InnerSpecOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/LeafOp.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/LeafOpOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/LengthOp.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/NonExistenceProof.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/NonExistenceProofOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/ProofSpec.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/ProofSpecOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/ProofsProto.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/upgrade/v1beta1/CancelSoftwareUpgradeProposal.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/upgrade/v1beta1/CancelSoftwareUpgradeProposalOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/upgrade/v1beta1/ModuleVersion.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/upgrade/v1beta1/ModuleVersionOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/upgrade/v1beta1/Plan.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/upgrade/v1beta1/PlanOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/upgrade/v1beta1/SoftwareUpgradeProposal.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/upgrade/v1beta1/SoftwareUpgradeProposalOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/upgrade/v1beta1/UpgradeProto.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos_proto/CosmosProto.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos_proto/InterfaceDescriptor.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos_proto/InterfaceDescriptorOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos_proto/ScalarDescriptor.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos_proto/ScalarDescriptorOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos_proto/ScalarType.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/gogoproto/GogoProto.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/ClientConsensusStates.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/ClientConsensusStatesOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/ClientProto.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/ClientUpdateProposal.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/ClientUpdateProposalOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/ConsensusStateWithHeight.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/ConsensusStateWithHeightOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/Height.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/HeightOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/IdentifiedClientState.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/IdentifiedClientStateOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/Params.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/ParamsOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/UpgradeProposal.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/UpgradeProposalOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/commitment/v1/CommitmentProto.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/commitment/v1/MerklePath.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/commitment/v1/MerklePathOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/commitment/v1/MerklePrefix.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/commitment/v1/MerklePrefixOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/commitment/v1/MerkleProof.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/commitment/v1/MerkleProofOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/commitment/v1/MerkleRoot.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/commitment/v1/MerkleRootOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/lightclients/tendermint/v1/ClientState.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/lightclients/tendermint/v1/ClientStateOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/lightclients/tendermint/v1/ConsensusState.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/lightclients/tendermint/v1/ConsensusStateOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/lightclients/tendermint/v1/Fraction.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/lightclients/tendermint/v1/FractionOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/lightclients/tendermint/v1/Header.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/lightclients/tendermint/v1/HeaderOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/lightclients/tendermint/v1/Misbehaviour.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/lightclients/tendermint/v1/MisbehaviourOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/lightclients/tendermint/v1/TendermintLightProto.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/lightclient/v1/BlockUpdate.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/lightclient/v1/BlockUpdateOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/lightclient/v1/ClientState.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/lightclient/v1/ClientStateOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/lightclient/v1/ConsensusState.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/lightclient/v1/ConsensusStateOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/lightclient/v1/LightProto.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/lightclient/v1/Misbehaviour.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/lightclient/v1/MisbehaviourOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/lightclient/v1/TrustLevel.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/lightclient/v1/TrustLevelOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/channel/Channel.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/channel/ChannelOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/channel/ChannelProto.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/channel/Packet.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/channel/PacketOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/channel/PacketState.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/channel/PacketStateOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/client/ClientProto.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/client/Height.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/client/HeightOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/BatchEntry.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/BatchEntryOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/BatchProof.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/BatchProofOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/CommitmentProof.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/CommitmentProofOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/CommitmentProto.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/CompressedBatchEntry.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/CompressedBatchEntryOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/CompressedBatchProof.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/CompressedBatchProofOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/CompressedExistenceProof.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/CompressedExistenceProofOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/CompressedNonExistenceProof.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/CompressedNonExistenceProofOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/ExistenceProof.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/ExistenceProofOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/HashOp.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/InnerOp.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/InnerOpOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/InnerSpec.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/InnerSpecOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/LeafOp.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/LeafOpOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/LengthOp.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/MerklePath.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/MerklePathOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/MerklePrefix.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/MerklePrefixOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/MerkleProof.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/MerkleProofOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/MerkleRoot.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/MerkleRootOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/NonExistenceProof.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/NonExistenceProofOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/ProofSpec.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/ProofSpecOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/ProofsProto.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/connection/ConnectionEnd.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/connection/ConnectionEndOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/connection/ConnectionProto.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/connection/Counterparty.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/connection/CounterpartyOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/connection/Version.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/connection/VersionOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/types/v1/BTPHeader.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/types/v1/BTPHeaderOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/types/v1/BlockIDFlag.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/types/v1/MerkleNode.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/types/v1/MerkleNodeOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/types/v1/MerkleProofs.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/types/v1/MerkleProofsOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/types/v1/SignedHeader.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/types/v1/SignedHeaderOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/types/v1/SignedMsgType.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/types/v1/TypesProto.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/DominoOp.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/DominoOpOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/KeysProto.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/Proof.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/ProofOp.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/ProofOpOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/ProofOps.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/ProofOpsOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/ProofOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/ProofProto.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/PublicKey.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/PublicKeyOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/ValueOp.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/ValueOpOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/BlockID.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/BlockIDFlag.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/BlockIDOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/BlockMeta.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/BlockMetaOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/Commit.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/CommitOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/CommitSig.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/CommitSigOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/Data.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/DataOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/Header.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/HeaderOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/LightBlock.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/LightBlockOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/Part.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/PartOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/PartSetHeader.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/PartSetHeaderOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/Proposal.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/ProposalOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/SignedHeader.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/SignedHeaderOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/SignedMsgType.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/SimpleValidator.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/SimpleValidatorOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/TxProof.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/TxProofOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/TypesProto.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/Validator.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/ValidatorOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/ValidatorProto.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/ValidatorSet.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/ValidatorSetOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/Vote.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/VoteOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/version/App.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/version/AppOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/version/Consensus.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/version/ConsensusOrBuilder.java create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/version/TypesProto.java create mode 100644 contracts/javascore/proto-lib/build.gradle rename contracts/javascore/{lib/src/main/java/icon/proto/core/commitment => proto-lib/src/main/java/cosmos/ics23/v1}/BatchEntry.java (97%) rename contracts/javascore/{lib/src/main/java/icon/proto/core/commitment => proto-lib/src/main/java/cosmos/ics23/v1}/BatchProof.java (96%) rename contracts/javascore/{lib/src/main/java/icon/proto/core/commitment => proto-lib/src/main/java/cosmos/ics23/v1}/CommitmentProof.java (98%) rename contracts/javascore/{lib/src/main/java/icon/proto/core/commitment => proto-lib/src/main/java/cosmos/ics23/v1}/CompressedBatchEntry.java (97%) rename contracts/javascore/{lib/src/main/java/icon/proto/core/commitment => proto-lib/src/main/java/cosmos/ics23/v1}/CompressedBatchProof.java (97%) rename contracts/javascore/{lib/src/main/java/icon/proto/core/commitment => proto-lib/src/main/java/cosmos/ics23/v1}/CompressedExistenceProof.java (98%) rename contracts/javascore/{lib/src/main/java/icon/proto/core/commitment => proto-lib/src/main/java/cosmos/ics23/v1}/CompressedNonExistenceProof.java (98%) rename contracts/javascore/{lib/src/main/java/icon/proto/core/commitment => proto-lib/src/main/java/cosmos/ics23/v1}/ExistenceProof.java (98%) rename contracts/javascore/{lib/src/main/java/icon/proto/core/commitment => proto-lib/src/main/java/cosmos/ics23/v1}/HashOp.java (58%) rename contracts/javascore/{lib/src/main/java/icon/proto/core/commitment => proto-lib/src/main/java/cosmos/ics23/v1}/InnerOp.java (97%) rename contracts/javascore/{lib/src/main/java/icon/proto/core/commitment => proto-lib/src/main/java/cosmos/ics23/v1}/InnerSpec.java (98%) rename contracts/javascore/{lib/src/main/java/icon/proto/core/commitment => proto-lib/src/main/java/cosmos/ics23/v1}/LeafOp.java (98%) rename contracts/javascore/{lib/src/main/java/icon/proto/core/commitment => proto-lib/src/main/java/cosmos/ics23/v1}/LengthOp.java (92%) rename contracts/javascore/{lib/src/main/java/icon/proto/core/commitment => proto-lib/src/main/java/cosmos/ics23/v1}/NonExistenceProof.java (98%) rename contracts/javascore/{lib/src/main/java/icon/proto/core/commitment => proto-lib/src/main/java/cosmos/ics23/v1}/ProofSpec.java (98%) create mode 100644 contracts/javascore/proto-lib/src/main/java/cosmos/upgrade/v1beta1/CancelSoftwareUpgradeProposal.java create mode 100644 contracts/javascore/proto-lib/src/main/java/cosmos/upgrade/v1beta1/ModuleVersion.java create mode 100644 contracts/javascore/proto-lib/src/main/java/cosmos/upgrade/v1beta1/Plan.java create mode 100644 contracts/javascore/proto-lib/src/main/java/cosmos/upgrade/v1beta1/SoftwareUpgradeProposal.java rename contracts/javascore/{lib/src/main/java/icon/proto/icon/types/v1/MerkleNode.java => proto-lib/src/main/java/google/protobuf/Any.java} (62%) rename contracts/javascore/{lib/src/main/java/icon/proto/clients/tendermint => proto-lib/src/main/java/google/protobuf}/Duration.java (97%) rename contracts/javascore/{lib/src/main/java/icon/proto/clients/tendermint => proto-lib/src/main/java/google/protobuf}/Timestamp.java (97%) create mode 100644 contracts/javascore/proto-lib/src/main/java/ibc/core/client/v1/ClientConsensusStates.java create mode 100644 contracts/javascore/proto-lib/src/main/java/ibc/core/client/v1/ClientUpdateProposal.java create mode 100644 contracts/javascore/proto-lib/src/main/java/ibc/core/client/v1/ConsensusStateWithHeight.java create mode 100644 contracts/javascore/proto-lib/src/main/java/ibc/core/client/v1/Height.java create mode 100644 contracts/javascore/proto-lib/src/main/java/ibc/core/client/v1/IdentifiedClientState.java create mode 100644 contracts/javascore/proto-lib/src/main/java/ibc/core/client/v1/Params.java create mode 100644 contracts/javascore/proto-lib/src/main/java/ibc/core/client/v1/UpgradeProposal.java rename contracts/javascore/{lib/src/main/java/icon/proto/core/commitment => proto-lib/src/main/java/ibc/core/commitment/v1}/MerklePath.java (96%) rename contracts/javascore/{lib/src/main/java/icon/proto/core/connection => proto-lib/src/main/java/ibc/core/commitment/v1}/MerklePrefix.java (96%) rename contracts/javascore/{lib/src/main/java/icon/proto/core/commitment => proto-lib/src/main/java/ibc/core/commitment/v1}/MerkleProof.java (86%) rename contracts/javascore/{lib/src/main/java/icon/proto/core/commitment => proto-lib/src/main/java/ibc/core/commitment/v1}/MerkleRoot.java (96%) rename contracts/javascore/{lib/src/main/java/icon/proto/clients/tendermint => proto-lib/src/main/java/ibc/lightclients/tendermint/v1}/ClientState.java (62%) rename contracts/javascore/{lib/src/main/java/icon/proto/clients/tendermint => proto-lib/src/main/java/ibc/lightclients/tendermint/v1}/ConsensusState.java (81%) rename contracts/javascore/{lib/src/main/java/icon/proto/clients/tendermint => proto-lib/src/main/java/ibc/lightclients/tendermint/v1}/Fraction.java (97%) rename contracts/javascore/{lib/src/main/java/icon/proto/clients/tendermint/TmHeader.java => proto-lib/src/main/java/ibc/lightclients/tendermint/v1/Header.java} (62%) rename contracts/javascore/{lib/src/main/java/icon/proto/icon/lightclient => proto-lib/src/main/java/ibc/lightclients/tendermint}/v1/Misbehaviour.java (77%) rename contracts/javascore/{lib => proto-lib}/src/main/java/icon/proto/core/channel/Channel.java (100%) rename contracts/javascore/{lib => proto-lib}/src/main/java/icon/proto/core/channel/Packet.java (96%) rename contracts/javascore/{lib => proto-lib}/src/main/java/icon/proto/core/channel/PacketState.java (100%) rename contracts/javascore/{lib => proto-lib}/src/main/java/icon/proto/core/client/Height.java (100%) rename contracts/javascore/{lib => proto-lib}/src/main/java/icon/proto/core/connection/ConnectionEnd.java (100%) rename contracts/javascore/{lib => proto-lib}/src/main/java/icon/proto/core/connection/Counterparty.java (89%) rename contracts/javascore/{lib => proto-lib}/src/main/java/icon/proto/core/connection/Version.java (100%) create mode 100644 contracts/javascore/proto-lib/src/main/java/tendermint/crypto/DominoOp.java create mode 100644 contracts/javascore/proto-lib/src/main/java/tendermint/crypto/Proof.java create mode 100644 contracts/javascore/proto-lib/src/main/java/tendermint/crypto/ProofOp.java rename contracts/javascore/{lib/src/main/java/icon/proto/icon/types/v1/MerkleProofs.java => proto-lib/src/main/java/tendermint/crypto/ProofOps.java} (55%) rename contracts/javascore/{lib/src/main/java/icon/proto/clients/tendermint => proto-lib/src/main/java/tendermint/crypto}/PublicKey.java (72%) create mode 100644 contracts/javascore/proto-lib/src/main/java/tendermint/crypto/ValueOp.java create mode 100644 contracts/javascore/proto-lib/src/main/java/tendermint/types/ABCIParams.java create mode 100644 contracts/javascore/proto-lib/src/main/java/tendermint/types/Block.java rename contracts/javascore/{lib/src/main/java/icon/proto/clients/tendermint => proto-lib/src/main/java/tendermint/types}/BlockID.java (97%) rename contracts/javascore/{lib/src/main/java/icon/proto/icon/types/v1 => proto-lib/src/main/java/tendermint/types}/BlockIDFlag.java (87%) create mode 100644 contracts/javascore/proto-lib/src/main/java/tendermint/types/BlockMeta.java create mode 100644 contracts/javascore/proto-lib/src/main/java/tendermint/types/BlockParams.java rename contracts/javascore/{lib/src/main/java/icon/proto/clients/tendermint => proto-lib/src/main/java/tendermint/types}/CanonicalBlockID.java (97%) rename contracts/javascore/{lib/src/main/java/icon/proto/clients/tendermint => proto-lib/src/main/java/tendermint/types}/CanonicalPartSetHeader.java (97%) create mode 100644 contracts/javascore/proto-lib/src/main/java/tendermint/types/CanonicalProposal.java rename contracts/javascore/{lib/src/main/java/icon/proto/clients/tendermint => proto-lib/src/main/java/tendermint/types}/CanonicalVote.java (87%) create mode 100644 contracts/javascore/proto-lib/src/main/java/tendermint/types/CanonicalVoteExtension.java rename contracts/javascore/{lib/src/main/java/icon/proto/clients/tendermint => proto-lib/src/main/java/tendermint/types}/Commit.java (98%) rename contracts/javascore/{lib/src/main/java/icon/proto/clients/tendermint => proto-lib/src/main/java/tendermint/types}/CommitSig.java (91%) create mode 100644 contracts/javascore/proto-lib/src/main/java/tendermint/types/ConsensusParams.java rename contracts/javascore/{lib/src/main/java/icon/proto/clients/tendermint/MerkleRoot.java => proto-lib/src/main/java/tendermint/types/Data.java} (55%) create mode 100644 contracts/javascore/proto-lib/src/main/java/tendermint/types/DuplicateVoteEvidence.java create mode 100644 contracts/javascore/proto-lib/src/main/java/tendermint/types/EventDataRoundState.java create mode 100644 contracts/javascore/proto-lib/src/main/java/tendermint/types/Evidence.java rename contracts/javascore/{lib/src/main/java/icon/proto/core/commitment/MerklePrefix.java => proto-lib/src/main/java/tendermint/types/EvidenceList.java} (50%) create mode 100644 contracts/javascore/proto-lib/src/main/java/tendermint/types/EvidenceParams.java create mode 100644 contracts/javascore/proto-lib/src/main/java/tendermint/types/ExtendedCommit.java create mode 100644 contracts/javascore/proto-lib/src/main/java/tendermint/types/ExtendedCommitSig.java create mode 100644 contracts/javascore/proto-lib/src/main/java/tendermint/types/HashedParams.java rename contracts/javascore/{lib/src/main/java/icon/proto/clients/tendermint/LightHeader.java => proto-lib/src/main/java/tendermint/types/Header.java} (93%) create mode 100644 contracts/javascore/proto-lib/src/main/java/tendermint/types/LightBlock.java create mode 100644 contracts/javascore/proto-lib/src/main/java/tendermint/types/LightClientAttackEvidence.java create mode 100644 contracts/javascore/proto-lib/src/main/java/tendermint/types/Part.java rename contracts/javascore/{lib/src/main/java/icon/proto/clients/tendermint => proto-lib/src/main/java/tendermint/types}/PartSetHeader.java (97%) create mode 100644 contracts/javascore/proto-lib/src/main/java/tendermint/types/Proposal.java rename contracts/javascore/{lib/src/main/java/icon/proto/clients/tendermint => proto-lib/src/main/java/tendermint/types}/SignedHeader.java (84%) rename contracts/javascore/{lib/src/main/java/icon/proto/icon/types/v1 => proto-lib/src/main/java/tendermint/types}/SignedMsgType.java (88%) rename contracts/javascore/{lib/src/main/java/icon/proto/clients/tendermint => proto-lib/src/main/java/tendermint/types}/SimpleValidator.java (87%) create mode 100644 contracts/javascore/proto-lib/src/main/java/tendermint/types/TxProof.java rename contracts/javascore/{lib/src/main/java/icon/proto/clients/tendermint => proto-lib/src/main/java/tendermint/types}/Validator.java (91%) create mode 100644 contracts/javascore/proto-lib/src/main/java/tendermint/types/ValidatorParams.java rename contracts/javascore/{lib/src/main/java/icon/proto/clients/tendermint => proto-lib/src/main/java/tendermint/types}/ValidatorSet.java (98%) create mode 100644 contracts/javascore/proto-lib/src/main/java/tendermint/types/VersionParams.java rename contracts/javascore/{lib/src/main/java/icon/proto/clients/tendermint => proto-lib/src/main/java/tendermint/types}/Vote.java (76%) create mode 100644 contracts/javascore/proto-lib/src/main/java/tendermint/version/App.java rename contracts/javascore/{lib/src/main/java/icon/proto/clients/tendermint => proto-lib/src/main/java/tendermint/version}/Consensus.java (97%) delete mode 100644 proto/clients/tendermint/TendermintLight.proto delete mode 100644 proto/core/23-commitment/commitment.proto delete mode 100644 proto/core/23-commitment/proofs.proto create mode 100755 scripts/generate_java_proto.sh diff --git a/contracts/javascore/ibc/build.gradle b/contracts/javascore/ibc/build.gradle index 544ae3543..b5b783cad 100644 --- a/contracts/javascore/ibc/build.gradle +++ b/contracts/javascore/ibc/build.gradle @@ -5,6 +5,7 @@ dependencies { implementation("foundation.icon:javaee-scorex:$scorexVersion") implementation project(':lib') implementation project(':score-util') + implementation project(':proto-lib') testImplementation 'com.google.protobuf:protobuf-javalite:3.16.3' testImplementation 'foundation.icon:javaee-rt:0.9.3' @@ -45,6 +46,7 @@ jacocoTestReport { tasks.named('compileJava') { dependsOn(':score-util:jar') dependsOn(':lib:jar') + dependsOn(':proto-lib:jar') } optimizedJar { diff --git a/contracts/javascore/ibc/src/intTest/java/ibc/core/integration/IBCIntegrationTest.java b/contracts/javascore/ibc/src/intTest/java/ibc/core/integration/IBCIntegrationTest.java index 10c2d68ab..40836db6c 100644 --- a/contracts/javascore/ibc/src/intTest/java/ibc/core/integration/IBCIntegrationTest.java +++ b/contracts/javascore/ibc/src/intTest/java/ibc/core/integration/IBCIntegrationTest.java @@ -12,26 +12,26 @@ import java.util.Map; import java.util.function.Consumer; -import ibc.icon.structs.messages.*; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Test; -import foundation.icon.jsonrpc.model.TransactionResult; -import foundation.icon.score.client.DefaultScoreClient; -import foundation.icon.score.client.Wallet; -import ibc.icon.integration.ScoreIntegrationTest; -import ibc.icon.interfaces.IIBCChannelHandshakeScoreClient; -import ibc.icon.interfaces.IIBCClientScoreClient; -import ibc.icon.interfaces.IIBCConnectionScoreClient; -import ibc.icon.interfaces.IIBCHandlerScoreClient; -import ibc.icon.interfaces.IIBCHostScoreClient; -import ibc.icon.interfaces.IIBCPacketScoreClient; import icon.proto.core.channel.Channel; import icon.proto.core.channel.Packet; import icon.proto.core.client.Height; -import icon.proto.core.connection.MerklePrefix; +import ibc.core.commitment.v1.MerklePrefix; import icon.proto.core.connection.Version; +import foundation.icon.jsonrpc.model.TransactionResult; +import foundation.icon.score.client.DefaultScoreClient; +import foundation.icon.score.client.Wallet; +import ibc.icon.integration.ScoreIntegrationTest; +import icon.ibc.interfaces.IIBCChannelHandshakeScoreClient; +import icon.ibc.interfaces.IIBCClientScoreClient; +import icon.ibc.interfaces.IIBCConnectionScoreClient; +import icon.ibc.interfaces.IIBCHandlerScoreClient; +import icon.ibc.interfaces.IIBCHostScoreClient; +import icon.ibc.interfaces.IIBCPacketScoreClient; +import icon.ibc.structs.messages.*; import score.Address; public class IBCIntegrationTest implements ScoreIntegrationTest { diff --git a/contracts/javascore/ibc/src/main/java/ibc/ics02/client/IBCClient.java b/contracts/javascore/ibc/src/main/java/ibc/ics02/client/IBCClient.java index 566ba26f2..f014a5c96 100644 --- a/contracts/javascore/ibc/src/main/java/ibc/ics02/client/IBCClient.java +++ b/contracts/javascore/ibc/src/main/java/ibc/ics02/client/IBCClient.java @@ -1,11 +1,11 @@ package ibc.ics02.client; -import ibc.icon.interfaces.ILightClient; import ibc.icon.score.util.Logger; import ibc.icon.score.util.NullChecker; -import ibc.icon.structs.messages.MsgCreateClient; -import ibc.icon.structs.messages.MsgUpdateClient; import ibc.ics24.host.IBCHost; +import icon.ibc.interfaces.ILightClient; +import icon.ibc.structs.messages.MsgCreateClient; +import icon.ibc.structs.messages.MsgUpdateClient; import score.Address; import score.Context; diff --git a/contracts/javascore/ibc/src/main/java/ibc/ics03/connection/IBCConnection.java b/contracts/javascore/ibc/src/main/java/ibc/ics03/connection/IBCConnection.java index 681509f62..147917c5e 100644 --- a/contracts/javascore/ibc/src/main/java/ibc/ics03/connection/IBCConnection.java +++ b/contracts/javascore/ibc/src/main/java/ibc/ics03/connection/IBCConnection.java @@ -4,19 +4,19 @@ import java.util.Arrays; import java.util.List; -import ibc.icon.interfaces.ILightClient; -import ibc.icon.score.util.ByteUtil; -import ibc.icon.score.util.Logger; -import ibc.icon.structs.messages.MsgConnectionOpenAck; -import ibc.icon.structs.messages.MsgConnectionOpenConfirm; -import ibc.icon.structs.messages.MsgConnectionOpenInit; -import ibc.icon.structs.messages.MsgConnectionOpenTry; -import ibc.ics02.client.IBCClient; -import ibc.ics24.host.IBCCommitment; import icon.proto.core.client.Height; import icon.proto.core.connection.ConnectionEnd; import icon.proto.core.connection.Counterparty; import icon.proto.core.connection.Version; +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Logger; +import ibc.ics02.client.IBCClient; +import ibc.ics24.host.IBCCommitment; +import icon.ibc.interfaces.ILightClient; +import icon.ibc.structs.messages.MsgConnectionOpenAck; +import icon.ibc.structs.messages.MsgConnectionOpenConfirm; +import icon.ibc.structs.messages.MsgConnectionOpenInit; +import icon.ibc.structs.messages.MsgConnectionOpenTry; import score.Context; import scorex.util.ArrayList; diff --git a/contracts/javascore/ibc/src/main/java/ibc/ics04/channel/IBCChannelHandshake.java b/contracts/javascore/ibc/src/main/java/ibc/ics04/channel/IBCChannelHandshake.java index 60290fab7..1da07d823 100644 --- a/contracts/javascore/ibc/src/main/java/ibc/ics04/channel/IBCChannelHandshake.java +++ b/contracts/javascore/ibc/src/main/java/ibc/ics04/channel/IBCChannelHandshake.java @@ -3,16 +3,16 @@ import java.math.BigInteger; import java.util.List; -import ibc.icon.interfaces.ILightClient; -import ibc.icon.score.util.ByteUtil; -import ibc.icon.structs.messages.MsgChannelCloseConfirm; -import ibc.icon.structs.messages.MsgChannelCloseInit; -import ibc.icon.structs.messages.MsgChannelOpenAck; -import ibc.icon.structs.messages.MsgChannelOpenConfirm; -import ibc.icon.structs.messages.MsgChannelOpenInit; -import ibc.icon.structs.messages.MsgChannelOpenTry; import icon.proto.core.channel.Channel; import icon.proto.core.connection.ConnectionEnd; +import ibc.icon.score.util.ByteUtil; +import icon.ibc.interfaces.ILightClient; +import icon.ibc.structs.messages.MsgChannelCloseConfirm; +import icon.ibc.structs.messages.MsgChannelCloseInit; +import icon.ibc.structs.messages.MsgChannelOpenAck; +import icon.ibc.structs.messages.MsgChannelOpenConfirm; +import icon.ibc.structs.messages.MsgChannelOpenInit; +import icon.ibc.structs.messages.MsgChannelOpenTry; import ibc.ics03.connection.IBCConnection; import ibc.ics24.host.IBCCommitment; import score.Context; diff --git a/contracts/javascore/ibc/src/main/java/ibc/ics04/channel/IBCPacket.java b/contracts/javascore/ibc/src/main/java/ibc/ics04/channel/IBCPacket.java index 548588506..4cca5cedb 100644 --- a/contracts/javascore/ibc/src/main/java/ibc/ics04/channel/IBCPacket.java +++ b/contracts/javascore/ibc/src/main/java/ibc/ics04/channel/IBCPacket.java @@ -1,20 +1,21 @@ package ibc.ics04.channel; -import ibc.icon.interfaces.ILightClient; import ibc.icon.score.util.ByteUtil; import ibc.icon.score.util.Proto; -import ibc.icon.structs.messages.MsgRequestTimeoutPacket; import ibc.ics24.host.IBCCommitment; -import icon.proto.core.channel.Channel; -import icon.proto.core.channel.Packet; -import icon.proto.core.client.Height; -import icon.proto.core.connection.ConnectionEnd; +import icon.ibc.interfaces.ILightClient; +import icon.ibc.structs.messages.MsgRequestTimeoutPacket; import score.Context; import score.DictDB; import java.math.BigInteger; import java.util.Arrays; +import icon.proto.core.channel.Channel; +import icon.proto.core.channel.Packet; +import icon.proto.core.client.Height; +import icon.proto.core.connection.ConnectionEnd; + public class IBCPacket extends IBCChannelHandshake { public void _sendPacket(Packet packet) { diff --git a/contracts/javascore/ibc/src/main/java/ibc/ics05/port/ModuleManager.java b/contracts/javascore/ibc/src/main/java/ibc/ics05/port/ModuleManager.java index f58a48baf..411e39d38 100644 --- a/contracts/javascore/ibc/src/main/java/ibc/ics05/port/ModuleManager.java +++ b/contracts/javascore/ibc/src/main/java/ibc/ics05/port/ModuleManager.java @@ -1,7 +1,7 @@ package ibc.ics05.port; -import ibc.icon.interfaces.IIBCModuleScoreInterface; import ibc.icon.score.util.StringUtil; +import icon.ibc.interfaces.IIBCModuleScoreInterface; import score.Address; /** diff --git a/contracts/javascore/ibc/src/main/java/ibc/ics23/commitment/Compress.java b/contracts/javascore/ibc/src/main/java/ibc/ics23/commitment/Compress.java index e93497da7..4fa907104 100644 --- a/contracts/javascore/ibc/src/main/java/ibc/ics23/commitment/Compress.java +++ b/contracts/javascore/ibc/src/main/java/ibc/ics23/commitment/Compress.java @@ -1,6 +1,6 @@ package ibc.ics23.commitment; -import icon.proto.core.commitment.*; +import cosmos.ics23.v1.*; import score.Context; import scorex.util.ArrayList; import scorex.util.HashMap; diff --git a/contracts/javascore/ibc/src/main/java/ibc/ics23/commitment/Ics23.java b/contracts/javascore/ibc/src/main/java/ibc/ics23/commitment/Ics23.java index adbb13a50..53e125aa2 100644 --- a/contracts/javascore/ibc/src/main/java/ibc/ics23/commitment/Ics23.java +++ b/contracts/javascore/ibc/src/main/java/ibc/ics23/commitment/Ics23.java @@ -1,6 +1,6 @@ package ibc.ics23.commitment; -import icon.proto.core.commitment.*; +import cosmos.ics23.v1.*; import score.UserRevertedException; import scorex.util.ArrayList; diff --git a/contracts/javascore/ibc/src/main/java/ibc/ics23/commitment/Ops.java b/contracts/javascore/ibc/src/main/java/ibc/ics23/commitment/Ops.java index ec000d5e8..f42db65cc 100644 --- a/contracts/javascore/ibc/src/main/java/ibc/ics23/commitment/Ops.java +++ b/contracts/javascore/ibc/src/main/java/ibc/ics23/commitment/Ops.java @@ -2,7 +2,7 @@ import ibc.icon.score.util.ByteUtil; import ibc.icon.score.util.Proto; -import icon.proto.core.commitment.*; +import cosmos.ics23.v1.*; import score.Context; import score.UserRevertedException; @@ -42,7 +42,7 @@ public static byte[] doHashOrNoop(int hashOp, byte[] preImage) { public static byte[] doHash(int hashOp, byte[] preImage) { if (hashOp == HashOp.SHA256) { return Context.hash("sha-256", preImage); - } else if (hashOp == HashOp.KECCAK) { + } else if (hashOp == HashOp.KECCAK256) { return Context.hash("keccak-256", preImage); } else if (hashOp == HashOp.RIPEMD160) { throw new UserRevertedException("RIPEMD160 hash not supported"); diff --git a/contracts/javascore/ibc/src/main/java/ibc/ics23/commitment/Proof.java b/contracts/javascore/ibc/src/main/java/ibc/ics23/commitment/Proof.java index d6cec969c..f91fc2d91 100644 --- a/contracts/javascore/ibc/src/main/java/ibc/ics23/commitment/Proof.java +++ b/contracts/javascore/ibc/src/main/java/ibc/ics23/commitment/Proof.java @@ -1,6 +1,6 @@ package ibc.ics23.commitment; -import icon.proto.core.commitment.*; +import cosmos.ics23.v1.*; import score.UserRevertedException; import java.math.BigInteger; diff --git a/contracts/javascore/ibc/src/main/java/ibc/ics23/commitment/types/Merkle.java b/contracts/javascore/ibc/src/main/java/ibc/ics23/commitment/types/Merkle.java index 6b3308c34..802ba75af 100644 --- a/contracts/javascore/ibc/src/main/java/ibc/ics23/commitment/types/Merkle.java +++ b/contracts/javascore/ibc/src/main/java/ibc/ics23/commitment/types/Merkle.java @@ -3,8 +3,8 @@ import ibc.icon.score.util.StringUtil; import ibc.ics23.commitment.Ics23; import ibc.ics23.commitment.Proof; -import icon.proto.clients.tendermint.MerkleRoot; -import icon.proto.core.commitment.*; +import cosmos.ics23.v1.*; +import ibc.core.commitment.v1.*; import score.UserRevertedException; import scorex.util.ArrayList; diff --git a/contracts/javascore/ibc/src/main/java/ibc/ics24/host/IBCStore.java b/contracts/javascore/ibc/src/main/java/ibc/ics24/host/IBCStore.java index ba067e754..d641338ff 100644 --- a/contracts/javascore/ibc/src/main/java/ibc/ics24/host/IBCStore.java +++ b/contracts/javascore/ibc/src/main/java/ibc/ics24/host/IBCStore.java @@ -1,10 +1,10 @@ package ibc.ics24.host; -import ibc.icon.interfaces.IIBCHost; -import ibc.icon.interfaces.ILightClient; -import ibc.icon.interfaces.ILightClientScoreInterface; import ibc.icon.score.util.NullChecker; import ibc.ics05.port.ModuleManager; +import icon.ibc.interfaces.IIBCHost; +import icon.ibc.interfaces.ILightClient; +import icon.ibc.interfaces.ILightClientScoreInterface; import score.*; import score.annotation.External; import scorex.util.ArrayList; diff --git a/contracts/javascore/ibc/src/main/java/ibc/ics25/handler/IBCHandler.java b/contracts/javascore/ibc/src/main/java/ibc/ics25/handler/IBCHandler.java index 62095082f..0036e25c6 100644 --- a/contracts/javascore/ibc/src/main/java/ibc/ics25/handler/IBCHandler.java +++ b/contracts/javascore/ibc/src/main/java/ibc/ics25/handler/IBCHandler.java @@ -6,7 +6,7 @@ import java.math.BigInteger; -import ibc.icon.structs.messages.MsgCreateClient; +import icon.ibc.structs.messages.MsgCreateClient; public class IBCHandler extends IBCHandlerPacket { diff --git a/contracts/javascore/ibc/src/main/java/ibc/ics25/handler/IBCHandlerChannel.java b/contracts/javascore/ibc/src/main/java/ibc/ics25/handler/IBCHandlerChannel.java index 060233e43..f93035e5e 100644 --- a/contracts/javascore/ibc/src/main/java/ibc/ics25/handler/IBCHandlerChannel.java +++ b/contracts/javascore/ibc/src/main/java/ibc/ics25/handler/IBCHandlerChannel.java @@ -2,10 +2,10 @@ import java.util.List; -import ibc.icon.interfaces.IIBCChannelHandshake; -import ibc.icon.interfaces.IIBCModuleScoreInterface; -import ibc.icon.structs.messages.*; import icon.proto.core.channel.Channel; +import icon.ibc.interfaces.IIBCChannelHandshake; +import icon.ibc.interfaces.IIBCModuleScoreInterface; +import icon.ibc.structs.messages.*; import score.annotation.EventLog; import score.annotation.External; diff --git a/contracts/javascore/ibc/src/main/java/ibc/ics25/handler/IBCHandlerClient.java b/contracts/javascore/ibc/src/main/java/ibc/ics25/handler/IBCHandlerClient.java index f4d2a6b68..7e529f629 100644 --- a/contracts/javascore/ibc/src/main/java/ibc/ics25/handler/IBCHandlerClient.java +++ b/contracts/javascore/ibc/src/main/java/ibc/ics25/handler/IBCHandlerClient.java @@ -1,9 +1,9 @@ package ibc.ics25.handler; -import ibc.icon.interfaces.IIBCClient; -import ibc.icon.structs.messages.MsgCreateClient; -import ibc.icon.structs.messages.MsgUpdateClient; import ibc.ics04.channel.IBCPacket; +import icon.ibc.interfaces.IIBCClient; +import icon.ibc.structs.messages.MsgCreateClient; +import icon.ibc.structs.messages.MsgUpdateClient; import score.annotation.EventLog; import score.annotation.External; diff --git a/contracts/javascore/ibc/src/main/java/ibc/ics25/handler/IBCHandlerConnection.java b/contracts/javascore/ibc/src/main/java/ibc/ics25/handler/IBCHandlerConnection.java index 9ace8b9c6..0bb209dbf 100644 --- a/contracts/javascore/ibc/src/main/java/ibc/ics25/handler/IBCHandlerConnection.java +++ b/contracts/javascore/ibc/src/main/java/ibc/ics25/handler/IBCHandlerConnection.java @@ -1,10 +1,10 @@ package ibc.ics25.handler; -import ibc.icon.interfaces.IIBCConnection; -import ibc.icon.structs.messages.MsgConnectionOpenAck; -import ibc.icon.structs.messages.MsgConnectionOpenConfirm; -import ibc.icon.structs.messages.MsgConnectionOpenInit; -import ibc.icon.structs.messages.MsgConnectionOpenTry; +import icon.ibc.interfaces.IIBCConnection; +import icon.ibc.structs.messages.MsgConnectionOpenAck; +import icon.ibc.structs.messages.MsgConnectionOpenConfirm; +import icon.ibc.structs.messages.MsgConnectionOpenInit; +import icon.ibc.structs.messages.MsgConnectionOpenTry; import score.annotation.EventLog; import score.annotation.External; diff --git a/contracts/javascore/ibc/src/main/java/ibc/ics25/handler/IBCHandlerPacket.java b/contracts/javascore/ibc/src/main/java/ibc/ics25/handler/IBCHandlerPacket.java index 42255d045..d58892ea0 100644 --- a/contracts/javascore/ibc/src/main/java/ibc/ics25/handler/IBCHandlerPacket.java +++ b/contracts/javascore/ibc/src/main/java/ibc/ics25/handler/IBCHandlerPacket.java @@ -2,13 +2,13 @@ import java.math.BigInteger; -import ibc.icon.interfaces.IIBCModule; -import ibc.icon.interfaces.IIBCPacket; -import ibc.icon.structs.messages.MsgPacketAcknowledgement; -import ibc.icon.structs.messages.MsgPacketRecv; -import ibc.icon.structs.messages.MsgPacketTimeout; -import ibc.icon.structs.messages.MsgRequestTimeoutPacket; import icon.proto.core.channel.Packet; +import icon.ibc.interfaces.IIBCModule; +import icon.ibc.interfaces.IIBCPacket; +import icon.ibc.structs.messages.MsgPacketAcknowledgement; +import icon.ibc.structs.messages.MsgPacketRecv; +import icon.ibc.structs.messages.MsgPacketTimeout; +import icon.ibc.structs.messages.MsgRequestTimeoutPacket; import score.Context; import score.annotation.EventLog; import score.annotation.External; diff --git a/contracts/javascore/ibc/src/test/java/ibc/ics02/client/ClientTest.java b/contracts/javascore/ibc/src/test/java/ibc/ics02/client/ClientTest.java index 7a99947b9..5bd18f389 100644 --- a/contracts/javascore/ibc/src/test/java/ibc/ics02/client/ClientTest.java +++ b/contracts/javascore/ibc/src/test/java/ibc/ics02/client/ClientTest.java @@ -4,11 +4,13 @@ import com.iconloop.score.test.Score; import com.iconloop.score.test.ServiceManager; import com.iconloop.score.test.TestBase; -import ibc.icon.interfaces.ILightClient; -import ibc.icon.interfaces.ILightClientScoreInterface; -import ibc.icon.structs.messages.MsgCreateClient; -import ibc.icon.structs.messages.MsgUpdateClient; + import ibc.icon.test.MockContract; +import icon.ibc.interfaces.ILightClient; +import icon.ibc.interfaces.ILightClientScoreInterface; +import icon.ibc.structs.messages.MsgCreateClient; +import icon.ibc.structs.messages.MsgUpdateClient; + import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.function.Executable; diff --git a/contracts/javascore/ibc/src/test/java/ibc/ics03/connection/ConnectionTest.java b/contracts/javascore/ibc/src/test/java/ibc/ics03/connection/ConnectionTest.java index bbad02fc2..68ae75048 100644 --- a/contracts/javascore/ibc/src/test/java/ibc/ics03/connection/ConnectionTest.java +++ b/contracts/javascore/ibc/src/test/java/ibc/ics03/connection/ConnectionTest.java @@ -23,15 +23,15 @@ import com.iconloop.score.test.ServiceManager; import com.iconloop.score.test.TestBase; -import ibc.icon.interfaces.ILightClient; -import ibc.icon.interfaces.ILightClientScoreInterface; import ibc.icon.score.util.ByteUtil; -import ibc.icon.structs.messages.MsgConnectionOpenAck; -import ibc.icon.structs.messages.MsgConnectionOpenConfirm; -import ibc.icon.structs.messages.MsgConnectionOpenInit; -import ibc.icon.structs.messages.MsgConnectionOpenTry; import ibc.icon.test.MockContract; import ibc.ics24.host.IBCCommitment; +import icon.ibc.interfaces.ILightClient; +import icon.ibc.interfaces.ILightClientScoreInterface; +import icon.ibc.structs.messages.MsgConnectionOpenAck; +import icon.ibc.structs.messages.MsgConnectionOpenConfirm; +import icon.ibc.structs.messages.MsgConnectionOpenInit; +import icon.ibc.structs.messages.MsgConnectionOpenTry; import score.Address; import test.proto.core.client.Client.Height; import test.proto.core.connection.Connection.ConnectionEnd; diff --git a/contracts/javascore/ibc/src/test/java/ibc/ics04/channel/ChannelHandshakeTest.java b/contracts/javascore/ibc/src/test/java/ibc/ics04/channel/ChannelHandshakeTest.java index d3bf6632b..665967485 100644 --- a/contracts/javascore/ibc/src/test/java/ibc/ics04/channel/ChannelHandshakeTest.java +++ b/contracts/javascore/ibc/src/test/java/ibc/ics04/channel/ChannelHandshakeTest.java @@ -22,18 +22,18 @@ import com.iconloop.score.test.ServiceManager; import com.iconloop.score.test.TestBase; -import ibc.icon.interfaces.ILightClient; -import ibc.icon.interfaces.ILightClientScoreInterface; import ibc.icon.score.util.ByteUtil; -import ibc.icon.structs.messages.MsgChannelCloseConfirm; -import ibc.icon.structs.messages.MsgChannelCloseInit; -import ibc.icon.structs.messages.MsgChannelOpenAck; -import ibc.icon.structs.messages.MsgChannelOpenConfirm; -import ibc.icon.structs.messages.MsgChannelOpenInit; -import ibc.icon.structs.messages.MsgChannelOpenTry; import ibc.icon.test.MockContract; import ibc.ics03.connection.IBCConnection; import ibc.ics24.host.IBCCommitment; +import icon.ibc.interfaces.ILightClient; +import icon.ibc.interfaces.ILightClientScoreInterface; +import icon.ibc.structs.messages.MsgChannelCloseConfirm; +import icon.ibc.structs.messages.MsgChannelCloseInit; +import icon.ibc.structs.messages.MsgChannelOpenAck; +import icon.ibc.structs.messages.MsgChannelOpenConfirm; +import icon.ibc.structs.messages.MsgChannelOpenInit; +import icon.ibc.structs.messages.MsgChannelOpenTry; import score.Address; import test.proto.core.channel.ChannelOuterClass.Channel; import test.proto.core.channel.ChannelOuterClass.Channel.Counterparty; diff --git a/contracts/javascore/ibc/src/test/java/ibc/ics04/channel/PacketTest.java b/contracts/javascore/ibc/src/test/java/ibc/ics04/channel/PacketTest.java index abf929dd1..d1715036f 100644 --- a/contracts/javascore/ibc/src/test/java/ibc/ics04/channel/PacketTest.java +++ b/contracts/javascore/ibc/src/test/java/ibc/ics04/channel/PacketTest.java @@ -18,7 +18,7 @@ import java.util.Map; import ibc.icon.score.util.Proto; -import ibc.icon.structs.messages.MsgRequestTimeoutPacket; + import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.function.Executable; @@ -28,19 +28,20 @@ import com.iconloop.score.test.ServiceManager; import com.iconloop.score.test.TestBase; -import ibc.icon.interfaces.ILightClient; -import ibc.icon.interfaces.ILightClientScoreInterface; -import ibc.icon.score.util.ByteUtil; -import ibc.icon.test.MockContract; -import ibc.ics03.connection.IBCConnection; -import ibc.ics24.host.IBCCommitment; import icon.proto.core.channel.Channel; import icon.proto.core.channel.Packet; import icon.proto.core.client.Height; import icon.proto.core.connection.ConnectionEnd; import icon.proto.core.connection.Counterparty; -import icon.proto.core.connection.MerklePrefix; +import ibc.core.commitment.v1.MerklePrefix; import icon.proto.core.connection.Version; +import ibc.icon.score.util.ByteUtil; +import ibc.icon.test.MockContract; +import ibc.ics03.connection.IBCConnection; +import ibc.ics24.host.IBCCommitment; +import icon.ibc.interfaces.ILightClient; +import icon.ibc.interfaces.ILightClientScoreInterface; +import icon.ibc.structs.messages.MsgRequestTimeoutPacket; import score.Address; public class PacketTest extends TestBase { diff --git a/contracts/javascore/ibc/src/test/java/ibc/ics23/commitment/Ics23Test.java b/contracts/javascore/ibc/src/test/java/ibc/ics23/commitment/Ics23Test.java index 4f8c004c6..09cb89405 100644 --- a/contracts/javascore/ibc/src/test/java/ibc/ics23/commitment/Ics23Test.java +++ b/contracts/javascore/ibc/src/test/java/ibc/ics23/commitment/Ics23Test.java @@ -1,6 +1,6 @@ package ibc.ics23.commitment; -import icon.proto.core.commitment.CommitmentProof; +import cosmos.ics23.v1.*; import org.junit.jupiter.api.Test; import java.io.IOException; diff --git a/contracts/javascore/ibc/src/test/java/ibc/ics23/commitment/LoadOpsTestData.java b/contracts/javascore/ibc/src/test/java/ibc/ics23/commitment/LoadOpsTestData.java index 99cd8e131..b5ed886ee 100644 --- a/contracts/javascore/ibc/src/test/java/ibc/ics23/commitment/LoadOpsTestData.java +++ b/contracts/javascore/ibc/src/test/java/ibc/ics23/commitment/LoadOpsTestData.java @@ -2,8 +2,7 @@ import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; -import icon.proto.core.commitment.InnerOp; -import icon.proto.core.commitment.LeafOp; +import cosmos.ics23.v1.*; import java.io.IOException; import java.io.InputStream; diff --git a/contracts/javascore/ibc/src/test/java/ibc/ics23/commitment/LoadProofTestData.java b/contracts/javascore/ibc/src/test/java/ibc/ics23/commitment/LoadProofTestData.java index 9fd43bcd9..e7d25d94b 100644 --- a/contracts/javascore/ibc/src/test/java/ibc/ics23/commitment/LoadProofTestData.java +++ b/contracts/javascore/ibc/src/test/java/ibc/ics23/commitment/LoadProofTestData.java @@ -3,7 +3,7 @@ import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; import ibc.icon.score.util.ByteUtil; -import icon.proto.core.commitment.*; +import cosmos.ics23.v1.*; import java.io.IOException; import java.io.InputStream; diff --git a/contracts/javascore/ibc/src/test/java/ibc/ics23/commitment/LoadVectorTestData.java b/contracts/javascore/ibc/src/test/java/ibc/ics23/commitment/LoadVectorTestData.java index 82d90b244..2e85dbe85 100644 --- a/contracts/javascore/ibc/src/test/java/ibc/ics23/commitment/LoadVectorTestData.java +++ b/contracts/javascore/ibc/src/test/java/ibc/ics23/commitment/LoadVectorTestData.java @@ -2,8 +2,7 @@ import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; -import icon.proto.core.commitment.CommitmentProof; -import icon.proto.core.commitment.ProofSpec; +import cosmos.ics23.v1.*; import java.io.IOException; import java.io.InputStream; diff --git a/contracts/javascore/ibc/src/test/java/ibc/ics23/commitment/ProofTest.java b/contracts/javascore/ibc/src/test/java/ibc/ics23/commitment/ProofTest.java index 4616fa098..0ecc870d0 100644 --- a/contracts/javascore/ibc/src/test/java/ibc/ics23/commitment/ProofTest.java +++ b/contracts/javascore/ibc/src/test/java/ibc/ics23/commitment/ProofTest.java @@ -1,6 +1,6 @@ package ibc.ics23.commitment; -import icon.proto.core.commitment.ProofSpec; +import cosmos.ics23.v1.*; import org.junit.jupiter.api.Test; import java.io.IOException; diff --git a/contracts/javascore/ibc/src/test/java/ibc/ics23/commitment/types/MerkleTest.java b/contracts/javascore/ibc/src/test/java/ibc/ics23/commitment/types/MerkleTest.java index 635dfa11a..e957299ee 100644 --- a/contracts/javascore/ibc/src/test/java/ibc/ics23/commitment/types/MerkleTest.java +++ b/contracts/javascore/ibc/src/test/java/ibc/ics23/commitment/types/MerkleTest.java @@ -2,9 +2,7 @@ import ibc.icon.score.util.ByteUtil; import ibc.icon.score.util.StringUtil; -import icon.proto.clients.tendermint.MerkleRoot; -import icon.proto.core.commitment.MerklePath; -import icon.proto.core.commitment.MerkleProof; +import ibc.core.commitment.v1.*; import score.Context; import org.junit.jupiter.api.Test; diff --git a/contracts/javascore/ibc/src/test/java/ibc/ics25/handler/IBCHandlerTest.java b/contracts/javascore/ibc/src/test/java/ibc/ics25/handler/IBCHandlerTest.java index 71bf7524e..b14c93804 100644 --- a/contracts/javascore/ibc/src/test/java/ibc/ics25/handler/IBCHandlerTest.java +++ b/contracts/javascore/ibc/src/test/java/ibc/ics25/handler/IBCHandlerTest.java @@ -1,7 +1,9 @@ package ibc.ics25.handler; import com.iconloop.score.test.Account; -import ibc.icon.structs.messages.*; + +import icon.ibc.structs.messages.*; + import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.function.Executable; @@ -101,14 +103,14 @@ void sendAndAckPacket() throws Exception { acknowledgePacket(); } - @Test + @Test @SuppressWarnings("unchecked") void ackResponse_checkAckHeightSaved() throws Exception{ establishCommunication(); receivePacket(); - Map ackHeights = (Map) handler.call("getAckHeights", portId, channelId, 0,10); + Map ackHeights = (Map) handler.call("getAckHeights", portId, channelId, 0,10); assertEquals( ackHeights.keySet().size(), 0); diff --git a/contracts/javascore/ibc/src/test/java/ibc/ics25/handler/IBCHandlerTestBase.java b/contracts/javascore/ibc/src/test/java/ibc/ics25/handler/IBCHandlerTestBase.java index c4a5ec11a..83bf08808 100644 --- a/contracts/javascore/ibc/src/test/java/ibc/ics25/handler/IBCHandlerTestBase.java +++ b/contracts/javascore/ibc/src/test/java/ibc/ics25/handler/IBCHandlerTestBase.java @@ -21,13 +21,13 @@ import com.iconloop.score.test.ServiceManager; import com.iconloop.score.test.TestBase; -import ibc.icon.interfaces.ILightClient; -import ibc.icon.interfaces.IIBCModule; -import ibc.icon.interfaces.IIBCModuleScoreInterface; -import ibc.icon.interfaces.ILightClientScoreInterface; -import ibc.icon.structs.messages.*; import ibc.icon.test.MockContract; import ibc.ics03.connection.IBCConnection; +import icon.ibc.interfaces.IIBCModule; +import icon.ibc.interfaces.IIBCModuleScoreInterface; +import icon.ibc.interfaces.ILightClient; +import icon.ibc.interfaces.ILightClientScoreInterface; +import icon.ibc.structs.messages.*; import test.proto.core.channel.ChannelOuterClass.Channel; import test.proto.core.channel.ChannelOuterClass.Packet; import test.proto.core.client.Client.Height; diff --git a/contracts/javascore/lib/build.gradle b/contracts/javascore/lib/build.gradle index dab4546d2..e012a4829 100644 --- a/contracts/javascore/lib/build.gradle +++ b/contracts/javascore/lib/build.gradle @@ -14,13 +14,5 @@ dependencies { annotationProcessor("foundation.icon:javaee-score-client:$scoreClientVersion") compileOnly("com.fasterxml.jackson.core:jackson-databind:$jacksonVersion") compileOnly("foundation.icon:icon-sdk:$iconsdkVersion") - -// testImplementation("org.junit.jupiter:junit-jupiter-api:$jupiterApiVersion") -// testImplementation("org.junit.jupiter:junit-jupiter-params:$jupiterParamsVersion") -// testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:$jupiterEngineVersion") -// testImplementation("foundation.icon:javaee-unittest:$javaeeUnittestVersion") } -//test { -// useJUnitPlatform() -//} diff --git a/contracts/javascore/lib/src/main/java/ibc/icon/enums/clientstate/Status.java b/contracts/javascore/lib/src/main/java/icon/ibc/enums/clientstate/Status.java similarity index 66% rename from contracts/javascore/lib/src/main/java/ibc/icon/enums/clientstate/Status.java rename to contracts/javascore/lib/src/main/java/icon/ibc/enums/clientstate/Status.java index b1bf4548e..0af2f3d06 100644 --- a/contracts/javascore/lib/src/main/java/ibc/icon/enums/clientstate/Status.java +++ b/contracts/javascore/lib/src/main/java/icon/ibc/enums/clientstate/Status.java @@ -1,4 +1,4 @@ -package ibc.icon.enums.clientstate; +package icon.ibc.enums.clientstate; public enum Status { Active, diff --git a/contracts/javascore/lib/src/main/java/ibc/icon/interfaces/IIBCChannelHandshake.java b/contracts/javascore/lib/src/main/java/icon/ibc/interfaces/IIBCChannelHandshake.java similarity index 97% rename from contracts/javascore/lib/src/main/java/ibc/icon/interfaces/IIBCChannelHandshake.java rename to contracts/javascore/lib/src/main/java/icon/ibc/interfaces/IIBCChannelHandshake.java index d16a930f3..f9aa601c3 100644 --- a/contracts/javascore/lib/src/main/java/ibc/icon/interfaces/IIBCChannelHandshake.java +++ b/contracts/javascore/lib/src/main/java/icon/ibc/interfaces/IIBCChannelHandshake.java @@ -1,7 +1,7 @@ -package ibc.icon.interfaces; +package icon.ibc.interfaces; import foundation.icon.score.client.ScoreClient; -import ibc.icon.structs.messages.*; +import icon.ibc.structs.messages.*; import score.annotation.EventLog; @ScoreClient diff --git a/contracts/javascore/lib/src/main/java/ibc/icon/interfaces/IIBCClient.java b/contracts/javascore/lib/src/main/java/icon/ibc/interfaces/IIBCClient.java similarity index 88% rename from contracts/javascore/lib/src/main/java/ibc/icon/interfaces/IIBCClient.java rename to contracts/javascore/lib/src/main/java/icon/ibc/interfaces/IIBCClient.java index 354190bb1..a9bebbd3a 100644 --- a/contracts/javascore/lib/src/main/java/ibc/icon/interfaces/IIBCClient.java +++ b/contracts/javascore/lib/src/main/java/icon/ibc/interfaces/IIBCClient.java @@ -1,8 +1,8 @@ -package ibc.icon.interfaces; +package icon.ibc.interfaces; import foundation.icon.score.client.ScoreClient; -import ibc.icon.structs.messages.MsgCreateClient; -import ibc.icon.structs.messages.MsgUpdateClient; +import icon.ibc.structs.messages.MsgCreateClient; +import icon.ibc.structs.messages.MsgUpdateClient; import score.Address; import score.annotation.EventLog; diff --git a/contracts/javascore/lib/src/main/java/ibc/icon/interfaces/IIBCConnection.java b/contracts/javascore/lib/src/main/java/icon/ibc/interfaces/IIBCConnection.java similarity index 76% rename from contracts/javascore/lib/src/main/java/ibc/icon/interfaces/IIBCConnection.java rename to contracts/javascore/lib/src/main/java/icon/ibc/interfaces/IIBCConnection.java index 42167352f..10e724baf 100644 --- a/contracts/javascore/lib/src/main/java/ibc/icon/interfaces/IIBCConnection.java +++ b/contracts/javascore/lib/src/main/java/icon/ibc/interfaces/IIBCConnection.java @@ -1,10 +1,10 @@ -package ibc.icon.interfaces; +package icon.ibc.interfaces; import foundation.icon.score.client.ScoreClient; -import ibc.icon.structs.messages.MsgConnectionOpenAck; -import ibc.icon.structs.messages.MsgConnectionOpenConfirm; -import ibc.icon.structs.messages.MsgConnectionOpenInit; -import ibc.icon.structs.messages.MsgConnectionOpenTry; +import icon.ibc.structs.messages.MsgConnectionOpenAck; +import icon.ibc.structs.messages.MsgConnectionOpenConfirm; +import icon.ibc.structs.messages.MsgConnectionOpenInit; +import icon.ibc.structs.messages.MsgConnectionOpenTry; import score.annotation.EventLog; @ScoreClient @@ -14,7 +14,7 @@ public interface IIBCConnection { @EventLog(indexed = 1) public void ConnectionOpenTry(String clientId, String connectionId, byte[] counterparty); - + @EventLog(indexed = 1) public void ConnectionOpenAck(String connectionId, byte[] connection); diff --git a/contracts/javascore/lib/src/main/java/ibc/icon/interfaces/IIBCHandler.java b/contracts/javascore/lib/src/main/java/icon/ibc/interfaces/IIBCHandler.java similarity index 96% rename from contracts/javascore/lib/src/main/java/ibc/icon/interfaces/IIBCHandler.java rename to contracts/javascore/lib/src/main/java/icon/ibc/interfaces/IIBCHandler.java index c48778c31..3a6b17310 100644 --- a/contracts/javascore/lib/src/main/java/ibc/icon/interfaces/IIBCHandler.java +++ b/contracts/javascore/lib/src/main/java/icon/ibc/interfaces/IIBCHandler.java @@ -1,4 +1,4 @@ -package ibc.icon.interfaces; +package icon.ibc.interfaces; import java.math.BigInteger; diff --git a/contracts/javascore/lib/src/main/java/ibc/icon/interfaces/IIBCHost.java b/contracts/javascore/lib/src/main/java/icon/ibc/interfaces/IIBCHost.java similarity index 98% rename from contracts/javascore/lib/src/main/java/ibc/icon/interfaces/IIBCHost.java rename to contracts/javascore/lib/src/main/java/icon/ibc/interfaces/IIBCHost.java index 3dbd98529..70460d778 100644 --- a/contracts/javascore/lib/src/main/java/ibc/icon/interfaces/IIBCHost.java +++ b/contracts/javascore/lib/src/main/java/icon/ibc/interfaces/IIBCHost.java @@ -1,4 +1,4 @@ -package ibc.icon.interfaces; +package icon.ibc.interfaces; import java.math.BigInteger; import java.util.List; diff --git a/contracts/javascore/lib/src/main/java/ibc/icon/interfaces/IIBCModule.java b/contracts/javascore/lib/src/main/java/icon/ibc/interfaces/IIBCModule.java similarity index 99% rename from contracts/javascore/lib/src/main/java/ibc/icon/interfaces/IIBCModule.java rename to contracts/javascore/lib/src/main/java/icon/ibc/interfaces/IIBCModule.java index ebf6ef794..0fdfe1544 100644 --- a/contracts/javascore/lib/src/main/java/ibc/icon/interfaces/IIBCModule.java +++ b/contracts/javascore/lib/src/main/java/icon/ibc/interfaces/IIBCModule.java @@ -1,4 +1,4 @@ -package ibc.icon.interfaces; +package icon.ibc.interfaces; import foundation.icon.score.client.ScoreInterface; import score.Address; diff --git a/contracts/javascore/lib/src/main/java/ibc/icon/interfaces/IIBCPacket.java b/contracts/javascore/lib/src/main/java/icon/ibc/interfaces/IIBCPacket.java similarity index 90% rename from contracts/javascore/lib/src/main/java/ibc/icon/interfaces/IIBCPacket.java rename to contracts/javascore/lib/src/main/java/icon/ibc/interfaces/IIBCPacket.java index 649c27d5c..6c89e30fb 100644 --- a/contracts/javascore/lib/src/main/java/ibc/icon/interfaces/IIBCPacket.java +++ b/contracts/javascore/lib/src/main/java/icon/ibc/interfaces/IIBCPacket.java @@ -1,12 +1,12 @@ -package ibc.icon.interfaces; +package icon.ibc.interfaces; -import ibc.icon.structs.messages.MsgPacketAcknowledgement; -import ibc.icon.structs.messages.MsgPacketRecv; -import ibc.icon.structs.messages.MsgPacketTimeout; -import ibc.icon.structs.messages.MsgRequestTimeoutPacket; import score.annotation.EventLog; import foundation.icon.score.client.ScoreClient; +import icon.ibc.structs.messages.MsgPacketAcknowledgement; +import icon.ibc.structs.messages.MsgPacketRecv; +import icon.ibc.structs.messages.MsgPacketTimeout; +import icon.ibc.structs.messages.MsgRequestTimeoutPacket; @ScoreClient public interface IIBCPacket { diff --git a/contracts/javascore/lib/src/main/java/ibc/icon/interfaces/ILightClient.java b/contracts/javascore/lib/src/main/java/icon/ibc/interfaces/ILightClient.java similarity index 99% rename from contracts/javascore/lib/src/main/java/ibc/icon/interfaces/ILightClient.java rename to contracts/javascore/lib/src/main/java/icon/ibc/interfaces/ILightClient.java index 8cc814a9d..fdb9bc37f 100644 --- a/contracts/javascore/lib/src/main/java/ibc/icon/interfaces/ILightClient.java +++ b/contracts/javascore/lib/src/main/java/icon/ibc/interfaces/ILightClient.java @@ -1,4 +1,4 @@ -package ibc.icon.interfaces; +package icon.ibc.interfaces; import foundation.icon.score.client.ScoreInterface; diff --git a/contracts/javascore/lib/src/main/java/ibc/icon/structs/messages/MsgChannelCloseConfirm.java b/contracts/javascore/lib/src/main/java/icon/ibc/structs/messages/MsgChannelCloseConfirm.java similarity index 95% rename from contracts/javascore/lib/src/main/java/ibc/icon/structs/messages/MsgChannelCloseConfirm.java rename to contracts/javascore/lib/src/main/java/icon/ibc/structs/messages/MsgChannelCloseConfirm.java index adbb1b05d..b34ebfb53 100644 --- a/contracts/javascore/lib/src/main/java/ibc/icon/structs/messages/MsgChannelCloseConfirm.java +++ b/contracts/javascore/lib/src/main/java/icon/ibc/structs/messages/MsgChannelCloseConfirm.java @@ -1,4 +1,4 @@ -package ibc.icon.structs.messages; +package icon.ibc.structs.messages; public class MsgChannelCloseConfirm { private String portId; diff --git a/contracts/javascore/lib/src/main/java/ibc/icon/structs/messages/MsgChannelCloseInit.java b/contracts/javascore/lib/src/main/java/icon/ibc/structs/messages/MsgChannelCloseInit.java similarity index 91% rename from contracts/javascore/lib/src/main/java/ibc/icon/structs/messages/MsgChannelCloseInit.java rename to contracts/javascore/lib/src/main/java/icon/ibc/structs/messages/MsgChannelCloseInit.java index e3a6d753d..7a071d0fc 100644 --- a/contracts/javascore/lib/src/main/java/ibc/icon/structs/messages/MsgChannelCloseInit.java +++ b/contracts/javascore/lib/src/main/java/icon/ibc/structs/messages/MsgChannelCloseInit.java @@ -1,4 +1,4 @@ -package ibc.icon.structs.messages; +package icon.ibc.structs.messages; public class MsgChannelCloseInit { private String portId; diff --git a/contracts/javascore/lib/src/main/java/ibc/icon/structs/messages/MsgChannelOpenAck.java b/contracts/javascore/lib/src/main/java/icon/ibc/structs/messages/MsgChannelOpenAck.java similarity index 97% rename from contracts/javascore/lib/src/main/java/ibc/icon/structs/messages/MsgChannelOpenAck.java rename to contracts/javascore/lib/src/main/java/icon/ibc/structs/messages/MsgChannelOpenAck.java index 8d5f4af34..b20e9a524 100644 --- a/contracts/javascore/lib/src/main/java/ibc/icon/structs/messages/MsgChannelOpenAck.java +++ b/contracts/javascore/lib/src/main/java/icon/ibc/structs/messages/MsgChannelOpenAck.java @@ -1,4 +1,4 @@ -package ibc.icon.structs.messages; +package icon.ibc.structs.messages; public class MsgChannelOpenAck { private String portId; diff --git a/contracts/javascore/lib/src/main/java/ibc/icon/structs/messages/MsgChannelOpenConfirm.java b/contracts/javascore/lib/src/main/java/icon/ibc/structs/messages/MsgChannelOpenConfirm.java similarity index 95% rename from contracts/javascore/lib/src/main/java/ibc/icon/structs/messages/MsgChannelOpenConfirm.java rename to contracts/javascore/lib/src/main/java/icon/ibc/structs/messages/MsgChannelOpenConfirm.java index 5f7137e62..61126685c 100644 --- a/contracts/javascore/lib/src/main/java/ibc/icon/structs/messages/MsgChannelOpenConfirm.java +++ b/contracts/javascore/lib/src/main/java/icon/ibc/structs/messages/MsgChannelOpenConfirm.java @@ -1,4 +1,4 @@ -package ibc.icon.structs.messages; +package icon.ibc.structs.messages; public class MsgChannelOpenConfirm { private String portId; diff --git a/contracts/javascore/lib/src/main/java/ibc/icon/structs/messages/MsgChannelOpenInit.java b/contracts/javascore/lib/src/main/java/icon/ibc/structs/messages/MsgChannelOpenInit.java similarity index 91% rename from contracts/javascore/lib/src/main/java/ibc/icon/structs/messages/MsgChannelOpenInit.java rename to contracts/javascore/lib/src/main/java/icon/ibc/structs/messages/MsgChannelOpenInit.java index 8440e443e..157302062 100644 --- a/contracts/javascore/lib/src/main/java/ibc/icon/structs/messages/MsgChannelOpenInit.java +++ b/contracts/javascore/lib/src/main/java/icon/ibc/structs/messages/MsgChannelOpenInit.java @@ -1,4 +1,4 @@ -package ibc.icon.structs.messages; +package icon.ibc.structs.messages; public class MsgChannelOpenInit { private String portId; diff --git a/contracts/javascore/lib/src/main/java/ibc/icon/structs/messages/MsgChannelOpenTry.java b/contracts/javascore/lib/src/main/java/icon/ibc/structs/messages/MsgChannelOpenTry.java similarity index 96% rename from contracts/javascore/lib/src/main/java/ibc/icon/structs/messages/MsgChannelOpenTry.java rename to contracts/javascore/lib/src/main/java/icon/ibc/structs/messages/MsgChannelOpenTry.java index 7b27eaa89..13ca13928 100644 --- a/contracts/javascore/lib/src/main/java/ibc/icon/structs/messages/MsgChannelOpenTry.java +++ b/contracts/javascore/lib/src/main/java/icon/ibc/structs/messages/MsgChannelOpenTry.java @@ -1,4 +1,4 @@ -package ibc.icon.structs.messages; +package icon.ibc.structs.messages; public class MsgChannelOpenTry { private String portId; diff --git a/contracts/javascore/lib/src/main/java/ibc/icon/structs/messages/MsgConnectionOpenAck.java b/contracts/javascore/lib/src/main/java/icon/ibc/structs/messages/MsgConnectionOpenAck.java similarity index 98% rename from contracts/javascore/lib/src/main/java/ibc/icon/structs/messages/MsgConnectionOpenAck.java rename to contracts/javascore/lib/src/main/java/icon/ibc/structs/messages/MsgConnectionOpenAck.java index 217adfcde..37b6d91e7 100644 --- a/contracts/javascore/lib/src/main/java/ibc/icon/structs/messages/MsgConnectionOpenAck.java +++ b/contracts/javascore/lib/src/main/java/icon/ibc/structs/messages/MsgConnectionOpenAck.java @@ -1,4 +1,4 @@ -package ibc.icon.structs.messages; +package icon.ibc.structs.messages; public class MsgConnectionOpenAck { private String connectionId; @@ -10,7 +10,7 @@ public class MsgConnectionOpenAck { private byte[] proofConsensus; // proof that chainB has stored ConsensusState of chainA on its client private byte[] proofHeight; // height that relayer conpublic classed proofTry private byte[] consensusHeight; // latest height of chainA that chainB has stored on its chainA client - + public String getConnectionId() { return connectionId; } @@ -66,6 +66,6 @@ public void setConsensusHeight(byte[] consensusHeight) { this.consensusHeight = consensusHeight; } - + } \ No newline at end of file diff --git a/contracts/javascore/lib/src/main/java/ibc/icon/structs/messages/MsgConnectionOpenConfirm.java b/contracts/javascore/lib/src/main/java/icon/ibc/structs/messages/MsgConnectionOpenConfirm.java similarity index 94% rename from contracts/javascore/lib/src/main/java/ibc/icon/structs/messages/MsgConnectionOpenConfirm.java rename to contracts/javascore/lib/src/main/java/icon/ibc/structs/messages/MsgConnectionOpenConfirm.java index c8fb15ccd..9bebec791 100644 --- a/contracts/javascore/lib/src/main/java/ibc/icon/structs/messages/MsgConnectionOpenConfirm.java +++ b/contracts/javascore/lib/src/main/java/icon/ibc/structs/messages/MsgConnectionOpenConfirm.java @@ -1,4 +1,4 @@ -package ibc.icon.structs.messages; +package icon.ibc.structs.messages; public class MsgConnectionOpenConfirm { private String connectionId; diff --git a/contracts/javascore/lib/src/main/java/ibc/icon/structs/messages/MsgConnectionOpenInit.java b/contracts/javascore/lib/src/main/java/icon/ibc/structs/messages/MsgConnectionOpenInit.java similarity index 95% rename from contracts/javascore/lib/src/main/java/ibc/icon/structs/messages/MsgConnectionOpenInit.java rename to contracts/javascore/lib/src/main/java/icon/ibc/structs/messages/MsgConnectionOpenInit.java index b9f90d6b2..54fe5e954 100644 --- a/contracts/javascore/lib/src/main/java/ibc/icon/structs/messages/MsgConnectionOpenInit.java +++ b/contracts/javascore/lib/src/main/java/icon/ibc/structs/messages/MsgConnectionOpenInit.java @@ -1,4 +1,4 @@ -package ibc.icon.structs.messages; +package icon.ibc.structs.messages; import java.math.BigInteger; diff --git a/contracts/javascore/lib/src/main/java/ibc/icon/structs/messages/MsgConnectionOpenTry.java b/contracts/javascore/lib/src/main/java/icon/ibc/structs/messages/MsgConnectionOpenTry.java similarity index 98% rename from contracts/javascore/lib/src/main/java/ibc/icon/structs/messages/MsgConnectionOpenTry.java rename to contracts/javascore/lib/src/main/java/icon/ibc/structs/messages/MsgConnectionOpenTry.java index 0052bf290..751319182 100644 --- a/contracts/javascore/lib/src/main/java/ibc/icon/structs/messages/MsgConnectionOpenTry.java +++ b/contracts/javascore/lib/src/main/java/icon/ibc/structs/messages/MsgConnectionOpenTry.java @@ -1,4 +1,4 @@ -package ibc.icon.structs.messages; +package icon.ibc.structs.messages; import java.math.BigInteger; diff --git a/contracts/javascore/lib/src/main/java/ibc/icon/structs/messages/MsgCreateClient.java b/contracts/javascore/lib/src/main/java/icon/ibc/structs/messages/MsgCreateClient.java similarity index 96% rename from contracts/javascore/lib/src/main/java/ibc/icon/structs/messages/MsgCreateClient.java rename to contracts/javascore/lib/src/main/java/icon/ibc/structs/messages/MsgCreateClient.java index 70d5ad8d6..f6e3279f4 100644 --- a/contracts/javascore/lib/src/main/java/ibc/icon/structs/messages/MsgCreateClient.java +++ b/contracts/javascore/lib/src/main/java/icon/ibc/structs/messages/MsgCreateClient.java @@ -1,4 +1,4 @@ -package ibc.icon.structs.messages; +package icon.ibc.structs.messages; public class MsgCreateClient { private String clientType; diff --git a/contracts/javascore/lib/src/main/java/ibc/icon/structs/messages/MsgPacketAcknowledgement.java b/contracts/javascore/lib/src/main/java/icon/ibc/structs/messages/MsgPacketAcknowledgement.java similarity index 95% rename from contracts/javascore/lib/src/main/java/ibc/icon/structs/messages/MsgPacketAcknowledgement.java rename to contracts/javascore/lib/src/main/java/icon/ibc/structs/messages/MsgPacketAcknowledgement.java index 1044ce43a..68a03b634 100644 --- a/contracts/javascore/lib/src/main/java/ibc/icon/structs/messages/MsgPacketAcknowledgement.java +++ b/contracts/javascore/lib/src/main/java/icon/ibc/structs/messages/MsgPacketAcknowledgement.java @@ -1,4 +1,4 @@ -package ibc.icon.structs.messages; +package icon.ibc.structs.messages; public class MsgPacketAcknowledgement { private byte[] packet; diff --git a/contracts/javascore/lib/src/main/java/ibc/icon/structs/messages/MsgPacketRecv.java b/contracts/javascore/lib/src/main/java/icon/ibc/structs/messages/MsgPacketRecv.java similarity index 94% rename from contracts/javascore/lib/src/main/java/ibc/icon/structs/messages/MsgPacketRecv.java rename to contracts/javascore/lib/src/main/java/icon/ibc/structs/messages/MsgPacketRecv.java index 4883e6e20..b89b9a149 100644 --- a/contracts/javascore/lib/src/main/java/ibc/icon/structs/messages/MsgPacketRecv.java +++ b/contracts/javascore/lib/src/main/java/icon/ibc/structs/messages/MsgPacketRecv.java @@ -1,4 +1,4 @@ -package ibc.icon.structs.messages; +package icon.ibc.structs.messages; public class MsgPacketRecv { private byte[] packet; diff --git a/contracts/javascore/lib/src/main/java/ibc/icon/structs/messages/MsgPacketTimeout.java b/contracts/javascore/lib/src/main/java/icon/ibc/structs/messages/MsgPacketTimeout.java similarity index 95% rename from contracts/javascore/lib/src/main/java/ibc/icon/structs/messages/MsgPacketTimeout.java rename to contracts/javascore/lib/src/main/java/icon/ibc/structs/messages/MsgPacketTimeout.java index 1a04c3683..aee46f024 100644 --- a/contracts/javascore/lib/src/main/java/ibc/icon/structs/messages/MsgPacketTimeout.java +++ b/contracts/javascore/lib/src/main/java/icon/ibc/structs/messages/MsgPacketTimeout.java @@ -1,4 +1,4 @@ -package ibc.icon.structs.messages; +package icon.ibc.structs.messages; import java.math.BigInteger; @@ -7,7 +7,7 @@ public class MsgPacketTimeout { private byte[] proof; private byte[] proofHeight; private BigInteger nextSequenceRecv; - + public byte[] getPacket() { return packet; } diff --git a/contracts/javascore/lib/src/main/java/ibc/icon/structs/messages/MsgRequestTimeoutPacket.java b/contracts/javascore/lib/src/main/java/icon/ibc/structs/messages/MsgRequestTimeoutPacket.java similarity index 94% rename from contracts/javascore/lib/src/main/java/ibc/icon/structs/messages/MsgRequestTimeoutPacket.java rename to contracts/javascore/lib/src/main/java/icon/ibc/structs/messages/MsgRequestTimeoutPacket.java index e9938f694..8d97a33e2 100644 --- a/contracts/javascore/lib/src/main/java/ibc/icon/structs/messages/MsgRequestTimeoutPacket.java +++ b/contracts/javascore/lib/src/main/java/icon/ibc/structs/messages/MsgRequestTimeoutPacket.java @@ -1,4 +1,4 @@ -package ibc.icon.structs.messages; +package icon.ibc.structs.messages; public class MsgRequestTimeoutPacket { private byte[] packet; diff --git a/contracts/javascore/lib/src/main/java/ibc/icon/structs/messages/MsgUpdateClient.java b/contracts/javascore/lib/src/main/java/icon/ibc/structs/messages/MsgUpdateClient.java similarity index 92% rename from contracts/javascore/lib/src/main/java/ibc/icon/structs/messages/MsgUpdateClient.java rename to contracts/javascore/lib/src/main/java/icon/ibc/structs/messages/MsgUpdateClient.java index 7d0f65143..d0a0719ab 100644 --- a/contracts/javascore/lib/src/main/java/ibc/icon/structs/messages/MsgUpdateClient.java +++ b/contracts/javascore/lib/src/main/java/icon/ibc/structs/messages/MsgUpdateClient.java @@ -1,4 +1,4 @@ -package ibc.icon.structs.messages; +package icon.ibc.structs.messages; public class MsgUpdateClient { private String clientId; diff --git a/contracts/javascore/lib/src/main/java/ibc/icon/structs/messages/UpdateClientResponse.java b/contracts/javascore/lib/src/main/java/icon/ibc/structs/messages/UpdateClientResponse.java similarity index 96% rename from contracts/javascore/lib/src/main/java/ibc/icon/structs/messages/UpdateClientResponse.java rename to contracts/javascore/lib/src/main/java/icon/ibc/structs/messages/UpdateClientResponse.java index cc7d31d3d..2718a03dd 100644 --- a/contracts/javascore/lib/src/main/java/ibc/icon/structs/messages/UpdateClientResponse.java +++ b/contracts/javascore/lib/src/main/java/icon/ibc/structs/messages/UpdateClientResponse.java @@ -1,4 +1,4 @@ -package ibc.icon.structs.messages; +package icon.ibc.structs.messages; public class UpdateClientResponse { // current client state @@ -8,7 +8,7 @@ public class UpdateClientResponse { // updated height private byte[] height; - + public UpdateClientResponse(byte[] clientStateCommitment, byte[] consensusStateCommitment, byte[] height) { this.clientStateCommitment = clientStateCommitment; diff --git a/contracts/javascore/lib/src/main/java/icon/proto/clients/tendermint/BlockIDFlag.java b/contracts/javascore/lib/src/main/java/icon/proto/clients/tendermint/BlockIDFlag.java deleted file mode 100644 index bca418fb0..000000000 --- a/contracts/javascore/lib/src/main/java/icon/proto/clients/tendermint/BlockIDFlag.java +++ /dev/null @@ -1,11 +0,0 @@ -package icon.proto.clients.tendermint; - -public class BlockIDFlag { - public static final int BLOCK_ID_FLAG_UNKNOWN = 0; - - public static final int BLOCK_ID_FLAG_ABSENT = 1; - - public static final int BLOCK_ID_FLAG_COMMIT = 2; - - public static final int BLOCK_ID_FLAG_NIL = 3; -} diff --git a/contracts/javascore/lib/src/main/java/icon/proto/clients/tendermint/SignedMsgType.java b/contracts/javascore/lib/src/main/java/icon/proto/clients/tendermint/SignedMsgType.java deleted file mode 100644 index 92cb55e93..000000000 --- a/contracts/javascore/lib/src/main/java/icon/proto/clients/tendermint/SignedMsgType.java +++ /dev/null @@ -1,11 +0,0 @@ -package icon.proto.clients.tendermint; - -public class SignedMsgType { - public static final int SIGNED_MSG_TYPE_UNKNOWN = 0; - - public static final int SIGNED_MSG_TYPE_PREVOTE = 1; - - public static final int SIGNED_MSG_TYPE_PRECOMMIT = 2; - - public static final int SIGNED_MSG_TYPE_PROPOSAL = 32; -} diff --git a/contracts/javascore/lib/src/main/java/icon/proto/icon/lightclient/v1/BlockUpdate.java b/contracts/javascore/lib/src/main/java/icon/proto/icon/lightclient/v1/BlockUpdate.java deleted file mode 100644 index 7ea6e7d4a..000000000 --- a/contracts/javascore/lib/src/main/java/icon/proto/icon/lightclient/v1/BlockUpdate.java +++ /dev/null @@ -1,43 +0,0 @@ -package icon.proto.icon.lightclient.v1; - -import ibc.icon.score.util.ByteUtil; -import ibc.icon.score.util.Proto; -import ibc.icon.score.util.ProtoMessage; -import icon.proto.icon.types.v1.SignedHeader; - -public class BlockUpdate extends ProtoMessage { - private SignedHeader header = new SignedHeader(); - - public SignedHeader getHeader() { - return this.header; - } - - public void setHeader(SignedHeader header) { - this.header = header; - } - - public byte[] encode() { - return ByteUtil.join( - Proto.encode(1, this.header)); - } - - public static BlockUpdate decode(byte[] data) { - BlockUpdate obj = new BlockUpdate(); - int index = 0; - int order; - int length = data.length; - while (index < length) { - order = data[index] >> 3; - index++; - switch(order) { - case 1: { - Proto.DecodeResponse resp = Proto.decodeBytes(data, index); - index = resp.index; - obj.header = SignedHeader.decode(resp.res); - break; - } - } - } - return obj; - } -} diff --git a/contracts/javascore/lib/src/main/java/icon/proto/icon/lightclient/v1/ClientState.java b/contracts/javascore/lib/src/main/java/icon/proto/icon/lightclient/v1/ClientState.java deleted file mode 100644 index b32a67768..000000000 --- a/contracts/javascore/lib/src/main/java/icon/proto/icon/lightclient/v1/ClientState.java +++ /dev/null @@ -1,130 +0,0 @@ -package icon.proto.icon.lightclient.v1; - -import ibc.icon.score.util.ByteUtil; -import ibc.icon.score.util.Proto; -import ibc.icon.score.util.ProtoMessage; -import java.math.BigInteger; -import java.util.List; -import scorex.util.ArrayList; - -public class ClientState extends ProtoMessage { - private BigInteger trustingPeriod = BigInteger.ZERO; - - private BigInteger frozenHeight = BigInteger.ZERO; - - private BigInteger maxClockDrift = BigInteger.ZERO; - - private BigInteger latestHeight = BigInteger.ZERO; - - private byte[] networkSectionHash = new byte[0]; - - private List validators = new ArrayList<>(); - - public BigInteger getTrustingPeriod() { - return this.trustingPeriod; - } - - public void setTrustingPeriod(BigInteger trustingPeriod) { - this.trustingPeriod = trustingPeriod; - } - - public BigInteger getFrozenHeight() { - return this.frozenHeight; - } - - public void setFrozenHeight(BigInteger frozenHeight) { - this.frozenHeight = frozenHeight; - } - - public BigInteger getMaxClockDrift() { - return this.maxClockDrift; - } - - public void setMaxClockDrift(BigInteger maxClockDrift) { - this.maxClockDrift = maxClockDrift; - } - - public BigInteger getLatestHeight() { - return this.latestHeight; - } - - public void setLatestHeight(BigInteger latestHeight) { - this.latestHeight = latestHeight; - } - - public byte[] getNetworkSectionHash() { - return this.networkSectionHash; - } - - public void setNetworkSectionHash(byte[] networkSectionHash) { - this.networkSectionHash = networkSectionHash; - } - - public List getValidators() { - return this.validators; - } - - public void setValidators(List validators) { - this.validators = validators; - } - - public byte[] encode() { - return ByteUtil.join( - Proto.encode(1, this.trustingPeriod), - Proto.encode(2, this.frozenHeight), - Proto.encode(3, this.maxClockDrift), - Proto.encode(4, this.latestHeight), - Proto.encode(5, this.networkSectionHash), - Proto.encodeBytesArray(6, this.validators)); - } - - public static ClientState decode(byte[] data) { - ClientState obj = new ClientState(); - int index = 0; - int order; - int length = data.length; - while (index < length) { - order = data[index] >> 3; - index++; - switch(order) { - case 1: { - Proto.DecodeResponse resp = Proto.decodeVarInt(data, index); - index = resp.index; - obj.trustingPeriod = resp.res; - break; - } - case 2: { - Proto.DecodeResponse resp = Proto.decodeVarInt(data, index); - index = resp.index; - obj.frozenHeight = resp.res; - break; - } - case 3: { - Proto.DecodeResponse resp = Proto.decodeVarInt(data, index); - index = resp.index; - obj.maxClockDrift = resp.res; - break; - } - case 4: { - Proto.DecodeResponse resp = Proto.decodeVarInt(data, index); - index = resp.index; - obj.latestHeight = resp.res; - break; - } - case 5: { - Proto.DecodeResponse resp = Proto.decodeBytes(data, index); - index = resp.index; - obj.networkSectionHash = resp.res; - break; - } - case 6: { - Proto.DecodeResponse resp = Proto.decodeBytes(data, index); - index = resp.index; - obj.validators.add(resp.res); - break; - } - } - } - return obj; - } -} diff --git a/contracts/javascore/lib/src/main/java/icon/proto/icon/lightclient/v1/ConsensusState.java b/contracts/javascore/lib/src/main/java/icon/proto/icon/lightclient/v1/ConsensusState.java deleted file mode 100644 index 5efd014fb..000000000 --- a/contracts/javascore/lib/src/main/java/icon/proto/icon/lightclient/v1/ConsensusState.java +++ /dev/null @@ -1,42 +0,0 @@ -package icon.proto.icon.lightclient.v1; - -import ibc.icon.score.util.ByteUtil; -import ibc.icon.score.util.Proto; -import ibc.icon.score.util.ProtoMessage; - -public class ConsensusState extends ProtoMessage { - private byte[] messageRoot = new byte[0]; - - public byte[] getMessageRoot() { - return this.messageRoot; - } - - public void setMessageRoot(byte[] messageRoot) { - this.messageRoot = messageRoot; - } - - public byte[] encode() { - return ByteUtil.join( - Proto.encode(1, this.messageRoot)); - } - - public static ConsensusState decode(byte[] data) { - ConsensusState obj = new ConsensusState(); - int index = 0; - int order; - int length = data.length; - while (index < length) { - order = data[index] >> 3; - index++; - switch(order) { - case 1: { - Proto.DecodeResponse resp = Proto.decodeBytes(data, index); - index = resp.index; - obj.messageRoot = resp.res; - break; - } - } - } - return obj; - } -} diff --git a/contracts/javascore/lib/src/main/java/icon/proto/icon/types/v1/BTPHeader.java b/contracts/javascore/lib/src/main/java/icon/proto/icon/types/v1/BTPHeader.java deleted file mode 100644 index e23de057c..000000000 --- a/contracts/javascore/lib/src/main/java/icon/proto/icon/types/v1/BTPHeader.java +++ /dev/null @@ -1,198 +0,0 @@ -package icon.proto.icon.types.v1; - -import ibc.icon.score.util.ByteUtil; -import ibc.icon.score.util.Proto; -import ibc.icon.score.util.ProtoMessage; -import java.math.BigInteger; -import java.util.List; -import scorex.util.ArrayList; - -public class BTPHeader extends ProtoMessage { - private BigInteger mainHeight = BigInteger.ZERO; - - private BigInteger round = BigInteger.ZERO; - - private byte[] nextProofContextHash = new byte[0]; - - private List networkSectionToRoot = new ArrayList<>(); - - private BigInteger networkId = BigInteger.ZERO; - - private BigInteger updateNumber = BigInteger.ZERO; - - private byte[] prevNetworkSectionHash = new byte[0]; - - private BigInteger messageCount = BigInteger.ZERO; - - private byte[] messageRoot = new byte[0]; - - private List nextvalidators = new ArrayList<>(); - - public BigInteger getMainHeight() { - return this.mainHeight; - } - - public void setMainHeight(BigInteger mainHeight) { - this.mainHeight = mainHeight; - } - - public BigInteger getRound() { - return this.round; - } - - public void setRound(BigInteger round) { - this.round = round; - } - - public byte[] getNextProofContextHash() { - return this.nextProofContextHash; - } - - public void setNextProofContextHash(byte[] nextProofContextHash) { - this.nextProofContextHash = nextProofContextHash; - } - - public List getNetworkSectionToRoot() { - return this.networkSectionToRoot; - } - - public void setNetworkSectionToRoot(List networkSectionToRoot) { - this.networkSectionToRoot = networkSectionToRoot; - } - - public BigInteger getNetworkId() { - return this.networkId; - } - - public void setNetworkId(BigInteger networkId) { - this.networkId = networkId; - } - - public BigInteger getUpdateNumber() { - return this.updateNumber; - } - - public void setUpdateNumber(BigInteger updateNumber) { - this.updateNumber = updateNumber; - } - - public byte[] getPrevNetworkSectionHash() { - return this.prevNetworkSectionHash; - } - - public void setPrevNetworkSectionHash(byte[] prevNetworkSectionHash) { - this.prevNetworkSectionHash = prevNetworkSectionHash; - } - - public BigInteger getMessageCount() { - return this.messageCount; - } - - public void setMessageCount(BigInteger messageCount) { - this.messageCount = messageCount; - } - - public byte[] getMessageRoot() { - return this.messageRoot; - } - - public void setMessageRoot(byte[] messageRoot) { - this.messageRoot = messageRoot; - } - - public List getNextvalidators() { - return this.nextvalidators; - } - - public void setNextvalidators(List nextvalidators) { - this.nextvalidators = nextvalidators; - } - - public byte[] encode() { - return ByteUtil.join( - Proto.encode(1, this.mainHeight), - Proto.encode(2, this.round), - Proto.encode(3, this.nextProofContextHash), - Proto.encodeMessageArray(4, this.networkSectionToRoot), - Proto.encode(5, this.networkId), - Proto.encode(6, this.updateNumber), - Proto.encode(7, this.prevNetworkSectionHash), - Proto.encode(8, this.messageCount), - Proto.encode(9, this.messageRoot), - Proto.encodeBytesArray(10, this.nextvalidators)); - } - - public static BTPHeader decode(byte[] data) { - BTPHeader obj = new BTPHeader(); - int index = 0; - int order; - int length = data.length; - while (index < length) { - order = data[index] >> 3; - index++; - switch(order) { - case 1: { - Proto.DecodeResponse resp = Proto.decodeVarInt(data, index); - index = resp.index; - obj.mainHeight = resp.res; - break; - } - case 2: { - Proto.DecodeResponse resp = Proto.decodeVarInt(data, index); - index = resp.index; - obj.round = resp.res; - break; - } - case 3: { - Proto.DecodeResponse resp = Proto.decodeBytes(data, index); - index = resp.index; - obj.nextProofContextHash = resp.res; - break; - } - case 4: { - Proto.DecodeResponse resp = Proto.decodeBytes(data, index); - index = resp.index; - obj.networkSectionToRoot.add(MerkleNode.decode(resp.res)); - break; - } - case 5: { - Proto.DecodeResponse resp = Proto.decodeVarInt(data, index); - index = resp.index; - obj.networkId = resp.res; - break; - } - case 6: { - Proto.DecodeResponse resp = Proto.decodeVarInt(data, index); - index = resp.index; - obj.updateNumber = resp.res; - break; - } - case 7: { - Proto.DecodeResponse resp = Proto.decodeBytes(data, index); - index = resp.index; - obj.prevNetworkSectionHash = resp.res; - break; - } - case 8: { - Proto.DecodeResponse resp = Proto.decodeVarInt(data, index); - index = resp.index; - obj.messageCount = resp.res; - break; - } - case 9: { - Proto.DecodeResponse resp = Proto.decodeBytes(data, index); - index = resp.index; - obj.messageRoot = resp.res; - break; - } - case 10: { - Proto.DecodeResponse resp = Proto.decodeBytes(data, index); - index = resp.index; - obj.nextvalidators.add(resp.res); - break; - } - } - } - return obj; - } -} diff --git a/contracts/javascore/lib/src/main/java/icon/proto/icon/types/v1/SignedHeader.java b/contracts/javascore/lib/src/main/java/icon/proto/icon/types/v1/SignedHeader.java deleted file mode 100644 index dcbff035a..000000000 --- a/contracts/javascore/lib/src/main/java/icon/proto/icon/types/v1/SignedHeader.java +++ /dev/null @@ -1,61 +0,0 @@ -package icon.proto.icon.types.v1; - -import ibc.icon.score.util.ByteUtil; -import ibc.icon.score.util.Proto; -import ibc.icon.score.util.ProtoMessage; -import java.util.List; -import scorex.util.ArrayList; - -public class SignedHeader extends ProtoMessage { - private BTPHeader header = new BTPHeader(); - - private List signatures = new ArrayList<>(); - - public BTPHeader getHeader() { - return this.header; - } - - public void setHeader(BTPHeader header) { - this.header = header; - } - - public List getSignatures() { - return this.signatures; - } - - public void setSignatures(List signatures) { - this.signatures = signatures; - } - - public byte[] encode() { - return ByteUtil.join( - Proto.encode(1, this.header), - Proto.encodeBytesArray(2, this.signatures)); - } - - public static SignedHeader decode(byte[] data) { - SignedHeader obj = new SignedHeader(); - int index = 0; - int order; - int length = data.length; - while (index < length) { - order = data[index] >> 3; - index++; - switch(order) { - case 1: { - Proto.DecodeResponse resp = Proto.decodeBytes(data, index); - index = resp.index; - obj.header = BTPHeader.decode(resp.res); - break; - } - case 2: { - Proto.DecodeResponse resp = Proto.decodeBytes(data, index); - index = resp.index; - obj.signatures.add(resp.res); - break; - } - } - } - return obj; - } -} diff --git a/contracts/javascore/lightclients/mockclient/build.gradle b/contracts/javascore/lightclients/mockclient/build.gradle index 1816d5dd8..673979ff0 100644 --- a/contracts/javascore/lightclients/mockclient/build.gradle +++ b/contracts/javascore/lightclients/mockclient/build.gradle @@ -6,6 +6,7 @@ dependencies { implementation project(':lib') implementation project(':score-util') implementation project(':ibc') + implementation project(':proto-lib') testImplementation 'com.google.protobuf:protobuf-javalite:3.13.0' diff --git a/contracts/javascore/lightclients/mockclient/src/main/java/ibc/mockclient/MockClient.java b/contracts/javascore/lightclients/mockclient/src/main/java/ibc/mockclient/MockClient.java index e04cfa8a5..6753b0dec 100644 --- a/contracts/javascore/lightclients/mockclient/src/main/java/ibc/mockclient/MockClient.java +++ b/contracts/javascore/lightclients/mockclient/src/main/java/ibc/mockclient/MockClient.java @@ -3,13 +3,12 @@ import java.math.BigInteger; import java.util.Map; +import icon.proto.core.client.Height; import score.Address; import score.Context; import score.annotation.External; import score.annotation.Optional; -import ibc.icon.interfaces.ILightClient; -import icon.proto.core.client.Height; - +import icon.ibc.interfaces.ILightClient; import ibc.ics24.host.IBCCommitment; public class MockClient implements ILightClient { diff --git a/contracts/javascore/lightclients/tendermint/build.gradle b/contracts/javascore/lightclients/tendermint/build.gradle index 2f82fee7a..eedfc9ade 100644 --- a/contracts/javascore/lightclients/tendermint/build.gradle +++ b/contracts/javascore/lightclients/tendermint/build.gradle @@ -6,9 +6,11 @@ dependencies { implementation project(':lib') implementation project(':score-util') implementation project(':ibc') + implementation project(':proto-lib') testImplementation 'com.google.protobuf:protobuf-javalite:3.16.3' + testImplementation 'com.google.protobuf:protobuf-java-util:3.16.3' testImplementation 'foundation.icon:javaee-rt:0.9.3' testImplementation("org.mockito:mockito-core:$mockitoCoreVersion") testImplementation("org.mockito:mockito-inline:$mockitoCoreVersion") @@ -35,6 +37,7 @@ jacocoTestReport { dependsOn ':ibc:jacocoTestReport' dependsOn ':ibc:processTestResources' dependsOn ':lib:test' + dependsOn ':proto-lib:test' dependsOn ':mockapp:compileJava' dependsOn ':mockapp:test' dependsOn ':proto-util:compileJava' diff --git a/contracts/javascore/lightclients/tendermint/src/main/java/ibc/tendermint/Tendermint.java b/contracts/javascore/lightclients/tendermint/src/main/java/ibc/tendermint/Tendermint.java index 11f3aa8ff..7f2e99b63 100644 --- a/contracts/javascore/lightclients/tendermint/src/main/java/ibc/tendermint/Tendermint.java +++ b/contracts/javascore/lightclients/tendermint/src/main/java/ibc/tendermint/Tendermint.java @@ -4,7 +4,9 @@ import java.util.Arrays; import ibc.icon.score.util.Proto; -import icon.proto.clients.tendermint.*; +import tendermint.types.*; +import google.protobuf.*; +import ibc.lightclients.tendermint.v1.*; import score.Context; import static ibc.tendermint.TendermintHelper.*; @@ -256,7 +258,7 @@ protected byte[] voteSignBytes( String chainID, int idx) { - return toCanonicalVote(commit, idx, chainID).encode(); + return toCanonicalVote(commit, idx, chainID); } protected byte[] voteSignBytesDelim( diff --git a/contracts/javascore/lightclients/tendermint/src/main/java/ibc/tendermint/TendermintHelper.java b/contracts/javascore/lightclients/tendermint/src/main/java/ibc/tendermint/TendermintHelper.java index da7c287ea..1aa812492 100644 --- a/contracts/javascore/lightclients/tendermint/src/main/java/ibc/tendermint/TendermintHelper.java +++ b/contracts/javascore/lightclients/tendermint/src/main/java/ibc/tendermint/TendermintHelper.java @@ -5,40 +5,38 @@ import ibc.icon.score.util.MerkleTree; import ibc.icon.score.util.Proto; -import icon.proto.clients.tendermint.CanonicalVote; -import icon.proto.clients.tendermint.Commit; -import icon.proto.clients.tendermint.CommitSig; -import icon.proto.clients.tendermint.ConsensusState; -import icon.proto.clients.tendermint.Duration; -import icon.proto.clients.tendermint.LightHeader; -import icon.proto.clients.tendermint.MerkleRoot; -import icon.proto.clients.tendermint.SignedHeader; -import icon.proto.clients.tendermint.SignedMsgType; -import icon.proto.clients.tendermint.SimpleValidator; -import icon.proto.clients.tendermint.Timestamp; -import icon.proto.clients.tendermint.TmHeader; -import icon.proto.clients.tendermint.Validator; -import icon.proto.clients.tendermint.ValidatorSet; -import icon.proto.core.client.Height; +import ibc.icon.score.util.ByteUtil; +import tendermint.types.Commit; +import tendermint.types.CommitSig; +import ibc.lightclients.tendermint.v1.ConsensusState; +import tendermint.types.Header; +import ibc.core.commitment.v1.MerkleRoot; +import tendermint.types.SignedHeader; +import tendermint.types.SignedMsgType; +import tendermint.types.SimpleValidator; +import tendermint.types.Validator; +import tendermint.types.ValidatorSet; +import ibc.core.client.v1.Height; + +import google.protobuf.Timestamp; +import google.protobuf.Duration; import score.Context; public class TendermintHelper { public static final BigInteger MICRO_SECONDS_IN_A_SECOND = BigInteger.valueOf(1_000_000); - public static CanonicalVote toCanonicalVote(Commit commit, int valIdx, String chainId) { + public static byte[] toCanonicalVote(Commit commit, int valIdx, String chainId) { CommitSig commitSig = commit.getSignatures().get(valIdx); - CanonicalVote vote = new CanonicalVote(); - - vote.setType(SignedMsgType.SIGNED_MSG_TYPE_PRECOMMIT); - vote.setHeight(commit.getHeight()); - vote.setRound(commit.getRound()); - vote.setBlockId(commit.getBlockId()); - vote.setTimestamp(commitSig.getTimestamp()); - vote.setChainId(chainId); - return vote; + return ByteUtil.join( + Proto.encode(1, SignedMsgType.SIGNED_MSG_TYPE_PRECOMMIT), + Proto.encodeFixed64(2, commit.getHeight()), + Proto.encodeFixed64(3, commit.getRound()), + Proto.encode(4, commit.getBlockId()), + Proto.encode(5, commitSig.getTimestamp()), + Proto.encode(6, chainId)); } - public static ConsensusState toConsensusState(TmHeader header) { + public static ConsensusState toConsensusState(ibc.lightclients.tendermint.v1.Header header) { ConsensusState state = new ConsensusState(); state.setNextValidatorsHash(header.getSignedHeader().getHeader().getNextValidatorsHash()); state.setTimestamp(header.getSignedHeader().getHeader().getTime()); @@ -129,7 +127,7 @@ public static byte[] hash(ValidatorSet validatorSet) { return MerkleTree.merkleRootHash(data, 0, size); } - public static byte[] hash(LightHeader header) { + public static byte[] hash(Header header) { byte[] hbz = Proto.encode(1, header.getVersion().getBlock()); byte[] pbt = header.getTime().encode(); byte[] bzbi = header.getLastBlockId().encode(); diff --git a/contracts/javascore/lightclients/tendermint/src/main/java/ibc/tendermint/TendermintLightClient.java b/contracts/javascore/lightclients/tendermint/src/main/java/ibc/tendermint/TendermintLightClient.java index c52b57a79..2012a1057 100644 --- a/contracts/javascore/lightclients/tendermint/src/main/java/ibc/tendermint/TendermintLightClient.java +++ b/contracts/javascore/lightclients/tendermint/src/main/java/ibc/tendermint/TendermintLightClient.java @@ -1,14 +1,17 @@ package ibc.tendermint; -import ibc.icon.interfaces.ILightClient; +import icon.ibc.interfaces.ILightClient; import ibc.icon.score.util.ByteUtil; import ibc.icon.score.util.NullChecker; import ibc.icon.score.util.StringUtil; import ibc.ics23.commitment.types.Merkle; import ibc.ics24.host.IBCCommitment; -import icon.proto.clients.tendermint.*; -import icon.proto.core.client.Height; -import icon.proto.core.commitment.MerkleProof; +import cosmos.ics23.v1.*; +import google.protobuf.*; +import tendermint.types.*; +import ibc.core.commitment.v1.*; +import ibc.lightclients.tendermint.v1.*; +import ibc.core.client.v1.Height; import score.Address; import score.BranchDB; import score.Context; @@ -72,7 +75,7 @@ public byte[] getLatestHeight(String clientId) { byte[] encodedClientState = clientStates.get(clientId); NullChecker.requireNotNull(encodedClientState, "Client does not exist"); ClientState clientState = ClientState.decode(encodedClientState); - return newHeight(clientState.getLatestHeight()).encode(); + return clientState.getLatestHeight().encode(); } @External(readonly = true) @@ -101,12 +104,12 @@ public Map createClient(String clientId, byte[] clientStateBytes "trustLevel has zero Denominator"); clientStates.set(clientId, clientStateBytes); - consensusStates.at(clientId).set(clientState.getLatestHeight(), consensusStateBytes); + consensusStates.at(clientId).set(clientState.getLatestHeight().getRevisionHeight(), consensusStateBytes); return Map.of( "clientStateCommitment", IBCCommitment.keccak256(clientStateBytes), "consensusStateCommitment", IBCCommitment.keccak256(consensusStateBytes), - "height", newHeight(clientState.getLatestHeight()).encode()); + "height", clientState.getLatestHeight().encode()); } /** @@ -115,7 +118,7 @@ public Map createClient(String clientId, byte[] clientStateBytes @External public Map updateClient(String clientId, byte[] clientMessageBytes) { onlyHandler(); - TmHeader tmHeader = TmHeader.decode(clientMessageBytes); + ibc.lightclients.tendermint.v1.Header tmHeader = ibc.lightclients.tendermint.v1.Header.decode(clientMessageBytes); boolean conflictingHeader = false; // Check if the Client store already has a consensus state for the header's @@ -140,7 +143,7 @@ public Map updateClient(String clientId, byte[] clientMessageByt byte[] encodedClientState = clientStates.get(clientId); require(encodedClientState != null, "LC: client state is invalid"); ClientState clientState = ClientState.decode(encodedClientState); - byte[] encodedTrustedonsensusState = consensusStates.at(clientId).get(tmHeader.getTrustedHeight()); + byte[] encodedTrustedonsensusState = consensusStates.at(clientId).get(tmHeader.getTrustedHeight().getRevisionHeight()); require(encodedTrustedonsensusState != null, "LC: consensusState not found at trusted height"); ConsensusState trustedConsensusState = ConsensusState.decode(encodedTrustedonsensusState); @@ -150,12 +153,12 @@ public Map updateClient(String clientId, byte[] clientMessageByt // Header is different from existing consensus state and also valid, so freeze // the client and return if (conflictingHeader) { - clientState.setFrozenHeight(tmHeader.getSignedHeader().getHeader().getHeight()); + clientState.setFrozenHeight(newHeight(tmHeader.getSignedHeader().getHeader().getHeight())); encodedClientState = clientState.encode(); clientStates.set(clientId, encodedClientState); byte[] encodedConsensusState = toConsensusState(tmHeader).encode(); - consensusStates.at(clientId).set(clientState.getLatestHeight(), encodedConsensusState); + consensusStates.at(clientId).set(clientState.getLatestHeight().getRevisionHeight(), encodedConsensusState); processedHeights.at(clientId).set(tmHeader.getSignedHeader().getHeader().getHeight(), BigInteger.valueOf(Context.getBlockHeight())); processedTimes.at(clientId).set(tmHeader.getSignedHeader().getHeader().getHeight(), @@ -169,8 +172,8 @@ public Map updateClient(String clientId, byte[] clientMessageByt } // update the consensus state from a new header and set processed time metadata - if (tmHeader.getSignedHeader().getHeader().getHeight().compareTo(clientState.getLatestHeight()) > 0) { - clientState.setLatestHeight(tmHeader.getSignedHeader().getHeader().getHeight()); + if (tmHeader.getSignedHeader().getHeader().getHeight().compareTo(clientState.getLatestHeight().getRevisionHeight()) > 0) { + clientState.setLatestHeight(newHeight(tmHeader.getSignedHeader().getHeader().getHeight())); encodedClientState = clientState.encode(); clientStates.set(clientId, encodedClientState); } @@ -186,7 +189,7 @@ public Map updateClient(String clientId, byte[] clientMessageByt return Map.of( "clientStateCommitment", IBCCommitment.keccak256(encodedClientState), "consensusStateCommitment", IBCCommitment.keccak256(encodedConsensusState), - "height", newHeight(clientState.getLatestHeight()).encode()); + "height", clientState.getLatestHeight().encode()); } @External(readonly = true) @@ -249,17 +252,17 @@ public void verifyNonMembership( public void checkValidity( ClientState clientState, ConsensusState trustedConsensusState, - TmHeader tmHeader, + ibc.lightclients.tendermint.v1.Header tmHeader, Timestamp currentTime) { // assert header height is newer than consensus state require( tmHeader.getSignedHeader().getHeader().getHeight() - .compareTo(tmHeader.getTrustedHeight()) > 0, + .compareTo(tmHeader.getTrustedHeight().getRevisionHeight()) > 0, "LC: Trusted height is higher than untrusted header height"); - LightHeader lc = new LightHeader(); + tendermint.types.Header lc = new tendermint.types.Header(); lc.setChainId(clientState.getChainId()); - lc.setHeight(tmHeader.getTrustedHeight()); + lc.setHeight(tmHeader.getTrustedHeight().getRevisionHeight()); lc.setTime(trustedConsensusState.getTimestamp()); lc.setNextValidatorsHash(trustedConsensusState.getNextValidatorsHash()); @@ -287,10 +290,10 @@ public void checkValidity( } private void validateArgs(ClientState cs, BigInteger height, byte[] prefix, byte[] proof) { - Context.require(cs.getLatestHeight().compareTo(height) >= 0, + Context.require(cs.getLatestHeight().getRevisionHeight().compareTo(height) >= 0, "Latest height must be greater or equal to proof height"); - Context.require(cs.getFrozenHeight().equals(BigInteger.ZERO) || - cs.getFrozenHeight().compareTo(height) >= 0, + Context.require(cs.getFrozenHeight().getRevisionHeight().equals(BigInteger.ZERO) || + cs.getFrozenHeight().getRevisionHeight().compareTo(height) >= 0, "Client is Frozen"); Context.require(prefix.length > 0, "Prefix cant be empty"); Context.require(proof.length > 0, "Proof cant be empty"); diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/LightClientTest.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/LightClientTest.java index 47ea38a43..0fa6b2bd0 100644 --- a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/LightClientTest.java +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/LightClientTest.java @@ -9,19 +9,20 @@ import java.math.BigInteger; + +import com.google.protobuf.Timestamp; +import com.google.protobuf.Duration; + import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import ibc.tendermint.light.TendermintLight.ClientState; -import ibc.tendermint.light.TendermintLight.ConsensusState; -import ibc.tendermint.light.TendermintLight.Duration; -import ibc.tendermint.light.TendermintLight.Fraction; -import ibc.tendermint.light.TendermintLight.SignedHeader; -import icon.proto.clients.tendermint.Timestamp; -import icon.proto.clients.tendermint.TmHeader; -import icon.proto.core.client.Height; +import com.ibc.core.client.v1.Height; + import score.Address; +import com.ibc.lightclients.tendermint.v1.*; +import com.tendermint.types.*; + public class LightClientTest extends LightClientTestBase { @BeforeEach @@ -39,11 +40,11 @@ void createClient() throws Exception { // Assert ClientState clientState = getClientState(); - assertEquals(clientState.getLatestHeight(), initialHeader.getHeader().getHeight()); + assertEquals(clientState.getLatestHeight().getRevisionHeight(), initialHeader.getHeader().getHeight()); assertEquals(clientState.getAllowUpdateAfterExpiry(), allowUpdateAfterExpiry); assertEquals(clientState.getAllowUpdateAfterMisbehaviour(), allowUpdateAfterMisbehaviour); assertEquals(clientState.getChainId(), initialHeader.getHeader().getChainId()); - assertEquals(clientState.getFrozenHeight(), 0); + assertEquals(clientState.getFrozenHeight(), Height.newBuilder().build()); assertEquals(clientState.getMaxClockDrift(), maxClockDrift); assertEquals(clientState.getTrustLevel(), trustLevel); assertEquals(clientState.getTrustingPeriod(), trustingPeriod); @@ -74,7 +75,7 @@ void update_NonAdjacentInOrder() throws Exception { // Assert ClientState clientState = getClientState(); - assertEquals(clientState.getLatestHeight(), lastHeader.getHeader().getHeight()); + assertEquals(clientState.getLatestHeight().getRevisionHeight(), lastHeader.getHeader().getHeight()); assertConsensusState(parseSignedHeader(1)); assertConsensusState(parseSignedHeader(2)); assertConsensusState(lastHeader); @@ -92,7 +93,7 @@ void update_NonAdjacentOutOfOrder() throws Exception { // Assert ClientState clientState = getClientState(); - assertEquals(clientState.getLatestHeight(), lastHeader.getHeader().getHeight()); + assertEquals(clientState.getLatestHeight().getRevisionHeight(), lastHeader.getHeader().getHeight()); assertConsensusState(parseSignedHeader(1)); assertConsensusState(parseSignedHeader(2)); assertConsensusState(lastHeader); @@ -111,7 +112,7 @@ void updateMultiValidator() throws Exception { // Assert ClientState clientState = getClientState(); - assertEquals(clientState.getLatestHeight(), lastHeader.getHeader().getHeight()); + assertEquals(clientState.getLatestHeight().getRevisionHeight(), lastHeader.getHeader().getHeight()); assertConsensusState(parseSignedHeader(1)); assertConsensusState(parseSignedHeader(2)); assertConsensusState(lastHeader); @@ -130,7 +131,7 @@ void updateAdjacentBlocks() throws Exception { // Assert ClientState clientState = getClientState(); - assertEquals(clientState.getLatestHeight(), lastHeader.getHeader().getHeight()); + assertEquals(clientState.getLatestHeight().getRevisionHeight(), lastHeader.getHeader().getHeight()); assertConsensusState(parseSignedHeader(1)); assertConsensusState(parseSignedHeader(2)); assertConsensusState(lastHeader); @@ -144,17 +145,17 @@ void updateConflictingHeader() throws Exception { initializeClient(1); updateClient(2, 1); doNothing().when(clientSpy).checkValidity( - any(icon.proto.clients.tendermint.ClientState.class), - any(icon.proto.clients.tendermint.ConsensusState.class), - any(TmHeader.class), - any(Timestamp.class)); + any(ibc.lightclients.tendermint.v1.ClientState.class), + any(ibc.lightclients.tendermint.v1.ConsensusState.class), + any(ibc.lightclients.tendermint.v1.Header.class), + any()); // Act updateClient(3, 1); // Assert ClientState clientState = getClientState(); - assertEquals(clientState.getFrozenHeight(), duplicatedHeader.getHeader().getHeight()); + assertEquals(clientState.getFrozenHeight().getRevisionHeight(), duplicatedHeader.getHeader().getHeight()); } @Test @@ -246,16 +247,14 @@ void getTimestampAtHeight() throws Exception { SignedHeader header1 = parseSignedHeader(1); SignedHeader header2 = parseSignedHeader(2); - Height height1 = new Height(); - height1.setRevisionHeight(BigInteger.valueOf(header1.getHeader().getHeight())); - Height height2 = new Height(); - height2.setRevisionHeight(BigInteger.valueOf(header2.getHeader().getHeight())); + Height height1 = Height.newBuilder().setRevisionHeight(header1.getHeader().getHeight()).build(); + Height height2 = Height.newBuilder().setRevisionHeight(header2.getHeader().getHeight()).build(); long expectedTime1 = header1.getHeader().getTime().getSeconds(); long expectedTime2 = header2.getHeader().getTime().getSeconds(); // Act - BigInteger t1 = (BigInteger) client.call("getTimestampAtHeight", clientId, height1.encode()); - BigInteger t2 = (BigInteger) client.call("getTimestampAtHeight", clientId, height2.encode()); + BigInteger t1 = (BigInteger) client.call("getTimestampAtHeight", clientId, height1.toByteArray()); + BigInteger t2 = (BigInteger) client.call("getTimestampAtHeight", clientId, height2.toByteArray()); // Assert assertEquals(expectedTime1, t1.longValue()); @@ -265,14 +264,13 @@ void getTimestampAtHeight() throws Exception { @Test void getTimestampAtHeight_noConsensusState() throws Exception { // Arrange - Height height = new Height(); - height.setRevisionHeight(BigInteger.ONE); + Height height = Height.newBuilder().setRevisionHeight(1).build(); String expectedErrorMessage = "height: " + height.getRevisionHeight() + " does not have a consensus state"; // Act & Assert AssertionError e = assertThrows(AssertionError.class, - () -> client.call("getTimestampAtHeight", clientId, height.encode())); + () -> client.call("getTimestampAtHeight", clientId, height.toByteArray())); assertTrue(e.getMessage().contains(expectedErrorMessage)); } @@ -282,22 +280,20 @@ void getLatestHeight() throws Exception { SignedHeader header1 = parseSignedHeader(1); SignedHeader header2 = parseSignedHeader(2); - Height height1 = new Height(); - height1.setRevisionHeight(BigInteger.valueOf(header1.getHeader().getHeight())); - Height height2 = new Height(); - height2.setRevisionHeight(BigInteger.valueOf(header2.getHeader().getHeight())); + Height height1 = Height.newBuilder().setRevisionHeight(header1.getHeader().getHeight()).build(); + Height height2 = Height.newBuilder().setRevisionHeight(header2.getHeader().getHeight()).build(); // Act initializeClient(1); // Assert - assertArrayEquals(height1.encode(), (byte[]) client.call("getLatestHeight", clientId)); + assertArrayEquals(height1.toByteArray(), (byte[]) client.call("getLatestHeight", clientId)); // Act updateClient(2, 1); // Assert - assertArrayEquals(height2.encode(), (byte[]) client.call("getLatestHeight", clientId)); + assertArrayEquals(height2.toByteArray(), (byte[]) client.call("getLatestHeight", clientId)); } @Test diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/LightClientTestBase.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/LightClientTestBase.java index 263ae91e5..612c5daac 100644 --- a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/LightClientTestBase.java +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/LightClientTestBase.java @@ -8,7 +8,7 @@ import com.iconloop.score.test.ServiceManager; import com.iconloop.score.test.TestBase; import foundation.icon.ee.util.Crypto; -import ibc.tendermint.light.TendermintLight.*; +import ibc.lightclients.tendermint.v1.*; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -40,11 +40,22 @@ import com.iconloop.score.test.ServiceManager; import com.iconloop.score.test.TestBase; -import ibc.tendermint.light.TendermintLight.*; -import icon.proto.core.client.Height; +import com.google.protobuf.Timestamp; +import com.google.protobuf.Duration; import score.Context; import foundation.icon.ee.util.Crypto; +import com.ibc.lightclients.tendermint.v1.*; +import com.ibc.lightclients.tendermint.v1.ConsensusState; +import com.ibc.lightclients.tendermint.v1.ClientState; +import com.ibc.lightclients.tendermint.v1.Header; +import com.tendermint.types.*; +import com.tendermint.crypto.*; +import com.ibc.lightclients.tendermint.v1.Fraction; +import com.ibc.core.client.v1.Height; +import com.ibc.core.commitment.v1.MerkleRoot; +import com.tendermint.version.Consensus; + import static org.mockito.Mockito.spy; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.any; @@ -130,38 +141,38 @@ protected void teardown() { } protected void initializeClient(int blockOrder) throws Exception { - TmHeader tmHeader = TmHeader.newBuilder() + Header header = Header.newBuilder() .setSignedHeader(parseSignedHeader(blockOrder)) .setValidatorSet(parseValidatorSet(blockOrder)).build(); ClientState clientState = ClientState.newBuilder() - .setChainId(tmHeader.getSignedHeader().getHeader().getChainId()) + .setChainId(header.getSignedHeader().getHeader().getChainId()) .setTrustLevel(trustLevel) .setTrustingPeriod(trustingPeriod) .setMaxClockDrift(maxClockDrift) - .setLatestHeight(tmHeader.getSignedHeader().getHeader().getHeight()) + .setLatestHeight(Height.newBuilder().setRevisionHeight(header.getSignedHeader().getHeader().getHeight())) .setAllowUpdateAfterExpiry(allowUpdateAfterExpiry) .setAllowUpdateAfterMisbehaviour(allowUpdateAfterMisbehaviour).build(); MerkleRoot root = MerkleRoot.newBuilder() - .setHash(tmHeader.getSignedHeader().getHeader().getAppHash()).build(); + .setHash(header.getSignedHeader().getHeader().getAppHash()).build(); ConsensusState consensusState = ConsensusState.newBuilder() - .setTimestamp(tmHeader.getSignedHeader().getHeader().getTime()) + .setTimestamp(header.getSignedHeader().getHeader().getTime()) .setRoot(root) - .setNextValidatorsHash(tmHeader.getSignedHeader().getHeader().getNextValidatorsHash()).build(); + .setNextValidatorsHash(header.getSignedHeader().getHeader().getNextValidatorsHash()).build(); client.invoke(ibcHandler, "createClient", clientId, clientState.toByteArray(), consensusState.toByteArray(), new byte[0]); } protected void updateClient(int blockOrder, int referenceBlock) throws Exception { - TmHeader tmHeader = createHeader(blockOrder, referenceBlock); - client.invoke(ibcHandler, "updateClient", clientId, tmHeader.toByteArray()); + Header header = createHeader(blockOrder, referenceBlock); + client.invoke(ibcHandler, "updateClient", clientId, header.toByteArray()); } protected ConsensusState getConsensusState(Height height) throws Exception { - return ConsensusState.parseFrom((byte[]) client.call("getConsensusState", clientId, height.encode())); + return ConsensusState.parseFrom((byte[]) client.call("getConsensusState", clientId, height.toByteArray())); } protected ClientState getClientState() throws Exception { @@ -169,21 +180,20 @@ protected ClientState getClientState() throws Exception { } protected void assertConsensusState(SignedHeader header) throws Exception { - Height height = new Height(); - height.setRevisionHeight(BigInteger.valueOf(header.getHeader().getHeight())); + Height height = Height.newBuilder().setRevisionHeight(header.getHeader().getHeight()).build(); ConsensusState consensusState = getConsensusState(height); assertEquals(header.getHeader().getNextValidatorsHash(), consensusState.getNextValidatorsHash()); assertEquals(header.getHeader().getAppHash(), consensusState.getRoot().getHash()); assertEquals(header.getHeader().getTime(), consensusState.getTimestamp()); } - protected TmHeader createHeader(int blockOrder, int referenceBlock) throws Exception { - TmHeader tmHeader = TmHeader.newBuilder() + protected Header createHeader(int blockOrder, int referenceBlock) throws Exception { + Header header = Header.newBuilder() .setSignedHeader(parseSignedHeader(blockOrder)) .setValidatorSet(parseValidatorSet(blockOrder)) - .setTrustedHeight(parseSignedHeader(referenceBlock).getHeader().getHeight()) + .setTrustedHeight(Height.newBuilder().setRevisionHeight(parseSignedHeader(referenceBlock).getHeader().getHeight())) .setTrustedValidators(parseValidatorSet(referenceBlock)).build(); - return tmHeader; + return header; } protected SignedHeader parseSignedHeader(int blockOrder) throws Exception { @@ -198,7 +208,7 @@ protected SignedHeader parseSignedHeader(int blockOrder) throws Exception { Consensus version = Consensus.newBuilder() .setBlock(jsonHeader.get("version").get("block").asInt()).build(); - LightHeader lightHeader = LightHeader.newBuilder() + com.tendermint.types.Header lightHeader = com.tendermint.types.Header.newBuilder() .setVersion(version) .setChainId(jsonHeader.get("chain_id").asText()) .setHeight(jsonHeader.get("height").asInt()) diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/light/TendermintLight.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/light/TendermintLight.java deleted file mode 100644 index 2ecc57971..000000000 --- a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/light/TendermintLight.java +++ /dev/null @@ -1,11972 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: proto/clients/tendermint/TendermintLight.proto - -package ibc.tendermint.light; - -public final class TendermintLight { - private TendermintLight() {} - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistryLite registry) { - } - /** - * Protobuf enum {@code ibc.tendermint.light.BlockIDFlag} - */ - public enum BlockIDFlag - implements com.google.protobuf.Internal.EnumLite { - /** - * BLOCK_ID_FLAG_UNKNOWN = 0; - */ - BLOCK_ID_FLAG_UNKNOWN(0), - /** - * BLOCK_ID_FLAG_ABSENT = 1; - */ - BLOCK_ID_FLAG_ABSENT(1), - /** - * BLOCK_ID_FLAG_COMMIT = 2; - */ - BLOCK_ID_FLAG_COMMIT(2), - /** - * BLOCK_ID_FLAG_NIL = 3; - */ - BLOCK_ID_FLAG_NIL(3), - UNRECOGNIZED(-1), - ; - - /** - * BLOCK_ID_FLAG_UNKNOWN = 0; - */ - public static final int BLOCK_ID_FLAG_UNKNOWN_VALUE = 0; - /** - * BLOCK_ID_FLAG_ABSENT = 1; - */ - public static final int BLOCK_ID_FLAG_ABSENT_VALUE = 1; - /** - * BLOCK_ID_FLAG_COMMIT = 2; - */ - public static final int BLOCK_ID_FLAG_COMMIT_VALUE = 2; - /** - * BLOCK_ID_FLAG_NIL = 3; - */ - public static final int BLOCK_ID_FLAG_NIL_VALUE = 3; - - - @java.lang.Override - public final int getNumber() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - return value; - } - - /** - * @param value The number of the enum to look for. - * @return The enum associated with the given number. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static BlockIDFlag valueOf(int value) { - return forNumber(value); - } - - public static BlockIDFlag forNumber(int value) { - switch (value) { - case 0: return BLOCK_ID_FLAG_UNKNOWN; - case 1: return BLOCK_ID_FLAG_ABSENT; - case 2: return BLOCK_ID_FLAG_COMMIT; - case 3: return BLOCK_ID_FLAG_NIL; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static final com.google.protobuf.Internal.EnumLiteMap< - BlockIDFlag> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - @java.lang.Override - public BlockIDFlag findValueByNumber(int number) { - return BlockIDFlag.forNumber(number); - } - }; - - public static com.google.protobuf.Internal.EnumVerifier - internalGetVerifier() { - return BlockIDFlagVerifier.INSTANCE; - } - - private static final class BlockIDFlagVerifier implements - com.google.protobuf.Internal.EnumVerifier { - static final com.google.protobuf.Internal.EnumVerifier INSTANCE = new BlockIDFlagVerifier(); - @java.lang.Override - public boolean isInRange(int number) { - return BlockIDFlag.forNumber(number) != null; - } - }; - - private final int value; - - private BlockIDFlag(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:ibc.tendermint.light.BlockIDFlag) - } - - /** - * Protobuf enum {@code ibc.tendermint.light.SignedMsgType} - */ - public enum SignedMsgType - implements com.google.protobuf.Internal.EnumLite { - /** - * SIGNED_MSG_TYPE_UNKNOWN = 0; - */ - SIGNED_MSG_TYPE_UNKNOWN(0), - /** - *
-     * Votes
-     * 
- * - * SIGNED_MSG_TYPE_PREVOTE = 1; - */ - SIGNED_MSG_TYPE_PREVOTE(1), - /** - * SIGNED_MSG_TYPE_PRECOMMIT = 2; - */ - SIGNED_MSG_TYPE_PRECOMMIT(2), - /** - *
-     * Proposals
-     * 
- * - * SIGNED_MSG_TYPE_PROPOSAL = 32; - */ - SIGNED_MSG_TYPE_PROPOSAL(32), - UNRECOGNIZED(-1), - ; - - /** - * SIGNED_MSG_TYPE_UNKNOWN = 0; - */ - public static final int SIGNED_MSG_TYPE_UNKNOWN_VALUE = 0; - /** - *
-     * Votes
-     * 
- * - * SIGNED_MSG_TYPE_PREVOTE = 1; - */ - public static final int SIGNED_MSG_TYPE_PREVOTE_VALUE = 1; - /** - * SIGNED_MSG_TYPE_PRECOMMIT = 2; - */ - public static final int SIGNED_MSG_TYPE_PRECOMMIT_VALUE = 2; - /** - *
-     * Proposals
-     * 
- * - * SIGNED_MSG_TYPE_PROPOSAL = 32; - */ - public static final int SIGNED_MSG_TYPE_PROPOSAL_VALUE = 32; - - - @java.lang.Override - public final int getNumber() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - return value; - } - - /** - * @param value The number of the enum to look for. - * @return The enum associated with the given number. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static SignedMsgType valueOf(int value) { - return forNumber(value); - } - - public static SignedMsgType forNumber(int value) { - switch (value) { - case 0: return SIGNED_MSG_TYPE_UNKNOWN; - case 1: return SIGNED_MSG_TYPE_PREVOTE; - case 2: return SIGNED_MSG_TYPE_PRECOMMIT; - case 32: return SIGNED_MSG_TYPE_PROPOSAL; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static final com.google.protobuf.Internal.EnumLiteMap< - SignedMsgType> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - @java.lang.Override - public SignedMsgType findValueByNumber(int number) { - return SignedMsgType.forNumber(number); - } - }; - - public static com.google.protobuf.Internal.EnumVerifier - internalGetVerifier() { - return SignedMsgTypeVerifier.INSTANCE; - } - - private static final class SignedMsgTypeVerifier implements - com.google.protobuf.Internal.EnumVerifier { - static final com.google.protobuf.Internal.EnumVerifier INSTANCE = new SignedMsgTypeVerifier(); - @java.lang.Override - public boolean isInRange(int number) { - return SignedMsgType.forNumber(number) != null; - } - }; - - private final int value; - - private SignedMsgType(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:ibc.tendermint.light.SignedMsgType) - } - - public interface FractionOrBuilder extends - // @@protoc_insertion_point(interface_extends:ibc.tendermint.light.Fraction) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * uint64 numerator = 1; - * @return The numerator. - */ - long getNumerator(); - - /** - * uint64 denominator = 2; - * @return The denominator. - */ - long getDenominator(); - } - /** - * Protobuf type {@code ibc.tendermint.light.Fraction} - */ - public static final class Fraction extends - com.google.protobuf.GeneratedMessageLite< - Fraction, Fraction.Builder> implements - // @@protoc_insertion_point(message_implements:ibc.tendermint.light.Fraction) - FractionOrBuilder { - private Fraction() { - } - public static final int NUMERATOR_FIELD_NUMBER = 1; - private long numerator_; - /** - * uint64 numerator = 1; - * @return The numerator. - */ - @java.lang.Override - public long getNumerator() { - return numerator_; - } - /** - * uint64 numerator = 1; - * @param value The numerator to set. - */ - private void setNumerator(long value) { - - numerator_ = value; - } - /** - * uint64 numerator = 1; - */ - private void clearNumerator() { - - numerator_ = 0L; - } - - public static final int DENOMINATOR_FIELD_NUMBER = 2; - private long denominator_; - /** - * uint64 denominator = 2; - * @return The denominator. - */ - @java.lang.Override - public long getDenominator() { - return denominator_; - } - /** - * uint64 denominator = 2; - * @param value The denominator to set. - */ - private void setDenominator(long value) { - - denominator_ = value; - } - /** - * uint64 denominator = 2; - */ - private void clearDenominator() { - - denominator_ = 0L; - } - - public static ibc.tendermint.light.TendermintLight.Fraction parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static ibc.tendermint.light.TendermintLight.Fraction parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.Fraction parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static ibc.tendermint.light.TendermintLight.Fraction parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.Fraction parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static ibc.tendermint.light.TendermintLight.Fraction parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.Fraction parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static ibc.tendermint.light.TendermintLight.Fraction parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.Fraction parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - public static ibc.tendermint.light.TendermintLight.Fraction parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.Fraction parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static ibc.tendermint.light.TendermintLight.Fraction parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(ibc.tendermint.light.TendermintLight.Fraction prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - * Protobuf type {@code ibc.tendermint.light.Fraction} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - ibc.tendermint.light.TendermintLight.Fraction, Builder> implements - // @@protoc_insertion_point(builder_implements:ibc.tendermint.light.Fraction) - ibc.tendermint.light.TendermintLight.FractionOrBuilder { - // Construct using ibc.tendermint.light.TendermintLight.Fraction.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - /** - * uint64 numerator = 1; - * @return The numerator. - */ - @java.lang.Override - public long getNumerator() { - return instance.getNumerator(); - } - /** - * uint64 numerator = 1; - * @param value The numerator to set. - * @return This builder for chaining. - */ - public Builder setNumerator(long value) { - copyOnWrite(); - instance.setNumerator(value); - return this; - } - /** - * uint64 numerator = 1; - * @return This builder for chaining. - */ - public Builder clearNumerator() { - copyOnWrite(); - instance.clearNumerator(); - return this; - } - - /** - * uint64 denominator = 2; - * @return The denominator. - */ - @java.lang.Override - public long getDenominator() { - return instance.getDenominator(); - } - /** - * uint64 denominator = 2; - * @param value The denominator to set. - * @return This builder for chaining. - */ - public Builder setDenominator(long value) { - copyOnWrite(); - instance.setDenominator(value); - return this; - } - /** - * uint64 denominator = 2; - * @return This builder for chaining. - */ - public Builder clearDenominator() { - copyOnWrite(); - instance.clearDenominator(); - return this; - } - - // @@protoc_insertion_point(builder_scope:ibc.tendermint.light.Fraction) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new ibc.tendermint.light.TendermintLight.Fraction(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[] { - "numerator_", - "denominator_", - }; - java.lang.String info = - "\u0000\u0002\u0000\u0000\u0001\u0002\u0002\u0000\u0000\u0000\u0001\u0003\u0002\u0003" + - ""; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (ibc.tendermint.light.TendermintLight.Fraction.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:ibc.tendermint.light.Fraction) - private static final ibc.tendermint.light.TendermintLight.Fraction DEFAULT_INSTANCE; - static { - Fraction defaultInstance = new Fraction(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - Fraction.class, defaultInstance); - } - - public static ibc.tendermint.light.TendermintLight.Fraction getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface DurationOrBuilder extends - // @@protoc_insertion_point(interface_extends:ibc.tendermint.light.Duration) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * int64 seconds = 1; - * @return The seconds. - */ - long getSeconds(); - - /** - * int32 nanos = 2; - * @return The nanos. - */ - int getNanos(); - } - /** - *
-   * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Timestamp
-   * 
- * - * Protobuf type {@code ibc.tendermint.light.Duration} - */ - public static final class Duration extends - com.google.protobuf.GeneratedMessageLite< - Duration, Duration.Builder> implements - // @@protoc_insertion_point(message_implements:ibc.tendermint.light.Duration) - DurationOrBuilder { - private Duration() { - } - public static final int SECONDS_FIELD_NUMBER = 1; - private long seconds_; - /** - * int64 seconds = 1; - * @return The seconds. - */ - @java.lang.Override - public long getSeconds() { - return seconds_; - } - /** - * int64 seconds = 1; - * @param value The seconds to set. - */ - private void setSeconds(long value) { - - seconds_ = value; - } - /** - * int64 seconds = 1; - */ - private void clearSeconds() { - - seconds_ = 0L; - } - - public static final int NANOS_FIELD_NUMBER = 2; - private int nanos_; - /** - * int32 nanos = 2; - * @return The nanos. - */ - @java.lang.Override - public int getNanos() { - return nanos_; - } - /** - * int32 nanos = 2; - * @param value The nanos to set. - */ - private void setNanos(int value) { - - nanos_ = value; - } - /** - * int32 nanos = 2; - */ - private void clearNanos() { - - nanos_ = 0; - } - - public static ibc.tendermint.light.TendermintLight.Duration parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static ibc.tendermint.light.TendermintLight.Duration parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.Duration parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static ibc.tendermint.light.TendermintLight.Duration parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.Duration parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static ibc.tendermint.light.TendermintLight.Duration parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.Duration parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static ibc.tendermint.light.TendermintLight.Duration parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.Duration parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - public static ibc.tendermint.light.TendermintLight.Duration parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.Duration parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static ibc.tendermint.light.TendermintLight.Duration parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(ibc.tendermint.light.TendermintLight.Duration prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - *
-     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Timestamp
-     * 
- * - * Protobuf type {@code ibc.tendermint.light.Duration} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - ibc.tendermint.light.TendermintLight.Duration, Builder> implements - // @@protoc_insertion_point(builder_implements:ibc.tendermint.light.Duration) - ibc.tendermint.light.TendermintLight.DurationOrBuilder { - // Construct using ibc.tendermint.light.TendermintLight.Duration.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - /** - * int64 seconds = 1; - * @return The seconds. - */ - @java.lang.Override - public long getSeconds() { - return instance.getSeconds(); - } - /** - * int64 seconds = 1; - * @param value The seconds to set. - * @return This builder for chaining. - */ - public Builder setSeconds(long value) { - copyOnWrite(); - instance.setSeconds(value); - return this; - } - /** - * int64 seconds = 1; - * @return This builder for chaining. - */ - public Builder clearSeconds() { - copyOnWrite(); - instance.clearSeconds(); - return this; - } - - /** - * int32 nanos = 2; - * @return The nanos. - */ - @java.lang.Override - public int getNanos() { - return instance.getNanos(); - } - /** - * int32 nanos = 2; - * @param value The nanos to set. - * @return This builder for chaining. - */ - public Builder setNanos(int value) { - copyOnWrite(); - instance.setNanos(value); - return this; - } - /** - * int32 nanos = 2; - * @return This builder for chaining. - */ - public Builder clearNanos() { - copyOnWrite(); - instance.clearNanos(); - return this; - } - - // @@protoc_insertion_point(builder_scope:ibc.tendermint.light.Duration) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new ibc.tendermint.light.TendermintLight.Duration(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[] { - "seconds_", - "nanos_", - }; - java.lang.String info = - "\u0000\u0002\u0000\u0000\u0001\u0002\u0002\u0000\u0000\u0000\u0001\u0002\u0002\u0004" + - ""; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (ibc.tendermint.light.TendermintLight.Duration.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:ibc.tendermint.light.Duration) - private static final ibc.tendermint.light.TendermintLight.Duration DEFAULT_INSTANCE; - static { - Duration defaultInstance = new Duration(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - Duration.class, defaultInstance); - } - - public static ibc.tendermint.light.TendermintLight.Duration getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface ConsensusOrBuilder extends - // @@protoc_insertion_point(interface_extends:ibc.tendermint.light.Consensus) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * uint64 block = 1; - * @return The block. - */ - long getBlock(); - - /** - * uint64 app = 2; - * @return The app. - */ - long getApp(); - } - /** - * Protobuf type {@code ibc.tendermint.light.Consensus} - */ - public static final class Consensus extends - com.google.protobuf.GeneratedMessageLite< - Consensus, Consensus.Builder> implements - // @@protoc_insertion_point(message_implements:ibc.tendermint.light.Consensus) - ConsensusOrBuilder { - private Consensus() { - } - public static final int BLOCK_FIELD_NUMBER = 1; - private long block_; - /** - * uint64 block = 1; - * @return The block. - */ - @java.lang.Override - public long getBlock() { - return block_; - } - /** - * uint64 block = 1; - * @param value The block to set. - */ - private void setBlock(long value) { - - block_ = value; - } - /** - * uint64 block = 1; - */ - private void clearBlock() { - - block_ = 0L; - } - - public static final int APP_FIELD_NUMBER = 2; - private long app_; - /** - * uint64 app = 2; - * @return The app. - */ - @java.lang.Override - public long getApp() { - return app_; - } - /** - * uint64 app = 2; - * @param value The app to set. - */ - private void setApp(long value) { - - app_ = value; - } - /** - * uint64 app = 2; - */ - private void clearApp() { - - app_ = 0L; - } - - public static ibc.tendermint.light.TendermintLight.Consensus parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static ibc.tendermint.light.TendermintLight.Consensus parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.Consensus parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static ibc.tendermint.light.TendermintLight.Consensus parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.Consensus parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static ibc.tendermint.light.TendermintLight.Consensus parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.Consensus parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static ibc.tendermint.light.TendermintLight.Consensus parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.Consensus parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - public static ibc.tendermint.light.TendermintLight.Consensus parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.Consensus parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static ibc.tendermint.light.TendermintLight.Consensus parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(ibc.tendermint.light.TendermintLight.Consensus prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - * Protobuf type {@code ibc.tendermint.light.Consensus} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - ibc.tendermint.light.TendermintLight.Consensus, Builder> implements - // @@protoc_insertion_point(builder_implements:ibc.tendermint.light.Consensus) - ibc.tendermint.light.TendermintLight.ConsensusOrBuilder { - // Construct using ibc.tendermint.light.TendermintLight.Consensus.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - /** - * uint64 block = 1; - * @return The block. - */ - @java.lang.Override - public long getBlock() { - return instance.getBlock(); - } - /** - * uint64 block = 1; - * @param value The block to set. - * @return This builder for chaining. - */ - public Builder setBlock(long value) { - copyOnWrite(); - instance.setBlock(value); - return this; - } - /** - * uint64 block = 1; - * @return This builder for chaining. - */ - public Builder clearBlock() { - copyOnWrite(); - instance.clearBlock(); - return this; - } - - /** - * uint64 app = 2; - * @return The app. - */ - @java.lang.Override - public long getApp() { - return instance.getApp(); - } - /** - * uint64 app = 2; - * @param value The app to set. - * @return This builder for chaining. - */ - public Builder setApp(long value) { - copyOnWrite(); - instance.setApp(value); - return this; - } - /** - * uint64 app = 2; - * @return This builder for chaining. - */ - public Builder clearApp() { - copyOnWrite(); - instance.clearApp(); - return this; - } - - // @@protoc_insertion_point(builder_scope:ibc.tendermint.light.Consensus) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new ibc.tendermint.light.TendermintLight.Consensus(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[] { - "block_", - "app_", - }; - java.lang.String info = - "\u0000\u0002\u0000\u0000\u0001\u0002\u0002\u0000\u0000\u0000\u0001\u0003\u0002\u0003" + - ""; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (ibc.tendermint.light.TendermintLight.Consensus.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:ibc.tendermint.light.Consensus) - private static final ibc.tendermint.light.TendermintLight.Consensus DEFAULT_INSTANCE; - static { - Consensus defaultInstance = new Consensus(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - Consensus.class, defaultInstance); - } - - public static ibc.tendermint.light.TendermintLight.Consensus getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface ClientStateOrBuilder extends - // @@protoc_insertion_point(interface_extends:ibc.tendermint.light.ClientState) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * string chain_id = 1; - * @return The chainId. - */ - java.lang.String getChainId(); - /** - * string chain_id = 1; - * @return The bytes for chainId. - */ - com.google.protobuf.ByteString - getChainIdBytes(); - - /** - * .ibc.tendermint.light.Fraction trust_level = 2; - * @return Whether the trustLevel field is set. - */ - boolean hasTrustLevel(); - /** - * .ibc.tendermint.light.Fraction trust_level = 2; - * @return The trustLevel. - */ - ibc.tendermint.light.TendermintLight.Fraction getTrustLevel(); - - /** - *
-     * duration of the period since the LastestTimestamp during which the
-     * submitted headers are valid for upgrade
-     * 
- * - * .ibc.tendermint.light.Duration trusting_period = 3; - * @return Whether the trustingPeriod field is set. - */ - boolean hasTrustingPeriod(); - /** - *
-     * duration of the period since the LastestTimestamp during which the
-     * submitted headers are valid for upgrade
-     * 
- * - * .ibc.tendermint.light.Duration trusting_period = 3; - * @return The trustingPeriod. - */ - ibc.tendermint.light.TendermintLight.Duration getTrustingPeriod(); - - /** - *
-     * duration of the staking unbonding period
-     * 
- * - * .ibc.tendermint.light.Duration unbonding_period = 4; - * @return Whether the unbondingPeriod field is set. - */ - boolean hasUnbondingPeriod(); - /** - *
-     * duration of the staking unbonding period
-     * 
- * - * .ibc.tendermint.light.Duration unbonding_period = 4; - * @return The unbondingPeriod. - */ - ibc.tendermint.light.TendermintLight.Duration getUnbondingPeriod(); - - /** - *
-     * defines how much new (untrusted) header's Time can drift into the future.
-     * 
- * - * .ibc.tendermint.light.Duration max_clock_drift = 5; - * @return Whether the maxClockDrift field is set. - */ - boolean hasMaxClockDrift(); - /** - *
-     * defines how much new (untrusted) header's Time can drift into the future.
-     * 
- * - * .ibc.tendermint.light.Duration max_clock_drift = 5; - * @return The maxClockDrift. - */ - ibc.tendermint.light.TendermintLight.Duration getMaxClockDrift(); - - /** - *
-     * Block height when the client was frozen due to a misbehaviour
-     *ibc.core.client.v1.Height frozen_height = 6;
-     * 
- * - * int64 frozen_height = 6; - * @return The frozenHeight. - */ - long getFrozenHeight(); - - /** - *
-     * Latest height the client was updated to
-     * 
- * - * int64 latest_height = 7; - * @return The latestHeight. - */ - long getLatestHeight(); - - /** - *
-     * This flag, when set to true, will allow governance to recover a client
-     * which has expired
-     * 
- * - * bool allow_update_after_expiry = 8; - * @return The allowUpdateAfterExpiry. - */ - boolean getAllowUpdateAfterExpiry(); - - /** - *
-     * This flag, when set to true, will allow governance to unfreeze a client
-     * whose chain has experienced a misbehaviour event
-     * 
- * - * bool allow_update_after_misbehaviour = 9; - * @return The allowUpdateAfterMisbehaviour. - */ - boolean getAllowUpdateAfterMisbehaviour(); - } - /** - * Protobuf type {@code ibc.tendermint.light.ClientState} - */ - public static final class ClientState extends - com.google.protobuf.GeneratedMessageLite< - ClientState, ClientState.Builder> implements - // @@protoc_insertion_point(message_implements:ibc.tendermint.light.ClientState) - ClientStateOrBuilder { - private ClientState() { - chainId_ = ""; - } - public static final int CHAIN_ID_FIELD_NUMBER = 1; - private java.lang.String chainId_; - /** - * string chain_id = 1; - * @return The chainId. - */ - @java.lang.Override - public java.lang.String getChainId() { - return chainId_; - } - /** - * string chain_id = 1; - * @return The bytes for chainId. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getChainIdBytes() { - return com.google.protobuf.ByteString.copyFromUtf8(chainId_); - } - /** - * string chain_id = 1; - * @param value The chainId to set. - */ - private void setChainId( - java.lang.String value) { - java.lang.Class valueClass = value.getClass(); - - chainId_ = value; - } - /** - * string chain_id = 1; - */ - private void clearChainId() { - - chainId_ = getDefaultInstance().getChainId(); - } - /** - * string chain_id = 1; - * @param value The bytes for chainId to set. - */ - private void setChainIdBytes( - com.google.protobuf.ByteString value) { - checkByteStringIsUtf8(value); - chainId_ = value.toStringUtf8(); - - } - - public static final int TRUST_LEVEL_FIELD_NUMBER = 2; - private ibc.tendermint.light.TendermintLight.Fraction trustLevel_; - /** - * .ibc.tendermint.light.Fraction trust_level = 2; - */ - @java.lang.Override - public boolean hasTrustLevel() { - return trustLevel_ != null; - } - /** - * .ibc.tendermint.light.Fraction trust_level = 2; - */ - @java.lang.Override - public ibc.tendermint.light.TendermintLight.Fraction getTrustLevel() { - return trustLevel_ == null ? ibc.tendermint.light.TendermintLight.Fraction.getDefaultInstance() : trustLevel_; - } - /** - * .ibc.tendermint.light.Fraction trust_level = 2; - */ - private void setTrustLevel(ibc.tendermint.light.TendermintLight.Fraction value) { - value.getClass(); - trustLevel_ = value; - - } - /** - * .ibc.tendermint.light.Fraction trust_level = 2; - */ - @java.lang.SuppressWarnings({"ReferenceEquality"}) - private void mergeTrustLevel(ibc.tendermint.light.TendermintLight.Fraction value) { - value.getClass(); - if (trustLevel_ != null && - trustLevel_ != ibc.tendermint.light.TendermintLight.Fraction.getDefaultInstance()) { - trustLevel_ = - ibc.tendermint.light.TendermintLight.Fraction.newBuilder(trustLevel_).mergeFrom(value).buildPartial(); - } else { - trustLevel_ = value; - } - - } - /** - * .ibc.tendermint.light.Fraction trust_level = 2; - */ - private void clearTrustLevel() { trustLevel_ = null; - - } - - public static final int TRUSTING_PERIOD_FIELD_NUMBER = 3; - private ibc.tendermint.light.TendermintLight.Duration trustingPeriod_; - /** - *
-     * duration of the period since the LastestTimestamp during which the
-     * submitted headers are valid for upgrade
-     * 
- * - * .ibc.tendermint.light.Duration trusting_period = 3; - */ - @java.lang.Override - public boolean hasTrustingPeriod() { - return trustingPeriod_ != null; - } - /** - *
-     * duration of the period since the LastestTimestamp during which the
-     * submitted headers are valid for upgrade
-     * 
- * - * .ibc.tendermint.light.Duration trusting_period = 3; - */ - @java.lang.Override - public ibc.tendermint.light.TendermintLight.Duration getTrustingPeriod() { - return trustingPeriod_ == null ? ibc.tendermint.light.TendermintLight.Duration.getDefaultInstance() : trustingPeriod_; - } - /** - *
-     * duration of the period since the LastestTimestamp during which the
-     * submitted headers are valid for upgrade
-     * 
- * - * .ibc.tendermint.light.Duration trusting_period = 3; - */ - private void setTrustingPeriod(ibc.tendermint.light.TendermintLight.Duration value) { - value.getClass(); - trustingPeriod_ = value; - - } - /** - *
-     * duration of the period since the LastestTimestamp during which the
-     * submitted headers are valid for upgrade
-     * 
- * - * .ibc.tendermint.light.Duration trusting_period = 3; - */ - @java.lang.SuppressWarnings({"ReferenceEquality"}) - private void mergeTrustingPeriod(ibc.tendermint.light.TendermintLight.Duration value) { - value.getClass(); - if (trustingPeriod_ != null && - trustingPeriod_ != ibc.tendermint.light.TendermintLight.Duration.getDefaultInstance()) { - trustingPeriod_ = - ibc.tendermint.light.TendermintLight.Duration.newBuilder(trustingPeriod_).mergeFrom(value).buildPartial(); - } else { - trustingPeriod_ = value; - } - - } - /** - *
-     * duration of the period since the LastestTimestamp during which the
-     * submitted headers are valid for upgrade
-     * 
- * - * .ibc.tendermint.light.Duration trusting_period = 3; - */ - private void clearTrustingPeriod() { trustingPeriod_ = null; - - } - - public static final int UNBONDING_PERIOD_FIELD_NUMBER = 4; - private ibc.tendermint.light.TendermintLight.Duration unbondingPeriod_; - /** - *
-     * duration of the staking unbonding period
-     * 
- * - * .ibc.tendermint.light.Duration unbonding_period = 4; - */ - @java.lang.Override - public boolean hasUnbondingPeriod() { - return unbondingPeriod_ != null; - } - /** - *
-     * duration of the staking unbonding period
-     * 
- * - * .ibc.tendermint.light.Duration unbonding_period = 4; - */ - @java.lang.Override - public ibc.tendermint.light.TendermintLight.Duration getUnbondingPeriod() { - return unbondingPeriod_ == null ? ibc.tendermint.light.TendermintLight.Duration.getDefaultInstance() : unbondingPeriod_; - } - /** - *
-     * duration of the staking unbonding period
-     * 
- * - * .ibc.tendermint.light.Duration unbonding_period = 4; - */ - private void setUnbondingPeriod(ibc.tendermint.light.TendermintLight.Duration value) { - value.getClass(); - unbondingPeriod_ = value; - - } - /** - *
-     * duration of the staking unbonding period
-     * 
- * - * .ibc.tendermint.light.Duration unbonding_period = 4; - */ - @java.lang.SuppressWarnings({"ReferenceEquality"}) - private void mergeUnbondingPeriod(ibc.tendermint.light.TendermintLight.Duration value) { - value.getClass(); - if (unbondingPeriod_ != null && - unbondingPeriod_ != ibc.tendermint.light.TendermintLight.Duration.getDefaultInstance()) { - unbondingPeriod_ = - ibc.tendermint.light.TendermintLight.Duration.newBuilder(unbondingPeriod_).mergeFrom(value).buildPartial(); - } else { - unbondingPeriod_ = value; - } - - } - /** - *
-     * duration of the staking unbonding period
-     * 
- * - * .ibc.tendermint.light.Duration unbonding_period = 4; - */ - private void clearUnbondingPeriod() { unbondingPeriod_ = null; - - } - - public static final int MAX_CLOCK_DRIFT_FIELD_NUMBER = 5; - private ibc.tendermint.light.TendermintLight.Duration maxClockDrift_; - /** - *
-     * defines how much new (untrusted) header's Time can drift into the future.
-     * 
- * - * .ibc.tendermint.light.Duration max_clock_drift = 5; - */ - @java.lang.Override - public boolean hasMaxClockDrift() { - return maxClockDrift_ != null; - } - /** - *
-     * defines how much new (untrusted) header's Time can drift into the future.
-     * 
- * - * .ibc.tendermint.light.Duration max_clock_drift = 5; - */ - @java.lang.Override - public ibc.tendermint.light.TendermintLight.Duration getMaxClockDrift() { - return maxClockDrift_ == null ? ibc.tendermint.light.TendermintLight.Duration.getDefaultInstance() : maxClockDrift_; - } - /** - *
-     * defines how much new (untrusted) header's Time can drift into the future.
-     * 
- * - * .ibc.tendermint.light.Duration max_clock_drift = 5; - */ - private void setMaxClockDrift(ibc.tendermint.light.TendermintLight.Duration value) { - value.getClass(); - maxClockDrift_ = value; - - } - /** - *
-     * defines how much new (untrusted) header's Time can drift into the future.
-     * 
- * - * .ibc.tendermint.light.Duration max_clock_drift = 5; - */ - @java.lang.SuppressWarnings({"ReferenceEquality"}) - private void mergeMaxClockDrift(ibc.tendermint.light.TendermintLight.Duration value) { - value.getClass(); - if (maxClockDrift_ != null && - maxClockDrift_ != ibc.tendermint.light.TendermintLight.Duration.getDefaultInstance()) { - maxClockDrift_ = - ibc.tendermint.light.TendermintLight.Duration.newBuilder(maxClockDrift_).mergeFrom(value).buildPartial(); - } else { - maxClockDrift_ = value; - } - - } - /** - *
-     * defines how much new (untrusted) header's Time can drift into the future.
-     * 
- * - * .ibc.tendermint.light.Duration max_clock_drift = 5; - */ - private void clearMaxClockDrift() { maxClockDrift_ = null; - - } - - public static final int FROZEN_HEIGHT_FIELD_NUMBER = 6; - private long frozenHeight_; - /** - *
-     * Block height when the client was frozen due to a misbehaviour
-     *ibc.core.client.v1.Height frozen_height = 6;
-     * 
- * - * int64 frozen_height = 6; - * @return The frozenHeight. - */ - @java.lang.Override - public long getFrozenHeight() { - return frozenHeight_; - } - /** - *
-     * Block height when the client was frozen due to a misbehaviour
-     *ibc.core.client.v1.Height frozen_height = 6;
-     * 
- * - * int64 frozen_height = 6; - * @param value The frozenHeight to set. - */ - private void setFrozenHeight(long value) { - - frozenHeight_ = value; - } - /** - *
-     * Block height when the client was frozen due to a misbehaviour
-     *ibc.core.client.v1.Height frozen_height = 6;
-     * 
- * - * int64 frozen_height = 6; - */ - private void clearFrozenHeight() { - - frozenHeight_ = 0L; - } - - public static final int LATEST_HEIGHT_FIELD_NUMBER = 7; - private long latestHeight_; - /** - *
-     * Latest height the client was updated to
-     * 
- * - * int64 latest_height = 7; - * @return The latestHeight. - */ - @java.lang.Override - public long getLatestHeight() { - return latestHeight_; - } - /** - *
-     * Latest height the client was updated to
-     * 
- * - * int64 latest_height = 7; - * @param value The latestHeight to set. - */ - private void setLatestHeight(long value) { - - latestHeight_ = value; - } - /** - *
-     * Latest height the client was updated to
-     * 
- * - * int64 latest_height = 7; - */ - private void clearLatestHeight() { - - latestHeight_ = 0L; - } - - public static final int ALLOW_UPDATE_AFTER_EXPIRY_FIELD_NUMBER = 8; - private boolean allowUpdateAfterExpiry_; - /** - *
-     * This flag, when set to true, will allow governance to recover a client
-     * which has expired
-     * 
- * - * bool allow_update_after_expiry = 8; - * @return The allowUpdateAfterExpiry. - */ - @java.lang.Override - public boolean getAllowUpdateAfterExpiry() { - return allowUpdateAfterExpiry_; - } - /** - *
-     * This flag, when set to true, will allow governance to recover a client
-     * which has expired
-     * 
- * - * bool allow_update_after_expiry = 8; - * @param value The allowUpdateAfterExpiry to set. - */ - private void setAllowUpdateAfterExpiry(boolean value) { - - allowUpdateAfterExpiry_ = value; - } - /** - *
-     * This flag, when set to true, will allow governance to recover a client
-     * which has expired
-     * 
- * - * bool allow_update_after_expiry = 8; - */ - private void clearAllowUpdateAfterExpiry() { - - allowUpdateAfterExpiry_ = false; - } - - public static final int ALLOW_UPDATE_AFTER_MISBEHAVIOUR_FIELD_NUMBER = 9; - private boolean allowUpdateAfterMisbehaviour_; - /** - *
-     * This flag, when set to true, will allow governance to unfreeze a client
-     * whose chain has experienced a misbehaviour event
-     * 
- * - * bool allow_update_after_misbehaviour = 9; - * @return The allowUpdateAfterMisbehaviour. - */ - @java.lang.Override - public boolean getAllowUpdateAfterMisbehaviour() { - return allowUpdateAfterMisbehaviour_; - } - /** - *
-     * This flag, when set to true, will allow governance to unfreeze a client
-     * whose chain has experienced a misbehaviour event
-     * 
- * - * bool allow_update_after_misbehaviour = 9; - * @param value The allowUpdateAfterMisbehaviour to set. - */ - private void setAllowUpdateAfterMisbehaviour(boolean value) { - - allowUpdateAfterMisbehaviour_ = value; - } - /** - *
-     * This flag, when set to true, will allow governance to unfreeze a client
-     * whose chain has experienced a misbehaviour event
-     * 
- * - * bool allow_update_after_misbehaviour = 9; - */ - private void clearAllowUpdateAfterMisbehaviour() { - - allowUpdateAfterMisbehaviour_ = false; - } - - public static ibc.tendermint.light.TendermintLight.ClientState parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static ibc.tendermint.light.TendermintLight.ClientState parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.ClientState parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static ibc.tendermint.light.TendermintLight.ClientState parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.ClientState parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static ibc.tendermint.light.TendermintLight.ClientState parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.ClientState parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static ibc.tendermint.light.TendermintLight.ClientState parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.ClientState parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - public static ibc.tendermint.light.TendermintLight.ClientState parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.ClientState parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static ibc.tendermint.light.TendermintLight.ClientState parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(ibc.tendermint.light.TendermintLight.ClientState prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - * Protobuf type {@code ibc.tendermint.light.ClientState} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - ibc.tendermint.light.TendermintLight.ClientState, Builder> implements - // @@protoc_insertion_point(builder_implements:ibc.tendermint.light.ClientState) - ibc.tendermint.light.TendermintLight.ClientStateOrBuilder { - // Construct using ibc.tendermint.light.TendermintLight.ClientState.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - /** - * string chain_id = 1; - * @return The chainId. - */ - @java.lang.Override - public java.lang.String getChainId() { - return instance.getChainId(); - } - /** - * string chain_id = 1; - * @return The bytes for chainId. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getChainIdBytes() { - return instance.getChainIdBytes(); - } - /** - * string chain_id = 1; - * @param value The chainId to set. - * @return This builder for chaining. - */ - public Builder setChainId( - java.lang.String value) { - copyOnWrite(); - instance.setChainId(value); - return this; - } - /** - * string chain_id = 1; - * @return This builder for chaining. - */ - public Builder clearChainId() { - copyOnWrite(); - instance.clearChainId(); - return this; - } - /** - * string chain_id = 1; - * @param value The bytes for chainId to set. - * @return This builder for chaining. - */ - public Builder setChainIdBytes( - com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setChainIdBytes(value); - return this; - } - - /** - * .ibc.tendermint.light.Fraction trust_level = 2; - */ - @java.lang.Override - public boolean hasTrustLevel() { - return instance.hasTrustLevel(); - } - /** - * .ibc.tendermint.light.Fraction trust_level = 2; - */ - @java.lang.Override - public ibc.tendermint.light.TendermintLight.Fraction getTrustLevel() { - return instance.getTrustLevel(); - } - /** - * .ibc.tendermint.light.Fraction trust_level = 2; - */ - public Builder setTrustLevel(ibc.tendermint.light.TendermintLight.Fraction value) { - copyOnWrite(); - instance.setTrustLevel(value); - return this; - } - /** - * .ibc.tendermint.light.Fraction trust_level = 2; - */ - public Builder setTrustLevel( - ibc.tendermint.light.TendermintLight.Fraction.Builder builderForValue) { - copyOnWrite(); - instance.setTrustLevel(builderForValue.build()); - return this; - } - /** - * .ibc.tendermint.light.Fraction trust_level = 2; - */ - public Builder mergeTrustLevel(ibc.tendermint.light.TendermintLight.Fraction value) { - copyOnWrite(); - instance.mergeTrustLevel(value); - return this; - } - /** - * .ibc.tendermint.light.Fraction trust_level = 2; - */ - public Builder clearTrustLevel() { copyOnWrite(); - instance.clearTrustLevel(); - return this; - } - - /** - *
-       * duration of the period since the LastestTimestamp during which the
-       * submitted headers are valid for upgrade
-       * 
- * - * .ibc.tendermint.light.Duration trusting_period = 3; - */ - @java.lang.Override - public boolean hasTrustingPeriod() { - return instance.hasTrustingPeriod(); - } - /** - *
-       * duration of the period since the LastestTimestamp during which the
-       * submitted headers are valid for upgrade
-       * 
- * - * .ibc.tendermint.light.Duration trusting_period = 3; - */ - @java.lang.Override - public ibc.tendermint.light.TendermintLight.Duration getTrustingPeriod() { - return instance.getTrustingPeriod(); - } - /** - *
-       * duration of the period since the LastestTimestamp during which the
-       * submitted headers are valid for upgrade
-       * 
- * - * .ibc.tendermint.light.Duration trusting_period = 3; - */ - public Builder setTrustingPeriod(ibc.tendermint.light.TendermintLight.Duration value) { - copyOnWrite(); - instance.setTrustingPeriod(value); - return this; - } - /** - *
-       * duration of the period since the LastestTimestamp during which the
-       * submitted headers are valid for upgrade
-       * 
- * - * .ibc.tendermint.light.Duration trusting_period = 3; - */ - public Builder setTrustingPeriod( - ibc.tendermint.light.TendermintLight.Duration.Builder builderForValue) { - copyOnWrite(); - instance.setTrustingPeriod(builderForValue.build()); - return this; - } - /** - *
-       * duration of the period since the LastestTimestamp during which the
-       * submitted headers are valid for upgrade
-       * 
- * - * .ibc.tendermint.light.Duration trusting_period = 3; - */ - public Builder mergeTrustingPeriod(ibc.tendermint.light.TendermintLight.Duration value) { - copyOnWrite(); - instance.mergeTrustingPeriod(value); - return this; - } - /** - *
-       * duration of the period since the LastestTimestamp during which the
-       * submitted headers are valid for upgrade
-       * 
- * - * .ibc.tendermint.light.Duration trusting_period = 3; - */ - public Builder clearTrustingPeriod() { copyOnWrite(); - instance.clearTrustingPeriod(); - return this; - } - - /** - *
-       * duration of the staking unbonding period
-       * 
- * - * .ibc.tendermint.light.Duration unbonding_period = 4; - */ - @java.lang.Override - public boolean hasUnbondingPeriod() { - return instance.hasUnbondingPeriod(); - } - /** - *
-       * duration of the staking unbonding period
-       * 
- * - * .ibc.tendermint.light.Duration unbonding_period = 4; - */ - @java.lang.Override - public ibc.tendermint.light.TendermintLight.Duration getUnbondingPeriod() { - return instance.getUnbondingPeriod(); - } - /** - *
-       * duration of the staking unbonding period
-       * 
- * - * .ibc.tendermint.light.Duration unbonding_period = 4; - */ - public Builder setUnbondingPeriod(ibc.tendermint.light.TendermintLight.Duration value) { - copyOnWrite(); - instance.setUnbondingPeriod(value); - return this; - } - /** - *
-       * duration of the staking unbonding period
-       * 
- * - * .ibc.tendermint.light.Duration unbonding_period = 4; - */ - public Builder setUnbondingPeriod( - ibc.tendermint.light.TendermintLight.Duration.Builder builderForValue) { - copyOnWrite(); - instance.setUnbondingPeriod(builderForValue.build()); - return this; - } - /** - *
-       * duration of the staking unbonding period
-       * 
- * - * .ibc.tendermint.light.Duration unbonding_period = 4; - */ - public Builder mergeUnbondingPeriod(ibc.tendermint.light.TendermintLight.Duration value) { - copyOnWrite(); - instance.mergeUnbondingPeriod(value); - return this; - } - /** - *
-       * duration of the staking unbonding period
-       * 
- * - * .ibc.tendermint.light.Duration unbonding_period = 4; - */ - public Builder clearUnbondingPeriod() { copyOnWrite(); - instance.clearUnbondingPeriod(); - return this; - } - - /** - *
-       * defines how much new (untrusted) header's Time can drift into the future.
-       * 
- * - * .ibc.tendermint.light.Duration max_clock_drift = 5; - */ - @java.lang.Override - public boolean hasMaxClockDrift() { - return instance.hasMaxClockDrift(); - } - /** - *
-       * defines how much new (untrusted) header's Time can drift into the future.
-       * 
- * - * .ibc.tendermint.light.Duration max_clock_drift = 5; - */ - @java.lang.Override - public ibc.tendermint.light.TendermintLight.Duration getMaxClockDrift() { - return instance.getMaxClockDrift(); - } - /** - *
-       * defines how much new (untrusted) header's Time can drift into the future.
-       * 
- * - * .ibc.tendermint.light.Duration max_clock_drift = 5; - */ - public Builder setMaxClockDrift(ibc.tendermint.light.TendermintLight.Duration value) { - copyOnWrite(); - instance.setMaxClockDrift(value); - return this; - } - /** - *
-       * defines how much new (untrusted) header's Time can drift into the future.
-       * 
- * - * .ibc.tendermint.light.Duration max_clock_drift = 5; - */ - public Builder setMaxClockDrift( - ibc.tendermint.light.TendermintLight.Duration.Builder builderForValue) { - copyOnWrite(); - instance.setMaxClockDrift(builderForValue.build()); - return this; - } - /** - *
-       * defines how much new (untrusted) header's Time can drift into the future.
-       * 
- * - * .ibc.tendermint.light.Duration max_clock_drift = 5; - */ - public Builder mergeMaxClockDrift(ibc.tendermint.light.TendermintLight.Duration value) { - copyOnWrite(); - instance.mergeMaxClockDrift(value); - return this; - } - /** - *
-       * defines how much new (untrusted) header's Time can drift into the future.
-       * 
- * - * .ibc.tendermint.light.Duration max_clock_drift = 5; - */ - public Builder clearMaxClockDrift() { copyOnWrite(); - instance.clearMaxClockDrift(); - return this; - } - - /** - *
-       * Block height when the client was frozen due to a misbehaviour
-       *ibc.core.client.v1.Height frozen_height = 6;
-       * 
- * - * int64 frozen_height = 6; - * @return The frozenHeight. - */ - @java.lang.Override - public long getFrozenHeight() { - return instance.getFrozenHeight(); - } - /** - *
-       * Block height when the client was frozen due to a misbehaviour
-       *ibc.core.client.v1.Height frozen_height = 6;
-       * 
- * - * int64 frozen_height = 6; - * @param value The frozenHeight to set. - * @return This builder for chaining. - */ - public Builder setFrozenHeight(long value) { - copyOnWrite(); - instance.setFrozenHeight(value); - return this; - } - /** - *
-       * Block height when the client was frozen due to a misbehaviour
-       *ibc.core.client.v1.Height frozen_height = 6;
-       * 
- * - * int64 frozen_height = 6; - * @return This builder for chaining. - */ - public Builder clearFrozenHeight() { - copyOnWrite(); - instance.clearFrozenHeight(); - return this; - } - - /** - *
-       * Latest height the client was updated to
-       * 
- * - * int64 latest_height = 7; - * @return The latestHeight. - */ - @java.lang.Override - public long getLatestHeight() { - return instance.getLatestHeight(); - } - /** - *
-       * Latest height the client was updated to
-       * 
- * - * int64 latest_height = 7; - * @param value The latestHeight to set. - * @return This builder for chaining. - */ - public Builder setLatestHeight(long value) { - copyOnWrite(); - instance.setLatestHeight(value); - return this; - } - /** - *
-       * Latest height the client was updated to
-       * 
- * - * int64 latest_height = 7; - * @return This builder for chaining. - */ - public Builder clearLatestHeight() { - copyOnWrite(); - instance.clearLatestHeight(); - return this; - } - - /** - *
-       * This flag, when set to true, will allow governance to recover a client
-       * which has expired
-       * 
- * - * bool allow_update_after_expiry = 8; - * @return The allowUpdateAfterExpiry. - */ - @java.lang.Override - public boolean getAllowUpdateAfterExpiry() { - return instance.getAllowUpdateAfterExpiry(); - } - /** - *
-       * This flag, when set to true, will allow governance to recover a client
-       * which has expired
-       * 
- * - * bool allow_update_after_expiry = 8; - * @param value The allowUpdateAfterExpiry to set. - * @return This builder for chaining. - */ - public Builder setAllowUpdateAfterExpiry(boolean value) { - copyOnWrite(); - instance.setAllowUpdateAfterExpiry(value); - return this; - } - /** - *
-       * This flag, when set to true, will allow governance to recover a client
-       * which has expired
-       * 
- * - * bool allow_update_after_expiry = 8; - * @return This builder for chaining. - */ - public Builder clearAllowUpdateAfterExpiry() { - copyOnWrite(); - instance.clearAllowUpdateAfterExpiry(); - return this; - } - - /** - *
-       * This flag, when set to true, will allow governance to unfreeze a client
-       * whose chain has experienced a misbehaviour event
-       * 
- * - * bool allow_update_after_misbehaviour = 9; - * @return The allowUpdateAfterMisbehaviour. - */ - @java.lang.Override - public boolean getAllowUpdateAfterMisbehaviour() { - return instance.getAllowUpdateAfterMisbehaviour(); - } - /** - *
-       * This flag, when set to true, will allow governance to unfreeze a client
-       * whose chain has experienced a misbehaviour event
-       * 
- * - * bool allow_update_after_misbehaviour = 9; - * @param value The allowUpdateAfterMisbehaviour to set. - * @return This builder for chaining. - */ - public Builder setAllowUpdateAfterMisbehaviour(boolean value) { - copyOnWrite(); - instance.setAllowUpdateAfterMisbehaviour(value); - return this; - } - /** - *
-       * This flag, when set to true, will allow governance to unfreeze a client
-       * whose chain has experienced a misbehaviour event
-       * 
- * - * bool allow_update_after_misbehaviour = 9; - * @return This builder for chaining. - */ - public Builder clearAllowUpdateAfterMisbehaviour() { - copyOnWrite(); - instance.clearAllowUpdateAfterMisbehaviour(); - return this; - } - - // @@protoc_insertion_point(builder_scope:ibc.tendermint.light.ClientState) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new ibc.tendermint.light.TendermintLight.ClientState(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[] { - "chainId_", - "trustLevel_", - "trustingPeriod_", - "unbondingPeriod_", - "maxClockDrift_", - "frozenHeight_", - "latestHeight_", - "allowUpdateAfterExpiry_", - "allowUpdateAfterMisbehaviour_", - }; - java.lang.String info = - "\u0000\t\u0000\u0000\u0001\t\t\u0000\u0000\u0000\u0001\u0208\u0002\t\u0003\t\u0004" + - "\t\u0005\t\u0006\u0002\u0007\u0002\b\u0007\t\u0007"; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (ibc.tendermint.light.TendermintLight.ClientState.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:ibc.tendermint.light.ClientState) - private static final ibc.tendermint.light.TendermintLight.ClientState DEFAULT_INSTANCE; - static { - ClientState defaultInstance = new ClientState(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - ClientState.class, defaultInstance); - } - - public static ibc.tendermint.light.TendermintLight.ClientState getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface ConsensusStateOrBuilder extends - // @@protoc_insertion_point(interface_extends:ibc.tendermint.light.ConsensusState) - com.google.protobuf.MessageLiteOrBuilder { - - /** - *
-     * timestamp that corresponds to the block height in which the ConsensusState
-     * was stored.
-     * 
- * - * .ibc.tendermint.light.Timestamp timestamp = 1; - * @return Whether the timestamp field is set. - */ - boolean hasTimestamp(); - /** - *
-     * timestamp that corresponds to the block height in which the ConsensusState
-     * was stored.
-     * 
- * - * .ibc.tendermint.light.Timestamp timestamp = 1; - * @return The timestamp. - */ - ibc.tendermint.light.TendermintLight.Timestamp getTimestamp(); - - /** - *
-     * commitment root (i.e app hash)
-     * 
- * - * .ibc.tendermint.light.MerkleRoot root = 2; - * @return Whether the root field is set. - */ - boolean hasRoot(); - /** - *
-     * commitment root (i.e app hash)
-     * 
- * - * .ibc.tendermint.light.MerkleRoot root = 2; - * @return The root. - */ - ibc.tendermint.light.TendermintLight.MerkleRoot getRoot(); - - /** - * bytes next_validators_hash = 3; - * @return The nextValidatorsHash. - */ - com.google.protobuf.ByteString getNextValidatorsHash(); - } - /** - *
-   * ConsensusState defines the consensus state from Tendermint.
-   * 
- * - * Protobuf type {@code ibc.tendermint.light.ConsensusState} - */ - public static final class ConsensusState extends - com.google.protobuf.GeneratedMessageLite< - ConsensusState, ConsensusState.Builder> implements - // @@protoc_insertion_point(message_implements:ibc.tendermint.light.ConsensusState) - ConsensusStateOrBuilder { - private ConsensusState() { - nextValidatorsHash_ = com.google.protobuf.ByteString.EMPTY; - } - public static final int TIMESTAMP_FIELD_NUMBER = 1; - private ibc.tendermint.light.TendermintLight.Timestamp timestamp_; - /** - *
-     * timestamp that corresponds to the block height in which the ConsensusState
-     * was stored.
-     * 
- * - * .ibc.tendermint.light.Timestamp timestamp = 1; - */ - @java.lang.Override - public boolean hasTimestamp() { - return timestamp_ != null; - } - /** - *
-     * timestamp that corresponds to the block height in which the ConsensusState
-     * was stored.
-     * 
- * - * .ibc.tendermint.light.Timestamp timestamp = 1; - */ - @java.lang.Override - public ibc.tendermint.light.TendermintLight.Timestamp getTimestamp() { - return timestamp_ == null ? ibc.tendermint.light.TendermintLight.Timestamp.getDefaultInstance() : timestamp_; - } - /** - *
-     * timestamp that corresponds to the block height in which the ConsensusState
-     * was stored.
-     * 
- * - * .ibc.tendermint.light.Timestamp timestamp = 1; - */ - private void setTimestamp(ibc.tendermint.light.TendermintLight.Timestamp value) { - value.getClass(); - timestamp_ = value; - - } - /** - *
-     * timestamp that corresponds to the block height in which the ConsensusState
-     * was stored.
-     * 
- * - * .ibc.tendermint.light.Timestamp timestamp = 1; - */ - @java.lang.SuppressWarnings({"ReferenceEquality"}) - private void mergeTimestamp(ibc.tendermint.light.TendermintLight.Timestamp value) { - value.getClass(); - if (timestamp_ != null && - timestamp_ != ibc.tendermint.light.TendermintLight.Timestamp.getDefaultInstance()) { - timestamp_ = - ibc.tendermint.light.TendermintLight.Timestamp.newBuilder(timestamp_).mergeFrom(value).buildPartial(); - } else { - timestamp_ = value; - } - - } - /** - *
-     * timestamp that corresponds to the block height in which the ConsensusState
-     * was stored.
-     * 
- * - * .ibc.tendermint.light.Timestamp timestamp = 1; - */ - private void clearTimestamp() { timestamp_ = null; - - } - - public static final int ROOT_FIELD_NUMBER = 2; - private ibc.tendermint.light.TendermintLight.MerkleRoot root_; - /** - *
-     * commitment root (i.e app hash)
-     * 
- * - * .ibc.tendermint.light.MerkleRoot root = 2; - */ - @java.lang.Override - public boolean hasRoot() { - return root_ != null; - } - /** - *
-     * commitment root (i.e app hash)
-     * 
- * - * .ibc.tendermint.light.MerkleRoot root = 2; - */ - @java.lang.Override - public ibc.tendermint.light.TendermintLight.MerkleRoot getRoot() { - return root_ == null ? ibc.tendermint.light.TendermintLight.MerkleRoot.getDefaultInstance() : root_; - } - /** - *
-     * commitment root (i.e app hash)
-     * 
- * - * .ibc.tendermint.light.MerkleRoot root = 2; - */ - private void setRoot(ibc.tendermint.light.TendermintLight.MerkleRoot value) { - value.getClass(); - root_ = value; - - } - /** - *
-     * commitment root (i.e app hash)
-     * 
- * - * .ibc.tendermint.light.MerkleRoot root = 2; - */ - @java.lang.SuppressWarnings({"ReferenceEquality"}) - private void mergeRoot(ibc.tendermint.light.TendermintLight.MerkleRoot value) { - value.getClass(); - if (root_ != null && - root_ != ibc.tendermint.light.TendermintLight.MerkleRoot.getDefaultInstance()) { - root_ = - ibc.tendermint.light.TendermintLight.MerkleRoot.newBuilder(root_).mergeFrom(value).buildPartial(); - } else { - root_ = value; - } - - } - /** - *
-     * commitment root (i.e app hash)
-     * 
- * - * .ibc.tendermint.light.MerkleRoot root = 2; - */ - private void clearRoot() { root_ = null; - - } - - public static final int NEXT_VALIDATORS_HASH_FIELD_NUMBER = 3; - private com.google.protobuf.ByteString nextValidatorsHash_; - /** - * bytes next_validators_hash = 3; - * @return The nextValidatorsHash. - */ - @java.lang.Override - public com.google.protobuf.ByteString getNextValidatorsHash() { - return nextValidatorsHash_; - } - /** - * bytes next_validators_hash = 3; - * @param value The nextValidatorsHash to set. - */ - private void setNextValidatorsHash(com.google.protobuf.ByteString value) { - java.lang.Class valueClass = value.getClass(); - - nextValidatorsHash_ = value; - } - /** - * bytes next_validators_hash = 3; - */ - private void clearNextValidatorsHash() { - - nextValidatorsHash_ = getDefaultInstance().getNextValidatorsHash(); - } - - public static ibc.tendermint.light.TendermintLight.ConsensusState parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static ibc.tendermint.light.TendermintLight.ConsensusState parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.ConsensusState parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static ibc.tendermint.light.TendermintLight.ConsensusState parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.ConsensusState parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static ibc.tendermint.light.TendermintLight.ConsensusState parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.ConsensusState parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static ibc.tendermint.light.TendermintLight.ConsensusState parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.ConsensusState parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - public static ibc.tendermint.light.TendermintLight.ConsensusState parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.ConsensusState parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static ibc.tendermint.light.TendermintLight.ConsensusState parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(ibc.tendermint.light.TendermintLight.ConsensusState prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - *
-     * ConsensusState defines the consensus state from Tendermint.
-     * 
- * - * Protobuf type {@code ibc.tendermint.light.ConsensusState} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - ibc.tendermint.light.TendermintLight.ConsensusState, Builder> implements - // @@protoc_insertion_point(builder_implements:ibc.tendermint.light.ConsensusState) - ibc.tendermint.light.TendermintLight.ConsensusStateOrBuilder { - // Construct using ibc.tendermint.light.TendermintLight.ConsensusState.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - /** - *
-       * timestamp that corresponds to the block height in which the ConsensusState
-       * was stored.
-       * 
- * - * .ibc.tendermint.light.Timestamp timestamp = 1; - */ - @java.lang.Override - public boolean hasTimestamp() { - return instance.hasTimestamp(); - } - /** - *
-       * timestamp that corresponds to the block height in which the ConsensusState
-       * was stored.
-       * 
- * - * .ibc.tendermint.light.Timestamp timestamp = 1; - */ - @java.lang.Override - public ibc.tendermint.light.TendermintLight.Timestamp getTimestamp() { - return instance.getTimestamp(); - } - /** - *
-       * timestamp that corresponds to the block height in which the ConsensusState
-       * was stored.
-       * 
- * - * .ibc.tendermint.light.Timestamp timestamp = 1; - */ - public Builder setTimestamp(ibc.tendermint.light.TendermintLight.Timestamp value) { - copyOnWrite(); - instance.setTimestamp(value); - return this; - } - /** - *
-       * timestamp that corresponds to the block height in which the ConsensusState
-       * was stored.
-       * 
- * - * .ibc.tendermint.light.Timestamp timestamp = 1; - */ - public Builder setTimestamp( - ibc.tendermint.light.TendermintLight.Timestamp.Builder builderForValue) { - copyOnWrite(); - instance.setTimestamp(builderForValue.build()); - return this; - } - /** - *
-       * timestamp that corresponds to the block height in which the ConsensusState
-       * was stored.
-       * 
- * - * .ibc.tendermint.light.Timestamp timestamp = 1; - */ - public Builder mergeTimestamp(ibc.tendermint.light.TendermintLight.Timestamp value) { - copyOnWrite(); - instance.mergeTimestamp(value); - return this; - } - /** - *
-       * timestamp that corresponds to the block height in which the ConsensusState
-       * was stored.
-       * 
- * - * .ibc.tendermint.light.Timestamp timestamp = 1; - */ - public Builder clearTimestamp() { copyOnWrite(); - instance.clearTimestamp(); - return this; - } - - /** - *
-       * commitment root (i.e app hash)
-       * 
- * - * .ibc.tendermint.light.MerkleRoot root = 2; - */ - @java.lang.Override - public boolean hasRoot() { - return instance.hasRoot(); - } - /** - *
-       * commitment root (i.e app hash)
-       * 
- * - * .ibc.tendermint.light.MerkleRoot root = 2; - */ - @java.lang.Override - public ibc.tendermint.light.TendermintLight.MerkleRoot getRoot() { - return instance.getRoot(); - } - /** - *
-       * commitment root (i.e app hash)
-       * 
- * - * .ibc.tendermint.light.MerkleRoot root = 2; - */ - public Builder setRoot(ibc.tendermint.light.TendermintLight.MerkleRoot value) { - copyOnWrite(); - instance.setRoot(value); - return this; - } - /** - *
-       * commitment root (i.e app hash)
-       * 
- * - * .ibc.tendermint.light.MerkleRoot root = 2; - */ - public Builder setRoot( - ibc.tendermint.light.TendermintLight.MerkleRoot.Builder builderForValue) { - copyOnWrite(); - instance.setRoot(builderForValue.build()); - return this; - } - /** - *
-       * commitment root (i.e app hash)
-       * 
- * - * .ibc.tendermint.light.MerkleRoot root = 2; - */ - public Builder mergeRoot(ibc.tendermint.light.TendermintLight.MerkleRoot value) { - copyOnWrite(); - instance.mergeRoot(value); - return this; - } - /** - *
-       * commitment root (i.e app hash)
-       * 
- * - * .ibc.tendermint.light.MerkleRoot root = 2; - */ - public Builder clearRoot() { copyOnWrite(); - instance.clearRoot(); - return this; - } - - /** - * bytes next_validators_hash = 3; - * @return The nextValidatorsHash. - */ - @java.lang.Override - public com.google.protobuf.ByteString getNextValidatorsHash() { - return instance.getNextValidatorsHash(); - } - /** - * bytes next_validators_hash = 3; - * @param value The nextValidatorsHash to set. - * @return This builder for chaining. - */ - public Builder setNextValidatorsHash(com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setNextValidatorsHash(value); - return this; - } - /** - * bytes next_validators_hash = 3; - * @return This builder for chaining. - */ - public Builder clearNextValidatorsHash() { - copyOnWrite(); - instance.clearNextValidatorsHash(); - return this; - } - - // @@protoc_insertion_point(builder_scope:ibc.tendermint.light.ConsensusState) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new ibc.tendermint.light.TendermintLight.ConsensusState(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[] { - "timestamp_", - "root_", - "nextValidatorsHash_", - }; - java.lang.String info = - "\u0000\u0003\u0000\u0000\u0001\u0003\u0003\u0000\u0000\u0000\u0001\t\u0002\t\u0003" + - "\n"; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (ibc.tendermint.light.TendermintLight.ConsensusState.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:ibc.tendermint.light.ConsensusState) - private static final ibc.tendermint.light.TendermintLight.ConsensusState DEFAULT_INSTANCE; - static { - ConsensusState defaultInstance = new ConsensusState(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - ConsensusState.class, defaultInstance); - } - - public static ibc.tendermint.light.TendermintLight.ConsensusState getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface MerkleRootOrBuilder extends - // @@protoc_insertion_point(interface_extends:ibc.tendermint.light.MerkleRoot) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * bytes hash = 1; - * @return The hash. - */ - com.google.protobuf.ByteString getHash(); - } - /** - *
-   * MerkleRoot defines a merkle root hash.
-   * In the Cosmos SDK, the AppHash of a block header becomes the root.
-   * 
- * - * Protobuf type {@code ibc.tendermint.light.MerkleRoot} - */ - public static final class MerkleRoot extends - com.google.protobuf.GeneratedMessageLite< - MerkleRoot, MerkleRoot.Builder> implements - // @@protoc_insertion_point(message_implements:ibc.tendermint.light.MerkleRoot) - MerkleRootOrBuilder { - private MerkleRoot() { - hash_ = com.google.protobuf.ByteString.EMPTY; - } - public static final int HASH_FIELD_NUMBER = 1; - private com.google.protobuf.ByteString hash_; - /** - * bytes hash = 1; - * @return The hash. - */ - @java.lang.Override - public com.google.protobuf.ByteString getHash() { - return hash_; - } - /** - * bytes hash = 1; - * @param value The hash to set. - */ - private void setHash(com.google.protobuf.ByteString value) { - java.lang.Class valueClass = value.getClass(); - - hash_ = value; - } - /** - * bytes hash = 1; - */ - private void clearHash() { - - hash_ = getDefaultInstance().getHash(); - } - - public static ibc.tendermint.light.TendermintLight.MerkleRoot parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static ibc.tendermint.light.TendermintLight.MerkleRoot parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.MerkleRoot parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static ibc.tendermint.light.TendermintLight.MerkleRoot parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.MerkleRoot parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static ibc.tendermint.light.TendermintLight.MerkleRoot parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.MerkleRoot parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static ibc.tendermint.light.TendermintLight.MerkleRoot parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.MerkleRoot parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - public static ibc.tendermint.light.TendermintLight.MerkleRoot parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.MerkleRoot parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static ibc.tendermint.light.TendermintLight.MerkleRoot parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(ibc.tendermint.light.TendermintLight.MerkleRoot prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - *
-     * MerkleRoot defines a merkle root hash.
-     * In the Cosmos SDK, the AppHash of a block header becomes the root.
-     * 
- * - * Protobuf type {@code ibc.tendermint.light.MerkleRoot} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - ibc.tendermint.light.TendermintLight.MerkleRoot, Builder> implements - // @@protoc_insertion_point(builder_implements:ibc.tendermint.light.MerkleRoot) - ibc.tendermint.light.TendermintLight.MerkleRootOrBuilder { - // Construct using ibc.tendermint.light.TendermintLight.MerkleRoot.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - /** - * bytes hash = 1; - * @return The hash. - */ - @java.lang.Override - public com.google.protobuf.ByteString getHash() { - return instance.getHash(); - } - /** - * bytes hash = 1; - * @param value The hash to set. - * @return This builder for chaining. - */ - public Builder setHash(com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setHash(value); - return this; - } - /** - * bytes hash = 1; - * @return This builder for chaining. - */ - public Builder clearHash() { - copyOnWrite(); - instance.clearHash(); - return this; - } - - // @@protoc_insertion_point(builder_scope:ibc.tendermint.light.MerkleRoot) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new ibc.tendermint.light.TendermintLight.MerkleRoot(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[] { - "hash_", - }; - java.lang.String info = - "\u0000\u0001\u0000\u0000\u0001\u0001\u0001\u0000\u0000\u0000\u0001\n"; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (ibc.tendermint.light.TendermintLight.MerkleRoot.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:ibc.tendermint.light.MerkleRoot) - private static final ibc.tendermint.light.TendermintLight.MerkleRoot DEFAULT_INSTANCE; - static { - MerkleRoot defaultInstance = new MerkleRoot(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - MerkleRoot.class, defaultInstance); - } - - public static ibc.tendermint.light.TendermintLight.MerkleRoot getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface CanonicalPartSetHeaderOrBuilder extends - // @@protoc_insertion_point(interface_extends:ibc.tendermint.light.CanonicalPartSetHeader) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * uint32 total = 1; - * @return The total. - */ - int getTotal(); - - /** - * bytes hash = 2; - * @return The hash. - */ - com.google.protobuf.ByteString getHash(); - } - /** - * Protobuf type {@code ibc.tendermint.light.CanonicalPartSetHeader} - */ - public static final class CanonicalPartSetHeader extends - com.google.protobuf.GeneratedMessageLite< - CanonicalPartSetHeader, CanonicalPartSetHeader.Builder> implements - // @@protoc_insertion_point(message_implements:ibc.tendermint.light.CanonicalPartSetHeader) - CanonicalPartSetHeaderOrBuilder { - private CanonicalPartSetHeader() { - hash_ = com.google.protobuf.ByteString.EMPTY; - } - public static final int TOTAL_FIELD_NUMBER = 1; - private int total_; - /** - * uint32 total = 1; - * @return The total. - */ - @java.lang.Override - public int getTotal() { - return total_; - } - /** - * uint32 total = 1; - * @param value The total to set. - */ - private void setTotal(int value) { - - total_ = value; - } - /** - * uint32 total = 1; - */ - private void clearTotal() { - - total_ = 0; - } - - public static final int HASH_FIELD_NUMBER = 2; - private com.google.protobuf.ByteString hash_; - /** - * bytes hash = 2; - * @return The hash. - */ - @java.lang.Override - public com.google.protobuf.ByteString getHash() { - return hash_; - } - /** - * bytes hash = 2; - * @param value The hash to set. - */ - private void setHash(com.google.protobuf.ByteString value) { - java.lang.Class valueClass = value.getClass(); - - hash_ = value; - } - /** - * bytes hash = 2; - */ - private void clearHash() { - - hash_ = getDefaultInstance().getHash(); - } - - public static ibc.tendermint.light.TendermintLight.CanonicalPartSetHeader parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static ibc.tendermint.light.TendermintLight.CanonicalPartSetHeader parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.CanonicalPartSetHeader parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static ibc.tendermint.light.TendermintLight.CanonicalPartSetHeader parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.CanonicalPartSetHeader parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static ibc.tendermint.light.TendermintLight.CanonicalPartSetHeader parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.CanonicalPartSetHeader parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static ibc.tendermint.light.TendermintLight.CanonicalPartSetHeader parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.CanonicalPartSetHeader parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - public static ibc.tendermint.light.TendermintLight.CanonicalPartSetHeader parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.CanonicalPartSetHeader parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static ibc.tendermint.light.TendermintLight.CanonicalPartSetHeader parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(ibc.tendermint.light.TendermintLight.CanonicalPartSetHeader prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - * Protobuf type {@code ibc.tendermint.light.CanonicalPartSetHeader} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - ibc.tendermint.light.TendermintLight.CanonicalPartSetHeader, Builder> implements - // @@protoc_insertion_point(builder_implements:ibc.tendermint.light.CanonicalPartSetHeader) - ibc.tendermint.light.TendermintLight.CanonicalPartSetHeaderOrBuilder { - // Construct using ibc.tendermint.light.TendermintLight.CanonicalPartSetHeader.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - /** - * uint32 total = 1; - * @return The total. - */ - @java.lang.Override - public int getTotal() { - return instance.getTotal(); - } - /** - * uint32 total = 1; - * @param value The total to set. - * @return This builder for chaining. - */ - public Builder setTotal(int value) { - copyOnWrite(); - instance.setTotal(value); - return this; - } - /** - * uint32 total = 1; - * @return This builder for chaining. - */ - public Builder clearTotal() { - copyOnWrite(); - instance.clearTotal(); - return this; - } - - /** - * bytes hash = 2; - * @return The hash. - */ - @java.lang.Override - public com.google.protobuf.ByteString getHash() { - return instance.getHash(); - } - /** - * bytes hash = 2; - * @param value The hash to set. - * @return This builder for chaining. - */ - public Builder setHash(com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setHash(value); - return this; - } - /** - * bytes hash = 2; - * @return This builder for chaining. - */ - public Builder clearHash() { - copyOnWrite(); - instance.clearHash(); - return this; - } - - // @@protoc_insertion_point(builder_scope:ibc.tendermint.light.CanonicalPartSetHeader) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new ibc.tendermint.light.TendermintLight.CanonicalPartSetHeader(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[] { - "total_", - "hash_", - }; - java.lang.String info = - "\u0000\u0002\u0000\u0000\u0001\u0002\u0002\u0000\u0000\u0000\u0001\u000b\u0002\n" + - ""; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (ibc.tendermint.light.TendermintLight.CanonicalPartSetHeader.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:ibc.tendermint.light.CanonicalPartSetHeader) - private static final ibc.tendermint.light.TendermintLight.CanonicalPartSetHeader DEFAULT_INSTANCE; - static { - CanonicalPartSetHeader defaultInstance = new CanonicalPartSetHeader(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - CanonicalPartSetHeader.class, defaultInstance); - } - - public static ibc.tendermint.light.TendermintLight.CanonicalPartSetHeader getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface CanonicalBlockIDOrBuilder extends - // @@protoc_insertion_point(interface_extends:ibc.tendermint.light.CanonicalBlockID) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * bytes hash = 1; - * @return The hash. - */ - com.google.protobuf.ByteString getHash(); - - /** - * .ibc.tendermint.light.CanonicalPartSetHeader part_set_header = 2; - * @return Whether the partSetHeader field is set. - */ - boolean hasPartSetHeader(); - /** - * .ibc.tendermint.light.CanonicalPartSetHeader part_set_header = 2; - * @return The partSetHeader. - */ - ibc.tendermint.light.TendermintLight.CanonicalPartSetHeader getPartSetHeader(); - } - /** - * Protobuf type {@code ibc.tendermint.light.CanonicalBlockID} - */ - public static final class CanonicalBlockID extends - com.google.protobuf.GeneratedMessageLite< - CanonicalBlockID, CanonicalBlockID.Builder> implements - // @@protoc_insertion_point(message_implements:ibc.tendermint.light.CanonicalBlockID) - CanonicalBlockIDOrBuilder { - private CanonicalBlockID() { - hash_ = com.google.protobuf.ByteString.EMPTY; - } - public static final int HASH_FIELD_NUMBER = 1; - private com.google.protobuf.ByteString hash_; - /** - * bytes hash = 1; - * @return The hash. - */ - @java.lang.Override - public com.google.protobuf.ByteString getHash() { - return hash_; - } - /** - * bytes hash = 1; - * @param value The hash to set. - */ - private void setHash(com.google.protobuf.ByteString value) { - java.lang.Class valueClass = value.getClass(); - - hash_ = value; - } - /** - * bytes hash = 1; - */ - private void clearHash() { - - hash_ = getDefaultInstance().getHash(); - } - - public static final int PART_SET_HEADER_FIELD_NUMBER = 2; - private ibc.tendermint.light.TendermintLight.CanonicalPartSetHeader partSetHeader_; - /** - * .ibc.tendermint.light.CanonicalPartSetHeader part_set_header = 2; - */ - @java.lang.Override - public boolean hasPartSetHeader() { - return partSetHeader_ != null; - } - /** - * .ibc.tendermint.light.CanonicalPartSetHeader part_set_header = 2; - */ - @java.lang.Override - public ibc.tendermint.light.TendermintLight.CanonicalPartSetHeader getPartSetHeader() { - return partSetHeader_ == null ? ibc.tendermint.light.TendermintLight.CanonicalPartSetHeader.getDefaultInstance() : partSetHeader_; - } - /** - * .ibc.tendermint.light.CanonicalPartSetHeader part_set_header = 2; - */ - private void setPartSetHeader(ibc.tendermint.light.TendermintLight.CanonicalPartSetHeader value) { - value.getClass(); - partSetHeader_ = value; - - } - /** - * .ibc.tendermint.light.CanonicalPartSetHeader part_set_header = 2; - */ - @java.lang.SuppressWarnings({"ReferenceEquality"}) - private void mergePartSetHeader(ibc.tendermint.light.TendermintLight.CanonicalPartSetHeader value) { - value.getClass(); - if (partSetHeader_ != null && - partSetHeader_ != ibc.tendermint.light.TendermintLight.CanonicalPartSetHeader.getDefaultInstance()) { - partSetHeader_ = - ibc.tendermint.light.TendermintLight.CanonicalPartSetHeader.newBuilder(partSetHeader_).mergeFrom(value).buildPartial(); - } else { - partSetHeader_ = value; - } - - } - /** - * .ibc.tendermint.light.CanonicalPartSetHeader part_set_header = 2; - */ - private void clearPartSetHeader() { partSetHeader_ = null; - - } - - public static ibc.tendermint.light.TendermintLight.CanonicalBlockID parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static ibc.tendermint.light.TendermintLight.CanonicalBlockID parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.CanonicalBlockID parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static ibc.tendermint.light.TendermintLight.CanonicalBlockID parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.CanonicalBlockID parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static ibc.tendermint.light.TendermintLight.CanonicalBlockID parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.CanonicalBlockID parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static ibc.tendermint.light.TendermintLight.CanonicalBlockID parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.CanonicalBlockID parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - public static ibc.tendermint.light.TendermintLight.CanonicalBlockID parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.CanonicalBlockID parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static ibc.tendermint.light.TendermintLight.CanonicalBlockID parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(ibc.tendermint.light.TendermintLight.CanonicalBlockID prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - * Protobuf type {@code ibc.tendermint.light.CanonicalBlockID} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - ibc.tendermint.light.TendermintLight.CanonicalBlockID, Builder> implements - // @@protoc_insertion_point(builder_implements:ibc.tendermint.light.CanonicalBlockID) - ibc.tendermint.light.TendermintLight.CanonicalBlockIDOrBuilder { - // Construct using ibc.tendermint.light.TendermintLight.CanonicalBlockID.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - /** - * bytes hash = 1; - * @return The hash. - */ - @java.lang.Override - public com.google.protobuf.ByteString getHash() { - return instance.getHash(); - } - /** - * bytes hash = 1; - * @param value The hash to set. - * @return This builder for chaining. - */ - public Builder setHash(com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setHash(value); - return this; - } - /** - * bytes hash = 1; - * @return This builder for chaining. - */ - public Builder clearHash() { - copyOnWrite(); - instance.clearHash(); - return this; - } - - /** - * .ibc.tendermint.light.CanonicalPartSetHeader part_set_header = 2; - */ - @java.lang.Override - public boolean hasPartSetHeader() { - return instance.hasPartSetHeader(); - } - /** - * .ibc.tendermint.light.CanonicalPartSetHeader part_set_header = 2; - */ - @java.lang.Override - public ibc.tendermint.light.TendermintLight.CanonicalPartSetHeader getPartSetHeader() { - return instance.getPartSetHeader(); - } - /** - * .ibc.tendermint.light.CanonicalPartSetHeader part_set_header = 2; - */ - public Builder setPartSetHeader(ibc.tendermint.light.TendermintLight.CanonicalPartSetHeader value) { - copyOnWrite(); - instance.setPartSetHeader(value); - return this; - } - /** - * .ibc.tendermint.light.CanonicalPartSetHeader part_set_header = 2; - */ - public Builder setPartSetHeader( - ibc.tendermint.light.TendermintLight.CanonicalPartSetHeader.Builder builderForValue) { - copyOnWrite(); - instance.setPartSetHeader(builderForValue.build()); - return this; - } - /** - * .ibc.tendermint.light.CanonicalPartSetHeader part_set_header = 2; - */ - public Builder mergePartSetHeader(ibc.tendermint.light.TendermintLight.CanonicalPartSetHeader value) { - copyOnWrite(); - instance.mergePartSetHeader(value); - return this; - } - /** - * .ibc.tendermint.light.CanonicalPartSetHeader part_set_header = 2; - */ - public Builder clearPartSetHeader() { copyOnWrite(); - instance.clearPartSetHeader(); - return this; - } - - // @@protoc_insertion_point(builder_scope:ibc.tendermint.light.CanonicalBlockID) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new ibc.tendermint.light.TendermintLight.CanonicalBlockID(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[] { - "hash_", - "partSetHeader_", - }; - java.lang.String info = - "\u0000\u0002\u0000\u0000\u0001\u0002\u0002\u0000\u0000\u0000\u0001\n\u0002\t"; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (ibc.tendermint.light.TendermintLight.CanonicalBlockID.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:ibc.tendermint.light.CanonicalBlockID) - private static final ibc.tendermint.light.TendermintLight.CanonicalBlockID DEFAULT_INSTANCE; - static { - CanonicalBlockID defaultInstance = new CanonicalBlockID(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - CanonicalBlockID.class, defaultInstance); - } - - public static ibc.tendermint.light.TendermintLight.CanonicalBlockID getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface CanonicalVoteOrBuilder extends - // @@protoc_insertion_point(interface_extends:ibc.tendermint.light.CanonicalVote) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * .ibc.tendermint.light.SignedMsgType type = 1; - * @return The enum numeric value on the wire for type. - */ - int getTypeValue(); - /** - * .ibc.tendermint.light.SignedMsgType type = 1; - * @return The type. - */ - ibc.tendermint.light.TendermintLight.SignedMsgType getType(); - - /** - * sfixed64 height = 2; - * @return The height. - */ - long getHeight(); - - /** - * sfixed64 round = 3; - * @return The round. - */ - long getRound(); - - /** - * .ibc.tendermint.light.BlockID block_id = 4; - * @return Whether the blockId field is set. - */ - boolean hasBlockId(); - /** - * .ibc.tendermint.light.BlockID block_id = 4; - * @return The blockId. - */ - ibc.tendermint.light.TendermintLight.BlockID getBlockId(); - - /** - * .ibc.tendermint.light.Timestamp timestamp = 5; - * @return Whether the timestamp field is set. - */ - boolean hasTimestamp(); - /** - * .ibc.tendermint.light.Timestamp timestamp = 5; - * @return The timestamp. - */ - ibc.tendermint.light.TendermintLight.Timestamp getTimestamp(); - - /** - * string chain_id = 6; - * @return The chainId. - */ - java.lang.String getChainId(); - /** - * string chain_id = 6; - * @return The bytes for chainId. - */ - com.google.protobuf.ByteString - getChainIdBytes(); - } - /** - * Protobuf type {@code ibc.tendermint.light.CanonicalVote} - */ - public static final class CanonicalVote extends - com.google.protobuf.GeneratedMessageLite< - CanonicalVote, CanonicalVote.Builder> implements - // @@protoc_insertion_point(message_implements:ibc.tendermint.light.CanonicalVote) - CanonicalVoteOrBuilder { - private CanonicalVote() { - chainId_ = ""; - } - public static final int TYPE_FIELD_NUMBER = 1; - private int type_; - /** - * .ibc.tendermint.light.SignedMsgType type = 1; - * @return The enum numeric value on the wire for type. - */ - @java.lang.Override - public int getTypeValue() { - return type_; - } - /** - * .ibc.tendermint.light.SignedMsgType type = 1; - * @return The type. - */ - @java.lang.Override - public ibc.tendermint.light.TendermintLight.SignedMsgType getType() { - ibc.tendermint.light.TendermintLight.SignedMsgType result = ibc.tendermint.light.TendermintLight.SignedMsgType.forNumber(type_); - return result == null ? ibc.tendermint.light.TendermintLight.SignedMsgType.UNRECOGNIZED : result; - } - /** - * .ibc.tendermint.light.SignedMsgType type = 1; - * @param value The enum numeric value on the wire for type to set. - */ - private void setTypeValue(int value) { - type_ = value; - } - /** - * .ibc.tendermint.light.SignedMsgType type = 1; - * @param value The type to set. - */ - private void setType(ibc.tendermint.light.TendermintLight.SignedMsgType value) { - type_ = value.getNumber(); - - } - /** - * .ibc.tendermint.light.SignedMsgType type = 1; - */ - private void clearType() { - - type_ = 0; - } - - public static final int HEIGHT_FIELD_NUMBER = 2; - private long height_; - /** - * sfixed64 height = 2; - * @return The height. - */ - @java.lang.Override - public long getHeight() { - return height_; - } - /** - * sfixed64 height = 2; - * @param value The height to set. - */ - private void setHeight(long value) { - - height_ = value; - } - /** - * sfixed64 height = 2; - */ - private void clearHeight() { - - height_ = 0L; - } - - public static final int ROUND_FIELD_NUMBER = 3; - private long round_; - /** - * sfixed64 round = 3; - * @return The round. - */ - @java.lang.Override - public long getRound() { - return round_; - } - /** - * sfixed64 round = 3; - * @param value The round to set. - */ - private void setRound(long value) { - - round_ = value; - } - /** - * sfixed64 round = 3; - */ - private void clearRound() { - - round_ = 0L; - } - - public static final int BLOCK_ID_FIELD_NUMBER = 4; - private ibc.tendermint.light.TendermintLight.BlockID blockId_; - /** - * .ibc.tendermint.light.BlockID block_id = 4; - */ - @java.lang.Override - public boolean hasBlockId() { - return blockId_ != null; - } - /** - * .ibc.tendermint.light.BlockID block_id = 4; - */ - @java.lang.Override - public ibc.tendermint.light.TendermintLight.BlockID getBlockId() { - return blockId_ == null ? ibc.tendermint.light.TendermintLight.BlockID.getDefaultInstance() : blockId_; - } - /** - * .ibc.tendermint.light.BlockID block_id = 4; - */ - private void setBlockId(ibc.tendermint.light.TendermintLight.BlockID value) { - value.getClass(); - blockId_ = value; - - } - /** - * .ibc.tendermint.light.BlockID block_id = 4; - */ - @java.lang.SuppressWarnings({"ReferenceEquality"}) - private void mergeBlockId(ibc.tendermint.light.TendermintLight.BlockID value) { - value.getClass(); - if (blockId_ != null && - blockId_ != ibc.tendermint.light.TendermintLight.BlockID.getDefaultInstance()) { - blockId_ = - ibc.tendermint.light.TendermintLight.BlockID.newBuilder(blockId_).mergeFrom(value).buildPartial(); - } else { - blockId_ = value; - } - - } - /** - * .ibc.tendermint.light.BlockID block_id = 4; - */ - private void clearBlockId() { blockId_ = null; - - } - - public static final int TIMESTAMP_FIELD_NUMBER = 5; - private ibc.tendermint.light.TendermintLight.Timestamp timestamp_; - /** - * .ibc.tendermint.light.Timestamp timestamp = 5; - */ - @java.lang.Override - public boolean hasTimestamp() { - return timestamp_ != null; - } - /** - * .ibc.tendermint.light.Timestamp timestamp = 5; - */ - @java.lang.Override - public ibc.tendermint.light.TendermintLight.Timestamp getTimestamp() { - return timestamp_ == null ? ibc.tendermint.light.TendermintLight.Timestamp.getDefaultInstance() : timestamp_; - } - /** - * .ibc.tendermint.light.Timestamp timestamp = 5; - */ - private void setTimestamp(ibc.tendermint.light.TendermintLight.Timestamp value) { - value.getClass(); - timestamp_ = value; - - } - /** - * .ibc.tendermint.light.Timestamp timestamp = 5; - */ - @java.lang.SuppressWarnings({"ReferenceEquality"}) - private void mergeTimestamp(ibc.tendermint.light.TendermintLight.Timestamp value) { - value.getClass(); - if (timestamp_ != null && - timestamp_ != ibc.tendermint.light.TendermintLight.Timestamp.getDefaultInstance()) { - timestamp_ = - ibc.tendermint.light.TendermintLight.Timestamp.newBuilder(timestamp_).mergeFrom(value).buildPartial(); - } else { - timestamp_ = value; - } - - } - /** - * .ibc.tendermint.light.Timestamp timestamp = 5; - */ - private void clearTimestamp() { timestamp_ = null; - - } - - public static final int CHAIN_ID_FIELD_NUMBER = 6; - private java.lang.String chainId_; - /** - * string chain_id = 6; - * @return The chainId. - */ - @java.lang.Override - public java.lang.String getChainId() { - return chainId_; - } - /** - * string chain_id = 6; - * @return The bytes for chainId. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getChainIdBytes() { - return com.google.protobuf.ByteString.copyFromUtf8(chainId_); - } - /** - * string chain_id = 6; - * @param value The chainId to set. - */ - private void setChainId( - java.lang.String value) { - java.lang.Class valueClass = value.getClass(); - - chainId_ = value; - } - /** - * string chain_id = 6; - */ - private void clearChainId() { - - chainId_ = getDefaultInstance().getChainId(); - } - /** - * string chain_id = 6; - * @param value The bytes for chainId to set. - */ - private void setChainIdBytes( - com.google.protobuf.ByteString value) { - checkByteStringIsUtf8(value); - chainId_ = value.toStringUtf8(); - - } - - public static ibc.tendermint.light.TendermintLight.CanonicalVote parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static ibc.tendermint.light.TendermintLight.CanonicalVote parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.CanonicalVote parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static ibc.tendermint.light.TendermintLight.CanonicalVote parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.CanonicalVote parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static ibc.tendermint.light.TendermintLight.CanonicalVote parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.CanonicalVote parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static ibc.tendermint.light.TendermintLight.CanonicalVote parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.CanonicalVote parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - public static ibc.tendermint.light.TendermintLight.CanonicalVote parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.CanonicalVote parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static ibc.tendermint.light.TendermintLight.CanonicalVote parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(ibc.tendermint.light.TendermintLight.CanonicalVote prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - * Protobuf type {@code ibc.tendermint.light.CanonicalVote} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - ibc.tendermint.light.TendermintLight.CanonicalVote, Builder> implements - // @@protoc_insertion_point(builder_implements:ibc.tendermint.light.CanonicalVote) - ibc.tendermint.light.TendermintLight.CanonicalVoteOrBuilder { - // Construct using ibc.tendermint.light.TendermintLight.CanonicalVote.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - /** - * .ibc.tendermint.light.SignedMsgType type = 1; - * @return The enum numeric value on the wire for type. - */ - @java.lang.Override - public int getTypeValue() { - return instance.getTypeValue(); - } - /** - * .ibc.tendermint.light.SignedMsgType type = 1; - * @param value The type to set. - * @return This builder for chaining. - */ - public Builder setTypeValue(int value) { - copyOnWrite(); - instance.setTypeValue(value); - return this; - } - /** - * .ibc.tendermint.light.SignedMsgType type = 1; - * @return The type. - */ - @java.lang.Override - public ibc.tendermint.light.TendermintLight.SignedMsgType getType() { - return instance.getType(); - } - /** - * .ibc.tendermint.light.SignedMsgType type = 1; - * @param value The enum numeric value on the wire for type to set. - * @return This builder for chaining. - */ - public Builder setType(ibc.tendermint.light.TendermintLight.SignedMsgType value) { - copyOnWrite(); - instance.setType(value); - return this; - } - /** - * .ibc.tendermint.light.SignedMsgType type = 1; - * @return This builder for chaining. - */ - public Builder clearType() { - copyOnWrite(); - instance.clearType(); - return this; - } - - /** - * sfixed64 height = 2; - * @return The height. - */ - @java.lang.Override - public long getHeight() { - return instance.getHeight(); - } - /** - * sfixed64 height = 2; - * @param value The height to set. - * @return This builder for chaining. - */ - public Builder setHeight(long value) { - copyOnWrite(); - instance.setHeight(value); - return this; - } - /** - * sfixed64 height = 2; - * @return This builder for chaining. - */ - public Builder clearHeight() { - copyOnWrite(); - instance.clearHeight(); - return this; - } - - /** - * sfixed64 round = 3; - * @return The round. - */ - @java.lang.Override - public long getRound() { - return instance.getRound(); - } - /** - * sfixed64 round = 3; - * @param value The round to set. - * @return This builder for chaining. - */ - public Builder setRound(long value) { - copyOnWrite(); - instance.setRound(value); - return this; - } - /** - * sfixed64 round = 3; - * @return This builder for chaining. - */ - public Builder clearRound() { - copyOnWrite(); - instance.clearRound(); - return this; - } - - /** - * .ibc.tendermint.light.BlockID block_id = 4; - */ - @java.lang.Override - public boolean hasBlockId() { - return instance.hasBlockId(); - } - /** - * .ibc.tendermint.light.BlockID block_id = 4; - */ - @java.lang.Override - public ibc.tendermint.light.TendermintLight.BlockID getBlockId() { - return instance.getBlockId(); - } - /** - * .ibc.tendermint.light.BlockID block_id = 4; - */ - public Builder setBlockId(ibc.tendermint.light.TendermintLight.BlockID value) { - copyOnWrite(); - instance.setBlockId(value); - return this; - } - /** - * .ibc.tendermint.light.BlockID block_id = 4; - */ - public Builder setBlockId( - ibc.tendermint.light.TendermintLight.BlockID.Builder builderForValue) { - copyOnWrite(); - instance.setBlockId(builderForValue.build()); - return this; - } - /** - * .ibc.tendermint.light.BlockID block_id = 4; - */ - public Builder mergeBlockId(ibc.tendermint.light.TendermintLight.BlockID value) { - copyOnWrite(); - instance.mergeBlockId(value); - return this; - } - /** - * .ibc.tendermint.light.BlockID block_id = 4; - */ - public Builder clearBlockId() { copyOnWrite(); - instance.clearBlockId(); - return this; - } - - /** - * .ibc.tendermint.light.Timestamp timestamp = 5; - */ - @java.lang.Override - public boolean hasTimestamp() { - return instance.hasTimestamp(); - } - /** - * .ibc.tendermint.light.Timestamp timestamp = 5; - */ - @java.lang.Override - public ibc.tendermint.light.TendermintLight.Timestamp getTimestamp() { - return instance.getTimestamp(); - } - /** - * .ibc.tendermint.light.Timestamp timestamp = 5; - */ - public Builder setTimestamp(ibc.tendermint.light.TendermintLight.Timestamp value) { - copyOnWrite(); - instance.setTimestamp(value); - return this; - } - /** - * .ibc.tendermint.light.Timestamp timestamp = 5; - */ - public Builder setTimestamp( - ibc.tendermint.light.TendermintLight.Timestamp.Builder builderForValue) { - copyOnWrite(); - instance.setTimestamp(builderForValue.build()); - return this; - } - /** - * .ibc.tendermint.light.Timestamp timestamp = 5; - */ - public Builder mergeTimestamp(ibc.tendermint.light.TendermintLight.Timestamp value) { - copyOnWrite(); - instance.mergeTimestamp(value); - return this; - } - /** - * .ibc.tendermint.light.Timestamp timestamp = 5; - */ - public Builder clearTimestamp() { copyOnWrite(); - instance.clearTimestamp(); - return this; - } - - /** - * string chain_id = 6; - * @return The chainId. - */ - @java.lang.Override - public java.lang.String getChainId() { - return instance.getChainId(); - } - /** - * string chain_id = 6; - * @return The bytes for chainId. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getChainIdBytes() { - return instance.getChainIdBytes(); - } - /** - * string chain_id = 6; - * @param value The chainId to set. - * @return This builder for chaining. - */ - public Builder setChainId( - java.lang.String value) { - copyOnWrite(); - instance.setChainId(value); - return this; - } - /** - * string chain_id = 6; - * @return This builder for chaining. - */ - public Builder clearChainId() { - copyOnWrite(); - instance.clearChainId(); - return this; - } - /** - * string chain_id = 6; - * @param value The bytes for chainId to set. - * @return This builder for chaining. - */ - public Builder setChainIdBytes( - com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setChainIdBytes(value); - return this; - } - - // @@protoc_insertion_point(builder_scope:ibc.tendermint.light.CanonicalVote) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new ibc.tendermint.light.TendermintLight.CanonicalVote(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[] { - "type_", - "height_", - "round_", - "blockId_", - "timestamp_", - "chainId_", - }; - java.lang.String info = - "\u0000\u0006\u0000\u0000\u0001\u0006\u0006\u0000\u0000\u0000\u0001\f\u0002\u000e" + - "\u0003\u000e\u0004\t\u0005\t\u0006\u0208"; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (ibc.tendermint.light.TendermintLight.CanonicalVote.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:ibc.tendermint.light.CanonicalVote) - private static final ibc.tendermint.light.TendermintLight.CanonicalVote DEFAULT_INSTANCE; - static { - CanonicalVote defaultInstance = new CanonicalVote(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - CanonicalVote.class, defaultInstance); - } - - public static ibc.tendermint.light.TendermintLight.CanonicalVote getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface VoteOrBuilder extends - // @@protoc_insertion_point(interface_extends:ibc.tendermint.light.Vote) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * .ibc.tendermint.light.SignedMsgType type = 1; - * @return The enum numeric value on the wire for type. - */ - int getTypeValue(); - /** - * .ibc.tendermint.light.SignedMsgType type = 1; - * @return The type. - */ - ibc.tendermint.light.TendermintLight.SignedMsgType getType(); - - /** - * int64 height = 2; - * @return The height. - */ - long getHeight(); - - /** - * int32 round = 3; - * @return The round. - */ - int getRound(); - - /** - * .ibc.tendermint.light.BlockID block_id = 4; - * @return Whether the blockId field is set. - */ - boolean hasBlockId(); - /** - * .ibc.tendermint.light.BlockID block_id = 4; - * @return The blockId. - */ - ibc.tendermint.light.TendermintLight.BlockID getBlockId(); - - /** - * .ibc.tendermint.light.Timestamp timestamp = 5; - * @return Whether the timestamp field is set. - */ - boolean hasTimestamp(); - /** - * .ibc.tendermint.light.Timestamp timestamp = 5; - * @return The timestamp. - */ - ibc.tendermint.light.TendermintLight.Timestamp getTimestamp(); - - /** - * bytes validator_address = 6; - * @return The validatorAddress. - */ - com.google.protobuf.ByteString getValidatorAddress(); - - /** - * int32 validator_index = 7; - * @return The validatorIndex. - */ - int getValidatorIndex(); - - /** - * bytes signature = 8; - * @return The signature. - */ - com.google.protobuf.ByteString getSignature(); - } - /** - * Protobuf type {@code ibc.tendermint.light.Vote} - */ - public static final class Vote extends - com.google.protobuf.GeneratedMessageLite< - Vote, Vote.Builder> implements - // @@protoc_insertion_point(message_implements:ibc.tendermint.light.Vote) - VoteOrBuilder { - private Vote() { - validatorAddress_ = com.google.protobuf.ByteString.EMPTY; - signature_ = com.google.protobuf.ByteString.EMPTY; - } - public static final int TYPE_FIELD_NUMBER = 1; - private int type_; - /** - * .ibc.tendermint.light.SignedMsgType type = 1; - * @return The enum numeric value on the wire for type. - */ - @java.lang.Override - public int getTypeValue() { - return type_; - } - /** - * .ibc.tendermint.light.SignedMsgType type = 1; - * @return The type. - */ - @java.lang.Override - public ibc.tendermint.light.TendermintLight.SignedMsgType getType() { - ibc.tendermint.light.TendermintLight.SignedMsgType result = ibc.tendermint.light.TendermintLight.SignedMsgType.forNumber(type_); - return result == null ? ibc.tendermint.light.TendermintLight.SignedMsgType.UNRECOGNIZED : result; - } - /** - * .ibc.tendermint.light.SignedMsgType type = 1; - * @param value The enum numeric value on the wire for type to set. - */ - private void setTypeValue(int value) { - type_ = value; - } - /** - * .ibc.tendermint.light.SignedMsgType type = 1; - * @param value The type to set. - */ - private void setType(ibc.tendermint.light.TendermintLight.SignedMsgType value) { - type_ = value.getNumber(); - - } - /** - * .ibc.tendermint.light.SignedMsgType type = 1; - */ - private void clearType() { - - type_ = 0; - } - - public static final int HEIGHT_FIELD_NUMBER = 2; - private long height_; - /** - * int64 height = 2; - * @return The height. - */ - @java.lang.Override - public long getHeight() { - return height_; - } - /** - * int64 height = 2; - * @param value The height to set. - */ - private void setHeight(long value) { - - height_ = value; - } - /** - * int64 height = 2; - */ - private void clearHeight() { - - height_ = 0L; - } - - public static final int ROUND_FIELD_NUMBER = 3; - private int round_; - /** - * int32 round = 3; - * @return The round. - */ - @java.lang.Override - public int getRound() { - return round_; - } - /** - * int32 round = 3; - * @param value The round to set. - */ - private void setRound(int value) { - - round_ = value; - } - /** - * int32 round = 3; - */ - private void clearRound() { - - round_ = 0; - } - - public static final int BLOCK_ID_FIELD_NUMBER = 4; - private ibc.tendermint.light.TendermintLight.BlockID blockId_; - /** - * .ibc.tendermint.light.BlockID block_id = 4; - */ - @java.lang.Override - public boolean hasBlockId() { - return blockId_ != null; - } - /** - * .ibc.tendermint.light.BlockID block_id = 4; - */ - @java.lang.Override - public ibc.tendermint.light.TendermintLight.BlockID getBlockId() { - return blockId_ == null ? ibc.tendermint.light.TendermintLight.BlockID.getDefaultInstance() : blockId_; - } - /** - * .ibc.tendermint.light.BlockID block_id = 4; - */ - private void setBlockId(ibc.tendermint.light.TendermintLight.BlockID value) { - value.getClass(); - blockId_ = value; - - } - /** - * .ibc.tendermint.light.BlockID block_id = 4; - */ - @java.lang.SuppressWarnings({"ReferenceEquality"}) - private void mergeBlockId(ibc.tendermint.light.TendermintLight.BlockID value) { - value.getClass(); - if (blockId_ != null && - blockId_ != ibc.tendermint.light.TendermintLight.BlockID.getDefaultInstance()) { - blockId_ = - ibc.tendermint.light.TendermintLight.BlockID.newBuilder(blockId_).mergeFrom(value).buildPartial(); - } else { - blockId_ = value; - } - - } - /** - * .ibc.tendermint.light.BlockID block_id = 4; - */ - private void clearBlockId() { blockId_ = null; - - } - - public static final int TIMESTAMP_FIELD_NUMBER = 5; - private ibc.tendermint.light.TendermintLight.Timestamp timestamp_; - /** - * .ibc.tendermint.light.Timestamp timestamp = 5; - */ - @java.lang.Override - public boolean hasTimestamp() { - return timestamp_ != null; - } - /** - * .ibc.tendermint.light.Timestamp timestamp = 5; - */ - @java.lang.Override - public ibc.tendermint.light.TendermintLight.Timestamp getTimestamp() { - return timestamp_ == null ? ibc.tendermint.light.TendermintLight.Timestamp.getDefaultInstance() : timestamp_; - } - /** - * .ibc.tendermint.light.Timestamp timestamp = 5; - */ - private void setTimestamp(ibc.tendermint.light.TendermintLight.Timestamp value) { - value.getClass(); - timestamp_ = value; - - } - /** - * .ibc.tendermint.light.Timestamp timestamp = 5; - */ - @java.lang.SuppressWarnings({"ReferenceEquality"}) - private void mergeTimestamp(ibc.tendermint.light.TendermintLight.Timestamp value) { - value.getClass(); - if (timestamp_ != null && - timestamp_ != ibc.tendermint.light.TendermintLight.Timestamp.getDefaultInstance()) { - timestamp_ = - ibc.tendermint.light.TendermintLight.Timestamp.newBuilder(timestamp_).mergeFrom(value).buildPartial(); - } else { - timestamp_ = value; - } - - } - /** - * .ibc.tendermint.light.Timestamp timestamp = 5; - */ - private void clearTimestamp() { timestamp_ = null; - - } - - public static final int VALIDATOR_ADDRESS_FIELD_NUMBER = 6; - private com.google.protobuf.ByteString validatorAddress_; - /** - * bytes validator_address = 6; - * @return The validatorAddress. - */ - @java.lang.Override - public com.google.protobuf.ByteString getValidatorAddress() { - return validatorAddress_; - } - /** - * bytes validator_address = 6; - * @param value The validatorAddress to set. - */ - private void setValidatorAddress(com.google.protobuf.ByteString value) { - java.lang.Class valueClass = value.getClass(); - - validatorAddress_ = value; - } - /** - * bytes validator_address = 6; - */ - private void clearValidatorAddress() { - - validatorAddress_ = getDefaultInstance().getValidatorAddress(); - } - - public static final int VALIDATOR_INDEX_FIELD_NUMBER = 7; - private int validatorIndex_; - /** - * int32 validator_index = 7; - * @return The validatorIndex. - */ - @java.lang.Override - public int getValidatorIndex() { - return validatorIndex_; - } - /** - * int32 validator_index = 7; - * @param value The validatorIndex to set. - */ - private void setValidatorIndex(int value) { - - validatorIndex_ = value; - } - /** - * int32 validator_index = 7; - */ - private void clearValidatorIndex() { - - validatorIndex_ = 0; - } - - public static final int SIGNATURE_FIELD_NUMBER = 8; - private com.google.protobuf.ByteString signature_; - /** - * bytes signature = 8; - * @return The signature. - */ - @java.lang.Override - public com.google.protobuf.ByteString getSignature() { - return signature_; - } - /** - * bytes signature = 8; - * @param value The signature to set. - */ - private void setSignature(com.google.protobuf.ByteString value) { - java.lang.Class valueClass = value.getClass(); - - signature_ = value; - } - /** - * bytes signature = 8; - */ - private void clearSignature() { - - signature_ = getDefaultInstance().getSignature(); - } - - public static ibc.tendermint.light.TendermintLight.Vote parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static ibc.tendermint.light.TendermintLight.Vote parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.Vote parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static ibc.tendermint.light.TendermintLight.Vote parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.Vote parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static ibc.tendermint.light.TendermintLight.Vote parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.Vote parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static ibc.tendermint.light.TendermintLight.Vote parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.Vote parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - public static ibc.tendermint.light.TendermintLight.Vote parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.Vote parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static ibc.tendermint.light.TendermintLight.Vote parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(ibc.tendermint.light.TendermintLight.Vote prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - * Protobuf type {@code ibc.tendermint.light.Vote} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - ibc.tendermint.light.TendermintLight.Vote, Builder> implements - // @@protoc_insertion_point(builder_implements:ibc.tendermint.light.Vote) - ibc.tendermint.light.TendermintLight.VoteOrBuilder { - // Construct using ibc.tendermint.light.TendermintLight.Vote.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - /** - * .ibc.tendermint.light.SignedMsgType type = 1; - * @return The enum numeric value on the wire for type. - */ - @java.lang.Override - public int getTypeValue() { - return instance.getTypeValue(); - } - /** - * .ibc.tendermint.light.SignedMsgType type = 1; - * @param value The type to set. - * @return This builder for chaining. - */ - public Builder setTypeValue(int value) { - copyOnWrite(); - instance.setTypeValue(value); - return this; - } - /** - * .ibc.tendermint.light.SignedMsgType type = 1; - * @return The type. - */ - @java.lang.Override - public ibc.tendermint.light.TendermintLight.SignedMsgType getType() { - return instance.getType(); - } - /** - * .ibc.tendermint.light.SignedMsgType type = 1; - * @param value The enum numeric value on the wire for type to set. - * @return This builder for chaining. - */ - public Builder setType(ibc.tendermint.light.TendermintLight.SignedMsgType value) { - copyOnWrite(); - instance.setType(value); - return this; - } - /** - * .ibc.tendermint.light.SignedMsgType type = 1; - * @return This builder for chaining. - */ - public Builder clearType() { - copyOnWrite(); - instance.clearType(); - return this; - } - - /** - * int64 height = 2; - * @return The height. - */ - @java.lang.Override - public long getHeight() { - return instance.getHeight(); - } - /** - * int64 height = 2; - * @param value The height to set. - * @return This builder for chaining. - */ - public Builder setHeight(long value) { - copyOnWrite(); - instance.setHeight(value); - return this; - } - /** - * int64 height = 2; - * @return This builder for chaining. - */ - public Builder clearHeight() { - copyOnWrite(); - instance.clearHeight(); - return this; - } - - /** - * int32 round = 3; - * @return The round. - */ - @java.lang.Override - public int getRound() { - return instance.getRound(); - } - /** - * int32 round = 3; - * @param value The round to set. - * @return This builder for chaining. - */ - public Builder setRound(int value) { - copyOnWrite(); - instance.setRound(value); - return this; - } - /** - * int32 round = 3; - * @return This builder for chaining. - */ - public Builder clearRound() { - copyOnWrite(); - instance.clearRound(); - return this; - } - - /** - * .ibc.tendermint.light.BlockID block_id = 4; - */ - @java.lang.Override - public boolean hasBlockId() { - return instance.hasBlockId(); - } - /** - * .ibc.tendermint.light.BlockID block_id = 4; - */ - @java.lang.Override - public ibc.tendermint.light.TendermintLight.BlockID getBlockId() { - return instance.getBlockId(); - } - /** - * .ibc.tendermint.light.BlockID block_id = 4; - */ - public Builder setBlockId(ibc.tendermint.light.TendermintLight.BlockID value) { - copyOnWrite(); - instance.setBlockId(value); - return this; - } - /** - * .ibc.tendermint.light.BlockID block_id = 4; - */ - public Builder setBlockId( - ibc.tendermint.light.TendermintLight.BlockID.Builder builderForValue) { - copyOnWrite(); - instance.setBlockId(builderForValue.build()); - return this; - } - /** - * .ibc.tendermint.light.BlockID block_id = 4; - */ - public Builder mergeBlockId(ibc.tendermint.light.TendermintLight.BlockID value) { - copyOnWrite(); - instance.mergeBlockId(value); - return this; - } - /** - * .ibc.tendermint.light.BlockID block_id = 4; - */ - public Builder clearBlockId() { copyOnWrite(); - instance.clearBlockId(); - return this; - } - - /** - * .ibc.tendermint.light.Timestamp timestamp = 5; - */ - @java.lang.Override - public boolean hasTimestamp() { - return instance.hasTimestamp(); - } - /** - * .ibc.tendermint.light.Timestamp timestamp = 5; - */ - @java.lang.Override - public ibc.tendermint.light.TendermintLight.Timestamp getTimestamp() { - return instance.getTimestamp(); - } - /** - * .ibc.tendermint.light.Timestamp timestamp = 5; - */ - public Builder setTimestamp(ibc.tendermint.light.TendermintLight.Timestamp value) { - copyOnWrite(); - instance.setTimestamp(value); - return this; - } - /** - * .ibc.tendermint.light.Timestamp timestamp = 5; - */ - public Builder setTimestamp( - ibc.tendermint.light.TendermintLight.Timestamp.Builder builderForValue) { - copyOnWrite(); - instance.setTimestamp(builderForValue.build()); - return this; - } - /** - * .ibc.tendermint.light.Timestamp timestamp = 5; - */ - public Builder mergeTimestamp(ibc.tendermint.light.TendermintLight.Timestamp value) { - copyOnWrite(); - instance.mergeTimestamp(value); - return this; - } - /** - * .ibc.tendermint.light.Timestamp timestamp = 5; - */ - public Builder clearTimestamp() { copyOnWrite(); - instance.clearTimestamp(); - return this; - } - - /** - * bytes validator_address = 6; - * @return The validatorAddress. - */ - @java.lang.Override - public com.google.protobuf.ByteString getValidatorAddress() { - return instance.getValidatorAddress(); - } - /** - * bytes validator_address = 6; - * @param value The validatorAddress to set. - * @return This builder for chaining. - */ - public Builder setValidatorAddress(com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setValidatorAddress(value); - return this; - } - /** - * bytes validator_address = 6; - * @return This builder for chaining. - */ - public Builder clearValidatorAddress() { - copyOnWrite(); - instance.clearValidatorAddress(); - return this; - } - - /** - * int32 validator_index = 7; - * @return The validatorIndex. - */ - @java.lang.Override - public int getValidatorIndex() { - return instance.getValidatorIndex(); - } - /** - * int32 validator_index = 7; - * @param value The validatorIndex to set. - * @return This builder for chaining. - */ - public Builder setValidatorIndex(int value) { - copyOnWrite(); - instance.setValidatorIndex(value); - return this; - } - /** - * int32 validator_index = 7; - * @return This builder for chaining. - */ - public Builder clearValidatorIndex() { - copyOnWrite(); - instance.clearValidatorIndex(); - return this; - } - - /** - * bytes signature = 8; - * @return The signature. - */ - @java.lang.Override - public com.google.protobuf.ByteString getSignature() { - return instance.getSignature(); - } - /** - * bytes signature = 8; - * @param value The signature to set. - * @return This builder for chaining. - */ - public Builder setSignature(com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setSignature(value); - return this; - } - /** - * bytes signature = 8; - * @return This builder for chaining. - */ - public Builder clearSignature() { - copyOnWrite(); - instance.clearSignature(); - return this; - } - - // @@protoc_insertion_point(builder_scope:ibc.tendermint.light.Vote) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new ibc.tendermint.light.TendermintLight.Vote(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[] { - "type_", - "height_", - "round_", - "blockId_", - "timestamp_", - "validatorAddress_", - "validatorIndex_", - "signature_", - }; - java.lang.String info = - "\u0000\b\u0000\u0000\u0001\b\b\u0000\u0000\u0000\u0001\f\u0002\u0002\u0003\u0004" + - "\u0004\t\u0005\t\u0006\n\u0007\u0004\b\n"; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (ibc.tendermint.light.TendermintLight.Vote.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:ibc.tendermint.light.Vote) - private static final ibc.tendermint.light.TendermintLight.Vote DEFAULT_INSTANCE; - static { - Vote defaultInstance = new Vote(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - Vote.class, defaultInstance); - } - - public static ibc.tendermint.light.TendermintLight.Vote getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface ValidatorSetOrBuilder extends - // @@protoc_insertion_point(interface_extends:ibc.tendermint.light.ValidatorSet) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * repeated .ibc.tendermint.light.Validator validators = 1; - */ - java.util.List - getValidatorsList(); - /** - * repeated .ibc.tendermint.light.Validator validators = 1; - */ - ibc.tendermint.light.TendermintLight.Validator getValidators(int index); - /** - * repeated .ibc.tendermint.light.Validator validators = 1; - */ - int getValidatorsCount(); - - /** - * .ibc.tendermint.light.Validator proposer = 2; - * @return Whether the proposer field is set. - */ - boolean hasProposer(); - /** - * .ibc.tendermint.light.Validator proposer = 2; - * @return The proposer. - */ - ibc.tendermint.light.TendermintLight.Validator getProposer(); - - /** - * int64 total_voting_power = 3; - * @return The totalVotingPower. - */ - long getTotalVotingPower(); - } - /** - * Protobuf type {@code ibc.tendermint.light.ValidatorSet} - */ - public static final class ValidatorSet extends - com.google.protobuf.GeneratedMessageLite< - ValidatorSet, ValidatorSet.Builder> implements - // @@protoc_insertion_point(message_implements:ibc.tendermint.light.ValidatorSet) - ValidatorSetOrBuilder { - private ValidatorSet() { - validators_ = emptyProtobufList(); - } - public static final int VALIDATORS_FIELD_NUMBER = 1; - private com.google.protobuf.Internal.ProtobufList validators_; - /** - * repeated .ibc.tendermint.light.Validator validators = 1; - */ - @java.lang.Override - public java.util.List getValidatorsList() { - return validators_; - } - /** - * repeated .ibc.tendermint.light.Validator validators = 1; - */ - public java.util.List - getValidatorsOrBuilderList() { - return validators_; - } - /** - * repeated .ibc.tendermint.light.Validator validators = 1; - */ - @java.lang.Override - public int getValidatorsCount() { - return validators_.size(); - } - /** - * repeated .ibc.tendermint.light.Validator validators = 1; - */ - @java.lang.Override - public ibc.tendermint.light.TendermintLight.Validator getValidators(int index) { - return validators_.get(index); - } - /** - * repeated .ibc.tendermint.light.Validator validators = 1; - */ - public ibc.tendermint.light.TendermintLight.ValidatorOrBuilder getValidatorsOrBuilder( - int index) { - return validators_.get(index); - } - private void ensureValidatorsIsMutable() { - com.google.protobuf.Internal.ProtobufList tmp = validators_; - if (!tmp.isModifiable()) { - validators_ = - com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp); - } - } - - /** - * repeated .ibc.tendermint.light.Validator validators = 1; - */ - private void setValidators( - int index, ibc.tendermint.light.TendermintLight.Validator value) { - value.getClass(); - ensureValidatorsIsMutable(); - validators_.set(index, value); - } - /** - * repeated .ibc.tendermint.light.Validator validators = 1; - */ - private void addValidators(ibc.tendermint.light.TendermintLight.Validator value) { - value.getClass(); - ensureValidatorsIsMutable(); - validators_.add(value); - } - /** - * repeated .ibc.tendermint.light.Validator validators = 1; - */ - private void addValidators( - int index, ibc.tendermint.light.TendermintLight.Validator value) { - value.getClass(); - ensureValidatorsIsMutable(); - validators_.add(index, value); - } - /** - * repeated .ibc.tendermint.light.Validator validators = 1; - */ - private void addAllValidators( - java.lang.Iterable values) { - ensureValidatorsIsMutable(); - com.google.protobuf.AbstractMessageLite.addAll( - values, validators_); - } - /** - * repeated .ibc.tendermint.light.Validator validators = 1; - */ - private void clearValidators() { - validators_ = emptyProtobufList(); - } - /** - * repeated .ibc.tendermint.light.Validator validators = 1; - */ - private void removeValidators(int index) { - ensureValidatorsIsMutable(); - validators_.remove(index); - } - - public static final int PROPOSER_FIELD_NUMBER = 2; - private ibc.tendermint.light.TendermintLight.Validator proposer_; - /** - * .ibc.tendermint.light.Validator proposer = 2; - */ - @java.lang.Override - public boolean hasProposer() { - return proposer_ != null; - } - /** - * .ibc.tendermint.light.Validator proposer = 2; - */ - @java.lang.Override - public ibc.tendermint.light.TendermintLight.Validator getProposer() { - return proposer_ == null ? ibc.tendermint.light.TendermintLight.Validator.getDefaultInstance() : proposer_; - } - /** - * .ibc.tendermint.light.Validator proposer = 2; - */ - private void setProposer(ibc.tendermint.light.TendermintLight.Validator value) { - value.getClass(); - proposer_ = value; - - } - /** - * .ibc.tendermint.light.Validator proposer = 2; - */ - @java.lang.SuppressWarnings({"ReferenceEquality"}) - private void mergeProposer(ibc.tendermint.light.TendermintLight.Validator value) { - value.getClass(); - if (proposer_ != null && - proposer_ != ibc.tendermint.light.TendermintLight.Validator.getDefaultInstance()) { - proposer_ = - ibc.tendermint.light.TendermintLight.Validator.newBuilder(proposer_).mergeFrom(value).buildPartial(); - } else { - proposer_ = value; - } - - } - /** - * .ibc.tendermint.light.Validator proposer = 2; - */ - private void clearProposer() { proposer_ = null; - - } - - public static final int TOTAL_VOTING_POWER_FIELD_NUMBER = 3; - private long totalVotingPower_; - /** - * int64 total_voting_power = 3; - * @return The totalVotingPower. - */ - @java.lang.Override - public long getTotalVotingPower() { - return totalVotingPower_; - } - /** - * int64 total_voting_power = 3; - * @param value The totalVotingPower to set. - */ - private void setTotalVotingPower(long value) { - - totalVotingPower_ = value; - } - /** - * int64 total_voting_power = 3; - */ - private void clearTotalVotingPower() { - - totalVotingPower_ = 0L; - } - - public static ibc.tendermint.light.TendermintLight.ValidatorSet parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static ibc.tendermint.light.TendermintLight.ValidatorSet parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.ValidatorSet parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static ibc.tendermint.light.TendermintLight.ValidatorSet parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.ValidatorSet parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static ibc.tendermint.light.TendermintLight.ValidatorSet parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.ValidatorSet parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static ibc.tendermint.light.TendermintLight.ValidatorSet parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.ValidatorSet parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - public static ibc.tendermint.light.TendermintLight.ValidatorSet parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.ValidatorSet parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static ibc.tendermint.light.TendermintLight.ValidatorSet parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(ibc.tendermint.light.TendermintLight.ValidatorSet prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - * Protobuf type {@code ibc.tendermint.light.ValidatorSet} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - ibc.tendermint.light.TendermintLight.ValidatorSet, Builder> implements - // @@protoc_insertion_point(builder_implements:ibc.tendermint.light.ValidatorSet) - ibc.tendermint.light.TendermintLight.ValidatorSetOrBuilder { - // Construct using ibc.tendermint.light.TendermintLight.ValidatorSet.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - /** - * repeated .ibc.tendermint.light.Validator validators = 1; - */ - @java.lang.Override - public java.util.List getValidatorsList() { - return java.util.Collections.unmodifiableList( - instance.getValidatorsList()); - } - /** - * repeated .ibc.tendermint.light.Validator validators = 1; - */ - @java.lang.Override - public int getValidatorsCount() { - return instance.getValidatorsCount(); - }/** - * repeated .ibc.tendermint.light.Validator validators = 1; - */ - @java.lang.Override - public ibc.tendermint.light.TendermintLight.Validator getValidators(int index) { - return instance.getValidators(index); - } - /** - * repeated .ibc.tendermint.light.Validator validators = 1; - */ - public Builder setValidators( - int index, ibc.tendermint.light.TendermintLight.Validator value) { - copyOnWrite(); - instance.setValidators(index, value); - return this; - } - /** - * repeated .ibc.tendermint.light.Validator validators = 1; - */ - public Builder setValidators( - int index, ibc.tendermint.light.TendermintLight.Validator.Builder builderForValue) { - copyOnWrite(); - instance.setValidators(index, - builderForValue.build()); - return this; - } - /** - * repeated .ibc.tendermint.light.Validator validators = 1; - */ - public Builder addValidators(ibc.tendermint.light.TendermintLight.Validator value) { - copyOnWrite(); - instance.addValidators(value); - return this; - } - /** - * repeated .ibc.tendermint.light.Validator validators = 1; - */ - public Builder addValidators( - int index, ibc.tendermint.light.TendermintLight.Validator value) { - copyOnWrite(); - instance.addValidators(index, value); - return this; - } - /** - * repeated .ibc.tendermint.light.Validator validators = 1; - */ - public Builder addValidators( - ibc.tendermint.light.TendermintLight.Validator.Builder builderForValue) { - copyOnWrite(); - instance.addValidators(builderForValue.build()); - return this; - } - /** - * repeated .ibc.tendermint.light.Validator validators = 1; - */ - public Builder addValidators( - int index, ibc.tendermint.light.TendermintLight.Validator.Builder builderForValue) { - copyOnWrite(); - instance.addValidators(index, - builderForValue.build()); - return this; - } - /** - * repeated .ibc.tendermint.light.Validator validators = 1; - */ - public Builder addAllValidators( - java.lang.Iterable values) { - copyOnWrite(); - instance.addAllValidators(values); - return this; - } - /** - * repeated .ibc.tendermint.light.Validator validators = 1; - */ - public Builder clearValidators() { - copyOnWrite(); - instance.clearValidators(); - return this; - } - /** - * repeated .ibc.tendermint.light.Validator validators = 1; - */ - public Builder removeValidators(int index) { - copyOnWrite(); - instance.removeValidators(index); - return this; - } - - /** - * .ibc.tendermint.light.Validator proposer = 2; - */ - @java.lang.Override - public boolean hasProposer() { - return instance.hasProposer(); - } - /** - * .ibc.tendermint.light.Validator proposer = 2; - */ - @java.lang.Override - public ibc.tendermint.light.TendermintLight.Validator getProposer() { - return instance.getProposer(); - } - /** - * .ibc.tendermint.light.Validator proposer = 2; - */ - public Builder setProposer(ibc.tendermint.light.TendermintLight.Validator value) { - copyOnWrite(); - instance.setProposer(value); - return this; - } - /** - * .ibc.tendermint.light.Validator proposer = 2; - */ - public Builder setProposer( - ibc.tendermint.light.TendermintLight.Validator.Builder builderForValue) { - copyOnWrite(); - instance.setProposer(builderForValue.build()); - return this; - } - /** - * .ibc.tendermint.light.Validator proposer = 2; - */ - public Builder mergeProposer(ibc.tendermint.light.TendermintLight.Validator value) { - copyOnWrite(); - instance.mergeProposer(value); - return this; - } - /** - * .ibc.tendermint.light.Validator proposer = 2; - */ - public Builder clearProposer() { copyOnWrite(); - instance.clearProposer(); - return this; - } - - /** - * int64 total_voting_power = 3; - * @return The totalVotingPower. - */ - @java.lang.Override - public long getTotalVotingPower() { - return instance.getTotalVotingPower(); - } - /** - * int64 total_voting_power = 3; - * @param value The totalVotingPower to set. - * @return This builder for chaining. - */ - public Builder setTotalVotingPower(long value) { - copyOnWrite(); - instance.setTotalVotingPower(value); - return this; - } - /** - * int64 total_voting_power = 3; - * @return This builder for chaining. - */ - public Builder clearTotalVotingPower() { - copyOnWrite(); - instance.clearTotalVotingPower(); - return this; - } - - // @@protoc_insertion_point(builder_scope:ibc.tendermint.light.ValidatorSet) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new ibc.tendermint.light.TendermintLight.ValidatorSet(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[] { - "validators_", - ibc.tendermint.light.TendermintLight.Validator.class, - "proposer_", - "totalVotingPower_", - }; - java.lang.String info = - "\u0000\u0003\u0000\u0000\u0001\u0003\u0003\u0000\u0001\u0000\u0001\u001b\u0002\t" + - "\u0003\u0002"; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (ibc.tendermint.light.TendermintLight.ValidatorSet.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:ibc.tendermint.light.ValidatorSet) - private static final ibc.tendermint.light.TendermintLight.ValidatorSet DEFAULT_INSTANCE; - static { - ValidatorSet defaultInstance = new ValidatorSet(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - ValidatorSet.class, defaultInstance); - } - - public static ibc.tendermint.light.TendermintLight.ValidatorSet getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface ValidatorOrBuilder extends - // @@protoc_insertion_point(interface_extends:ibc.tendermint.light.Validator) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * bytes address = 1; - * @return The address. - */ - com.google.protobuf.ByteString getAddress(); - - /** - * .ibc.tendermint.light.PublicKey pub_key = 2; - * @return Whether the pubKey field is set. - */ - boolean hasPubKey(); - /** - * .ibc.tendermint.light.PublicKey pub_key = 2; - * @return The pubKey. - */ - ibc.tendermint.light.TendermintLight.PublicKey getPubKey(); - - /** - * int64 voting_power = 3; - * @return The votingPower. - */ - long getVotingPower(); - - /** - * int64 proposer_priority = 4; - * @return The proposerPriority. - */ - long getProposerPriority(); - } - /** - * Protobuf type {@code ibc.tendermint.light.Validator} - */ - public static final class Validator extends - com.google.protobuf.GeneratedMessageLite< - Validator, Validator.Builder> implements - // @@protoc_insertion_point(message_implements:ibc.tendermint.light.Validator) - ValidatorOrBuilder { - private Validator() { - address_ = com.google.protobuf.ByteString.EMPTY; - } - public static final int ADDRESS_FIELD_NUMBER = 1; - private com.google.protobuf.ByteString address_; - /** - * bytes address = 1; - * @return The address. - */ - @java.lang.Override - public com.google.protobuf.ByteString getAddress() { - return address_; - } - /** - * bytes address = 1; - * @param value The address to set. - */ - private void setAddress(com.google.protobuf.ByteString value) { - java.lang.Class valueClass = value.getClass(); - - address_ = value; - } - /** - * bytes address = 1; - */ - private void clearAddress() { - - address_ = getDefaultInstance().getAddress(); - } - - public static final int PUB_KEY_FIELD_NUMBER = 2; - private ibc.tendermint.light.TendermintLight.PublicKey pubKey_; - /** - * .ibc.tendermint.light.PublicKey pub_key = 2; - */ - @java.lang.Override - public boolean hasPubKey() { - return pubKey_ != null; - } - /** - * .ibc.tendermint.light.PublicKey pub_key = 2; - */ - @java.lang.Override - public ibc.tendermint.light.TendermintLight.PublicKey getPubKey() { - return pubKey_ == null ? ibc.tendermint.light.TendermintLight.PublicKey.getDefaultInstance() : pubKey_; - } - /** - * .ibc.tendermint.light.PublicKey pub_key = 2; - */ - private void setPubKey(ibc.tendermint.light.TendermintLight.PublicKey value) { - value.getClass(); - pubKey_ = value; - - } - /** - * .ibc.tendermint.light.PublicKey pub_key = 2; - */ - @java.lang.SuppressWarnings({"ReferenceEquality"}) - private void mergePubKey(ibc.tendermint.light.TendermintLight.PublicKey value) { - value.getClass(); - if (pubKey_ != null && - pubKey_ != ibc.tendermint.light.TendermintLight.PublicKey.getDefaultInstance()) { - pubKey_ = - ibc.tendermint.light.TendermintLight.PublicKey.newBuilder(pubKey_).mergeFrom(value).buildPartial(); - } else { - pubKey_ = value; - } - - } - /** - * .ibc.tendermint.light.PublicKey pub_key = 2; - */ - private void clearPubKey() { pubKey_ = null; - - } - - public static final int VOTING_POWER_FIELD_NUMBER = 3; - private long votingPower_; - /** - * int64 voting_power = 3; - * @return The votingPower. - */ - @java.lang.Override - public long getVotingPower() { - return votingPower_; - } - /** - * int64 voting_power = 3; - * @param value The votingPower to set. - */ - private void setVotingPower(long value) { - - votingPower_ = value; - } - /** - * int64 voting_power = 3; - */ - private void clearVotingPower() { - - votingPower_ = 0L; - } - - public static final int PROPOSER_PRIORITY_FIELD_NUMBER = 4; - private long proposerPriority_; - /** - * int64 proposer_priority = 4; - * @return The proposerPriority. - */ - @java.lang.Override - public long getProposerPriority() { - return proposerPriority_; - } - /** - * int64 proposer_priority = 4; - * @param value The proposerPriority to set. - */ - private void setProposerPriority(long value) { - - proposerPriority_ = value; - } - /** - * int64 proposer_priority = 4; - */ - private void clearProposerPriority() { - - proposerPriority_ = 0L; - } - - public static ibc.tendermint.light.TendermintLight.Validator parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static ibc.tendermint.light.TendermintLight.Validator parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.Validator parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static ibc.tendermint.light.TendermintLight.Validator parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.Validator parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static ibc.tendermint.light.TendermintLight.Validator parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.Validator parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static ibc.tendermint.light.TendermintLight.Validator parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.Validator parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - public static ibc.tendermint.light.TendermintLight.Validator parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.Validator parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static ibc.tendermint.light.TendermintLight.Validator parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(ibc.tendermint.light.TendermintLight.Validator prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - * Protobuf type {@code ibc.tendermint.light.Validator} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - ibc.tendermint.light.TendermintLight.Validator, Builder> implements - // @@protoc_insertion_point(builder_implements:ibc.tendermint.light.Validator) - ibc.tendermint.light.TendermintLight.ValidatorOrBuilder { - // Construct using ibc.tendermint.light.TendermintLight.Validator.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - /** - * bytes address = 1; - * @return The address. - */ - @java.lang.Override - public com.google.protobuf.ByteString getAddress() { - return instance.getAddress(); - } - /** - * bytes address = 1; - * @param value The address to set. - * @return This builder for chaining. - */ - public Builder setAddress(com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setAddress(value); - return this; - } - /** - * bytes address = 1; - * @return This builder for chaining. - */ - public Builder clearAddress() { - copyOnWrite(); - instance.clearAddress(); - return this; - } - - /** - * .ibc.tendermint.light.PublicKey pub_key = 2; - */ - @java.lang.Override - public boolean hasPubKey() { - return instance.hasPubKey(); - } - /** - * .ibc.tendermint.light.PublicKey pub_key = 2; - */ - @java.lang.Override - public ibc.tendermint.light.TendermintLight.PublicKey getPubKey() { - return instance.getPubKey(); - } - /** - * .ibc.tendermint.light.PublicKey pub_key = 2; - */ - public Builder setPubKey(ibc.tendermint.light.TendermintLight.PublicKey value) { - copyOnWrite(); - instance.setPubKey(value); - return this; - } - /** - * .ibc.tendermint.light.PublicKey pub_key = 2; - */ - public Builder setPubKey( - ibc.tendermint.light.TendermintLight.PublicKey.Builder builderForValue) { - copyOnWrite(); - instance.setPubKey(builderForValue.build()); - return this; - } - /** - * .ibc.tendermint.light.PublicKey pub_key = 2; - */ - public Builder mergePubKey(ibc.tendermint.light.TendermintLight.PublicKey value) { - copyOnWrite(); - instance.mergePubKey(value); - return this; - } - /** - * .ibc.tendermint.light.PublicKey pub_key = 2; - */ - public Builder clearPubKey() { copyOnWrite(); - instance.clearPubKey(); - return this; - } - - /** - * int64 voting_power = 3; - * @return The votingPower. - */ - @java.lang.Override - public long getVotingPower() { - return instance.getVotingPower(); - } - /** - * int64 voting_power = 3; - * @param value The votingPower to set. - * @return This builder for chaining. - */ - public Builder setVotingPower(long value) { - copyOnWrite(); - instance.setVotingPower(value); - return this; - } - /** - * int64 voting_power = 3; - * @return This builder for chaining. - */ - public Builder clearVotingPower() { - copyOnWrite(); - instance.clearVotingPower(); - return this; - } - - /** - * int64 proposer_priority = 4; - * @return The proposerPriority. - */ - @java.lang.Override - public long getProposerPriority() { - return instance.getProposerPriority(); - } - /** - * int64 proposer_priority = 4; - * @param value The proposerPriority to set. - * @return This builder for chaining. - */ - public Builder setProposerPriority(long value) { - copyOnWrite(); - instance.setProposerPriority(value); - return this; - } - /** - * int64 proposer_priority = 4; - * @return This builder for chaining. - */ - public Builder clearProposerPriority() { - copyOnWrite(); - instance.clearProposerPriority(); - return this; - } - - // @@protoc_insertion_point(builder_scope:ibc.tendermint.light.Validator) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new ibc.tendermint.light.TendermintLight.Validator(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[] { - "address_", - "pubKey_", - "votingPower_", - "proposerPriority_", - }; - java.lang.String info = - "\u0000\u0004\u0000\u0000\u0001\u0004\u0004\u0000\u0000\u0000\u0001\n\u0002\t\u0003" + - "\u0002\u0004\u0002"; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (ibc.tendermint.light.TendermintLight.Validator.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:ibc.tendermint.light.Validator) - private static final ibc.tendermint.light.TendermintLight.Validator DEFAULT_INSTANCE; - static { - Validator defaultInstance = new Validator(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - Validator.class, defaultInstance); - } - - public static ibc.tendermint.light.TendermintLight.Validator getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface SimpleValidatorOrBuilder extends - // @@protoc_insertion_point(interface_extends:ibc.tendermint.light.SimpleValidator) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * .ibc.tendermint.light.PublicKey pub_key = 1; - * @return Whether the pubKey field is set. - */ - boolean hasPubKey(); - /** - * .ibc.tendermint.light.PublicKey pub_key = 1; - * @return The pubKey. - */ - ibc.tendermint.light.TendermintLight.PublicKey getPubKey(); - - /** - * int64 voting_power = 2; - * @return The votingPower. - */ - long getVotingPower(); - } - /** - * Protobuf type {@code ibc.tendermint.light.SimpleValidator} - */ - public static final class SimpleValidator extends - com.google.protobuf.GeneratedMessageLite< - SimpleValidator, SimpleValidator.Builder> implements - // @@protoc_insertion_point(message_implements:ibc.tendermint.light.SimpleValidator) - SimpleValidatorOrBuilder { - private SimpleValidator() { - } - public static final int PUB_KEY_FIELD_NUMBER = 1; - private ibc.tendermint.light.TendermintLight.PublicKey pubKey_; - /** - * .ibc.tendermint.light.PublicKey pub_key = 1; - */ - @java.lang.Override - public boolean hasPubKey() { - return pubKey_ != null; - } - /** - * .ibc.tendermint.light.PublicKey pub_key = 1; - */ - @java.lang.Override - public ibc.tendermint.light.TendermintLight.PublicKey getPubKey() { - return pubKey_ == null ? ibc.tendermint.light.TendermintLight.PublicKey.getDefaultInstance() : pubKey_; - } - /** - * .ibc.tendermint.light.PublicKey pub_key = 1; - */ - private void setPubKey(ibc.tendermint.light.TendermintLight.PublicKey value) { - value.getClass(); - pubKey_ = value; - - } - /** - * .ibc.tendermint.light.PublicKey pub_key = 1; - */ - @java.lang.SuppressWarnings({"ReferenceEquality"}) - private void mergePubKey(ibc.tendermint.light.TendermintLight.PublicKey value) { - value.getClass(); - if (pubKey_ != null && - pubKey_ != ibc.tendermint.light.TendermintLight.PublicKey.getDefaultInstance()) { - pubKey_ = - ibc.tendermint.light.TendermintLight.PublicKey.newBuilder(pubKey_).mergeFrom(value).buildPartial(); - } else { - pubKey_ = value; - } - - } - /** - * .ibc.tendermint.light.PublicKey pub_key = 1; - */ - private void clearPubKey() { pubKey_ = null; - - } - - public static final int VOTING_POWER_FIELD_NUMBER = 2; - private long votingPower_; - /** - * int64 voting_power = 2; - * @return The votingPower. - */ - @java.lang.Override - public long getVotingPower() { - return votingPower_; - } - /** - * int64 voting_power = 2; - * @param value The votingPower to set. - */ - private void setVotingPower(long value) { - - votingPower_ = value; - } - /** - * int64 voting_power = 2; - */ - private void clearVotingPower() { - - votingPower_ = 0L; - } - - public static ibc.tendermint.light.TendermintLight.SimpleValidator parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static ibc.tendermint.light.TendermintLight.SimpleValidator parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.SimpleValidator parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static ibc.tendermint.light.TendermintLight.SimpleValidator parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.SimpleValidator parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static ibc.tendermint.light.TendermintLight.SimpleValidator parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.SimpleValidator parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static ibc.tendermint.light.TendermintLight.SimpleValidator parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.SimpleValidator parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - public static ibc.tendermint.light.TendermintLight.SimpleValidator parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.SimpleValidator parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static ibc.tendermint.light.TendermintLight.SimpleValidator parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(ibc.tendermint.light.TendermintLight.SimpleValidator prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - * Protobuf type {@code ibc.tendermint.light.SimpleValidator} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - ibc.tendermint.light.TendermintLight.SimpleValidator, Builder> implements - // @@protoc_insertion_point(builder_implements:ibc.tendermint.light.SimpleValidator) - ibc.tendermint.light.TendermintLight.SimpleValidatorOrBuilder { - // Construct using ibc.tendermint.light.TendermintLight.SimpleValidator.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - /** - * .ibc.tendermint.light.PublicKey pub_key = 1; - */ - @java.lang.Override - public boolean hasPubKey() { - return instance.hasPubKey(); - } - /** - * .ibc.tendermint.light.PublicKey pub_key = 1; - */ - @java.lang.Override - public ibc.tendermint.light.TendermintLight.PublicKey getPubKey() { - return instance.getPubKey(); - } - /** - * .ibc.tendermint.light.PublicKey pub_key = 1; - */ - public Builder setPubKey(ibc.tendermint.light.TendermintLight.PublicKey value) { - copyOnWrite(); - instance.setPubKey(value); - return this; - } - /** - * .ibc.tendermint.light.PublicKey pub_key = 1; - */ - public Builder setPubKey( - ibc.tendermint.light.TendermintLight.PublicKey.Builder builderForValue) { - copyOnWrite(); - instance.setPubKey(builderForValue.build()); - return this; - } - /** - * .ibc.tendermint.light.PublicKey pub_key = 1; - */ - public Builder mergePubKey(ibc.tendermint.light.TendermintLight.PublicKey value) { - copyOnWrite(); - instance.mergePubKey(value); - return this; - } - /** - * .ibc.tendermint.light.PublicKey pub_key = 1; - */ - public Builder clearPubKey() { copyOnWrite(); - instance.clearPubKey(); - return this; - } - - /** - * int64 voting_power = 2; - * @return The votingPower. - */ - @java.lang.Override - public long getVotingPower() { - return instance.getVotingPower(); - } - /** - * int64 voting_power = 2; - * @param value The votingPower to set. - * @return This builder for chaining. - */ - public Builder setVotingPower(long value) { - copyOnWrite(); - instance.setVotingPower(value); - return this; - } - /** - * int64 voting_power = 2; - * @return This builder for chaining. - */ - public Builder clearVotingPower() { - copyOnWrite(); - instance.clearVotingPower(); - return this; - } - - // @@protoc_insertion_point(builder_scope:ibc.tendermint.light.SimpleValidator) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new ibc.tendermint.light.TendermintLight.SimpleValidator(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[] { - "pubKey_", - "votingPower_", - }; - java.lang.String info = - "\u0000\u0002\u0000\u0000\u0001\u0002\u0002\u0000\u0000\u0000\u0001\t\u0002\u0002" + - ""; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (ibc.tendermint.light.TendermintLight.SimpleValidator.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:ibc.tendermint.light.SimpleValidator) - private static final ibc.tendermint.light.TendermintLight.SimpleValidator DEFAULT_INSTANCE; - static { - SimpleValidator defaultInstance = new SimpleValidator(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - SimpleValidator.class, defaultInstance); - } - - public static ibc.tendermint.light.TendermintLight.SimpleValidator getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface PublicKeyOrBuilder extends - // @@protoc_insertion_point(interface_extends:ibc.tendermint.light.PublicKey) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * bytes ed25519 = 1; - * @return Whether the ed25519 field is set. - */ - boolean hasEd25519(); - /** - * bytes ed25519 = 1; - * @return The ed25519. - */ - com.google.protobuf.ByteString getEd25519(); - - /** - * bytes secp256k1 = 2; - * @return Whether the secp256k1 field is set. - */ - boolean hasSecp256K1(); - /** - * bytes secp256k1 = 2; - * @return The secp256k1. - */ - com.google.protobuf.ByteString getSecp256K1(); - - /** - * bytes sr25519 = 3; - * @return Whether the sr25519 field is set. - */ - boolean hasSr25519(); - /** - * bytes sr25519 = 3; - * @return The sr25519. - */ - com.google.protobuf.ByteString getSr25519(); - - public ibc.tendermint.light.TendermintLight.PublicKey.SumCase getSumCase(); - } - /** - * Protobuf type {@code ibc.tendermint.light.PublicKey} - */ - public static final class PublicKey extends - com.google.protobuf.GeneratedMessageLite< - PublicKey, PublicKey.Builder> implements - // @@protoc_insertion_point(message_implements:ibc.tendermint.light.PublicKey) - PublicKeyOrBuilder { - private PublicKey() { - } - private int sumCase_ = 0; - private java.lang.Object sum_; - public enum SumCase { - ED25519(1), - SECP256K1(2), - SR25519(3), - SUM_NOT_SET(0); - private final int value; - private SumCase(int value) { - this.value = value; - } - /** - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static SumCase valueOf(int value) { - return forNumber(value); - } - - public static SumCase forNumber(int value) { - switch (value) { - case 1: return ED25519; - case 2: return SECP256K1; - case 3: return SR25519; - case 0: return SUM_NOT_SET; - default: return null; - } - } - public int getNumber() { - return this.value; - } - }; - - @java.lang.Override - public SumCase - getSumCase() { - return SumCase.forNumber( - sumCase_); - } - - private void clearSum() { - sumCase_ = 0; - sum_ = null; - } - - public static final int ED25519_FIELD_NUMBER = 1; - /** - * bytes ed25519 = 1; - * @return Whether the ed25519 field is set. - */ - @java.lang.Override - public boolean hasEd25519() { - return sumCase_ == 1; - } - /** - * bytes ed25519 = 1; - * @return The ed25519. - */ - @java.lang.Override - public com.google.protobuf.ByteString getEd25519() { - if (sumCase_ == 1) { - return (com.google.protobuf.ByteString) sum_; - } - return com.google.protobuf.ByteString.EMPTY; - } - /** - * bytes ed25519 = 1; - * @param value The ed25519 to set. - */ - private void setEd25519(com.google.protobuf.ByteString value) { - java.lang.Class valueClass = value.getClass(); - sumCase_ = 1; - sum_ = value; - } - /** - * bytes ed25519 = 1; - */ - private void clearEd25519() { - if (sumCase_ == 1) { - sumCase_ = 0; - sum_ = null; - } - } - - public static final int SECP256K1_FIELD_NUMBER = 2; - /** - * bytes secp256k1 = 2; - * @return Whether the secp256k1 field is set. - */ - @java.lang.Override - public boolean hasSecp256K1() { - return sumCase_ == 2; - } - /** - * bytes secp256k1 = 2; - * @return The secp256k1. - */ - @java.lang.Override - public com.google.protobuf.ByteString getSecp256K1() { - if (sumCase_ == 2) { - return (com.google.protobuf.ByteString) sum_; - } - return com.google.protobuf.ByteString.EMPTY; - } - /** - * bytes secp256k1 = 2; - * @param value The secp256k1 to set. - */ - private void setSecp256K1(com.google.protobuf.ByteString value) { - java.lang.Class valueClass = value.getClass(); - sumCase_ = 2; - sum_ = value; - } - /** - * bytes secp256k1 = 2; - */ - private void clearSecp256K1() { - if (sumCase_ == 2) { - sumCase_ = 0; - sum_ = null; - } - } - - public static final int SR25519_FIELD_NUMBER = 3; - /** - * bytes sr25519 = 3; - * @return Whether the sr25519 field is set. - */ - @java.lang.Override - public boolean hasSr25519() { - return sumCase_ == 3; - } - /** - * bytes sr25519 = 3; - * @return The sr25519. - */ - @java.lang.Override - public com.google.protobuf.ByteString getSr25519() { - if (sumCase_ == 3) { - return (com.google.protobuf.ByteString) sum_; - } - return com.google.protobuf.ByteString.EMPTY; - } - /** - * bytes sr25519 = 3; - * @param value The sr25519 to set. - */ - private void setSr25519(com.google.protobuf.ByteString value) { - java.lang.Class valueClass = value.getClass(); - sumCase_ = 3; - sum_ = value; - } - /** - * bytes sr25519 = 3; - */ - private void clearSr25519() { - if (sumCase_ == 3) { - sumCase_ = 0; - sum_ = null; - } - } - - public static ibc.tendermint.light.TendermintLight.PublicKey parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static ibc.tendermint.light.TendermintLight.PublicKey parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.PublicKey parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static ibc.tendermint.light.TendermintLight.PublicKey parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.PublicKey parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static ibc.tendermint.light.TendermintLight.PublicKey parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.PublicKey parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static ibc.tendermint.light.TendermintLight.PublicKey parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.PublicKey parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - public static ibc.tendermint.light.TendermintLight.PublicKey parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.PublicKey parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static ibc.tendermint.light.TendermintLight.PublicKey parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(ibc.tendermint.light.TendermintLight.PublicKey prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - * Protobuf type {@code ibc.tendermint.light.PublicKey} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - ibc.tendermint.light.TendermintLight.PublicKey, Builder> implements - // @@protoc_insertion_point(builder_implements:ibc.tendermint.light.PublicKey) - ibc.tendermint.light.TendermintLight.PublicKeyOrBuilder { - // Construct using ibc.tendermint.light.TendermintLight.PublicKey.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - @java.lang.Override - public SumCase - getSumCase() { - return instance.getSumCase(); - } - - public Builder clearSum() { - copyOnWrite(); - instance.clearSum(); - return this; - } - - - /** - * bytes ed25519 = 1; - * @return Whether the ed25519 field is set. - */ - @java.lang.Override - public boolean hasEd25519() { - return instance.hasEd25519(); - } - /** - * bytes ed25519 = 1; - * @return The ed25519. - */ - @java.lang.Override - public com.google.protobuf.ByteString getEd25519() { - return instance.getEd25519(); - } - /** - * bytes ed25519 = 1; - * @param value The ed25519 to set. - * @return This builder for chaining. - */ - public Builder setEd25519(com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setEd25519(value); - return this; - } - /** - * bytes ed25519 = 1; - * @return This builder for chaining. - */ - public Builder clearEd25519() { - copyOnWrite(); - instance.clearEd25519(); - return this; - } - - /** - * bytes secp256k1 = 2; - * @return Whether the secp256k1 field is set. - */ - @java.lang.Override - public boolean hasSecp256K1() { - return instance.hasSecp256K1(); - } - /** - * bytes secp256k1 = 2; - * @return The secp256k1. - */ - @java.lang.Override - public com.google.protobuf.ByteString getSecp256K1() { - return instance.getSecp256K1(); - } - /** - * bytes secp256k1 = 2; - * @param value The secp256k1 to set. - * @return This builder for chaining. - */ - public Builder setSecp256K1(com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setSecp256K1(value); - return this; - } - /** - * bytes secp256k1 = 2; - * @return This builder for chaining. - */ - public Builder clearSecp256K1() { - copyOnWrite(); - instance.clearSecp256K1(); - return this; - } - - /** - * bytes sr25519 = 3; - * @return Whether the sr25519 field is set. - */ - @java.lang.Override - public boolean hasSr25519() { - return instance.hasSr25519(); - } - /** - * bytes sr25519 = 3; - * @return The sr25519. - */ - @java.lang.Override - public com.google.protobuf.ByteString getSr25519() { - return instance.getSr25519(); - } - /** - * bytes sr25519 = 3; - * @param value The sr25519 to set. - * @return This builder for chaining. - */ - public Builder setSr25519(com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setSr25519(value); - return this; - } - /** - * bytes sr25519 = 3; - * @return This builder for chaining. - */ - public Builder clearSr25519() { - copyOnWrite(); - instance.clearSr25519(); - return this; - } - - // @@protoc_insertion_point(builder_scope:ibc.tendermint.light.PublicKey) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new ibc.tendermint.light.TendermintLight.PublicKey(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[] { - "sum_", - "sumCase_", - }; - java.lang.String info = - "\u0000\u0003\u0001\u0000\u0001\u0003\u0003\u0000\u0000\u0000\u0001=\u0000\u0002=" + - "\u0000\u0003=\u0000"; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (ibc.tendermint.light.TendermintLight.PublicKey.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:ibc.tendermint.light.PublicKey) - private static final ibc.tendermint.light.TendermintLight.PublicKey DEFAULT_INSTANCE; - static { - PublicKey defaultInstance = new PublicKey(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - PublicKey.class, defaultInstance); - } - - public static ibc.tendermint.light.TendermintLight.PublicKey getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface PartSetHeaderOrBuilder extends - // @@protoc_insertion_point(interface_extends:ibc.tendermint.light.PartSetHeader) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * uint32 total = 1; - * @return The total. - */ - int getTotal(); - - /** - * bytes hash = 2; - * @return The hash. - */ - com.google.protobuf.ByteString getHash(); - } - /** - * Protobuf type {@code ibc.tendermint.light.PartSetHeader} - */ - public static final class PartSetHeader extends - com.google.protobuf.GeneratedMessageLite< - PartSetHeader, PartSetHeader.Builder> implements - // @@protoc_insertion_point(message_implements:ibc.tendermint.light.PartSetHeader) - PartSetHeaderOrBuilder { - private PartSetHeader() { - hash_ = com.google.protobuf.ByteString.EMPTY; - } - public static final int TOTAL_FIELD_NUMBER = 1; - private int total_; - /** - * uint32 total = 1; - * @return The total. - */ - @java.lang.Override - public int getTotal() { - return total_; - } - /** - * uint32 total = 1; - * @param value The total to set. - */ - private void setTotal(int value) { - - total_ = value; - } - /** - * uint32 total = 1; - */ - private void clearTotal() { - - total_ = 0; - } - - public static final int HASH_FIELD_NUMBER = 2; - private com.google.protobuf.ByteString hash_; - /** - * bytes hash = 2; - * @return The hash. - */ - @java.lang.Override - public com.google.protobuf.ByteString getHash() { - return hash_; - } - /** - * bytes hash = 2; - * @param value The hash to set. - */ - private void setHash(com.google.protobuf.ByteString value) { - java.lang.Class valueClass = value.getClass(); - - hash_ = value; - } - /** - * bytes hash = 2; - */ - private void clearHash() { - - hash_ = getDefaultInstance().getHash(); - } - - public static ibc.tendermint.light.TendermintLight.PartSetHeader parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static ibc.tendermint.light.TendermintLight.PartSetHeader parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.PartSetHeader parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static ibc.tendermint.light.TendermintLight.PartSetHeader parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.PartSetHeader parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static ibc.tendermint.light.TendermintLight.PartSetHeader parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.PartSetHeader parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static ibc.tendermint.light.TendermintLight.PartSetHeader parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.PartSetHeader parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - public static ibc.tendermint.light.TendermintLight.PartSetHeader parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.PartSetHeader parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static ibc.tendermint.light.TendermintLight.PartSetHeader parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(ibc.tendermint.light.TendermintLight.PartSetHeader prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - * Protobuf type {@code ibc.tendermint.light.PartSetHeader} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - ibc.tendermint.light.TendermintLight.PartSetHeader, Builder> implements - // @@protoc_insertion_point(builder_implements:ibc.tendermint.light.PartSetHeader) - ibc.tendermint.light.TendermintLight.PartSetHeaderOrBuilder { - // Construct using ibc.tendermint.light.TendermintLight.PartSetHeader.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - /** - * uint32 total = 1; - * @return The total. - */ - @java.lang.Override - public int getTotal() { - return instance.getTotal(); - } - /** - * uint32 total = 1; - * @param value The total to set. - * @return This builder for chaining. - */ - public Builder setTotal(int value) { - copyOnWrite(); - instance.setTotal(value); - return this; - } - /** - * uint32 total = 1; - * @return This builder for chaining. - */ - public Builder clearTotal() { - copyOnWrite(); - instance.clearTotal(); - return this; - } - - /** - * bytes hash = 2; - * @return The hash. - */ - @java.lang.Override - public com.google.protobuf.ByteString getHash() { - return instance.getHash(); - } - /** - * bytes hash = 2; - * @param value The hash to set. - * @return This builder for chaining. - */ - public Builder setHash(com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setHash(value); - return this; - } - /** - * bytes hash = 2; - * @return This builder for chaining. - */ - public Builder clearHash() { - copyOnWrite(); - instance.clearHash(); - return this; - } - - // @@protoc_insertion_point(builder_scope:ibc.tendermint.light.PartSetHeader) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new ibc.tendermint.light.TendermintLight.PartSetHeader(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[] { - "total_", - "hash_", - }; - java.lang.String info = - "\u0000\u0002\u0000\u0000\u0001\u0002\u0002\u0000\u0000\u0000\u0001\u000b\u0002\n" + - ""; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (ibc.tendermint.light.TendermintLight.PartSetHeader.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:ibc.tendermint.light.PartSetHeader) - private static final ibc.tendermint.light.TendermintLight.PartSetHeader DEFAULT_INSTANCE; - static { - PartSetHeader defaultInstance = new PartSetHeader(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - PartSetHeader.class, defaultInstance); - } - - public static ibc.tendermint.light.TendermintLight.PartSetHeader getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface BlockIDOrBuilder extends - // @@protoc_insertion_point(interface_extends:ibc.tendermint.light.BlockID) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * bytes hash = 1; - * @return The hash. - */ - com.google.protobuf.ByteString getHash(); - - /** - * .ibc.tendermint.light.PartSetHeader part_set_header = 2; - * @return Whether the partSetHeader field is set. - */ - boolean hasPartSetHeader(); - /** - * .ibc.tendermint.light.PartSetHeader part_set_header = 2; - * @return The partSetHeader. - */ - ibc.tendermint.light.TendermintLight.PartSetHeader getPartSetHeader(); - } - /** - * Protobuf type {@code ibc.tendermint.light.BlockID} - */ - public static final class BlockID extends - com.google.protobuf.GeneratedMessageLite< - BlockID, BlockID.Builder> implements - // @@protoc_insertion_point(message_implements:ibc.tendermint.light.BlockID) - BlockIDOrBuilder { - private BlockID() { - hash_ = com.google.protobuf.ByteString.EMPTY; - } - public static final int HASH_FIELD_NUMBER = 1; - private com.google.protobuf.ByteString hash_; - /** - * bytes hash = 1; - * @return The hash. - */ - @java.lang.Override - public com.google.protobuf.ByteString getHash() { - return hash_; - } - /** - * bytes hash = 1; - * @param value The hash to set. - */ - private void setHash(com.google.protobuf.ByteString value) { - java.lang.Class valueClass = value.getClass(); - - hash_ = value; - } - /** - * bytes hash = 1; - */ - private void clearHash() { - - hash_ = getDefaultInstance().getHash(); - } - - public static final int PART_SET_HEADER_FIELD_NUMBER = 2; - private ibc.tendermint.light.TendermintLight.PartSetHeader partSetHeader_; - /** - * .ibc.tendermint.light.PartSetHeader part_set_header = 2; - */ - @java.lang.Override - public boolean hasPartSetHeader() { - return partSetHeader_ != null; - } - /** - * .ibc.tendermint.light.PartSetHeader part_set_header = 2; - */ - @java.lang.Override - public ibc.tendermint.light.TendermintLight.PartSetHeader getPartSetHeader() { - return partSetHeader_ == null ? ibc.tendermint.light.TendermintLight.PartSetHeader.getDefaultInstance() : partSetHeader_; - } - /** - * .ibc.tendermint.light.PartSetHeader part_set_header = 2; - */ - private void setPartSetHeader(ibc.tendermint.light.TendermintLight.PartSetHeader value) { - value.getClass(); - partSetHeader_ = value; - - } - /** - * .ibc.tendermint.light.PartSetHeader part_set_header = 2; - */ - @java.lang.SuppressWarnings({"ReferenceEquality"}) - private void mergePartSetHeader(ibc.tendermint.light.TendermintLight.PartSetHeader value) { - value.getClass(); - if (partSetHeader_ != null && - partSetHeader_ != ibc.tendermint.light.TendermintLight.PartSetHeader.getDefaultInstance()) { - partSetHeader_ = - ibc.tendermint.light.TendermintLight.PartSetHeader.newBuilder(partSetHeader_).mergeFrom(value).buildPartial(); - } else { - partSetHeader_ = value; - } - - } - /** - * .ibc.tendermint.light.PartSetHeader part_set_header = 2; - */ - private void clearPartSetHeader() { partSetHeader_ = null; - - } - - public static ibc.tendermint.light.TendermintLight.BlockID parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static ibc.tendermint.light.TendermintLight.BlockID parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.BlockID parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static ibc.tendermint.light.TendermintLight.BlockID parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.BlockID parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static ibc.tendermint.light.TendermintLight.BlockID parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.BlockID parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static ibc.tendermint.light.TendermintLight.BlockID parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.BlockID parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - public static ibc.tendermint.light.TendermintLight.BlockID parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.BlockID parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static ibc.tendermint.light.TendermintLight.BlockID parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(ibc.tendermint.light.TendermintLight.BlockID prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - * Protobuf type {@code ibc.tendermint.light.BlockID} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - ibc.tendermint.light.TendermintLight.BlockID, Builder> implements - // @@protoc_insertion_point(builder_implements:ibc.tendermint.light.BlockID) - ibc.tendermint.light.TendermintLight.BlockIDOrBuilder { - // Construct using ibc.tendermint.light.TendermintLight.BlockID.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - /** - * bytes hash = 1; - * @return The hash. - */ - @java.lang.Override - public com.google.protobuf.ByteString getHash() { - return instance.getHash(); - } - /** - * bytes hash = 1; - * @param value The hash to set. - * @return This builder for chaining. - */ - public Builder setHash(com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setHash(value); - return this; - } - /** - * bytes hash = 1; - * @return This builder for chaining. - */ - public Builder clearHash() { - copyOnWrite(); - instance.clearHash(); - return this; - } - - /** - * .ibc.tendermint.light.PartSetHeader part_set_header = 2; - */ - @java.lang.Override - public boolean hasPartSetHeader() { - return instance.hasPartSetHeader(); - } - /** - * .ibc.tendermint.light.PartSetHeader part_set_header = 2; - */ - @java.lang.Override - public ibc.tendermint.light.TendermintLight.PartSetHeader getPartSetHeader() { - return instance.getPartSetHeader(); - } - /** - * .ibc.tendermint.light.PartSetHeader part_set_header = 2; - */ - public Builder setPartSetHeader(ibc.tendermint.light.TendermintLight.PartSetHeader value) { - copyOnWrite(); - instance.setPartSetHeader(value); - return this; - } - /** - * .ibc.tendermint.light.PartSetHeader part_set_header = 2; - */ - public Builder setPartSetHeader( - ibc.tendermint.light.TendermintLight.PartSetHeader.Builder builderForValue) { - copyOnWrite(); - instance.setPartSetHeader(builderForValue.build()); - return this; - } - /** - * .ibc.tendermint.light.PartSetHeader part_set_header = 2; - */ - public Builder mergePartSetHeader(ibc.tendermint.light.TendermintLight.PartSetHeader value) { - copyOnWrite(); - instance.mergePartSetHeader(value); - return this; - } - /** - * .ibc.tendermint.light.PartSetHeader part_set_header = 2; - */ - public Builder clearPartSetHeader() { copyOnWrite(); - instance.clearPartSetHeader(); - return this; - } - - // @@protoc_insertion_point(builder_scope:ibc.tendermint.light.BlockID) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new ibc.tendermint.light.TendermintLight.BlockID(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[] { - "hash_", - "partSetHeader_", - }; - java.lang.String info = - "\u0000\u0002\u0000\u0000\u0001\u0002\u0002\u0000\u0000\u0000\u0001\n\u0002\t"; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (ibc.tendermint.light.TendermintLight.BlockID.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:ibc.tendermint.light.BlockID) - private static final ibc.tendermint.light.TendermintLight.BlockID DEFAULT_INSTANCE; - static { - BlockID defaultInstance = new BlockID(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - BlockID.class, defaultInstance); - } - - public static ibc.tendermint.light.TendermintLight.BlockID getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface CommitOrBuilder extends - // @@protoc_insertion_point(interface_extends:ibc.tendermint.light.Commit) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * int64 height = 1; - * @return The height. - */ - long getHeight(); - - /** - * int32 round = 2; - * @return The round. - */ - int getRound(); - - /** - * .ibc.tendermint.light.BlockID block_id = 3; - * @return Whether the blockId field is set. - */ - boolean hasBlockId(); - /** - * .ibc.tendermint.light.BlockID block_id = 3; - * @return The blockId. - */ - ibc.tendermint.light.TendermintLight.BlockID getBlockId(); - - /** - * repeated .ibc.tendermint.light.CommitSig signatures = 4; - */ - java.util.List - getSignaturesList(); - /** - * repeated .ibc.tendermint.light.CommitSig signatures = 4; - */ - ibc.tendermint.light.TendermintLight.CommitSig getSignatures(int index); - /** - * repeated .ibc.tendermint.light.CommitSig signatures = 4; - */ - int getSignaturesCount(); - } - /** - * Protobuf type {@code ibc.tendermint.light.Commit} - */ - public static final class Commit extends - com.google.protobuf.GeneratedMessageLite< - Commit, Commit.Builder> implements - // @@protoc_insertion_point(message_implements:ibc.tendermint.light.Commit) - CommitOrBuilder { - private Commit() { - signatures_ = emptyProtobufList(); - } - public static final int HEIGHT_FIELD_NUMBER = 1; - private long height_; - /** - * int64 height = 1; - * @return The height. - */ - @java.lang.Override - public long getHeight() { - return height_; - } - /** - * int64 height = 1; - * @param value The height to set. - */ - private void setHeight(long value) { - - height_ = value; - } - /** - * int64 height = 1; - */ - private void clearHeight() { - - height_ = 0L; - } - - public static final int ROUND_FIELD_NUMBER = 2; - private int round_; - /** - * int32 round = 2; - * @return The round. - */ - @java.lang.Override - public int getRound() { - return round_; - } - /** - * int32 round = 2; - * @param value The round to set. - */ - private void setRound(int value) { - - round_ = value; - } - /** - * int32 round = 2; - */ - private void clearRound() { - - round_ = 0; - } - - public static final int BLOCK_ID_FIELD_NUMBER = 3; - private ibc.tendermint.light.TendermintLight.BlockID blockId_; - /** - * .ibc.tendermint.light.BlockID block_id = 3; - */ - @java.lang.Override - public boolean hasBlockId() { - return blockId_ != null; - } - /** - * .ibc.tendermint.light.BlockID block_id = 3; - */ - @java.lang.Override - public ibc.tendermint.light.TendermintLight.BlockID getBlockId() { - return blockId_ == null ? ibc.tendermint.light.TendermintLight.BlockID.getDefaultInstance() : blockId_; - } - /** - * .ibc.tendermint.light.BlockID block_id = 3; - */ - private void setBlockId(ibc.tendermint.light.TendermintLight.BlockID value) { - value.getClass(); - blockId_ = value; - - } - /** - * .ibc.tendermint.light.BlockID block_id = 3; - */ - @java.lang.SuppressWarnings({"ReferenceEquality"}) - private void mergeBlockId(ibc.tendermint.light.TendermintLight.BlockID value) { - value.getClass(); - if (blockId_ != null && - blockId_ != ibc.tendermint.light.TendermintLight.BlockID.getDefaultInstance()) { - blockId_ = - ibc.tendermint.light.TendermintLight.BlockID.newBuilder(blockId_).mergeFrom(value).buildPartial(); - } else { - blockId_ = value; - } - - } - /** - * .ibc.tendermint.light.BlockID block_id = 3; - */ - private void clearBlockId() { blockId_ = null; - - } - - public static final int SIGNATURES_FIELD_NUMBER = 4; - private com.google.protobuf.Internal.ProtobufList signatures_; - /** - * repeated .ibc.tendermint.light.CommitSig signatures = 4; - */ - @java.lang.Override - public java.util.List getSignaturesList() { - return signatures_; - } - /** - * repeated .ibc.tendermint.light.CommitSig signatures = 4; - */ - public java.util.List - getSignaturesOrBuilderList() { - return signatures_; - } - /** - * repeated .ibc.tendermint.light.CommitSig signatures = 4; - */ - @java.lang.Override - public int getSignaturesCount() { - return signatures_.size(); - } - /** - * repeated .ibc.tendermint.light.CommitSig signatures = 4; - */ - @java.lang.Override - public ibc.tendermint.light.TendermintLight.CommitSig getSignatures(int index) { - return signatures_.get(index); - } - /** - * repeated .ibc.tendermint.light.CommitSig signatures = 4; - */ - public ibc.tendermint.light.TendermintLight.CommitSigOrBuilder getSignaturesOrBuilder( - int index) { - return signatures_.get(index); - } - private void ensureSignaturesIsMutable() { - com.google.protobuf.Internal.ProtobufList tmp = signatures_; - if (!tmp.isModifiable()) { - signatures_ = - com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp); - } - } - - /** - * repeated .ibc.tendermint.light.CommitSig signatures = 4; - */ - private void setSignatures( - int index, ibc.tendermint.light.TendermintLight.CommitSig value) { - value.getClass(); - ensureSignaturesIsMutable(); - signatures_.set(index, value); - } - /** - * repeated .ibc.tendermint.light.CommitSig signatures = 4; - */ - private void addSignatures(ibc.tendermint.light.TendermintLight.CommitSig value) { - value.getClass(); - ensureSignaturesIsMutable(); - signatures_.add(value); - } - /** - * repeated .ibc.tendermint.light.CommitSig signatures = 4; - */ - private void addSignatures( - int index, ibc.tendermint.light.TendermintLight.CommitSig value) { - value.getClass(); - ensureSignaturesIsMutable(); - signatures_.add(index, value); - } - /** - * repeated .ibc.tendermint.light.CommitSig signatures = 4; - */ - private void addAllSignatures( - java.lang.Iterable values) { - ensureSignaturesIsMutable(); - com.google.protobuf.AbstractMessageLite.addAll( - values, signatures_); - } - /** - * repeated .ibc.tendermint.light.CommitSig signatures = 4; - */ - private void clearSignatures() { - signatures_ = emptyProtobufList(); - } - /** - * repeated .ibc.tendermint.light.CommitSig signatures = 4; - */ - private void removeSignatures(int index) { - ensureSignaturesIsMutable(); - signatures_.remove(index); - } - - public static ibc.tendermint.light.TendermintLight.Commit parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static ibc.tendermint.light.TendermintLight.Commit parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.Commit parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static ibc.tendermint.light.TendermintLight.Commit parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.Commit parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static ibc.tendermint.light.TendermintLight.Commit parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.Commit parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static ibc.tendermint.light.TendermintLight.Commit parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.Commit parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - public static ibc.tendermint.light.TendermintLight.Commit parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.Commit parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static ibc.tendermint.light.TendermintLight.Commit parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(ibc.tendermint.light.TendermintLight.Commit prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - * Protobuf type {@code ibc.tendermint.light.Commit} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - ibc.tendermint.light.TendermintLight.Commit, Builder> implements - // @@protoc_insertion_point(builder_implements:ibc.tendermint.light.Commit) - ibc.tendermint.light.TendermintLight.CommitOrBuilder { - // Construct using ibc.tendermint.light.TendermintLight.Commit.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - /** - * int64 height = 1; - * @return The height. - */ - @java.lang.Override - public long getHeight() { - return instance.getHeight(); - } - /** - * int64 height = 1; - * @param value The height to set. - * @return This builder for chaining. - */ - public Builder setHeight(long value) { - copyOnWrite(); - instance.setHeight(value); - return this; - } - /** - * int64 height = 1; - * @return This builder for chaining. - */ - public Builder clearHeight() { - copyOnWrite(); - instance.clearHeight(); - return this; - } - - /** - * int32 round = 2; - * @return The round. - */ - @java.lang.Override - public int getRound() { - return instance.getRound(); - } - /** - * int32 round = 2; - * @param value The round to set. - * @return This builder for chaining. - */ - public Builder setRound(int value) { - copyOnWrite(); - instance.setRound(value); - return this; - } - /** - * int32 round = 2; - * @return This builder for chaining. - */ - public Builder clearRound() { - copyOnWrite(); - instance.clearRound(); - return this; - } - - /** - * .ibc.tendermint.light.BlockID block_id = 3; - */ - @java.lang.Override - public boolean hasBlockId() { - return instance.hasBlockId(); - } - /** - * .ibc.tendermint.light.BlockID block_id = 3; - */ - @java.lang.Override - public ibc.tendermint.light.TendermintLight.BlockID getBlockId() { - return instance.getBlockId(); - } - /** - * .ibc.tendermint.light.BlockID block_id = 3; - */ - public Builder setBlockId(ibc.tendermint.light.TendermintLight.BlockID value) { - copyOnWrite(); - instance.setBlockId(value); - return this; - } - /** - * .ibc.tendermint.light.BlockID block_id = 3; - */ - public Builder setBlockId( - ibc.tendermint.light.TendermintLight.BlockID.Builder builderForValue) { - copyOnWrite(); - instance.setBlockId(builderForValue.build()); - return this; - } - /** - * .ibc.tendermint.light.BlockID block_id = 3; - */ - public Builder mergeBlockId(ibc.tendermint.light.TendermintLight.BlockID value) { - copyOnWrite(); - instance.mergeBlockId(value); - return this; - } - /** - * .ibc.tendermint.light.BlockID block_id = 3; - */ - public Builder clearBlockId() { copyOnWrite(); - instance.clearBlockId(); - return this; - } - - /** - * repeated .ibc.tendermint.light.CommitSig signatures = 4; - */ - @java.lang.Override - public java.util.List getSignaturesList() { - return java.util.Collections.unmodifiableList( - instance.getSignaturesList()); - } - /** - * repeated .ibc.tendermint.light.CommitSig signatures = 4; - */ - @java.lang.Override - public int getSignaturesCount() { - return instance.getSignaturesCount(); - }/** - * repeated .ibc.tendermint.light.CommitSig signatures = 4; - */ - @java.lang.Override - public ibc.tendermint.light.TendermintLight.CommitSig getSignatures(int index) { - return instance.getSignatures(index); - } - /** - * repeated .ibc.tendermint.light.CommitSig signatures = 4; - */ - public Builder setSignatures( - int index, ibc.tendermint.light.TendermintLight.CommitSig value) { - copyOnWrite(); - instance.setSignatures(index, value); - return this; - } - /** - * repeated .ibc.tendermint.light.CommitSig signatures = 4; - */ - public Builder setSignatures( - int index, ibc.tendermint.light.TendermintLight.CommitSig.Builder builderForValue) { - copyOnWrite(); - instance.setSignatures(index, - builderForValue.build()); - return this; - } - /** - * repeated .ibc.tendermint.light.CommitSig signatures = 4; - */ - public Builder addSignatures(ibc.tendermint.light.TendermintLight.CommitSig value) { - copyOnWrite(); - instance.addSignatures(value); - return this; - } - /** - * repeated .ibc.tendermint.light.CommitSig signatures = 4; - */ - public Builder addSignatures( - int index, ibc.tendermint.light.TendermintLight.CommitSig value) { - copyOnWrite(); - instance.addSignatures(index, value); - return this; - } - /** - * repeated .ibc.tendermint.light.CommitSig signatures = 4; - */ - public Builder addSignatures( - ibc.tendermint.light.TendermintLight.CommitSig.Builder builderForValue) { - copyOnWrite(); - instance.addSignatures(builderForValue.build()); - return this; - } - /** - * repeated .ibc.tendermint.light.CommitSig signatures = 4; - */ - public Builder addSignatures( - int index, ibc.tendermint.light.TendermintLight.CommitSig.Builder builderForValue) { - copyOnWrite(); - instance.addSignatures(index, - builderForValue.build()); - return this; - } - /** - * repeated .ibc.tendermint.light.CommitSig signatures = 4; - */ - public Builder addAllSignatures( - java.lang.Iterable values) { - copyOnWrite(); - instance.addAllSignatures(values); - return this; - } - /** - * repeated .ibc.tendermint.light.CommitSig signatures = 4; - */ - public Builder clearSignatures() { - copyOnWrite(); - instance.clearSignatures(); - return this; - } - /** - * repeated .ibc.tendermint.light.CommitSig signatures = 4; - */ - public Builder removeSignatures(int index) { - copyOnWrite(); - instance.removeSignatures(index); - return this; - } - - // @@protoc_insertion_point(builder_scope:ibc.tendermint.light.Commit) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new ibc.tendermint.light.TendermintLight.Commit(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[] { - "height_", - "round_", - "blockId_", - "signatures_", - ibc.tendermint.light.TendermintLight.CommitSig.class, - }; - java.lang.String info = - "\u0000\u0004\u0000\u0000\u0001\u0004\u0004\u0000\u0001\u0000\u0001\u0002\u0002\u0004" + - "\u0003\t\u0004\u001b"; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (ibc.tendermint.light.TendermintLight.Commit.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:ibc.tendermint.light.Commit) - private static final ibc.tendermint.light.TendermintLight.Commit DEFAULT_INSTANCE; - static { - Commit defaultInstance = new Commit(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - Commit.class, defaultInstance); - } - - public static ibc.tendermint.light.TendermintLight.Commit getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface CommitSigOrBuilder extends - // @@protoc_insertion_point(interface_extends:ibc.tendermint.light.CommitSig) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * .ibc.tendermint.light.BlockIDFlag block_id_flag = 1; - * @return The enum numeric value on the wire for blockIdFlag. - */ - int getBlockIdFlagValue(); - /** - * .ibc.tendermint.light.BlockIDFlag block_id_flag = 1; - * @return The blockIdFlag. - */ - ibc.tendermint.light.TendermintLight.BlockIDFlag getBlockIdFlag(); - - /** - * bytes validator_address = 2; - * @return The validatorAddress. - */ - com.google.protobuf.ByteString getValidatorAddress(); - - /** - * .ibc.tendermint.light.Timestamp timestamp = 3; - * @return Whether the timestamp field is set. - */ - boolean hasTimestamp(); - /** - * .ibc.tendermint.light.Timestamp timestamp = 3; - * @return The timestamp. - */ - ibc.tendermint.light.TendermintLight.Timestamp getTimestamp(); - - /** - * bytes signature = 4; - * @return The signature. - */ - com.google.protobuf.ByteString getSignature(); - } - /** - *
-   * CommitSig is a part of the Vote included in a Commit.
-   * 
- * - * Protobuf type {@code ibc.tendermint.light.CommitSig} - */ - public static final class CommitSig extends - com.google.protobuf.GeneratedMessageLite< - CommitSig, CommitSig.Builder> implements - // @@protoc_insertion_point(message_implements:ibc.tendermint.light.CommitSig) - CommitSigOrBuilder { - private CommitSig() { - validatorAddress_ = com.google.protobuf.ByteString.EMPTY; - signature_ = com.google.protobuf.ByteString.EMPTY; - } - public static final int BLOCK_ID_FLAG_FIELD_NUMBER = 1; - private int blockIdFlag_; - /** - * .ibc.tendermint.light.BlockIDFlag block_id_flag = 1; - * @return The enum numeric value on the wire for blockIdFlag. - */ - @java.lang.Override - public int getBlockIdFlagValue() { - return blockIdFlag_; - } - /** - * .ibc.tendermint.light.BlockIDFlag block_id_flag = 1; - * @return The blockIdFlag. - */ - @java.lang.Override - public ibc.tendermint.light.TendermintLight.BlockIDFlag getBlockIdFlag() { - ibc.tendermint.light.TendermintLight.BlockIDFlag result = ibc.tendermint.light.TendermintLight.BlockIDFlag.forNumber(blockIdFlag_); - return result == null ? ibc.tendermint.light.TendermintLight.BlockIDFlag.UNRECOGNIZED : result; - } - /** - * .ibc.tendermint.light.BlockIDFlag block_id_flag = 1; - * @param value The enum numeric value on the wire for blockIdFlag to set. - */ - private void setBlockIdFlagValue(int value) { - blockIdFlag_ = value; - } - /** - * .ibc.tendermint.light.BlockIDFlag block_id_flag = 1; - * @param value The blockIdFlag to set. - */ - private void setBlockIdFlag(ibc.tendermint.light.TendermintLight.BlockIDFlag value) { - blockIdFlag_ = value.getNumber(); - - } - /** - * .ibc.tendermint.light.BlockIDFlag block_id_flag = 1; - */ - private void clearBlockIdFlag() { - - blockIdFlag_ = 0; - } - - public static final int VALIDATOR_ADDRESS_FIELD_NUMBER = 2; - private com.google.protobuf.ByteString validatorAddress_; - /** - * bytes validator_address = 2; - * @return The validatorAddress. - */ - @java.lang.Override - public com.google.protobuf.ByteString getValidatorAddress() { - return validatorAddress_; - } - /** - * bytes validator_address = 2; - * @param value The validatorAddress to set. - */ - private void setValidatorAddress(com.google.protobuf.ByteString value) { - java.lang.Class valueClass = value.getClass(); - - validatorAddress_ = value; - } - /** - * bytes validator_address = 2; - */ - private void clearValidatorAddress() { - - validatorAddress_ = getDefaultInstance().getValidatorAddress(); - } - - public static final int TIMESTAMP_FIELD_NUMBER = 3; - private ibc.tendermint.light.TendermintLight.Timestamp timestamp_; - /** - * .ibc.tendermint.light.Timestamp timestamp = 3; - */ - @java.lang.Override - public boolean hasTimestamp() { - return timestamp_ != null; - } - /** - * .ibc.tendermint.light.Timestamp timestamp = 3; - */ - @java.lang.Override - public ibc.tendermint.light.TendermintLight.Timestamp getTimestamp() { - return timestamp_ == null ? ibc.tendermint.light.TendermintLight.Timestamp.getDefaultInstance() : timestamp_; - } - /** - * .ibc.tendermint.light.Timestamp timestamp = 3; - */ - private void setTimestamp(ibc.tendermint.light.TendermintLight.Timestamp value) { - value.getClass(); - timestamp_ = value; - - } - /** - * .ibc.tendermint.light.Timestamp timestamp = 3; - */ - @java.lang.SuppressWarnings({"ReferenceEquality"}) - private void mergeTimestamp(ibc.tendermint.light.TendermintLight.Timestamp value) { - value.getClass(); - if (timestamp_ != null && - timestamp_ != ibc.tendermint.light.TendermintLight.Timestamp.getDefaultInstance()) { - timestamp_ = - ibc.tendermint.light.TendermintLight.Timestamp.newBuilder(timestamp_).mergeFrom(value).buildPartial(); - } else { - timestamp_ = value; - } - - } - /** - * .ibc.tendermint.light.Timestamp timestamp = 3; - */ - private void clearTimestamp() { timestamp_ = null; - - } - - public static final int SIGNATURE_FIELD_NUMBER = 4; - private com.google.protobuf.ByteString signature_; - /** - * bytes signature = 4; - * @return The signature. - */ - @java.lang.Override - public com.google.protobuf.ByteString getSignature() { - return signature_; - } - /** - * bytes signature = 4; - * @param value The signature to set. - */ - private void setSignature(com.google.protobuf.ByteString value) { - java.lang.Class valueClass = value.getClass(); - - signature_ = value; - } - /** - * bytes signature = 4; - */ - private void clearSignature() { - - signature_ = getDefaultInstance().getSignature(); - } - - public static ibc.tendermint.light.TendermintLight.CommitSig parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static ibc.tendermint.light.TendermintLight.CommitSig parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.CommitSig parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static ibc.tendermint.light.TendermintLight.CommitSig parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.CommitSig parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static ibc.tendermint.light.TendermintLight.CommitSig parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.CommitSig parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static ibc.tendermint.light.TendermintLight.CommitSig parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.CommitSig parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - public static ibc.tendermint.light.TendermintLight.CommitSig parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.CommitSig parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static ibc.tendermint.light.TendermintLight.CommitSig parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(ibc.tendermint.light.TendermintLight.CommitSig prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - *
-     * CommitSig is a part of the Vote included in a Commit.
-     * 
- * - * Protobuf type {@code ibc.tendermint.light.CommitSig} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - ibc.tendermint.light.TendermintLight.CommitSig, Builder> implements - // @@protoc_insertion_point(builder_implements:ibc.tendermint.light.CommitSig) - ibc.tendermint.light.TendermintLight.CommitSigOrBuilder { - // Construct using ibc.tendermint.light.TendermintLight.CommitSig.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - /** - * .ibc.tendermint.light.BlockIDFlag block_id_flag = 1; - * @return The enum numeric value on the wire for blockIdFlag. - */ - @java.lang.Override - public int getBlockIdFlagValue() { - return instance.getBlockIdFlagValue(); - } - /** - * .ibc.tendermint.light.BlockIDFlag block_id_flag = 1; - * @param value The blockIdFlag to set. - * @return This builder for chaining. - */ - public Builder setBlockIdFlagValue(int value) { - copyOnWrite(); - instance.setBlockIdFlagValue(value); - return this; - } - /** - * .ibc.tendermint.light.BlockIDFlag block_id_flag = 1; - * @return The blockIdFlag. - */ - @java.lang.Override - public ibc.tendermint.light.TendermintLight.BlockIDFlag getBlockIdFlag() { - return instance.getBlockIdFlag(); - } - /** - * .ibc.tendermint.light.BlockIDFlag block_id_flag = 1; - * @param value The enum numeric value on the wire for blockIdFlag to set. - * @return This builder for chaining. - */ - public Builder setBlockIdFlag(ibc.tendermint.light.TendermintLight.BlockIDFlag value) { - copyOnWrite(); - instance.setBlockIdFlag(value); - return this; - } - /** - * .ibc.tendermint.light.BlockIDFlag block_id_flag = 1; - * @return This builder for chaining. - */ - public Builder clearBlockIdFlag() { - copyOnWrite(); - instance.clearBlockIdFlag(); - return this; - } - - /** - * bytes validator_address = 2; - * @return The validatorAddress. - */ - @java.lang.Override - public com.google.protobuf.ByteString getValidatorAddress() { - return instance.getValidatorAddress(); - } - /** - * bytes validator_address = 2; - * @param value The validatorAddress to set. - * @return This builder for chaining. - */ - public Builder setValidatorAddress(com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setValidatorAddress(value); - return this; - } - /** - * bytes validator_address = 2; - * @return This builder for chaining. - */ - public Builder clearValidatorAddress() { - copyOnWrite(); - instance.clearValidatorAddress(); - return this; - } - - /** - * .ibc.tendermint.light.Timestamp timestamp = 3; - */ - @java.lang.Override - public boolean hasTimestamp() { - return instance.hasTimestamp(); - } - /** - * .ibc.tendermint.light.Timestamp timestamp = 3; - */ - @java.lang.Override - public ibc.tendermint.light.TendermintLight.Timestamp getTimestamp() { - return instance.getTimestamp(); - } - /** - * .ibc.tendermint.light.Timestamp timestamp = 3; - */ - public Builder setTimestamp(ibc.tendermint.light.TendermintLight.Timestamp value) { - copyOnWrite(); - instance.setTimestamp(value); - return this; - } - /** - * .ibc.tendermint.light.Timestamp timestamp = 3; - */ - public Builder setTimestamp( - ibc.tendermint.light.TendermintLight.Timestamp.Builder builderForValue) { - copyOnWrite(); - instance.setTimestamp(builderForValue.build()); - return this; - } - /** - * .ibc.tendermint.light.Timestamp timestamp = 3; - */ - public Builder mergeTimestamp(ibc.tendermint.light.TendermintLight.Timestamp value) { - copyOnWrite(); - instance.mergeTimestamp(value); - return this; - } - /** - * .ibc.tendermint.light.Timestamp timestamp = 3; - */ - public Builder clearTimestamp() { copyOnWrite(); - instance.clearTimestamp(); - return this; - } - - /** - * bytes signature = 4; - * @return The signature. - */ - @java.lang.Override - public com.google.protobuf.ByteString getSignature() { - return instance.getSignature(); - } - /** - * bytes signature = 4; - * @param value The signature to set. - * @return This builder for chaining. - */ - public Builder setSignature(com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setSignature(value); - return this; - } - /** - * bytes signature = 4; - * @return This builder for chaining. - */ - public Builder clearSignature() { - copyOnWrite(); - instance.clearSignature(); - return this; - } - - // @@protoc_insertion_point(builder_scope:ibc.tendermint.light.CommitSig) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new ibc.tendermint.light.TendermintLight.CommitSig(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[] { - "blockIdFlag_", - "validatorAddress_", - "timestamp_", - "signature_", - }; - java.lang.String info = - "\u0000\u0004\u0000\u0000\u0001\u0004\u0004\u0000\u0000\u0000\u0001\f\u0002\n\u0003" + - "\t\u0004\n"; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (ibc.tendermint.light.TendermintLight.CommitSig.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:ibc.tendermint.light.CommitSig) - private static final ibc.tendermint.light.TendermintLight.CommitSig DEFAULT_INSTANCE; - static { - CommitSig defaultInstance = new CommitSig(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - CommitSig.class, defaultInstance); - } - - public static ibc.tendermint.light.TendermintLight.CommitSig getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface TimestampOrBuilder extends - // @@protoc_insertion_point(interface_extends:ibc.tendermint.light.Timestamp) - com.google.protobuf.MessageLiteOrBuilder { - - /** - *
-     * Represents seconds of UTC time since Unix epoch
-     * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
-     * 9999-12-31T23:59:59Z inclusive.
-     * 
- * - * int64 seconds = 1; - * @return The seconds. - */ - long getSeconds(); - - /** - *
-     * Non-negative fractions of a second at nanosecond resolution. Negative
-     * second values with fractions must still have non-negative nanos values
-     * that count forward in time. Must be from 0 to 999,999,999
-     * inclusive.
-     * 
- * - * int32 nanos = 2; - * @return The nanos. - */ - int getNanos(); - } - /** - * Protobuf type {@code ibc.tendermint.light.Timestamp} - */ - public static final class Timestamp extends - com.google.protobuf.GeneratedMessageLite< - Timestamp, Timestamp.Builder> implements - // @@protoc_insertion_point(message_implements:ibc.tendermint.light.Timestamp) - TimestampOrBuilder { - private Timestamp() { - } - public static final int SECONDS_FIELD_NUMBER = 1; - private long seconds_; - /** - *
-     * Represents seconds of UTC time since Unix epoch
-     * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
-     * 9999-12-31T23:59:59Z inclusive.
-     * 
- * - * int64 seconds = 1; - * @return The seconds. - */ - @java.lang.Override - public long getSeconds() { - return seconds_; - } - /** - *
-     * Represents seconds of UTC time since Unix epoch
-     * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
-     * 9999-12-31T23:59:59Z inclusive.
-     * 
- * - * int64 seconds = 1; - * @param value The seconds to set. - */ - private void setSeconds(long value) { - - seconds_ = value; - } - /** - *
-     * Represents seconds of UTC time since Unix epoch
-     * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
-     * 9999-12-31T23:59:59Z inclusive.
-     * 
- * - * int64 seconds = 1; - */ - private void clearSeconds() { - - seconds_ = 0L; - } - - public static final int NANOS_FIELD_NUMBER = 2; - private int nanos_; - /** - *
-     * Non-negative fractions of a second at nanosecond resolution. Negative
-     * second values with fractions must still have non-negative nanos values
-     * that count forward in time. Must be from 0 to 999,999,999
-     * inclusive.
-     * 
- * - * int32 nanos = 2; - * @return The nanos. - */ - @java.lang.Override - public int getNanos() { - return nanos_; - } - /** - *
-     * Non-negative fractions of a second at nanosecond resolution. Negative
-     * second values with fractions must still have non-negative nanos values
-     * that count forward in time. Must be from 0 to 999,999,999
-     * inclusive.
-     * 
- * - * int32 nanos = 2; - * @param value The nanos to set. - */ - private void setNanos(int value) { - - nanos_ = value; - } - /** - *
-     * Non-negative fractions of a second at nanosecond resolution. Negative
-     * second values with fractions must still have non-negative nanos values
-     * that count forward in time. Must be from 0 to 999,999,999
-     * inclusive.
-     * 
- * - * int32 nanos = 2; - */ - private void clearNanos() { - - nanos_ = 0; - } - - public static ibc.tendermint.light.TendermintLight.Timestamp parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static ibc.tendermint.light.TendermintLight.Timestamp parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.Timestamp parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static ibc.tendermint.light.TendermintLight.Timestamp parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.Timestamp parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static ibc.tendermint.light.TendermintLight.Timestamp parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.Timestamp parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static ibc.tendermint.light.TendermintLight.Timestamp parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.Timestamp parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - public static ibc.tendermint.light.TendermintLight.Timestamp parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.Timestamp parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static ibc.tendermint.light.TendermintLight.Timestamp parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(ibc.tendermint.light.TendermintLight.Timestamp prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - * Protobuf type {@code ibc.tendermint.light.Timestamp} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - ibc.tendermint.light.TendermintLight.Timestamp, Builder> implements - // @@protoc_insertion_point(builder_implements:ibc.tendermint.light.Timestamp) - ibc.tendermint.light.TendermintLight.TimestampOrBuilder { - // Construct using ibc.tendermint.light.TendermintLight.Timestamp.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - /** - *
-       * Represents seconds of UTC time since Unix epoch
-       * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
-       * 9999-12-31T23:59:59Z inclusive.
-       * 
- * - * int64 seconds = 1; - * @return The seconds. - */ - @java.lang.Override - public long getSeconds() { - return instance.getSeconds(); - } - /** - *
-       * Represents seconds of UTC time since Unix epoch
-       * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
-       * 9999-12-31T23:59:59Z inclusive.
-       * 
- * - * int64 seconds = 1; - * @param value The seconds to set. - * @return This builder for chaining. - */ - public Builder setSeconds(long value) { - copyOnWrite(); - instance.setSeconds(value); - return this; - } - /** - *
-       * Represents seconds of UTC time since Unix epoch
-       * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
-       * 9999-12-31T23:59:59Z inclusive.
-       * 
- * - * int64 seconds = 1; - * @return This builder for chaining. - */ - public Builder clearSeconds() { - copyOnWrite(); - instance.clearSeconds(); - return this; - } - - /** - *
-       * Non-negative fractions of a second at nanosecond resolution. Negative
-       * second values with fractions must still have non-negative nanos values
-       * that count forward in time. Must be from 0 to 999,999,999
-       * inclusive.
-       * 
- * - * int32 nanos = 2; - * @return The nanos. - */ - @java.lang.Override - public int getNanos() { - return instance.getNanos(); - } - /** - *
-       * Non-negative fractions of a second at nanosecond resolution. Negative
-       * second values with fractions must still have non-negative nanos values
-       * that count forward in time. Must be from 0 to 999,999,999
-       * inclusive.
-       * 
- * - * int32 nanos = 2; - * @param value The nanos to set. - * @return This builder for chaining. - */ - public Builder setNanos(int value) { - copyOnWrite(); - instance.setNanos(value); - return this; - } - /** - *
-       * Non-negative fractions of a second at nanosecond resolution. Negative
-       * second values with fractions must still have non-negative nanos values
-       * that count forward in time. Must be from 0 to 999,999,999
-       * inclusive.
-       * 
- * - * int32 nanos = 2; - * @return This builder for chaining. - */ - public Builder clearNanos() { - copyOnWrite(); - instance.clearNanos(); - return this; - } - - // @@protoc_insertion_point(builder_scope:ibc.tendermint.light.Timestamp) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new ibc.tendermint.light.TendermintLight.Timestamp(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[] { - "seconds_", - "nanos_", - }; - java.lang.String info = - "\u0000\u0002\u0000\u0000\u0001\u0002\u0002\u0000\u0000\u0000\u0001\u0002\u0002\u0004" + - ""; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (ibc.tendermint.light.TendermintLight.Timestamp.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:ibc.tendermint.light.Timestamp) - private static final ibc.tendermint.light.TendermintLight.Timestamp DEFAULT_INSTANCE; - static { - Timestamp defaultInstance = new Timestamp(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - Timestamp.class, defaultInstance); - } - - public static ibc.tendermint.light.TendermintLight.Timestamp getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface LightHeaderOrBuilder extends - // @@protoc_insertion_point(interface_extends:ibc.tendermint.light.LightHeader) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * .ibc.tendermint.light.Consensus version = 1; - * @return Whether the version field is set. - */ - boolean hasVersion(); - /** - * .ibc.tendermint.light.Consensus version = 1; - * @return The version. - */ - ibc.tendermint.light.TendermintLight.Consensus getVersion(); - - /** - * string chain_id = 2; - * @return The chainId. - */ - java.lang.String getChainId(); - /** - * string chain_id = 2; - * @return The bytes for chainId. - */ - com.google.protobuf.ByteString - getChainIdBytes(); - - /** - * int64 height = 3; - * @return The height. - */ - long getHeight(); - - /** - * .ibc.tendermint.light.Timestamp time = 4; - * @return Whether the time field is set. - */ - boolean hasTime(); - /** - * .ibc.tendermint.light.Timestamp time = 4; - * @return The time. - */ - ibc.tendermint.light.TendermintLight.Timestamp getTime(); - - /** - * .ibc.tendermint.light.BlockID last_block_id = 5; - * @return Whether the lastBlockId field is set. - */ - boolean hasLastBlockId(); - /** - * .ibc.tendermint.light.BlockID last_block_id = 5; - * @return The lastBlockId. - */ - ibc.tendermint.light.TendermintLight.BlockID getLastBlockId(); - - /** - *
-     * commit from validators from the last block
-     * 
- * - * bytes last_commit_hash = 6; - * @return The lastCommitHash. - */ - com.google.protobuf.ByteString getLastCommitHash(); - - /** - *
-     * transactions
-     * 
- * - * bytes data_hash = 7; - * @return The dataHash. - */ - com.google.protobuf.ByteString getDataHash(); - - /** - *
-     * validators for the current block
-     * 
- * - * bytes validators_hash = 8; - * @return The validatorsHash. - */ - com.google.protobuf.ByteString getValidatorsHash(); - - /** - *
-     * validators for the next block
-     * 
- * - * bytes next_validators_hash = 9; - * @return The nextValidatorsHash. - */ - com.google.protobuf.ByteString getNextValidatorsHash(); - - /** - *
-     * consensus params for current block
-     * 
- * - * bytes consensus_hash = 10; - * @return The consensusHash. - */ - com.google.protobuf.ByteString getConsensusHash(); - - /** - *
-     * state after txs from the previous block
-     * 
- * - * bytes app_hash = 11; - * @return The appHash. - */ - com.google.protobuf.ByteString getAppHash(); - - /** - *
-     * root hash of all results from the txs from the previous block
-     * 
- * - * bytes last_results_hash = 12; - * @return The lastResultsHash. - */ - com.google.protobuf.ByteString getLastResultsHash(); - - /** - *
-     * evidence included in the block
-     * 
- * - * bytes evidence_hash = 13; - * @return The evidenceHash. - */ - com.google.protobuf.ByteString getEvidenceHash(); - - /** - *
-     * original proposer of the block
-     * 
- * - * bytes proposer_address = 14; - * @return The proposerAddress. - */ - com.google.protobuf.ByteString getProposerAddress(); - } - /** - * Protobuf type {@code ibc.tendermint.light.LightHeader} - */ - public static final class LightHeader extends - com.google.protobuf.GeneratedMessageLite< - LightHeader, LightHeader.Builder> implements - // @@protoc_insertion_point(message_implements:ibc.tendermint.light.LightHeader) - LightHeaderOrBuilder { - private LightHeader() { - chainId_ = ""; - lastCommitHash_ = com.google.protobuf.ByteString.EMPTY; - dataHash_ = com.google.protobuf.ByteString.EMPTY; - validatorsHash_ = com.google.protobuf.ByteString.EMPTY; - nextValidatorsHash_ = com.google.protobuf.ByteString.EMPTY; - consensusHash_ = com.google.protobuf.ByteString.EMPTY; - appHash_ = com.google.protobuf.ByteString.EMPTY; - lastResultsHash_ = com.google.protobuf.ByteString.EMPTY; - evidenceHash_ = com.google.protobuf.ByteString.EMPTY; - proposerAddress_ = com.google.protobuf.ByteString.EMPTY; - } - public static final int VERSION_FIELD_NUMBER = 1; - private ibc.tendermint.light.TendermintLight.Consensus version_; - /** - * .ibc.tendermint.light.Consensus version = 1; - */ - @java.lang.Override - public boolean hasVersion() { - return version_ != null; - } - /** - * .ibc.tendermint.light.Consensus version = 1; - */ - @java.lang.Override - public ibc.tendermint.light.TendermintLight.Consensus getVersion() { - return version_ == null ? ibc.tendermint.light.TendermintLight.Consensus.getDefaultInstance() : version_; - } - /** - * .ibc.tendermint.light.Consensus version = 1; - */ - private void setVersion(ibc.tendermint.light.TendermintLight.Consensus value) { - value.getClass(); - version_ = value; - - } - /** - * .ibc.tendermint.light.Consensus version = 1; - */ - @java.lang.SuppressWarnings({"ReferenceEquality"}) - private void mergeVersion(ibc.tendermint.light.TendermintLight.Consensus value) { - value.getClass(); - if (version_ != null && - version_ != ibc.tendermint.light.TendermintLight.Consensus.getDefaultInstance()) { - version_ = - ibc.tendermint.light.TendermintLight.Consensus.newBuilder(version_).mergeFrom(value).buildPartial(); - } else { - version_ = value; - } - - } - /** - * .ibc.tendermint.light.Consensus version = 1; - */ - private void clearVersion() { version_ = null; - - } - - public static final int CHAIN_ID_FIELD_NUMBER = 2; - private java.lang.String chainId_; - /** - * string chain_id = 2; - * @return The chainId. - */ - @java.lang.Override - public java.lang.String getChainId() { - return chainId_; - } - /** - * string chain_id = 2; - * @return The bytes for chainId. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getChainIdBytes() { - return com.google.protobuf.ByteString.copyFromUtf8(chainId_); - } - /** - * string chain_id = 2; - * @param value The chainId to set. - */ - private void setChainId( - java.lang.String value) { - java.lang.Class valueClass = value.getClass(); - - chainId_ = value; - } - /** - * string chain_id = 2; - */ - private void clearChainId() { - - chainId_ = getDefaultInstance().getChainId(); - } - /** - * string chain_id = 2; - * @param value The bytes for chainId to set. - */ - private void setChainIdBytes( - com.google.protobuf.ByteString value) { - checkByteStringIsUtf8(value); - chainId_ = value.toStringUtf8(); - - } - - public static final int HEIGHT_FIELD_NUMBER = 3; - private long height_; - /** - * int64 height = 3; - * @return The height. - */ - @java.lang.Override - public long getHeight() { - return height_; - } - /** - * int64 height = 3; - * @param value The height to set. - */ - private void setHeight(long value) { - - height_ = value; - } - /** - * int64 height = 3; - */ - private void clearHeight() { - - height_ = 0L; - } - - public static final int TIME_FIELD_NUMBER = 4; - private ibc.tendermint.light.TendermintLight.Timestamp time_; - /** - * .ibc.tendermint.light.Timestamp time = 4; - */ - @java.lang.Override - public boolean hasTime() { - return time_ != null; - } - /** - * .ibc.tendermint.light.Timestamp time = 4; - */ - @java.lang.Override - public ibc.tendermint.light.TendermintLight.Timestamp getTime() { - return time_ == null ? ibc.tendermint.light.TendermintLight.Timestamp.getDefaultInstance() : time_; - } - /** - * .ibc.tendermint.light.Timestamp time = 4; - */ - private void setTime(ibc.tendermint.light.TendermintLight.Timestamp value) { - value.getClass(); - time_ = value; - - } - /** - * .ibc.tendermint.light.Timestamp time = 4; - */ - @java.lang.SuppressWarnings({"ReferenceEquality"}) - private void mergeTime(ibc.tendermint.light.TendermintLight.Timestamp value) { - value.getClass(); - if (time_ != null && - time_ != ibc.tendermint.light.TendermintLight.Timestamp.getDefaultInstance()) { - time_ = - ibc.tendermint.light.TendermintLight.Timestamp.newBuilder(time_).mergeFrom(value).buildPartial(); - } else { - time_ = value; - } - - } - /** - * .ibc.tendermint.light.Timestamp time = 4; - */ - private void clearTime() { time_ = null; - - } - - public static final int LAST_BLOCK_ID_FIELD_NUMBER = 5; - private ibc.tendermint.light.TendermintLight.BlockID lastBlockId_; - /** - * .ibc.tendermint.light.BlockID last_block_id = 5; - */ - @java.lang.Override - public boolean hasLastBlockId() { - return lastBlockId_ != null; - } - /** - * .ibc.tendermint.light.BlockID last_block_id = 5; - */ - @java.lang.Override - public ibc.tendermint.light.TendermintLight.BlockID getLastBlockId() { - return lastBlockId_ == null ? ibc.tendermint.light.TendermintLight.BlockID.getDefaultInstance() : lastBlockId_; - } - /** - * .ibc.tendermint.light.BlockID last_block_id = 5; - */ - private void setLastBlockId(ibc.tendermint.light.TendermintLight.BlockID value) { - value.getClass(); - lastBlockId_ = value; - - } - /** - * .ibc.tendermint.light.BlockID last_block_id = 5; - */ - @java.lang.SuppressWarnings({"ReferenceEquality"}) - private void mergeLastBlockId(ibc.tendermint.light.TendermintLight.BlockID value) { - value.getClass(); - if (lastBlockId_ != null && - lastBlockId_ != ibc.tendermint.light.TendermintLight.BlockID.getDefaultInstance()) { - lastBlockId_ = - ibc.tendermint.light.TendermintLight.BlockID.newBuilder(lastBlockId_).mergeFrom(value).buildPartial(); - } else { - lastBlockId_ = value; - } - - } - /** - * .ibc.tendermint.light.BlockID last_block_id = 5; - */ - private void clearLastBlockId() { lastBlockId_ = null; - - } - - public static final int LAST_COMMIT_HASH_FIELD_NUMBER = 6; - private com.google.protobuf.ByteString lastCommitHash_; - /** - *
-     * commit from validators from the last block
-     * 
- * - * bytes last_commit_hash = 6; - * @return The lastCommitHash. - */ - @java.lang.Override - public com.google.protobuf.ByteString getLastCommitHash() { - return lastCommitHash_; - } - /** - *
-     * commit from validators from the last block
-     * 
- * - * bytes last_commit_hash = 6; - * @param value The lastCommitHash to set. - */ - private void setLastCommitHash(com.google.protobuf.ByteString value) { - java.lang.Class valueClass = value.getClass(); - - lastCommitHash_ = value; - } - /** - *
-     * commit from validators from the last block
-     * 
- * - * bytes last_commit_hash = 6; - */ - private void clearLastCommitHash() { - - lastCommitHash_ = getDefaultInstance().getLastCommitHash(); - } - - public static final int DATA_HASH_FIELD_NUMBER = 7; - private com.google.protobuf.ByteString dataHash_; - /** - *
-     * transactions
-     * 
- * - * bytes data_hash = 7; - * @return The dataHash. - */ - @java.lang.Override - public com.google.protobuf.ByteString getDataHash() { - return dataHash_; - } - /** - *
-     * transactions
-     * 
- * - * bytes data_hash = 7; - * @param value The dataHash to set. - */ - private void setDataHash(com.google.protobuf.ByteString value) { - java.lang.Class valueClass = value.getClass(); - - dataHash_ = value; - } - /** - *
-     * transactions
-     * 
- * - * bytes data_hash = 7; - */ - private void clearDataHash() { - - dataHash_ = getDefaultInstance().getDataHash(); - } - - public static final int VALIDATORS_HASH_FIELD_NUMBER = 8; - private com.google.protobuf.ByteString validatorsHash_; - /** - *
-     * validators for the current block
-     * 
- * - * bytes validators_hash = 8; - * @return The validatorsHash. - */ - @java.lang.Override - public com.google.protobuf.ByteString getValidatorsHash() { - return validatorsHash_; - } - /** - *
-     * validators for the current block
-     * 
- * - * bytes validators_hash = 8; - * @param value The validatorsHash to set. - */ - private void setValidatorsHash(com.google.protobuf.ByteString value) { - java.lang.Class valueClass = value.getClass(); - - validatorsHash_ = value; - } - /** - *
-     * validators for the current block
-     * 
- * - * bytes validators_hash = 8; - */ - private void clearValidatorsHash() { - - validatorsHash_ = getDefaultInstance().getValidatorsHash(); - } - - public static final int NEXT_VALIDATORS_HASH_FIELD_NUMBER = 9; - private com.google.protobuf.ByteString nextValidatorsHash_; - /** - *
-     * validators for the next block
-     * 
- * - * bytes next_validators_hash = 9; - * @return The nextValidatorsHash. - */ - @java.lang.Override - public com.google.protobuf.ByteString getNextValidatorsHash() { - return nextValidatorsHash_; - } - /** - *
-     * validators for the next block
-     * 
- * - * bytes next_validators_hash = 9; - * @param value The nextValidatorsHash to set. - */ - private void setNextValidatorsHash(com.google.protobuf.ByteString value) { - java.lang.Class valueClass = value.getClass(); - - nextValidatorsHash_ = value; - } - /** - *
-     * validators for the next block
-     * 
- * - * bytes next_validators_hash = 9; - */ - private void clearNextValidatorsHash() { - - nextValidatorsHash_ = getDefaultInstance().getNextValidatorsHash(); - } - - public static final int CONSENSUS_HASH_FIELD_NUMBER = 10; - private com.google.protobuf.ByteString consensusHash_; - /** - *
-     * consensus params for current block
-     * 
- * - * bytes consensus_hash = 10; - * @return The consensusHash. - */ - @java.lang.Override - public com.google.protobuf.ByteString getConsensusHash() { - return consensusHash_; - } - /** - *
-     * consensus params for current block
-     * 
- * - * bytes consensus_hash = 10; - * @param value The consensusHash to set. - */ - private void setConsensusHash(com.google.protobuf.ByteString value) { - java.lang.Class valueClass = value.getClass(); - - consensusHash_ = value; - } - /** - *
-     * consensus params for current block
-     * 
- * - * bytes consensus_hash = 10; - */ - private void clearConsensusHash() { - - consensusHash_ = getDefaultInstance().getConsensusHash(); - } - - public static final int APP_HASH_FIELD_NUMBER = 11; - private com.google.protobuf.ByteString appHash_; - /** - *
-     * state after txs from the previous block
-     * 
- * - * bytes app_hash = 11; - * @return The appHash. - */ - @java.lang.Override - public com.google.protobuf.ByteString getAppHash() { - return appHash_; - } - /** - *
-     * state after txs from the previous block
-     * 
- * - * bytes app_hash = 11; - * @param value The appHash to set. - */ - private void setAppHash(com.google.protobuf.ByteString value) { - java.lang.Class valueClass = value.getClass(); - - appHash_ = value; - } - /** - *
-     * state after txs from the previous block
-     * 
- * - * bytes app_hash = 11; - */ - private void clearAppHash() { - - appHash_ = getDefaultInstance().getAppHash(); - } - - public static final int LAST_RESULTS_HASH_FIELD_NUMBER = 12; - private com.google.protobuf.ByteString lastResultsHash_; - /** - *
-     * root hash of all results from the txs from the previous block
-     * 
- * - * bytes last_results_hash = 12; - * @return The lastResultsHash. - */ - @java.lang.Override - public com.google.protobuf.ByteString getLastResultsHash() { - return lastResultsHash_; - } - /** - *
-     * root hash of all results from the txs from the previous block
-     * 
- * - * bytes last_results_hash = 12; - * @param value The lastResultsHash to set. - */ - private void setLastResultsHash(com.google.protobuf.ByteString value) { - java.lang.Class valueClass = value.getClass(); - - lastResultsHash_ = value; - } - /** - *
-     * root hash of all results from the txs from the previous block
-     * 
- * - * bytes last_results_hash = 12; - */ - private void clearLastResultsHash() { - - lastResultsHash_ = getDefaultInstance().getLastResultsHash(); - } - - public static final int EVIDENCE_HASH_FIELD_NUMBER = 13; - private com.google.protobuf.ByteString evidenceHash_; - /** - *
-     * evidence included in the block
-     * 
- * - * bytes evidence_hash = 13; - * @return The evidenceHash. - */ - @java.lang.Override - public com.google.protobuf.ByteString getEvidenceHash() { - return evidenceHash_; - } - /** - *
-     * evidence included in the block
-     * 
- * - * bytes evidence_hash = 13; - * @param value The evidenceHash to set. - */ - private void setEvidenceHash(com.google.protobuf.ByteString value) { - java.lang.Class valueClass = value.getClass(); - - evidenceHash_ = value; - } - /** - *
-     * evidence included in the block
-     * 
- * - * bytes evidence_hash = 13; - */ - private void clearEvidenceHash() { - - evidenceHash_ = getDefaultInstance().getEvidenceHash(); - } - - public static final int PROPOSER_ADDRESS_FIELD_NUMBER = 14; - private com.google.protobuf.ByteString proposerAddress_; - /** - *
-     * original proposer of the block
-     * 
- * - * bytes proposer_address = 14; - * @return The proposerAddress. - */ - @java.lang.Override - public com.google.protobuf.ByteString getProposerAddress() { - return proposerAddress_; - } - /** - *
-     * original proposer of the block
-     * 
- * - * bytes proposer_address = 14; - * @param value The proposerAddress to set. - */ - private void setProposerAddress(com.google.protobuf.ByteString value) { - java.lang.Class valueClass = value.getClass(); - - proposerAddress_ = value; - } - /** - *
-     * original proposer of the block
-     * 
- * - * bytes proposer_address = 14; - */ - private void clearProposerAddress() { - - proposerAddress_ = getDefaultInstance().getProposerAddress(); - } - - public static ibc.tendermint.light.TendermintLight.LightHeader parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static ibc.tendermint.light.TendermintLight.LightHeader parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.LightHeader parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static ibc.tendermint.light.TendermintLight.LightHeader parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.LightHeader parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static ibc.tendermint.light.TendermintLight.LightHeader parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.LightHeader parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static ibc.tendermint.light.TendermintLight.LightHeader parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.LightHeader parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - public static ibc.tendermint.light.TendermintLight.LightHeader parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.LightHeader parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static ibc.tendermint.light.TendermintLight.LightHeader parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(ibc.tendermint.light.TendermintLight.LightHeader prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - * Protobuf type {@code ibc.tendermint.light.LightHeader} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - ibc.tendermint.light.TendermintLight.LightHeader, Builder> implements - // @@protoc_insertion_point(builder_implements:ibc.tendermint.light.LightHeader) - ibc.tendermint.light.TendermintLight.LightHeaderOrBuilder { - // Construct using ibc.tendermint.light.TendermintLight.LightHeader.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - /** - * .ibc.tendermint.light.Consensus version = 1; - */ - @java.lang.Override - public boolean hasVersion() { - return instance.hasVersion(); - } - /** - * .ibc.tendermint.light.Consensus version = 1; - */ - @java.lang.Override - public ibc.tendermint.light.TendermintLight.Consensus getVersion() { - return instance.getVersion(); - } - /** - * .ibc.tendermint.light.Consensus version = 1; - */ - public Builder setVersion(ibc.tendermint.light.TendermintLight.Consensus value) { - copyOnWrite(); - instance.setVersion(value); - return this; - } - /** - * .ibc.tendermint.light.Consensus version = 1; - */ - public Builder setVersion( - ibc.tendermint.light.TendermintLight.Consensus.Builder builderForValue) { - copyOnWrite(); - instance.setVersion(builderForValue.build()); - return this; - } - /** - * .ibc.tendermint.light.Consensus version = 1; - */ - public Builder mergeVersion(ibc.tendermint.light.TendermintLight.Consensus value) { - copyOnWrite(); - instance.mergeVersion(value); - return this; - } - /** - * .ibc.tendermint.light.Consensus version = 1; - */ - public Builder clearVersion() { copyOnWrite(); - instance.clearVersion(); - return this; - } - - /** - * string chain_id = 2; - * @return The chainId. - */ - @java.lang.Override - public java.lang.String getChainId() { - return instance.getChainId(); - } - /** - * string chain_id = 2; - * @return The bytes for chainId. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getChainIdBytes() { - return instance.getChainIdBytes(); - } - /** - * string chain_id = 2; - * @param value The chainId to set. - * @return This builder for chaining. - */ - public Builder setChainId( - java.lang.String value) { - copyOnWrite(); - instance.setChainId(value); - return this; - } - /** - * string chain_id = 2; - * @return This builder for chaining. - */ - public Builder clearChainId() { - copyOnWrite(); - instance.clearChainId(); - return this; - } - /** - * string chain_id = 2; - * @param value The bytes for chainId to set. - * @return This builder for chaining. - */ - public Builder setChainIdBytes( - com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setChainIdBytes(value); - return this; - } - - /** - * int64 height = 3; - * @return The height. - */ - @java.lang.Override - public long getHeight() { - return instance.getHeight(); - } - /** - * int64 height = 3; - * @param value The height to set. - * @return This builder for chaining. - */ - public Builder setHeight(long value) { - copyOnWrite(); - instance.setHeight(value); - return this; - } - /** - * int64 height = 3; - * @return This builder for chaining. - */ - public Builder clearHeight() { - copyOnWrite(); - instance.clearHeight(); - return this; - } - - /** - * .ibc.tendermint.light.Timestamp time = 4; - */ - @java.lang.Override - public boolean hasTime() { - return instance.hasTime(); - } - /** - * .ibc.tendermint.light.Timestamp time = 4; - */ - @java.lang.Override - public ibc.tendermint.light.TendermintLight.Timestamp getTime() { - return instance.getTime(); - } - /** - * .ibc.tendermint.light.Timestamp time = 4; - */ - public Builder setTime(ibc.tendermint.light.TendermintLight.Timestamp value) { - copyOnWrite(); - instance.setTime(value); - return this; - } - /** - * .ibc.tendermint.light.Timestamp time = 4; - */ - public Builder setTime( - ibc.tendermint.light.TendermintLight.Timestamp.Builder builderForValue) { - copyOnWrite(); - instance.setTime(builderForValue.build()); - return this; - } - /** - * .ibc.tendermint.light.Timestamp time = 4; - */ - public Builder mergeTime(ibc.tendermint.light.TendermintLight.Timestamp value) { - copyOnWrite(); - instance.mergeTime(value); - return this; - } - /** - * .ibc.tendermint.light.Timestamp time = 4; - */ - public Builder clearTime() { copyOnWrite(); - instance.clearTime(); - return this; - } - - /** - * .ibc.tendermint.light.BlockID last_block_id = 5; - */ - @java.lang.Override - public boolean hasLastBlockId() { - return instance.hasLastBlockId(); - } - /** - * .ibc.tendermint.light.BlockID last_block_id = 5; - */ - @java.lang.Override - public ibc.tendermint.light.TendermintLight.BlockID getLastBlockId() { - return instance.getLastBlockId(); - } - /** - * .ibc.tendermint.light.BlockID last_block_id = 5; - */ - public Builder setLastBlockId(ibc.tendermint.light.TendermintLight.BlockID value) { - copyOnWrite(); - instance.setLastBlockId(value); - return this; - } - /** - * .ibc.tendermint.light.BlockID last_block_id = 5; - */ - public Builder setLastBlockId( - ibc.tendermint.light.TendermintLight.BlockID.Builder builderForValue) { - copyOnWrite(); - instance.setLastBlockId(builderForValue.build()); - return this; - } - /** - * .ibc.tendermint.light.BlockID last_block_id = 5; - */ - public Builder mergeLastBlockId(ibc.tendermint.light.TendermintLight.BlockID value) { - copyOnWrite(); - instance.mergeLastBlockId(value); - return this; - } - /** - * .ibc.tendermint.light.BlockID last_block_id = 5; - */ - public Builder clearLastBlockId() { copyOnWrite(); - instance.clearLastBlockId(); - return this; - } - - /** - *
-       * commit from validators from the last block
-       * 
- * - * bytes last_commit_hash = 6; - * @return The lastCommitHash. - */ - @java.lang.Override - public com.google.protobuf.ByteString getLastCommitHash() { - return instance.getLastCommitHash(); - } - /** - *
-       * commit from validators from the last block
-       * 
- * - * bytes last_commit_hash = 6; - * @param value The lastCommitHash to set. - * @return This builder for chaining. - */ - public Builder setLastCommitHash(com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setLastCommitHash(value); - return this; - } - /** - *
-       * commit from validators from the last block
-       * 
- * - * bytes last_commit_hash = 6; - * @return This builder for chaining. - */ - public Builder clearLastCommitHash() { - copyOnWrite(); - instance.clearLastCommitHash(); - return this; - } - - /** - *
-       * transactions
-       * 
- * - * bytes data_hash = 7; - * @return The dataHash. - */ - @java.lang.Override - public com.google.protobuf.ByteString getDataHash() { - return instance.getDataHash(); - } - /** - *
-       * transactions
-       * 
- * - * bytes data_hash = 7; - * @param value The dataHash to set. - * @return This builder for chaining. - */ - public Builder setDataHash(com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setDataHash(value); - return this; - } - /** - *
-       * transactions
-       * 
- * - * bytes data_hash = 7; - * @return This builder for chaining. - */ - public Builder clearDataHash() { - copyOnWrite(); - instance.clearDataHash(); - return this; - } - - /** - *
-       * validators for the current block
-       * 
- * - * bytes validators_hash = 8; - * @return The validatorsHash. - */ - @java.lang.Override - public com.google.protobuf.ByteString getValidatorsHash() { - return instance.getValidatorsHash(); - } - /** - *
-       * validators for the current block
-       * 
- * - * bytes validators_hash = 8; - * @param value The validatorsHash to set. - * @return This builder for chaining. - */ - public Builder setValidatorsHash(com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setValidatorsHash(value); - return this; - } - /** - *
-       * validators for the current block
-       * 
- * - * bytes validators_hash = 8; - * @return This builder for chaining. - */ - public Builder clearValidatorsHash() { - copyOnWrite(); - instance.clearValidatorsHash(); - return this; - } - - /** - *
-       * validators for the next block
-       * 
- * - * bytes next_validators_hash = 9; - * @return The nextValidatorsHash. - */ - @java.lang.Override - public com.google.protobuf.ByteString getNextValidatorsHash() { - return instance.getNextValidatorsHash(); - } - /** - *
-       * validators for the next block
-       * 
- * - * bytes next_validators_hash = 9; - * @param value The nextValidatorsHash to set. - * @return This builder for chaining. - */ - public Builder setNextValidatorsHash(com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setNextValidatorsHash(value); - return this; - } - /** - *
-       * validators for the next block
-       * 
- * - * bytes next_validators_hash = 9; - * @return This builder for chaining. - */ - public Builder clearNextValidatorsHash() { - copyOnWrite(); - instance.clearNextValidatorsHash(); - return this; - } - - /** - *
-       * consensus params for current block
-       * 
- * - * bytes consensus_hash = 10; - * @return The consensusHash. - */ - @java.lang.Override - public com.google.protobuf.ByteString getConsensusHash() { - return instance.getConsensusHash(); - } - /** - *
-       * consensus params for current block
-       * 
- * - * bytes consensus_hash = 10; - * @param value The consensusHash to set. - * @return This builder for chaining. - */ - public Builder setConsensusHash(com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setConsensusHash(value); - return this; - } - /** - *
-       * consensus params for current block
-       * 
- * - * bytes consensus_hash = 10; - * @return This builder for chaining. - */ - public Builder clearConsensusHash() { - copyOnWrite(); - instance.clearConsensusHash(); - return this; - } - - /** - *
-       * state after txs from the previous block
-       * 
- * - * bytes app_hash = 11; - * @return The appHash. - */ - @java.lang.Override - public com.google.protobuf.ByteString getAppHash() { - return instance.getAppHash(); - } - /** - *
-       * state after txs from the previous block
-       * 
- * - * bytes app_hash = 11; - * @param value The appHash to set. - * @return This builder for chaining. - */ - public Builder setAppHash(com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setAppHash(value); - return this; - } - /** - *
-       * state after txs from the previous block
-       * 
- * - * bytes app_hash = 11; - * @return This builder for chaining. - */ - public Builder clearAppHash() { - copyOnWrite(); - instance.clearAppHash(); - return this; - } - - /** - *
-       * root hash of all results from the txs from the previous block
-       * 
- * - * bytes last_results_hash = 12; - * @return The lastResultsHash. - */ - @java.lang.Override - public com.google.protobuf.ByteString getLastResultsHash() { - return instance.getLastResultsHash(); - } - /** - *
-       * root hash of all results from the txs from the previous block
-       * 
- * - * bytes last_results_hash = 12; - * @param value The lastResultsHash to set. - * @return This builder for chaining. - */ - public Builder setLastResultsHash(com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setLastResultsHash(value); - return this; - } - /** - *
-       * root hash of all results from the txs from the previous block
-       * 
- * - * bytes last_results_hash = 12; - * @return This builder for chaining. - */ - public Builder clearLastResultsHash() { - copyOnWrite(); - instance.clearLastResultsHash(); - return this; - } - - /** - *
-       * evidence included in the block
-       * 
- * - * bytes evidence_hash = 13; - * @return The evidenceHash. - */ - @java.lang.Override - public com.google.protobuf.ByteString getEvidenceHash() { - return instance.getEvidenceHash(); - } - /** - *
-       * evidence included in the block
-       * 
- * - * bytes evidence_hash = 13; - * @param value The evidenceHash to set. - * @return This builder for chaining. - */ - public Builder setEvidenceHash(com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setEvidenceHash(value); - return this; - } - /** - *
-       * evidence included in the block
-       * 
- * - * bytes evidence_hash = 13; - * @return This builder for chaining. - */ - public Builder clearEvidenceHash() { - copyOnWrite(); - instance.clearEvidenceHash(); - return this; - } - - /** - *
-       * original proposer of the block
-       * 
- * - * bytes proposer_address = 14; - * @return The proposerAddress. - */ - @java.lang.Override - public com.google.protobuf.ByteString getProposerAddress() { - return instance.getProposerAddress(); - } - /** - *
-       * original proposer of the block
-       * 
- * - * bytes proposer_address = 14; - * @param value The proposerAddress to set. - * @return This builder for chaining. - */ - public Builder setProposerAddress(com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setProposerAddress(value); - return this; - } - /** - *
-       * original proposer of the block
-       * 
- * - * bytes proposer_address = 14; - * @return This builder for chaining. - */ - public Builder clearProposerAddress() { - copyOnWrite(); - instance.clearProposerAddress(); - return this; - } - - // @@protoc_insertion_point(builder_scope:ibc.tendermint.light.LightHeader) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new ibc.tendermint.light.TendermintLight.LightHeader(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[] { - "version_", - "chainId_", - "height_", - "time_", - "lastBlockId_", - "lastCommitHash_", - "dataHash_", - "validatorsHash_", - "nextValidatorsHash_", - "consensusHash_", - "appHash_", - "lastResultsHash_", - "evidenceHash_", - "proposerAddress_", - }; - java.lang.String info = - "\u0000\u000e\u0000\u0000\u0001\u000e\u000e\u0000\u0000\u0000\u0001\t\u0002\u0208" + - "\u0003\u0002\u0004\t\u0005\t\u0006\n\u0007\n\b\n\t\n\n\n\u000b\n\f\n\r\n\u000e\n" + - ""; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (ibc.tendermint.light.TendermintLight.LightHeader.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:ibc.tendermint.light.LightHeader) - private static final ibc.tendermint.light.TendermintLight.LightHeader DEFAULT_INSTANCE; - static { - LightHeader defaultInstance = new LightHeader(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - LightHeader.class, defaultInstance); - } - - public static ibc.tendermint.light.TendermintLight.LightHeader getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface SignedHeaderOrBuilder extends - // @@protoc_insertion_point(interface_extends:ibc.tendermint.light.SignedHeader) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * .ibc.tendermint.light.LightHeader header = 1; - * @return Whether the header field is set. - */ - boolean hasHeader(); - /** - * .ibc.tendermint.light.LightHeader header = 1; - * @return The header. - */ - ibc.tendermint.light.TendermintLight.LightHeader getHeader(); - - /** - * .ibc.tendermint.light.Commit commit = 2; - * @return Whether the commit field is set. - */ - boolean hasCommit(); - /** - * .ibc.tendermint.light.Commit commit = 2; - * @return The commit. - */ - ibc.tendermint.light.TendermintLight.Commit getCommit(); - } - /** - * Protobuf type {@code ibc.tendermint.light.SignedHeader} - */ - public static final class SignedHeader extends - com.google.protobuf.GeneratedMessageLite< - SignedHeader, SignedHeader.Builder> implements - // @@protoc_insertion_point(message_implements:ibc.tendermint.light.SignedHeader) - SignedHeaderOrBuilder { - private SignedHeader() { - } - public static final int HEADER_FIELD_NUMBER = 1; - private ibc.tendermint.light.TendermintLight.LightHeader header_; - /** - * .ibc.tendermint.light.LightHeader header = 1; - */ - @java.lang.Override - public boolean hasHeader() { - return header_ != null; - } - /** - * .ibc.tendermint.light.LightHeader header = 1; - */ - @java.lang.Override - public ibc.tendermint.light.TendermintLight.LightHeader getHeader() { - return header_ == null ? ibc.tendermint.light.TendermintLight.LightHeader.getDefaultInstance() : header_; - } - /** - * .ibc.tendermint.light.LightHeader header = 1; - */ - private void setHeader(ibc.tendermint.light.TendermintLight.LightHeader value) { - value.getClass(); - header_ = value; - - } - /** - * .ibc.tendermint.light.LightHeader header = 1; - */ - @java.lang.SuppressWarnings({"ReferenceEquality"}) - private void mergeHeader(ibc.tendermint.light.TendermintLight.LightHeader value) { - value.getClass(); - if (header_ != null && - header_ != ibc.tendermint.light.TendermintLight.LightHeader.getDefaultInstance()) { - header_ = - ibc.tendermint.light.TendermintLight.LightHeader.newBuilder(header_).mergeFrom(value).buildPartial(); - } else { - header_ = value; - } - - } - /** - * .ibc.tendermint.light.LightHeader header = 1; - */ - private void clearHeader() { header_ = null; - - } - - public static final int COMMIT_FIELD_NUMBER = 2; - private ibc.tendermint.light.TendermintLight.Commit commit_; - /** - * .ibc.tendermint.light.Commit commit = 2; - */ - @java.lang.Override - public boolean hasCommit() { - return commit_ != null; - } - /** - * .ibc.tendermint.light.Commit commit = 2; - */ - @java.lang.Override - public ibc.tendermint.light.TendermintLight.Commit getCommit() { - return commit_ == null ? ibc.tendermint.light.TendermintLight.Commit.getDefaultInstance() : commit_; - } - /** - * .ibc.tendermint.light.Commit commit = 2; - */ - private void setCommit(ibc.tendermint.light.TendermintLight.Commit value) { - value.getClass(); - commit_ = value; - - } - /** - * .ibc.tendermint.light.Commit commit = 2; - */ - @java.lang.SuppressWarnings({"ReferenceEquality"}) - private void mergeCommit(ibc.tendermint.light.TendermintLight.Commit value) { - value.getClass(); - if (commit_ != null && - commit_ != ibc.tendermint.light.TendermintLight.Commit.getDefaultInstance()) { - commit_ = - ibc.tendermint.light.TendermintLight.Commit.newBuilder(commit_).mergeFrom(value).buildPartial(); - } else { - commit_ = value; - } - - } - /** - * .ibc.tendermint.light.Commit commit = 2; - */ - private void clearCommit() { commit_ = null; - - } - - public static ibc.tendermint.light.TendermintLight.SignedHeader parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static ibc.tendermint.light.TendermintLight.SignedHeader parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.SignedHeader parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static ibc.tendermint.light.TendermintLight.SignedHeader parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.SignedHeader parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static ibc.tendermint.light.TendermintLight.SignedHeader parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.SignedHeader parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static ibc.tendermint.light.TendermintLight.SignedHeader parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.SignedHeader parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - public static ibc.tendermint.light.TendermintLight.SignedHeader parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.SignedHeader parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static ibc.tendermint.light.TendermintLight.SignedHeader parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(ibc.tendermint.light.TendermintLight.SignedHeader prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - * Protobuf type {@code ibc.tendermint.light.SignedHeader} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - ibc.tendermint.light.TendermintLight.SignedHeader, Builder> implements - // @@protoc_insertion_point(builder_implements:ibc.tendermint.light.SignedHeader) - ibc.tendermint.light.TendermintLight.SignedHeaderOrBuilder { - // Construct using ibc.tendermint.light.TendermintLight.SignedHeader.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - /** - * .ibc.tendermint.light.LightHeader header = 1; - */ - @java.lang.Override - public boolean hasHeader() { - return instance.hasHeader(); - } - /** - * .ibc.tendermint.light.LightHeader header = 1; - */ - @java.lang.Override - public ibc.tendermint.light.TendermintLight.LightHeader getHeader() { - return instance.getHeader(); - } - /** - * .ibc.tendermint.light.LightHeader header = 1; - */ - public Builder setHeader(ibc.tendermint.light.TendermintLight.LightHeader value) { - copyOnWrite(); - instance.setHeader(value); - return this; - } - /** - * .ibc.tendermint.light.LightHeader header = 1; - */ - public Builder setHeader( - ibc.tendermint.light.TendermintLight.LightHeader.Builder builderForValue) { - copyOnWrite(); - instance.setHeader(builderForValue.build()); - return this; - } - /** - * .ibc.tendermint.light.LightHeader header = 1; - */ - public Builder mergeHeader(ibc.tendermint.light.TendermintLight.LightHeader value) { - copyOnWrite(); - instance.mergeHeader(value); - return this; - } - /** - * .ibc.tendermint.light.LightHeader header = 1; - */ - public Builder clearHeader() { copyOnWrite(); - instance.clearHeader(); - return this; - } - - /** - * .ibc.tendermint.light.Commit commit = 2; - */ - @java.lang.Override - public boolean hasCommit() { - return instance.hasCommit(); - } - /** - * .ibc.tendermint.light.Commit commit = 2; - */ - @java.lang.Override - public ibc.tendermint.light.TendermintLight.Commit getCommit() { - return instance.getCommit(); - } - /** - * .ibc.tendermint.light.Commit commit = 2; - */ - public Builder setCommit(ibc.tendermint.light.TendermintLight.Commit value) { - copyOnWrite(); - instance.setCommit(value); - return this; - } - /** - * .ibc.tendermint.light.Commit commit = 2; - */ - public Builder setCommit( - ibc.tendermint.light.TendermintLight.Commit.Builder builderForValue) { - copyOnWrite(); - instance.setCommit(builderForValue.build()); - return this; - } - /** - * .ibc.tendermint.light.Commit commit = 2; - */ - public Builder mergeCommit(ibc.tendermint.light.TendermintLight.Commit value) { - copyOnWrite(); - instance.mergeCommit(value); - return this; - } - /** - * .ibc.tendermint.light.Commit commit = 2; - */ - public Builder clearCommit() { copyOnWrite(); - instance.clearCommit(); - return this; - } - - // @@protoc_insertion_point(builder_scope:ibc.tendermint.light.SignedHeader) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new ibc.tendermint.light.TendermintLight.SignedHeader(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[] { - "header_", - "commit_", - }; - java.lang.String info = - "\u0000\u0002\u0000\u0000\u0001\u0002\u0002\u0000\u0000\u0000\u0001\t\u0002\t"; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (ibc.tendermint.light.TendermintLight.SignedHeader.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:ibc.tendermint.light.SignedHeader) - private static final ibc.tendermint.light.TendermintLight.SignedHeader DEFAULT_INSTANCE; - static { - SignedHeader defaultInstance = new SignedHeader(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - SignedHeader.class, defaultInstance); - } - - public static ibc.tendermint.light.TendermintLight.SignedHeader getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface TmHeaderOrBuilder extends - // @@protoc_insertion_point(interface_extends:ibc.tendermint.light.TmHeader) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * .ibc.tendermint.light.SignedHeader signed_header = 1; - * @return Whether the signedHeader field is set. - */ - boolean hasSignedHeader(); - /** - * .ibc.tendermint.light.SignedHeader signed_header = 1; - * @return The signedHeader. - */ - ibc.tendermint.light.TendermintLight.SignedHeader getSignedHeader(); - - /** - * .ibc.tendermint.light.ValidatorSet validator_set = 2; - * @return Whether the validatorSet field is set. - */ - boolean hasValidatorSet(); - /** - * .ibc.tendermint.light.ValidatorSet validator_set = 2; - * @return The validatorSet. - */ - ibc.tendermint.light.TendermintLight.ValidatorSet getValidatorSet(); - - /** - * int64 trusted_height = 3; - * @return The trustedHeight. - */ - long getTrustedHeight(); - - /** - * .ibc.tendermint.light.ValidatorSet trusted_validators = 4; - * @return Whether the trustedValidators field is set. - */ - boolean hasTrustedValidators(); - /** - * .ibc.tendermint.light.ValidatorSet trusted_validators = 4; - * @return The trustedValidators. - */ - ibc.tendermint.light.TendermintLight.ValidatorSet getTrustedValidators(); - } - /** - * Protobuf type {@code ibc.tendermint.light.TmHeader} - */ - public static final class TmHeader extends - com.google.protobuf.GeneratedMessageLite< - TmHeader, TmHeader.Builder> implements - // @@protoc_insertion_point(message_implements:ibc.tendermint.light.TmHeader) - TmHeaderOrBuilder { - private TmHeader() { - } - public static final int SIGNED_HEADER_FIELD_NUMBER = 1; - private ibc.tendermint.light.TendermintLight.SignedHeader signedHeader_; - /** - * .ibc.tendermint.light.SignedHeader signed_header = 1; - */ - @java.lang.Override - public boolean hasSignedHeader() { - return signedHeader_ != null; - } - /** - * .ibc.tendermint.light.SignedHeader signed_header = 1; - */ - @java.lang.Override - public ibc.tendermint.light.TendermintLight.SignedHeader getSignedHeader() { - return signedHeader_ == null ? ibc.tendermint.light.TendermintLight.SignedHeader.getDefaultInstance() : signedHeader_; - } - /** - * .ibc.tendermint.light.SignedHeader signed_header = 1; - */ - private void setSignedHeader(ibc.tendermint.light.TendermintLight.SignedHeader value) { - value.getClass(); - signedHeader_ = value; - - } - /** - * .ibc.tendermint.light.SignedHeader signed_header = 1; - */ - @java.lang.SuppressWarnings({"ReferenceEquality"}) - private void mergeSignedHeader(ibc.tendermint.light.TendermintLight.SignedHeader value) { - value.getClass(); - if (signedHeader_ != null && - signedHeader_ != ibc.tendermint.light.TendermintLight.SignedHeader.getDefaultInstance()) { - signedHeader_ = - ibc.tendermint.light.TendermintLight.SignedHeader.newBuilder(signedHeader_).mergeFrom(value).buildPartial(); - } else { - signedHeader_ = value; - } - - } - /** - * .ibc.tendermint.light.SignedHeader signed_header = 1; - */ - private void clearSignedHeader() { signedHeader_ = null; - - } - - public static final int VALIDATOR_SET_FIELD_NUMBER = 2; - private ibc.tendermint.light.TendermintLight.ValidatorSet validatorSet_; - /** - * .ibc.tendermint.light.ValidatorSet validator_set = 2; - */ - @java.lang.Override - public boolean hasValidatorSet() { - return validatorSet_ != null; - } - /** - * .ibc.tendermint.light.ValidatorSet validator_set = 2; - */ - @java.lang.Override - public ibc.tendermint.light.TendermintLight.ValidatorSet getValidatorSet() { - return validatorSet_ == null ? ibc.tendermint.light.TendermintLight.ValidatorSet.getDefaultInstance() : validatorSet_; - } - /** - * .ibc.tendermint.light.ValidatorSet validator_set = 2; - */ - private void setValidatorSet(ibc.tendermint.light.TendermintLight.ValidatorSet value) { - value.getClass(); - validatorSet_ = value; - - } - /** - * .ibc.tendermint.light.ValidatorSet validator_set = 2; - */ - @java.lang.SuppressWarnings({"ReferenceEquality"}) - private void mergeValidatorSet(ibc.tendermint.light.TendermintLight.ValidatorSet value) { - value.getClass(); - if (validatorSet_ != null && - validatorSet_ != ibc.tendermint.light.TendermintLight.ValidatorSet.getDefaultInstance()) { - validatorSet_ = - ibc.tendermint.light.TendermintLight.ValidatorSet.newBuilder(validatorSet_).mergeFrom(value).buildPartial(); - } else { - validatorSet_ = value; - } - - } - /** - * .ibc.tendermint.light.ValidatorSet validator_set = 2; - */ - private void clearValidatorSet() { validatorSet_ = null; - - } - - public static final int TRUSTED_HEIGHT_FIELD_NUMBER = 3; - private long trustedHeight_; - /** - * int64 trusted_height = 3; - * @return The trustedHeight. - */ - @java.lang.Override - public long getTrustedHeight() { - return trustedHeight_; - } - /** - * int64 trusted_height = 3; - * @param value The trustedHeight to set. - */ - private void setTrustedHeight(long value) { - - trustedHeight_ = value; - } - /** - * int64 trusted_height = 3; - */ - private void clearTrustedHeight() { - - trustedHeight_ = 0L; - } - - public static final int TRUSTED_VALIDATORS_FIELD_NUMBER = 4; - private ibc.tendermint.light.TendermintLight.ValidatorSet trustedValidators_; - /** - * .ibc.tendermint.light.ValidatorSet trusted_validators = 4; - */ - @java.lang.Override - public boolean hasTrustedValidators() { - return trustedValidators_ != null; - } - /** - * .ibc.tendermint.light.ValidatorSet trusted_validators = 4; - */ - @java.lang.Override - public ibc.tendermint.light.TendermintLight.ValidatorSet getTrustedValidators() { - return trustedValidators_ == null ? ibc.tendermint.light.TendermintLight.ValidatorSet.getDefaultInstance() : trustedValidators_; - } - /** - * .ibc.tendermint.light.ValidatorSet trusted_validators = 4; - */ - private void setTrustedValidators(ibc.tendermint.light.TendermintLight.ValidatorSet value) { - value.getClass(); - trustedValidators_ = value; - - } - /** - * .ibc.tendermint.light.ValidatorSet trusted_validators = 4; - */ - @java.lang.SuppressWarnings({"ReferenceEquality"}) - private void mergeTrustedValidators(ibc.tendermint.light.TendermintLight.ValidatorSet value) { - value.getClass(); - if (trustedValidators_ != null && - trustedValidators_ != ibc.tendermint.light.TendermintLight.ValidatorSet.getDefaultInstance()) { - trustedValidators_ = - ibc.tendermint.light.TendermintLight.ValidatorSet.newBuilder(trustedValidators_).mergeFrom(value).buildPartial(); - } else { - trustedValidators_ = value; - } - - } - /** - * .ibc.tendermint.light.ValidatorSet trusted_validators = 4; - */ - private void clearTrustedValidators() { trustedValidators_ = null; - - } - - public static ibc.tendermint.light.TendermintLight.TmHeader parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static ibc.tendermint.light.TendermintLight.TmHeader parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.TmHeader parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static ibc.tendermint.light.TendermintLight.TmHeader parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.TmHeader parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static ibc.tendermint.light.TendermintLight.TmHeader parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.TmHeader parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static ibc.tendermint.light.TendermintLight.TmHeader parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.TmHeader parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - public static ibc.tendermint.light.TendermintLight.TmHeader parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static ibc.tendermint.light.TendermintLight.TmHeader parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static ibc.tendermint.light.TendermintLight.TmHeader parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(ibc.tendermint.light.TendermintLight.TmHeader prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - * Protobuf type {@code ibc.tendermint.light.TmHeader} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - ibc.tendermint.light.TendermintLight.TmHeader, Builder> implements - // @@protoc_insertion_point(builder_implements:ibc.tendermint.light.TmHeader) - ibc.tendermint.light.TendermintLight.TmHeaderOrBuilder { - // Construct using ibc.tendermint.light.TendermintLight.TmHeader.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - /** - * .ibc.tendermint.light.SignedHeader signed_header = 1; - */ - @java.lang.Override - public boolean hasSignedHeader() { - return instance.hasSignedHeader(); - } - /** - * .ibc.tendermint.light.SignedHeader signed_header = 1; - */ - @java.lang.Override - public ibc.tendermint.light.TendermintLight.SignedHeader getSignedHeader() { - return instance.getSignedHeader(); - } - /** - * .ibc.tendermint.light.SignedHeader signed_header = 1; - */ - public Builder setSignedHeader(ibc.tendermint.light.TendermintLight.SignedHeader value) { - copyOnWrite(); - instance.setSignedHeader(value); - return this; - } - /** - * .ibc.tendermint.light.SignedHeader signed_header = 1; - */ - public Builder setSignedHeader( - ibc.tendermint.light.TendermintLight.SignedHeader.Builder builderForValue) { - copyOnWrite(); - instance.setSignedHeader(builderForValue.build()); - return this; - } - /** - * .ibc.tendermint.light.SignedHeader signed_header = 1; - */ - public Builder mergeSignedHeader(ibc.tendermint.light.TendermintLight.SignedHeader value) { - copyOnWrite(); - instance.mergeSignedHeader(value); - return this; - } - /** - * .ibc.tendermint.light.SignedHeader signed_header = 1; - */ - public Builder clearSignedHeader() { copyOnWrite(); - instance.clearSignedHeader(); - return this; - } - - /** - * .ibc.tendermint.light.ValidatorSet validator_set = 2; - */ - @java.lang.Override - public boolean hasValidatorSet() { - return instance.hasValidatorSet(); - } - /** - * .ibc.tendermint.light.ValidatorSet validator_set = 2; - */ - @java.lang.Override - public ibc.tendermint.light.TendermintLight.ValidatorSet getValidatorSet() { - return instance.getValidatorSet(); - } - /** - * .ibc.tendermint.light.ValidatorSet validator_set = 2; - */ - public Builder setValidatorSet(ibc.tendermint.light.TendermintLight.ValidatorSet value) { - copyOnWrite(); - instance.setValidatorSet(value); - return this; - } - /** - * .ibc.tendermint.light.ValidatorSet validator_set = 2; - */ - public Builder setValidatorSet( - ibc.tendermint.light.TendermintLight.ValidatorSet.Builder builderForValue) { - copyOnWrite(); - instance.setValidatorSet(builderForValue.build()); - return this; - } - /** - * .ibc.tendermint.light.ValidatorSet validator_set = 2; - */ - public Builder mergeValidatorSet(ibc.tendermint.light.TendermintLight.ValidatorSet value) { - copyOnWrite(); - instance.mergeValidatorSet(value); - return this; - } - /** - * .ibc.tendermint.light.ValidatorSet validator_set = 2; - */ - public Builder clearValidatorSet() { copyOnWrite(); - instance.clearValidatorSet(); - return this; - } - - /** - * int64 trusted_height = 3; - * @return The trustedHeight. - */ - @java.lang.Override - public long getTrustedHeight() { - return instance.getTrustedHeight(); - } - /** - * int64 trusted_height = 3; - * @param value The trustedHeight to set. - * @return This builder for chaining. - */ - public Builder setTrustedHeight(long value) { - copyOnWrite(); - instance.setTrustedHeight(value); - return this; - } - /** - * int64 trusted_height = 3; - * @return This builder for chaining. - */ - public Builder clearTrustedHeight() { - copyOnWrite(); - instance.clearTrustedHeight(); - return this; - } - - /** - * .ibc.tendermint.light.ValidatorSet trusted_validators = 4; - */ - @java.lang.Override - public boolean hasTrustedValidators() { - return instance.hasTrustedValidators(); - } - /** - * .ibc.tendermint.light.ValidatorSet trusted_validators = 4; - */ - @java.lang.Override - public ibc.tendermint.light.TendermintLight.ValidatorSet getTrustedValidators() { - return instance.getTrustedValidators(); - } - /** - * .ibc.tendermint.light.ValidatorSet trusted_validators = 4; - */ - public Builder setTrustedValidators(ibc.tendermint.light.TendermintLight.ValidatorSet value) { - copyOnWrite(); - instance.setTrustedValidators(value); - return this; - } - /** - * .ibc.tendermint.light.ValidatorSet trusted_validators = 4; - */ - public Builder setTrustedValidators( - ibc.tendermint.light.TendermintLight.ValidatorSet.Builder builderForValue) { - copyOnWrite(); - instance.setTrustedValidators(builderForValue.build()); - return this; - } - /** - * .ibc.tendermint.light.ValidatorSet trusted_validators = 4; - */ - public Builder mergeTrustedValidators(ibc.tendermint.light.TendermintLight.ValidatorSet value) { - copyOnWrite(); - instance.mergeTrustedValidators(value); - return this; - } - /** - * .ibc.tendermint.light.ValidatorSet trusted_validators = 4; - */ - public Builder clearTrustedValidators() { copyOnWrite(); - instance.clearTrustedValidators(); - return this; - } - - // @@protoc_insertion_point(builder_scope:ibc.tendermint.light.TmHeader) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new ibc.tendermint.light.TendermintLight.TmHeader(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[] { - "signedHeader_", - "validatorSet_", - "trustedHeight_", - "trustedValidators_", - }; - java.lang.String info = - "\u0000\u0004\u0000\u0000\u0001\u0004\u0004\u0000\u0000\u0000\u0001\t\u0002\t\u0003" + - "\u0002\u0004\t"; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (ibc.tendermint.light.TendermintLight.TmHeader.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:ibc.tendermint.light.TmHeader) - private static final ibc.tendermint.light.TendermintLight.TmHeader DEFAULT_INSTANCE; - static { - TmHeader defaultInstance = new TmHeader(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - TmHeader.class, defaultInstance); - } - - public static ibc.tendermint.light.TendermintLight.TmHeader getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - - static { - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/amino/AminoProto.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/amino/AminoProto.java new file mode 100644 index 000000000..1c6320b6c --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/amino/AminoProto.java @@ -0,0 +1,161 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: amino/amino.proto + +package com.amino; + +public final class AminoProto { + private AminoProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + registry.add(com.amino.AminoProto.name); + registry.add(com.amino.AminoProto.messageEncoding); + registry.add(com.amino.AminoProto.encoding); + registry.add(com.amino.AminoProto.fieldName); + registry.add(com.amino.AminoProto.dontOmitempty); + } + public static final int NAME_FIELD_NUMBER = 11110001; + /** + *
+   * name is the string used when registering a concrete
+   * type into the Amino type registry, via the Amino codec's
+   * `RegisterConcrete()` method. This string MUST be at most 39
+   * characters long, or else the message will be rejected by the
+   * Ledger hardware device.
+   * 
+ * + * extend .google.protobuf.MessageOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.MessageOptions, + java.lang.String> name = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.MessageOptions.getDefaultInstance(), + "", + null, + null, + 11110001, + com.google.protobuf.WireFormat.FieldType.STRING, + java.lang.String.class); + public static final int MESSAGE_ENCODING_FIELD_NUMBER = 11110002; + /** + *
+   * encoding describes the encoding format used by Amino for the given
+   * message. The field type is chosen to be a string for
+   * flexibility, but it should ideally be short and expected to be
+   * machine-readable, for example "base64" or "utf8_json". We
+   * highly recommend to use underscores for word separation instead of spaces.
+   * If left empty, then the Amino encoding is expected to be the same as the
+   * Protobuf one.
+   * This annotation should not be confused with the `encoding`
+   * one which operates on the field level.
+   * 
+ * + * extend .google.protobuf.MessageOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.MessageOptions, + java.lang.String> messageEncoding = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.MessageOptions.getDefaultInstance(), + "", + null, + null, + 11110002, + com.google.protobuf.WireFormat.FieldType.STRING, + java.lang.String.class); + public static final int ENCODING_FIELD_NUMBER = 11110003; + /** + *
+   * encoding describes the encoding format used by Amino for
+   * the given field. The field type is chosen to be a string for
+   * flexibility, but it should ideally be short and expected to be
+   * machine-readable, for example "base64" or "utf8_json". We
+   * highly recommend to use underscores for word separation instead of spaces.
+   * If left empty, then the Amino encoding is expected to be the same as the
+   * Protobuf one.
+   * This annotation should not be confused with the
+   * `message_encoding` one which operates on the message level.
+   * 
+ * + * extend .google.protobuf.FieldOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FieldOptions, + java.lang.String> encoding = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.FieldOptions.getDefaultInstance(), + "", + null, + null, + 11110003, + com.google.protobuf.WireFormat.FieldType.STRING, + java.lang.String.class); + public static final int FIELD_NAME_FIELD_NUMBER = 11110004; + /** + *
+   * field_name sets a different field name (i.e. key name) in
+   * the amino JSON object for the given field.
+   * Example:
+   * message Foo {
+   *   string bar = 1 [(amino.field_name) = "baz"];
+   * }
+   * Then the Amino encoding of Foo will be:
+   * `{"baz":"some value"}`
+   * 
+ * + * extend .google.protobuf.FieldOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FieldOptions, + java.lang.String> fieldName = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.FieldOptions.getDefaultInstance(), + "", + null, + null, + 11110004, + com.google.protobuf.WireFormat.FieldType.STRING, + java.lang.String.class); + public static final int DONT_OMITEMPTY_FIELD_NUMBER = 11110005; + /** + *
+   * dont_omitempty sets the field in the JSON object even if
+   * its value is empty, i.e. equal to the Golang zero value. To learn what
+   * the zero values are, see https://go.dev/ref/spec#The_zero_value.
+   * Fields default to `omitempty`, which is the default behavior when this
+   * annotation is unset. When set to true, then the field value in the
+   * JSON object will be set, i.e. not `undefined`.
+   * Example:
+   * message Foo {
+   *   string bar = 1;
+   *   string baz = 2 [(amino.dont_omitempty) = true];
+   * }
+   * f := Foo{};
+   * out := AminoJSONEncoder(&f);
+   * out == {"baz":""}
+   * 
+ * + * extend .google.protobuf.FieldOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FieldOptions, + java.lang.Boolean> dontOmitempty = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.FieldOptions.getDefaultInstance(), + false, + null, + null, + 11110005, + com.google.protobuf.WireFormat.FieldType.BOOL, + java.lang.Boolean.class); + + static { + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/BatchEntry.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/BatchEntry.java new file mode 100644 index 000000000..6ffe33479 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/BatchEntry.java @@ -0,0 +1,447 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: cosmos/ics23/v1/proofs.proto + +package com.cosmos.ics23.v1; + +/** + *
+ * Use BatchEntry not CommitmentProof, to avoid recursion
+ * 
+ * + * Protobuf type {@code cosmos.ics23.v1.BatchEntry} + */ +public final class BatchEntry extends + com.google.protobuf.GeneratedMessageLite< + BatchEntry, BatchEntry.Builder> implements + // @@protoc_insertion_point(message_implements:cosmos.ics23.v1.BatchEntry) + BatchEntryOrBuilder { + private BatchEntry() { + } + private int proofCase_ = 0; + private java.lang.Object proof_; + public enum ProofCase { + EXIST(1), + NONEXIST(2), + PROOF_NOT_SET(0); + private final int value; + private ProofCase(int value) { + this.value = value; + } + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ProofCase valueOf(int value) { + return forNumber(value); + } + + public static ProofCase forNumber(int value) { + switch (value) { + case 1: return EXIST; + case 2: return NONEXIST; + case 0: return PROOF_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + @java.lang.Override + public ProofCase + getProofCase() { + return ProofCase.forNumber( + proofCase_); + } + + private void clearProof() { + proofCase_ = 0; + proof_ = null; + } + + public static final int EXIST_FIELD_NUMBER = 1; + /** + * .cosmos.ics23.v1.ExistenceProof exist = 1 [json_name = "exist"]; + */ + @java.lang.Override + public boolean hasExist() { + return proofCase_ == 1; + } + /** + * .cosmos.ics23.v1.ExistenceProof exist = 1 [json_name = "exist"]; + */ + @java.lang.Override + public com.cosmos.ics23.v1.ExistenceProof getExist() { + if (proofCase_ == 1) { + return (com.cosmos.ics23.v1.ExistenceProof) proof_; + } + return com.cosmos.ics23.v1.ExistenceProof.getDefaultInstance(); + } + /** + * .cosmos.ics23.v1.ExistenceProof exist = 1 [json_name = "exist"]; + */ + private void setExist(com.cosmos.ics23.v1.ExistenceProof value) { + value.getClass(); + proof_ = value; + proofCase_ = 1; + } + /** + * .cosmos.ics23.v1.ExistenceProof exist = 1 [json_name = "exist"]; + */ + private void mergeExist(com.cosmos.ics23.v1.ExistenceProof value) { + value.getClass(); + if (proofCase_ == 1 && + proof_ != com.cosmos.ics23.v1.ExistenceProof.getDefaultInstance()) { + proof_ = com.cosmos.ics23.v1.ExistenceProof.newBuilder((com.cosmos.ics23.v1.ExistenceProof) proof_) + .mergeFrom(value).buildPartial(); + } else { + proof_ = value; + } + proofCase_ = 1; + } + /** + * .cosmos.ics23.v1.ExistenceProof exist = 1 [json_name = "exist"]; + */ + private void clearExist() { + if (proofCase_ == 1) { + proofCase_ = 0; + proof_ = null; + } + } + + public static final int NONEXIST_FIELD_NUMBER = 2; + /** + * .cosmos.ics23.v1.NonExistenceProof nonexist = 2 [json_name = "nonexist"]; + */ + @java.lang.Override + public boolean hasNonexist() { + return proofCase_ == 2; + } + /** + * .cosmos.ics23.v1.NonExistenceProof nonexist = 2 [json_name = "nonexist"]; + */ + @java.lang.Override + public com.cosmos.ics23.v1.NonExistenceProof getNonexist() { + if (proofCase_ == 2) { + return (com.cosmos.ics23.v1.NonExistenceProof) proof_; + } + return com.cosmos.ics23.v1.NonExistenceProof.getDefaultInstance(); + } + /** + * .cosmos.ics23.v1.NonExistenceProof nonexist = 2 [json_name = "nonexist"]; + */ + private void setNonexist(com.cosmos.ics23.v1.NonExistenceProof value) { + value.getClass(); + proof_ = value; + proofCase_ = 2; + } + /** + * .cosmos.ics23.v1.NonExistenceProof nonexist = 2 [json_name = "nonexist"]; + */ + private void mergeNonexist(com.cosmos.ics23.v1.NonExistenceProof value) { + value.getClass(); + if (proofCase_ == 2 && + proof_ != com.cosmos.ics23.v1.NonExistenceProof.getDefaultInstance()) { + proof_ = com.cosmos.ics23.v1.NonExistenceProof.newBuilder((com.cosmos.ics23.v1.NonExistenceProof) proof_) + .mergeFrom(value).buildPartial(); + } else { + proof_ = value; + } + proofCase_ = 2; + } + /** + * .cosmos.ics23.v1.NonExistenceProof nonexist = 2 [json_name = "nonexist"]; + */ + private void clearNonexist() { + if (proofCase_ == 2) { + proofCase_ = 0; + proof_ = null; + } + } + + public static com.cosmos.ics23.v1.BatchEntry parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.cosmos.ics23.v1.BatchEntry parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.cosmos.ics23.v1.BatchEntry parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.cosmos.ics23.v1.BatchEntry parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.cosmos.ics23.v1.BatchEntry parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.cosmos.ics23.v1.BatchEntry parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.cosmos.ics23.v1.BatchEntry parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.cosmos.ics23.v1.BatchEntry parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.cosmos.ics23.v1.BatchEntry parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.cosmos.ics23.v1.BatchEntry parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.cosmos.ics23.v1.BatchEntry parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.cosmos.ics23.v1.BatchEntry parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.cosmos.ics23.v1.BatchEntry prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+   * Use BatchEntry not CommitmentProof, to avoid recursion
+   * 
+ * + * Protobuf type {@code cosmos.ics23.v1.BatchEntry} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.cosmos.ics23.v1.BatchEntry, Builder> implements + // @@protoc_insertion_point(builder_implements:cosmos.ics23.v1.BatchEntry) + com.cosmos.ics23.v1.BatchEntryOrBuilder { + // Construct using com.cosmos.ics23.v1.BatchEntry.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + @java.lang.Override + public ProofCase + getProofCase() { + return instance.getProofCase(); + } + + public Builder clearProof() { + copyOnWrite(); + instance.clearProof(); + return this; + } + + + /** + * .cosmos.ics23.v1.ExistenceProof exist = 1 [json_name = "exist"]; + */ + @java.lang.Override + public boolean hasExist() { + return instance.hasExist(); + } + /** + * .cosmos.ics23.v1.ExistenceProof exist = 1 [json_name = "exist"]; + */ + @java.lang.Override + public com.cosmos.ics23.v1.ExistenceProof getExist() { + return instance.getExist(); + } + /** + * .cosmos.ics23.v1.ExistenceProof exist = 1 [json_name = "exist"]; + */ + public Builder setExist(com.cosmos.ics23.v1.ExistenceProof value) { + copyOnWrite(); + instance.setExist(value); + return this; + } + /** + * .cosmos.ics23.v1.ExistenceProof exist = 1 [json_name = "exist"]; + */ + public Builder setExist( + com.cosmos.ics23.v1.ExistenceProof.Builder builderForValue) { + copyOnWrite(); + instance.setExist(builderForValue.build()); + return this; + } + /** + * .cosmos.ics23.v1.ExistenceProof exist = 1 [json_name = "exist"]; + */ + public Builder mergeExist(com.cosmos.ics23.v1.ExistenceProof value) { + copyOnWrite(); + instance.mergeExist(value); + return this; + } + /** + * .cosmos.ics23.v1.ExistenceProof exist = 1 [json_name = "exist"]; + */ + public Builder clearExist() { + copyOnWrite(); + instance.clearExist(); + return this; + } + + /** + * .cosmos.ics23.v1.NonExistenceProof nonexist = 2 [json_name = "nonexist"]; + */ + @java.lang.Override + public boolean hasNonexist() { + return instance.hasNonexist(); + } + /** + * .cosmos.ics23.v1.NonExistenceProof nonexist = 2 [json_name = "nonexist"]; + */ + @java.lang.Override + public com.cosmos.ics23.v1.NonExistenceProof getNonexist() { + return instance.getNonexist(); + } + /** + * .cosmos.ics23.v1.NonExistenceProof nonexist = 2 [json_name = "nonexist"]; + */ + public Builder setNonexist(com.cosmos.ics23.v1.NonExistenceProof value) { + copyOnWrite(); + instance.setNonexist(value); + return this; + } + /** + * .cosmos.ics23.v1.NonExistenceProof nonexist = 2 [json_name = "nonexist"]; + */ + public Builder setNonexist( + com.cosmos.ics23.v1.NonExistenceProof.Builder builderForValue) { + copyOnWrite(); + instance.setNonexist(builderForValue.build()); + return this; + } + /** + * .cosmos.ics23.v1.NonExistenceProof nonexist = 2 [json_name = "nonexist"]; + */ + public Builder mergeNonexist(com.cosmos.ics23.v1.NonExistenceProof value) { + copyOnWrite(); + instance.mergeNonexist(value); + return this; + } + /** + * .cosmos.ics23.v1.NonExistenceProof nonexist = 2 [json_name = "nonexist"]; + */ + public Builder clearNonexist() { + copyOnWrite(); + instance.clearNonexist(); + return this; + } + + // @@protoc_insertion_point(builder_scope:cosmos.ics23.v1.BatchEntry) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.cosmos.ics23.v1.BatchEntry(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "proof_", + "proofCase_", + com.cosmos.ics23.v1.ExistenceProof.class, + com.cosmos.ics23.v1.NonExistenceProof.class, + }; + java.lang.String info = + "\u0000\u0002\u0001\u0000\u0001\u0002\u0002\u0000\u0000\u0000\u0001<\u0000\u0002<" + + "\u0000"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.cosmos.ics23.v1.BatchEntry.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:cosmos.ics23.v1.BatchEntry) + private static final com.cosmos.ics23.v1.BatchEntry DEFAULT_INSTANCE; + static { + BatchEntry defaultInstance = new BatchEntry(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + BatchEntry.class, defaultInstance); + } + + public static com.cosmos.ics23.v1.BatchEntry getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/BatchEntryOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/BatchEntryOrBuilder.java new file mode 100644 index 000000000..ea263439f --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/BatchEntryOrBuilder.java @@ -0,0 +1,33 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: cosmos/ics23/v1/proofs.proto + +package com.cosmos.ics23.v1; + +public interface BatchEntryOrBuilder extends + // @@protoc_insertion_point(interface_extends:cosmos.ics23.v1.BatchEntry) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * .cosmos.ics23.v1.ExistenceProof exist = 1 [json_name = "exist"]; + * @return Whether the exist field is set. + */ + boolean hasExist(); + /** + * .cosmos.ics23.v1.ExistenceProof exist = 1 [json_name = "exist"]; + * @return The exist. + */ + com.cosmos.ics23.v1.ExistenceProof getExist(); + + /** + * .cosmos.ics23.v1.NonExistenceProof nonexist = 2 [json_name = "nonexist"]; + * @return Whether the nonexist field is set. + */ + boolean hasNonexist(); + /** + * .cosmos.ics23.v1.NonExistenceProof nonexist = 2 [json_name = "nonexist"]; + * @return The nonexist. + */ + com.cosmos.ics23.v1.NonExistenceProof getNonexist(); + + public com.cosmos.ics23.v1.BatchEntry.ProofCase getProofCase(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/BatchProof.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/BatchProof.java new file mode 100644 index 000000000..b2b7a525b --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/BatchProof.java @@ -0,0 +1,390 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: cosmos/ics23/v1/proofs.proto + +package com.cosmos.ics23.v1; + +/** + *
+ *BatchProof is a group of multiple proof types than can be compressed
+ * 
+ * + * Protobuf type {@code cosmos.ics23.v1.BatchProof} + */ +public final class BatchProof extends + com.google.protobuf.GeneratedMessageLite< + BatchProof, BatchProof.Builder> implements + // @@protoc_insertion_point(message_implements:cosmos.ics23.v1.BatchProof) + BatchProofOrBuilder { + private BatchProof() { + entries_ = emptyProtobufList(); + } + public static final int ENTRIES_FIELD_NUMBER = 1; + private com.google.protobuf.Internal.ProtobufList entries_; + /** + * repeated .cosmos.ics23.v1.BatchEntry entries = 1 [json_name = "entries"]; + */ + @java.lang.Override + public java.util.List getEntriesList() { + return entries_; + } + /** + * repeated .cosmos.ics23.v1.BatchEntry entries = 1 [json_name = "entries"]; + */ + public java.util.List + getEntriesOrBuilderList() { + return entries_; + } + /** + * repeated .cosmos.ics23.v1.BatchEntry entries = 1 [json_name = "entries"]; + */ + @java.lang.Override + public int getEntriesCount() { + return entries_.size(); + } + /** + * repeated .cosmos.ics23.v1.BatchEntry entries = 1 [json_name = "entries"]; + */ + @java.lang.Override + public com.cosmos.ics23.v1.BatchEntry getEntries(int index) { + return entries_.get(index); + } + /** + * repeated .cosmos.ics23.v1.BatchEntry entries = 1 [json_name = "entries"]; + */ + public com.cosmos.ics23.v1.BatchEntryOrBuilder getEntriesOrBuilder( + int index) { + return entries_.get(index); + } + private void ensureEntriesIsMutable() { + com.google.protobuf.Internal.ProtobufList tmp = entries_; + if (!tmp.isModifiable()) { + entries_ = + com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp); + } + } + + /** + * repeated .cosmos.ics23.v1.BatchEntry entries = 1 [json_name = "entries"]; + */ + private void setEntries( + int index, com.cosmos.ics23.v1.BatchEntry value) { + value.getClass(); + ensureEntriesIsMutable(); + entries_.set(index, value); + } + /** + * repeated .cosmos.ics23.v1.BatchEntry entries = 1 [json_name = "entries"]; + */ + private void addEntries(com.cosmos.ics23.v1.BatchEntry value) { + value.getClass(); + ensureEntriesIsMutable(); + entries_.add(value); + } + /** + * repeated .cosmos.ics23.v1.BatchEntry entries = 1 [json_name = "entries"]; + */ + private void addEntries( + int index, com.cosmos.ics23.v1.BatchEntry value) { + value.getClass(); + ensureEntriesIsMutable(); + entries_.add(index, value); + } + /** + * repeated .cosmos.ics23.v1.BatchEntry entries = 1 [json_name = "entries"]; + */ + private void addAllEntries( + java.lang.Iterable values) { + ensureEntriesIsMutable(); + com.google.protobuf.AbstractMessageLite.addAll( + values, entries_); + } + /** + * repeated .cosmos.ics23.v1.BatchEntry entries = 1 [json_name = "entries"]; + */ + private void clearEntries() { + entries_ = emptyProtobufList(); + } + /** + * repeated .cosmos.ics23.v1.BatchEntry entries = 1 [json_name = "entries"]; + */ + private void removeEntries(int index) { + ensureEntriesIsMutable(); + entries_.remove(index); + } + + public static com.cosmos.ics23.v1.BatchProof parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.cosmos.ics23.v1.BatchProof parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.cosmos.ics23.v1.BatchProof parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.cosmos.ics23.v1.BatchProof parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.cosmos.ics23.v1.BatchProof parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.cosmos.ics23.v1.BatchProof parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.cosmos.ics23.v1.BatchProof parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.cosmos.ics23.v1.BatchProof parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.cosmos.ics23.v1.BatchProof parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.cosmos.ics23.v1.BatchProof parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.cosmos.ics23.v1.BatchProof parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.cosmos.ics23.v1.BatchProof parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.cosmos.ics23.v1.BatchProof prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+   *BatchProof is a group of multiple proof types than can be compressed
+   * 
+ * + * Protobuf type {@code cosmos.ics23.v1.BatchProof} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.cosmos.ics23.v1.BatchProof, Builder> implements + // @@protoc_insertion_point(builder_implements:cosmos.ics23.v1.BatchProof) + com.cosmos.ics23.v1.BatchProofOrBuilder { + // Construct using com.cosmos.ics23.v1.BatchProof.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * repeated .cosmos.ics23.v1.BatchEntry entries = 1 [json_name = "entries"]; + */ + @java.lang.Override + public java.util.List getEntriesList() { + return java.util.Collections.unmodifiableList( + instance.getEntriesList()); + } + /** + * repeated .cosmos.ics23.v1.BatchEntry entries = 1 [json_name = "entries"]; + */ + @java.lang.Override + public int getEntriesCount() { + return instance.getEntriesCount(); + }/** + * repeated .cosmos.ics23.v1.BatchEntry entries = 1 [json_name = "entries"]; + */ + @java.lang.Override + public com.cosmos.ics23.v1.BatchEntry getEntries(int index) { + return instance.getEntries(index); + } + /** + * repeated .cosmos.ics23.v1.BatchEntry entries = 1 [json_name = "entries"]; + */ + public Builder setEntries( + int index, com.cosmos.ics23.v1.BatchEntry value) { + copyOnWrite(); + instance.setEntries(index, value); + return this; + } + /** + * repeated .cosmos.ics23.v1.BatchEntry entries = 1 [json_name = "entries"]; + */ + public Builder setEntries( + int index, com.cosmos.ics23.v1.BatchEntry.Builder builderForValue) { + copyOnWrite(); + instance.setEntries(index, + builderForValue.build()); + return this; + } + /** + * repeated .cosmos.ics23.v1.BatchEntry entries = 1 [json_name = "entries"]; + */ + public Builder addEntries(com.cosmos.ics23.v1.BatchEntry value) { + copyOnWrite(); + instance.addEntries(value); + return this; + } + /** + * repeated .cosmos.ics23.v1.BatchEntry entries = 1 [json_name = "entries"]; + */ + public Builder addEntries( + int index, com.cosmos.ics23.v1.BatchEntry value) { + copyOnWrite(); + instance.addEntries(index, value); + return this; + } + /** + * repeated .cosmos.ics23.v1.BatchEntry entries = 1 [json_name = "entries"]; + */ + public Builder addEntries( + com.cosmos.ics23.v1.BatchEntry.Builder builderForValue) { + copyOnWrite(); + instance.addEntries(builderForValue.build()); + return this; + } + /** + * repeated .cosmos.ics23.v1.BatchEntry entries = 1 [json_name = "entries"]; + */ + public Builder addEntries( + int index, com.cosmos.ics23.v1.BatchEntry.Builder builderForValue) { + copyOnWrite(); + instance.addEntries(index, + builderForValue.build()); + return this; + } + /** + * repeated .cosmos.ics23.v1.BatchEntry entries = 1 [json_name = "entries"]; + */ + public Builder addAllEntries( + java.lang.Iterable values) { + copyOnWrite(); + instance.addAllEntries(values); + return this; + } + /** + * repeated .cosmos.ics23.v1.BatchEntry entries = 1 [json_name = "entries"]; + */ + public Builder clearEntries() { + copyOnWrite(); + instance.clearEntries(); + return this; + } + /** + * repeated .cosmos.ics23.v1.BatchEntry entries = 1 [json_name = "entries"]; + */ + public Builder removeEntries(int index) { + copyOnWrite(); + instance.removeEntries(index); + return this; + } + + // @@protoc_insertion_point(builder_scope:cosmos.ics23.v1.BatchProof) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.cosmos.ics23.v1.BatchProof(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "entries_", + com.cosmos.ics23.v1.BatchEntry.class, + }; + java.lang.String info = + "\u0000\u0001\u0000\u0000\u0001\u0001\u0001\u0000\u0001\u0000\u0001\u001b"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.cosmos.ics23.v1.BatchProof.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:cosmos.ics23.v1.BatchProof) + private static final com.cosmos.ics23.v1.BatchProof DEFAULT_INSTANCE; + static { + BatchProof defaultInstance = new BatchProof(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + BatchProof.class, defaultInstance); + } + + public static com.cosmos.ics23.v1.BatchProof getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/BatchProofOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/BatchProofOrBuilder.java new file mode 100644 index 000000000..871c307d4 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/BatchProofOrBuilder.java @@ -0,0 +1,23 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: cosmos/ics23/v1/proofs.proto + +package com.cosmos.ics23.v1; + +public interface BatchProofOrBuilder extends + // @@protoc_insertion_point(interface_extends:cosmos.ics23.v1.BatchProof) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * repeated .cosmos.ics23.v1.BatchEntry entries = 1 [json_name = "entries"]; + */ + java.util.List + getEntriesList(); + /** + * repeated .cosmos.ics23.v1.BatchEntry entries = 1 [json_name = "entries"]; + */ + com.cosmos.ics23.v1.BatchEntry getEntries(int index); + /** + * repeated .cosmos.ics23.v1.BatchEntry entries = 1 [json_name = "entries"]; + */ + int getEntriesCount(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/CommitmentProof.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/CommitmentProof.java new file mode 100644 index 000000000..1ba141c0d --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/CommitmentProof.java @@ -0,0 +1,649 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: cosmos/ics23/v1/proofs.proto + +package com.cosmos.ics23.v1; + +/** + *
+ *CommitmentProof is either an ExistenceProof or a NonExistenceProof, or a Batch of such messages
+ * 
+ * + * Protobuf type {@code cosmos.ics23.v1.CommitmentProof} + */ +public final class CommitmentProof extends + com.google.protobuf.GeneratedMessageLite< + CommitmentProof, CommitmentProof.Builder> implements + // @@protoc_insertion_point(message_implements:cosmos.ics23.v1.CommitmentProof) + CommitmentProofOrBuilder { + private CommitmentProof() { + } + private int proofCase_ = 0; + private java.lang.Object proof_; + public enum ProofCase { + EXIST(1), + NONEXIST(2), + BATCH(3), + COMPRESSED(4), + PROOF_NOT_SET(0); + private final int value; + private ProofCase(int value) { + this.value = value; + } + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ProofCase valueOf(int value) { + return forNumber(value); + } + + public static ProofCase forNumber(int value) { + switch (value) { + case 1: return EXIST; + case 2: return NONEXIST; + case 3: return BATCH; + case 4: return COMPRESSED; + case 0: return PROOF_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + @java.lang.Override + public ProofCase + getProofCase() { + return ProofCase.forNumber( + proofCase_); + } + + private void clearProof() { + proofCase_ = 0; + proof_ = null; + } + + public static final int EXIST_FIELD_NUMBER = 1; + /** + * .cosmos.ics23.v1.ExistenceProof exist = 1 [json_name = "exist"]; + */ + @java.lang.Override + public boolean hasExist() { + return proofCase_ == 1; + } + /** + * .cosmos.ics23.v1.ExistenceProof exist = 1 [json_name = "exist"]; + */ + @java.lang.Override + public com.cosmos.ics23.v1.ExistenceProof getExist() { + if (proofCase_ == 1) { + return (com.cosmos.ics23.v1.ExistenceProof) proof_; + } + return com.cosmos.ics23.v1.ExistenceProof.getDefaultInstance(); + } + /** + * .cosmos.ics23.v1.ExistenceProof exist = 1 [json_name = "exist"]; + */ + private void setExist(com.cosmos.ics23.v1.ExistenceProof value) { + value.getClass(); + proof_ = value; + proofCase_ = 1; + } + /** + * .cosmos.ics23.v1.ExistenceProof exist = 1 [json_name = "exist"]; + */ + private void mergeExist(com.cosmos.ics23.v1.ExistenceProof value) { + value.getClass(); + if (proofCase_ == 1 && + proof_ != com.cosmos.ics23.v1.ExistenceProof.getDefaultInstance()) { + proof_ = com.cosmos.ics23.v1.ExistenceProof.newBuilder((com.cosmos.ics23.v1.ExistenceProof) proof_) + .mergeFrom(value).buildPartial(); + } else { + proof_ = value; + } + proofCase_ = 1; + } + /** + * .cosmos.ics23.v1.ExistenceProof exist = 1 [json_name = "exist"]; + */ + private void clearExist() { + if (proofCase_ == 1) { + proofCase_ = 0; + proof_ = null; + } + } + + public static final int NONEXIST_FIELD_NUMBER = 2; + /** + * .cosmos.ics23.v1.NonExistenceProof nonexist = 2 [json_name = "nonexist"]; + */ + @java.lang.Override + public boolean hasNonexist() { + return proofCase_ == 2; + } + /** + * .cosmos.ics23.v1.NonExistenceProof nonexist = 2 [json_name = "nonexist"]; + */ + @java.lang.Override + public com.cosmos.ics23.v1.NonExistenceProof getNonexist() { + if (proofCase_ == 2) { + return (com.cosmos.ics23.v1.NonExistenceProof) proof_; + } + return com.cosmos.ics23.v1.NonExistenceProof.getDefaultInstance(); + } + /** + * .cosmos.ics23.v1.NonExistenceProof nonexist = 2 [json_name = "nonexist"]; + */ + private void setNonexist(com.cosmos.ics23.v1.NonExistenceProof value) { + value.getClass(); + proof_ = value; + proofCase_ = 2; + } + /** + * .cosmos.ics23.v1.NonExistenceProof nonexist = 2 [json_name = "nonexist"]; + */ + private void mergeNonexist(com.cosmos.ics23.v1.NonExistenceProof value) { + value.getClass(); + if (proofCase_ == 2 && + proof_ != com.cosmos.ics23.v1.NonExistenceProof.getDefaultInstance()) { + proof_ = com.cosmos.ics23.v1.NonExistenceProof.newBuilder((com.cosmos.ics23.v1.NonExistenceProof) proof_) + .mergeFrom(value).buildPartial(); + } else { + proof_ = value; + } + proofCase_ = 2; + } + /** + * .cosmos.ics23.v1.NonExistenceProof nonexist = 2 [json_name = "nonexist"]; + */ + private void clearNonexist() { + if (proofCase_ == 2) { + proofCase_ = 0; + proof_ = null; + } + } + + public static final int BATCH_FIELD_NUMBER = 3; + /** + * .cosmos.ics23.v1.BatchProof batch = 3 [json_name = "batch"]; + */ + @java.lang.Override + public boolean hasBatch() { + return proofCase_ == 3; + } + /** + * .cosmos.ics23.v1.BatchProof batch = 3 [json_name = "batch"]; + */ + @java.lang.Override + public com.cosmos.ics23.v1.BatchProof getBatch() { + if (proofCase_ == 3) { + return (com.cosmos.ics23.v1.BatchProof) proof_; + } + return com.cosmos.ics23.v1.BatchProof.getDefaultInstance(); + } + /** + * .cosmos.ics23.v1.BatchProof batch = 3 [json_name = "batch"]; + */ + private void setBatch(com.cosmos.ics23.v1.BatchProof value) { + value.getClass(); + proof_ = value; + proofCase_ = 3; + } + /** + * .cosmos.ics23.v1.BatchProof batch = 3 [json_name = "batch"]; + */ + private void mergeBatch(com.cosmos.ics23.v1.BatchProof value) { + value.getClass(); + if (proofCase_ == 3 && + proof_ != com.cosmos.ics23.v1.BatchProof.getDefaultInstance()) { + proof_ = com.cosmos.ics23.v1.BatchProof.newBuilder((com.cosmos.ics23.v1.BatchProof) proof_) + .mergeFrom(value).buildPartial(); + } else { + proof_ = value; + } + proofCase_ = 3; + } + /** + * .cosmos.ics23.v1.BatchProof batch = 3 [json_name = "batch"]; + */ + private void clearBatch() { + if (proofCase_ == 3) { + proofCase_ = 0; + proof_ = null; + } + } + + public static final int COMPRESSED_FIELD_NUMBER = 4; + /** + * .cosmos.ics23.v1.CompressedBatchProof compressed = 4 [json_name = "compressed"]; + */ + @java.lang.Override + public boolean hasCompressed() { + return proofCase_ == 4; + } + /** + * .cosmos.ics23.v1.CompressedBatchProof compressed = 4 [json_name = "compressed"]; + */ + @java.lang.Override + public com.cosmos.ics23.v1.CompressedBatchProof getCompressed() { + if (proofCase_ == 4) { + return (com.cosmos.ics23.v1.CompressedBatchProof) proof_; + } + return com.cosmos.ics23.v1.CompressedBatchProof.getDefaultInstance(); + } + /** + * .cosmos.ics23.v1.CompressedBatchProof compressed = 4 [json_name = "compressed"]; + */ + private void setCompressed(com.cosmos.ics23.v1.CompressedBatchProof value) { + value.getClass(); + proof_ = value; + proofCase_ = 4; + } + /** + * .cosmos.ics23.v1.CompressedBatchProof compressed = 4 [json_name = "compressed"]; + */ + private void mergeCompressed(com.cosmos.ics23.v1.CompressedBatchProof value) { + value.getClass(); + if (proofCase_ == 4 && + proof_ != com.cosmos.ics23.v1.CompressedBatchProof.getDefaultInstance()) { + proof_ = com.cosmos.ics23.v1.CompressedBatchProof.newBuilder((com.cosmos.ics23.v1.CompressedBatchProof) proof_) + .mergeFrom(value).buildPartial(); + } else { + proof_ = value; + } + proofCase_ = 4; + } + /** + * .cosmos.ics23.v1.CompressedBatchProof compressed = 4 [json_name = "compressed"]; + */ + private void clearCompressed() { + if (proofCase_ == 4) { + proofCase_ = 0; + proof_ = null; + } + } + + public static com.cosmos.ics23.v1.CommitmentProof parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.cosmos.ics23.v1.CommitmentProof parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.cosmos.ics23.v1.CommitmentProof parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.cosmos.ics23.v1.CommitmentProof parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.cosmos.ics23.v1.CommitmentProof parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.cosmos.ics23.v1.CommitmentProof parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.cosmos.ics23.v1.CommitmentProof parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.cosmos.ics23.v1.CommitmentProof parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.cosmos.ics23.v1.CommitmentProof parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.cosmos.ics23.v1.CommitmentProof parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.cosmos.ics23.v1.CommitmentProof parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.cosmos.ics23.v1.CommitmentProof parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.cosmos.ics23.v1.CommitmentProof prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+   *CommitmentProof is either an ExistenceProof or a NonExistenceProof, or a Batch of such messages
+   * 
+ * + * Protobuf type {@code cosmos.ics23.v1.CommitmentProof} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.cosmos.ics23.v1.CommitmentProof, Builder> implements + // @@protoc_insertion_point(builder_implements:cosmos.ics23.v1.CommitmentProof) + com.cosmos.ics23.v1.CommitmentProofOrBuilder { + // Construct using com.cosmos.ics23.v1.CommitmentProof.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + @java.lang.Override + public ProofCase + getProofCase() { + return instance.getProofCase(); + } + + public Builder clearProof() { + copyOnWrite(); + instance.clearProof(); + return this; + } + + + /** + * .cosmos.ics23.v1.ExistenceProof exist = 1 [json_name = "exist"]; + */ + @java.lang.Override + public boolean hasExist() { + return instance.hasExist(); + } + /** + * .cosmos.ics23.v1.ExistenceProof exist = 1 [json_name = "exist"]; + */ + @java.lang.Override + public com.cosmos.ics23.v1.ExistenceProof getExist() { + return instance.getExist(); + } + /** + * .cosmos.ics23.v1.ExistenceProof exist = 1 [json_name = "exist"]; + */ + public Builder setExist(com.cosmos.ics23.v1.ExistenceProof value) { + copyOnWrite(); + instance.setExist(value); + return this; + } + /** + * .cosmos.ics23.v1.ExistenceProof exist = 1 [json_name = "exist"]; + */ + public Builder setExist( + com.cosmos.ics23.v1.ExistenceProof.Builder builderForValue) { + copyOnWrite(); + instance.setExist(builderForValue.build()); + return this; + } + /** + * .cosmos.ics23.v1.ExistenceProof exist = 1 [json_name = "exist"]; + */ + public Builder mergeExist(com.cosmos.ics23.v1.ExistenceProof value) { + copyOnWrite(); + instance.mergeExist(value); + return this; + } + /** + * .cosmos.ics23.v1.ExistenceProof exist = 1 [json_name = "exist"]; + */ + public Builder clearExist() { + copyOnWrite(); + instance.clearExist(); + return this; + } + + /** + * .cosmos.ics23.v1.NonExistenceProof nonexist = 2 [json_name = "nonexist"]; + */ + @java.lang.Override + public boolean hasNonexist() { + return instance.hasNonexist(); + } + /** + * .cosmos.ics23.v1.NonExistenceProof nonexist = 2 [json_name = "nonexist"]; + */ + @java.lang.Override + public com.cosmos.ics23.v1.NonExistenceProof getNonexist() { + return instance.getNonexist(); + } + /** + * .cosmos.ics23.v1.NonExistenceProof nonexist = 2 [json_name = "nonexist"]; + */ + public Builder setNonexist(com.cosmos.ics23.v1.NonExistenceProof value) { + copyOnWrite(); + instance.setNonexist(value); + return this; + } + /** + * .cosmos.ics23.v1.NonExistenceProof nonexist = 2 [json_name = "nonexist"]; + */ + public Builder setNonexist( + com.cosmos.ics23.v1.NonExistenceProof.Builder builderForValue) { + copyOnWrite(); + instance.setNonexist(builderForValue.build()); + return this; + } + /** + * .cosmos.ics23.v1.NonExistenceProof nonexist = 2 [json_name = "nonexist"]; + */ + public Builder mergeNonexist(com.cosmos.ics23.v1.NonExistenceProof value) { + copyOnWrite(); + instance.mergeNonexist(value); + return this; + } + /** + * .cosmos.ics23.v1.NonExistenceProof nonexist = 2 [json_name = "nonexist"]; + */ + public Builder clearNonexist() { + copyOnWrite(); + instance.clearNonexist(); + return this; + } + + /** + * .cosmos.ics23.v1.BatchProof batch = 3 [json_name = "batch"]; + */ + @java.lang.Override + public boolean hasBatch() { + return instance.hasBatch(); + } + /** + * .cosmos.ics23.v1.BatchProof batch = 3 [json_name = "batch"]; + */ + @java.lang.Override + public com.cosmos.ics23.v1.BatchProof getBatch() { + return instance.getBatch(); + } + /** + * .cosmos.ics23.v1.BatchProof batch = 3 [json_name = "batch"]; + */ + public Builder setBatch(com.cosmos.ics23.v1.BatchProof value) { + copyOnWrite(); + instance.setBatch(value); + return this; + } + /** + * .cosmos.ics23.v1.BatchProof batch = 3 [json_name = "batch"]; + */ + public Builder setBatch( + com.cosmos.ics23.v1.BatchProof.Builder builderForValue) { + copyOnWrite(); + instance.setBatch(builderForValue.build()); + return this; + } + /** + * .cosmos.ics23.v1.BatchProof batch = 3 [json_name = "batch"]; + */ + public Builder mergeBatch(com.cosmos.ics23.v1.BatchProof value) { + copyOnWrite(); + instance.mergeBatch(value); + return this; + } + /** + * .cosmos.ics23.v1.BatchProof batch = 3 [json_name = "batch"]; + */ + public Builder clearBatch() { + copyOnWrite(); + instance.clearBatch(); + return this; + } + + /** + * .cosmos.ics23.v1.CompressedBatchProof compressed = 4 [json_name = "compressed"]; + */ + @java.lang.Override + public boolean hasCompressed() { + return instance.hasCompressed(); + } + /** + * .cosmos.ics23.v1.CompressedBatchProof compressed = 4 [json_name = "compressed"]; + */ + @java.lang.Override + public com.cosmos.ics23.v1.CompressedBatchProof getCompressed() { + return instance.getCompressed(); + } + /** + * .cosmos.ics23.v1.CompressedBatchProof compressed = 4 [json_name = "compressed"]; + */ + public Builder setCompressed(com.cosmos.ics23.v1.CompressedBatchProof value) { + copyOnWrite(); + instance.setCompressed(value); + return this; + } + /** + * .cosmos.ics23.v1.CompressedBatchProof compressed = 4 [json_name = "compressed"]; + */ + public Builder setCompressed( + com.cosmos.ics23.v1.CompressedBatchProof.Builder builderForValue) { + copyOnWrite(); + instance.setCompressed(builderForValue.build()); + return this; + } + /** + * .cosmos.ics23.v1.CompressedBatchProof compressed = 4 [json_name = "compressed"]; + */ + public Builder mergeCompressed(com.cosmos.ics23.v1.CompressedBatchProof value) { + copyOnWrite(); + instance.mergeCompressed(value); + return this; + } + /** + * .cosmos.ics23.v1.CompressedBatchProof compressed = 4 [json_name = "compressed"]; + */ + public Builder clearCompressed() { + copyOnWrite(); + instance.clearCompressed(); + return this; + } + + // @@protoc_insertion_point(builder_scope:cosmos.ics23.v1.CommitmentProof) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.cosmos.ics23.v1.CommitmentProof(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "proof_", + "proofCase_", + com.cosmos.ics23.v1.ExistenceProof.class, + com.cosmos.ics23.v1.NonExistenceProof.class, + com.cosmos.ics23.v1.BatchProof.class, + com.cosmos.ics23.v1.CompressedBatchProof.class, + }; + java.lang.String info = + "\u0000\u0004\u0001\u0000\u0001\u0004\u0004\u0000\u0000\u0000\u0001<\u0000\u0002<" + + "\u0000\u0003<\u0000\u0004<\u0000"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.cosmos.ics23.v1.CommitmentProof.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:cosmos.ics23.v1.CommitmentProof) + private static final com.cosmos.ics23.v1.CommitmentProof DEFAULT_INSTANCE; + static { + CommitmentProof defaultInstance = new CommitmentProof(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + CommitmentProof.class, defaultInstance); + } + + public static com.cosmos.ics23.v1.CommitmentProof getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/CommitmentProofOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/CommitmentProofOrBuilder.java new file mode 100644 index 000000000..49bfb5fe1 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/CommitmentProofOrBuilder.java @@ -0,0 +1,55 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: cosmos/ics23/v1/proofs.proto + +package com.cosmos.ics23.v1; + +public interface CommitmentProofOrBuilder extends + // @@protoc_insertion_point(interface_extends:cosmos.ics23.v1.CommitmentProof) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * .cosmos.ics23.v1.ExistenceProof exist = 1 [json_name = "exist"]; + * @return Whether the exist field is set. + */ + boolean hasExist(); + /** + * .cosmos.ics23.v1.ExistenceProof exist = 1 [json_name = "exist"]; + * @return The exist. + */ + com.cosmos.ics23.v1.ExistenceProof getExist(); + + /** + * .cosmos.ics23.v1.NonExistenceProof nonexist = 2 [json_name = "nonexist"]; + * @return Whether the nonexist field is set. + */ + boolean hasNonexist(); + /** + * .cosmos.ics23.v1.NonExistenceProof nonexist = 2 [json_name = "nonexist"]; + * @return The nonexist. + */ + com.cosmos.ics23.v1.NonExistenceProof getNonexist(); + + /** + * .cosmos.ics23.v1.BatchProof batch = 3 [json_name = "batch"]; + * @return Whether the batch field is set. + */ + boolean hasBatch(); + /** + * .cosmos.ics23.v1.BatchProof batch = 3 [json_name = "batch"]; + * @return The batch. + */ + com.cosmos.ics23.v1.BatchProof getBatch(); + + /** + * .cosmos.ics23.v1.CompressedBatchProof compressed = 4 [json_name = "compressed"]; + * @return Whether the compressed field is set. + */ + boolean hasCompressed(); + /** + * .cosmos.ics23.v1.CompressedBatchProof compressed = 4 [json_name = "compressed"]; + * @return The compressed. + */ + com.cosmos.ics23.v1.CompressedBatchProof getCompressed(); + + public com.cosmos.ics23.v1.CommitmentProof.ProofCase getProofCase(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/CompressedBatchEntry.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/CompressedBatchEntry.java new file mode 100644 index 000000000..07532b53d --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/CompressedBatchEntry.java @@ -0,0 +1,447 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: cosmos/ics23/v1/proofs.proto + +package com.cosmos.ics23.v1; + +/** + *
+ * Use BatchEntry not CommitmentProof, to avoid recursion
+ * 
+ * + * Protobuf type {@code cosmos.ics23.v1.CompressedBatchEntry} + */ +public final class CompressedBatchEntry extends + com.google.protobuf.GeneratedMessageLite< + CompressedBatchEntry, CompressedBatchEntry.Builder> implements + // @@protoc_insertion_point(message_implements:cosmos.ics23.v1.CompressedBatchEntry) + CompressedBatchEntryOrBuilder { + private CompressedBatchEntry() { + } + private int proofCase_ = 0; + private java.lang.Object proof_; + public enum ProofCase { + EXIST(1), + NONEXIST(2), + PROOF_NOT_SET(0); + private final int value; + private ProofCase(int value) { + this.value = value; + } + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ProofCase valueOf(int value) { + return forNumber(value); + } + + public static ProofCase forNumber(int value) { + switch (value) { + case 1: return EXIST; + case 2: return NONEXIST; + case 0: return PROOF_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + @java.lang.Override + public ProofCase + getProofCase() { + return ProofCase.forNumber( + proofCase_); + } + + private void clearProof() { + proofCase_ = 0; + proof_ = null; + } + + public static final int EXIST_FIELD_NUMBER = 1; + /** + * .cosmos.ics23.v1.CompressedExistenceProof exist = 1 [json_name = "exist"]; + */ + @java.lang.Override + public boolean hasExist() { + return proofCase_ == 1; + } + /** + * .cosmos.ics23.v1.CompressedExistenceProof exist = 1 [json_name = "exist"]; + */ + @java.lang.Override + public com.cosmos.ics23.v1.CompressedExistenceProof getExist() { + if (proofCase_ == 1) { + return (com.cosmos.ics23.v1.CompressedExistenceProof) proof_; + } + return com.cosmos.ics23.v1.CompressedExistenceProof.getDefaultInstance(); + } + /** + * .cosmos.ics23.v1.CompressedExistenceProof exist = 1 [json_name = "exist"]; + */ + private void setExist(com.cosmos.ics23.v1.CompressedExistenceProof value) { + value.getClass(); + proof_ = value; + proofCase_ = 1; + } + /** + * .cosmos.ics23.v1.CompressedExistenceProof exist = 1 [json_name = "exist"]; + */ + private void mergeExist(com.cosmos.ics23.v1.CompressedExistenceProof value) { + value.getClass(); + if (proofCase_ == 1 && + proof_ != com.cosmos.ics23.v1.CompressedExistenceProof.getDefaultInstance()) { + proof_ = com.cosmos.ics23.v1.CompressedExistenceProof.newBuilder((com.cosmos.ics23.v1.CompressedExistenceProof) proof_) + .mergeFrom(value).buildPartial(); + } else { + proof_ = value; + } + proofCase_ = 1; + } + /** + * .cosmos.ics23.v1.CompressedExistenceProof exist = 1 [json_name = "exist"]; + */ + private void clearExist() { + if (proofCase_ == 1) { + proofCase_ = 0; + proof_ = null; + } + } + + public static final int NONEXIST_FIELD_NUMBER = 2; + /** + * .cosmos.ics23.v1.CompressedNonExistenceProof nonexist = 2 [json_name = "nonexist"]; + */ + @java.lang.Override + public boolean hasNonexist() { + return proofCase_ == 2; + } + /** + * .cosmos.ics23.v1.CompressedNonExistenceProof nonexist = 2 [json_name = "nonexist"]; + */ + @java.lang.Override + public com.cosmos.ics23.v1.CompressedNonExistenceProof getNonexist() { + if (proofCase_ == 2) { + return (com.cosmos.ics23.v1.CompressedNonExistenceProof) proof_; + } + return com.cosmos.ics23.v1.CompressedNonExistenceProof.getDefaultInstance(); + } + /** + * .cosmos.ics23.v1.CompressedNonExistenceProof nonexist = 2 [json_name = "nonexist"]; + */ + private void setNonexist(com.cosmos.ics23.v1.CompressedNonExistenceProof value) { + value.getClass(); + proof_ = value; + proofCase_ = 2; + } + /** + * .cosmos.ics23.v1.CompressedNonExistenceProof nonexist = 2 [json_name = "nonexist"]; + */ + private void mergeNonexist(com.cosmos.ics23.v1.CompressedNonExistenceProof value) { + value.getClass(); + if (proofCase_ == 2 && + proof_ != com.cosmos.ics23.v1.CompressedNonExistenceProof.getDefaultInstance()) { + proof_ = com.cosmos.ics23.v1.CompressedNonExistenceProof.newBuilder((com.cosmos.ics23.v1.CompressedNonExistenceProof) proof_) + .mergeFrom(value).buildPartial(); + } else { + proof_ = value; + } + proofCase_ = 2; + } + /** + * .cosmos.ics23.v1.CompressedNonExistenceProof nonexist = 2 [json_name = "nonexist"]; + */ + private void clearNonexist() { + if (proofCase_ == 2) { + proofCase_ = 0; + proof_ = null; + } + } + + public static com.cosmos.ics23.v1.CompressedBatchEntry parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.cosmos.ics23.v1.CompressedBatchEntry parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.cosmos.ics23.v1.CompressedBatchEntry parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.cosmos.ics23.v1.CompressedBatchEntry parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.cosmos.ics23.v1.CompressedBatchEntry parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.cosmos.ics23.v1.CompressedBatchEntry parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.cosmos.ics23.v1.CompressedBatchEntry parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.cosmos.ics23.v1.CompressedBatchEntry parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.cosmos.ics23.v1.CompressedBatchEntry parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.cosmos.ics23.v1.CompressedBatchEntry parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.cosmos.ics23.v1.CompressedBatchEntry parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.cosmos.ics23.v1.CompressedBatchEntry parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.cosmos.ics23.v1.CompressedBatchEntry prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+   * Use BatchEntry not CommitmentProof, to avoid recursion
+   * 
+ * + * Protobuf type {@code cosmos.ics23.v1.CompressedBatchEntry} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.cosmos.ics23.v1.CompressedBatchEntry, Builder> implements + // @@protoc_insertion_point(builder_implements:cosmos.ics23.v1.CompressedBatchEntry) + com.cosmos.ics23.v1.CompressedBatchEntryOrBuilder { + // Construct using com.cosmos.ics23.v1.CompressedBatchEntry.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + @java.lang.Override + public ProofCase + getProofCase() { + return instance.getProofCase(); + } + + public Builder clearProof() { + copyOnWrite(); + instance.clearProof(); + return this; + } + + + /** + * .cosmos.ics23.v1.CompressedExistenceProof exist = 1 [json_name = "exist"]; + */ + @java.lang.Override + public boolean hasExist() { + return instance.hasExist(); + } + /** + * .cosmos.ics23.v1.CompressedExistenceProof exist = 1 [json_name = "exist"]; + */ + @java.lang.Override + public com.cosmos.ics23.v1.CompressedExistenceProof getExist() { + return instance.getExist(); + } + /** + * .cosmos.ics23.v1.CompressedExistenceProof exist = 1 [json_name = "exist"]; + */ + public Builder setExist(com.cosmos.ics23.v1.CompressedExistenceProof value) { + copyOnWrite(); + instance.setExist(value); + return this; + } + /** + * .cosmos.ics23.v1.CompressedExistenceProof exist = 1 [json_name = "exist"]; + */ + public Builder setExist( + com.cosmos.ics23.v1.CompressedExistenceProof.Builder builderForValue) { + copyOnWrite(); + instance.setExist(builderForValue.build()); + return this; + } + /** + * .cosmos.ics23.v1.CompressedExistenceProof exist = 1 [json_name = "exist"]; + */ + public Builder mergeExist(com.cosmos.ics23.v1.CompressedExistenceProof value) { + copyOnWrite(); + instance.mergeExist(value); + return this; + } + /** + * .cosmos.ics23.v1.CompressedExistenceProof exist = 1 [json_name = "exist"]; + */ + public Builder clearExist() { + copyOnWrite(); + instance.clearExist(); + return this; + } + + /** + * .cosmos.ics23.v1.CompressedNonExistenceProof nonexist = 2 [json_name = "nonexist"]; + */ + @java.lang.Override + public boolean hasNonexist() { + return instance.hasNonexist(); + } + /** + * .cosmos.ics23.v1.CompressedNonExistenceProof nonexist = 2 [json_name = "nonexist"]; + */ + @java.lang.Override + public com.cosmos.ics23.v1.CompressedNonExistenceProof getNonexist() { + return instance.getNonexist(); + } + /** + * .cosmos.ics23.v1.CompressedNonExistenceProof nonexist = 2 [json_name = "nonexist"]; + */ + public Builder setNonexist(com.cosmos.ics23.v1.CompressedNonExistenceProof value) { + copyOnWrite(); + instance.setNonexist(value); + return this; + } + /** + * .cosmos.ics23.v1.CompressedNonExistenceProof nonexist = 2 [json_name = "nonexist"]; + */ + public Builder setNonexist( + com.cosmos.ics23.v1.CompressedNonExistenceProof.Builder builderForValue) { + copyOnWrite(); + instance.setNonexist(builderForValue.build()); + return this; + } + /** + * .cosmos.ics23.v1.CompressedNonExistenceProof nonexist = 2 [json_name = "nonexist"]; + */ + public Builder mergeNonexist(com.cosmos.ics23.v1.CompressedNonExistenceProof value) { + copyOnWrite(); + instance.mergeNonexist(value); + return this; + } + /** + * .cosmos.ics23.v1.CompressedNonExistenceProof nonexist = 2 [json_name = "nonexist"]; + */ + public Builder clearNonexist() { + copyOnWrite(); + instance.clearNonexist(); + return this; + } + + // @@protoc_insertion_point(builder_scope:cosmos.ics23.v1.CompressedBatchEntry) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.cosmos.ics23.v1.CompressedBatchEntry(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "proof_", + "proofCase_", + com.cosmos.ics23.v1.CompressedExistenceProof.class, + com.cosmos.ics23.v1.CompressedNonExistenceProof.class, + }; + java.lang.String info = + "\u0000\u0002\u0001\u0000\u0001\u0002\u0002\u0000\u0000\u0000\u0001<\u0000\u0002<" + + "\u0000"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.cosmos.ics23.v1.CompressedBatchEntry.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:cosmos.ics23.v1.CompressedBatchEntry) + private static final com.cosmos.ics23.v1.CompressedBatchEntry DEFAULT_INSTANCE; + static { + CompressedBatchEntry defaultInstance = new CompressedBatchEntry(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + CompressedBatchEntry.class, defaultInstance); + } + + public static com.cosmos.ics23.v1.CompressedBatchEntry getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/CompressedBatchEntryOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/CompressedBatchEntryOrBuilder.java new file mode 100644 index 000000000..93a92cd25 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/CompressedBatchEntryOrBuilder.java @@ -0,0 +1,33 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: cosmos/ics23/v1/proofs.proto + +package com.cosmos.ics23.v1; + +public interface CompressedBatchEntryOrBuilder extends + // @@protoc_insertion_point(interface_extends:cosmos.ics23.v1.CompressedBatchEntry) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * .cosmos.ics23.v1.CompressedExistenceProof exist = 1 [json_name = "exist"]; + * @return Whether the exist field is set. + */ + boolean hasExist(); + /** + * .cosmos.ics23.v1.CompressedExistenceProof exist = 1 [json_name = "exist"]; + * @return The exist. + */ + com.cosmos.ics23.v1.CompressedExistenceProof getExist(); + + /** + * .cosmos.ics23.v1.CompressedNonExistenceProof nonexist = 2 [json_name = "nonexist"]; + * @return Whether the nonexist field is set. + */ + boolean hasNonexist(); + /** + * .cosmos.ics23.v1.CompressedNonExistenceProof nonexist = 2 [json_name = "nonexist"]; + * @return The nonexist. + */ + com.cosmos.ics23.v1.CompressedNonExistenceProof getNonexist(); + + public com.cosmos.ics23.v1.CompressedBatchEntry.ProofCase getProofCase(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/CompressedBatchProof.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/CompressedBatchProof.java new file mode 100644 index 000000000..5453c04ea --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/CompressedBatchProof.java @@ -0,0 +1,582 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: cosmos/ics23/v1/proofs.proto + +package com.cosmos.ics23.v1; + +/** + * Protobuf type {@code cosmos.ics23.v1.CompressedBatchProof} + */ +public final class CompressedBatchProof extends + com.google.protobuf.GeneratedMessageLite< + CompressedBatchProof, CompressedBatchProof.Builder> implements + // @@protoc_insertion_point(message_implements:cosmos.ics23.v1.CompressedBatchProof) + CompressedBatchProofOrBuilder { + private CompressedBatchProof() { + entries_ = emptyProtobufList(); + lookupInners_ = emptyProtobufList(); + } + public static final int ENTRIES_FIELD_NUMBER = 1; + private com.google.protobuf.Internal.ProtobufList entries_; + /** + * repeated .cosmos.ics23.v1.CompressedBatchEntry entries = 1 [json_name = "entries"]; + */ + @java.lang.Override + public java.util.List getEntriesList() { + return entries_; + } + /** + * repeated .cosmos.ics23.v1.CompressedBatchEntry entries = 1 [json_name = "entries"]; + */ + public java.util.List + getEntriesOrBuilderList() { + return entries_; + } + /** + * repeated .cosmos.ics23.v1.CompressedBatchEntry entries = 1 [json_name = "entries"]; + */ + @java.lang.Override + public int getEntriesCount() { + return entries_.size(); + } + /** + * repeated .cosmos.ics23.v1.CompressedBatchEntry entries = 1 [json_name = "entries"]; + */ + @java.lang.Override + public com.cosmos.ics23.v1.CompressedBatchEntry getEntries(int index) { + return entries_.get(index); + } + /** + * repeated .cosmos.ics23.v1.CompressedBatchEntry entries = 1 [json_name = "entries"]; + */ + public com.cosmos.ics23.v1.CompressedBatchEntryOrBuilder getEntriesOrBuilder( + int index) { + return entries_.get(index); + } + private void ensureEntriesIsMutable() { + com.google.protobuf.Internal.ProtobufList tmp = entries_; + if (!tmp.isModifiable()) { + entries_ = + com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp); + } + } + + /** + * repeated .cosmos.ics23.v1.CompressedBatchEntry entries = 1 [json_name = "entries"]; + */ + private void setEntries( + int index, com.cosmos.ics23.v1.CompressedBatchEntry value) { + value.getClass(); + ensureEntriesIsMutable(); + entries_.set(index, value); + } + /** + * repeated .cosmos.ics23.v1.CompressedBatchEntry entries = 1 [json_name = "entries"]; + */ + private void addEntries(com.cosmos.ics23.v1.CompressedBatchEntry value) { + value.getClass(); + ensureEntriesIsMutable(); + entries_.add(value); + } + /** + * repeated .cosmos.ics23.v1.CompressedBatchEntry entries = 1 [json_name = "entries"]; + */ + private void addEntries( + int index, com.cosmos.ics23.v1.CompressedBatchEntry value) { + value.getClass(); + ensureEntriesIsMutable(); + entries_.add(index, value); + } + /** + * repeated .cosmos.ics23.v1.CompressedBatchEntry entries = 1 [json_name = "entries"]; + */ + private void addAllEntries( + java.lang.Iterable values) { + ensureEntriesIsMutable(); + com.google.protobuf.AbstractMessageLite.addAll( + values, entries_); + } + /** + * repeated .cosmos.ics23.v1.CompressedBatchEntry entries = 1 [json_name = "entries"]; + */ + private void clearEntries() { + entries_ = emptyProtobufList(); + } + /** + * repeated .cosmos.ics23.v1.CompressedBatchEntry entries = 1 [json_name = "entries"]; + */ + private void removeEntries(int index) { + ensureEntriesIsMutable(); + entries_.remove(index); + } + + public static final int LOOKUP_INNERS_FIELD_NUMBER = 2; + private com.google.protobuf.Internal.ProtobufList lookupInners_; + /** + * repeated .cosmos.ics23.v1.InnerOp lookup_inners = 2 [json_name = "lookupInners"]; + */ + @java.lang.Override + public java.util.List getLookupInnersList() { + return lookupInners_; + } + /** + * repeated .cosmos.ics23.v1.InnerOp lookup_inners = 2 [json_name = "lookupInners"]; + */ + public java.util.List + getLookupInnersOrBuilderList() { + return lookupInners_; + } + /** + * repeated .cosmos.ics23.v1.InnerOp lookup_inners = 2 [json_name = "lookupInners"]; + */ + @java.lang.Override + public int getLookupInnersCount() { + return lookupInners_.size(); + } + /** + * repeated .cosmos.ics23.v1.InnerOp lookup_inners = 2 [json_name = "lookupInners"]; + */ + @java.lang.Override + public com.cosmos.ics23.v1.InnerOp getLookupInners(int index) { + return lookupInners_.get(index); + } + /** + * repeated .cosmos.ics23.v1.InnerOp lookup_inners = 2 [json_name = "lookupInners"]; + */ + public com.cosmos.ics23.v1.InnerOpOrBuilder getLookupInnersOrBuilder( + int index) { + return lookupInners_.get(index); + } + private void ensureLookupInnersIsMutable() { + com.google.protobuf.Internal.ProtobufList tmp = lookupInners_; + if (!tmp.isModifiable()) { + lookupInners_ = + com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp); + } + } + + /** + * repeated .cosmos.ics23.v1.InnerOp lookup_inners = 2 [json_name = "lookupInners"]; + */ + private void setLookupInners( + int index, com.cosmos.ics23.v1.InnerOp value) { + value.getClass(); + ensureLookupInnersIsMutable(); + lookupInners_.set(index, value); + } + /** + * repeated .cosmos.ics23.v1.InnerOp lookup_inners = 2 [json_name = "lookupInners"]; + */ + private void addLookupInners(com.cosmos.ics23.v1.InnerOp value) { + value.getClass(); + ensureLookupInnersIsMutable(); + lookupInners_.add(value); + } + /** + * repeated .cosmos.ics23.v1.InnerOp lookup_inners = 2 [json_name = "lookupInners"]; + */ + private void addLookupInners( + int index, com.cosmos.ics23.v1.InnerOp value) { + value.getClass(); + ensureLookupInnersIsMutable(); + lookupInners_.add(index, value); + } + /** + * repeated .cosmos.ics23.v1.InnerOp lookup_inners = 2 [json_name = "lookupInners"]; + */ + private void addAllLookupInners( + java.lang.Iterable values) { + ensureLookupInnersIsMutable(); + com.google.protobuf.AbstractMessageLite.addAll( + values, lookupInners_); + } + /** + * repeated .cosmos.ics23.v1.InnerOp lookup_inners = 2 [json_name = "lookupInners"]; + */ + private void clearLookupInners() { + lookupInners_ = emptyProtobufList(); + } + /** + * repeated .cosmos.ics23.v1.InnerOp lookup_inners = 2 [json_name = "lookupInners"]; + */ + private void removeLookupInners(int index) { + ensureLookupInnersIsMutable(); + lookupInners_.remove(index); + } + + public static com.cosmos.ics23.v1.CompressedBatchProof parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.cosmos.ics23.v1.CompressedBatchProof parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.cosmos.ics23.v1.CompressedBatchProof parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.cosmos.ics23.v1.CompressedBatchProof parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.cosmos.ics23.v1.CompressedBatchProof parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.cosmos.ics23.v1.CompressedBatchProof parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.cosmos.ics23.v1.CompressedBatchProof parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.cosmos.ics23.v1.CompressedBatchProof parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.cosmos.ics23.v1.CompressedBatchProof parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.cosmos.ics23.v1.CompressedBatchProof parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.cosmos.ics23.v1.CompressedBatchProof parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.cosmos.ics23.v1.CompressedBatchProof parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.cosmos.ics23.v1.CompressedBatchProof prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + * Protobuf type {@code cosmos.ics23.v1.CompressedBatchProof} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.cosmos.ics23.v1.CompressedBatchProof, Builder> implements + // @@protoc_insertion_point(builder_implements:cosmos.ics23.v1.CompressedBatchProof) + com.cosmos.ics23.v1.CompressedBatchProofOrBuilder { + // Construct using com.cosmos.ics23.v1.CompressedBatchProof.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * repeated .cosmos.ics23.v1.CompressedBatchEntry entries = 1 [json_name = "entries"]; + */ + @java.lang.Override + public java.util.List getEntriesList() { + return java.util.Collections.unmodifiableList( + instance.getEntriesList()); + } + /** + * repeated .cosmos.ics23.v1.CompressedBatchEntry entries = 1 [json_name = "entries"]; + */ + @java.lang.Override + public int getEntriesCount() { + return instance.getEntriesCount(); + }/** + * repeated .cosmos.ics23.v1.CompressedBatchEntry entries = 1 [json_name = "entries"]; + */ + @java.lang.Override + public com.cosmos.ics23.v1.CompressedBatchEntry getEntries(int index) { + return instance.getEntries(index); + } + /** + * repeated .cosmos.ics23.v1.CompressedBatchEntry entries = 1 [json_name = "entries"]; + */ + public Builder setEntries( + int index, com.cosmos.ics23.v1.CompressedBatchEntry value) { + copyOnWrite(); + instance.setEntries(index, value); + return this; + } + /** + * repeated .cosmos.ics23.v1.CompressedBatchEntry entries = 1 [json_name = "entries"]; + */ + public Builder setEntries( + int index, com.cosmos.ics23.v1.CompressedBatchEntry.Builder builderForValue) { + copyOnWrite(); + instance.setEntries(index, + builderForValue.build()); + return this; + } + /** + * repeated .cosmos.ics23.v1.CompressedBatchEntry entries = 1 [json_name = "entries"]; + */ + public Builder addEntries(com.cosmos.ics23.v1.CompressedBatchEntry value) { + copyOnWrite(); + instance.addEntries(value); + return this; + } + /** + * repeated .cosmos.ics23.v1.CompressedBatchEntry entries = 1 [json_name = "entries"]; + */ + public Builder addEntries( + int index, com.cosmos.ics23.v1.CompressedBatchEntry value) { + copyOnWrite(); + instance.addEntries(index, value); + return this; + } + /** + * repeated .cosmos.ics23.v1.CompressedBatchEntry entries = 1 [json_name = "entries"]; + */ + public Builder addEntries( + com.cosmos.ics23.v1.CompressedBatchEntry.Builder builderForValue) { + copyOnWrite(); + instance.addEntries(builderForValue.build()); + return this; + } + /** + * repeated .cosmos.ics23.v1.CompressedBatchEntry entries = 1 [json_name = "entries"]; + */ + public Builder addEntries( + int index, com.cosmos.ics23.v1.CompressedBatchEntry.Builder builderForValue) { + copyOnWrite(); + instance.addEntries(index, + builderForValue.build()); + return this; + } + /** + * repeated .cosmos.ics23.v1.CompressedBatchEntry entries = 1 [json_name = "entries"]; + */ + public Builder addAllEntries( + java.lang.Iterable values) { + copyOnWrite(); + instance.addAllEntries(values); + return this; + } + /** + * repeated .cosmos.ics23.v1.CompressedBatchEntry entries = 1 [json_name = "entries"]; + */ + public Builder clearEntries() { + copyOnWrite(); + instance.clearEntries(); + return this; + } + /** + * repeated .cosmos.ics23.v1.CompressedBatchEntry entries = 1 [json_name = "entries"]; + */ + public Builder removeEntries(int index) { + copyOnWrite(); + instance.removeEntries(index); + return this; + } + + /** + * repeated .cosmos.ics23.v1.InnerOp lookup_inners = 2 [json_name = "lookupInners"]; + */ + @java.lang.Override + public java.util.List getLookupInnersList() { + return java.util.Collections.unmodifiableList( + instance.getLookupInnersList()); + } + /** + * repeated .cosmos.ics23.v1.InnerOp lookup_inners = 2 [json_name = "lookupInners"]; + */ + @java.lang.Override + public int getLookupInnersCount() { + return instance.getLookupInnersCount(); + }/** + * repeated .cosmos.ics23.v1.InnerOp lookup_inners = 2 [json_name = "lookupInners"]; + */ + @java.lang.Override + public com.cosmos.ics23.v1.InnerOp getLookupInners(int index) { + return instance.getLookupInners(index); + } + /** + * repeated .cosmos.ics23.v1.InnerOp lookup_inners = 2 [json_name = "lookupInners"]; + */ + public Builder setLookupInners( + int index, com.cosmos.ics23.v1.InnerOp value) { + copyOnWrite(); + instance.setLookupInners(index, value); + return this; + } + /** + * repeated .cosmos.ics23.v1.InnerOp lookup_inners = 2 [json_name = "lookupInners"]; + */ + public Builder setLookupInners( + int index, com.cosmos.ics23.v1.InnerOp.Builder builderForValue) { + copyOnWrite(); + instance.setLookupInners(index, + builderForValue.build()); + return this; + } + /** + * repeated .cosmos.ics23.v1.InnerOp lookup_inners = 2 [json_name = "lookupInners"]; + */ + public Builder addLookupInners(com.cosmos.ics23.v1.InnerOp value) { + copyOnWrite(); + instance.addLookupInners(value); + return this; + } + /** + * repeated .cosmos.ics23.v1.InnerOp lookup_inners = 2 [json_name = "lookupInners"]; + */ + public Builder addLookupInners( + int index, com.cosmos.ics23.v1.InnerOp value) { + copyOnWrite(); + instance.addLookupInners(index, value); + return this; + } + /** + * repeated .cosmos.ics23.v1.InnerOp lookup_inners = 2 [json_name = "lookupInners"]; + */ + public Builder addLookupInners( + com.cosmos.ics23.v1.InnerOp.Builder builderForValue) { + copyOnWrite(); + instance.addLookupInners(builderForValue.build()); + return this; + } + /** + * repeated .cosmos.ics23.v1.InnerOp lookup_inners = 2 [json_name = "lookupInners"]; + */ + public Builder addLookupInners( + int index, com.cosmos.ics23.v1.InnerOp.Builder builderForValue) { + copyOnWrite(); + instance.addLookupInners(index, + builderForValue.build()); + return this; + } + /** + * repeated .cosmos.ics23.v1.InnerOp lookup_inners = 2 [json_name = "lookupInners"]; + */ + public Builder addAllLookupInners( + java.lang.Iterable values) { + copyOnWrite(); + instance.addAllLookupInners(values); + return this; + } + /** + * repeated .cosmos.ics23.v1.InnerOp lookup_inners = 2 [json_name = "lookupInners"]; + */ + public Builder clearLookupInners() { + copyOnWrite(); + instance.clearLookupInners(); + return this; + } + /** + * repeated .cosmos.ics23.v1.InnerOp lookup_inners = 2 [json_name = "lookupInners"]; + */ + public Builder removeLookupInners(int index) { + copyOnWrite(); + instance.removeLookupInners(index); + return this; + } + + // @@protoc_insertion_point(builder_scope:cosmos.ics23.v1.CompressedBatchProof) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.cosmos.ics23.v1.CompressedBatchProof(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "entries_", + com.cosmos.ics23.v1.CompressedBatchEntry.class, + "lookupInners_", + com.cosmos.ics23.v1.InnerOp.class, + }; + java.lang.String info = + "\u0000\u0002\u0000\u0000\u0001\u0002\u0002\u0000\u0002\u0000\u0001\u001b\u0002\u001b" + + ""; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.cosmos.ics23.v1.CompressedBatchProof.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:cosmos.ics23.v1.CompressedBatchProof) + private static final com.cosmos.ics23.v1.CompressedBatchProof DEFAULT_INSTANCE; + static { + CompressedBatchProof defaultInstance = new CompressedBatchProof(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + CompressedBatchProof.class, defaultInstance); + } + + public static com.cosmos.ics23.v1.CompressedBatchProof getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/CompressedBatchProofOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/CompressedBatchProofOrBuilder.java new file mode 100644 index 000000000..b886201c9 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/CompressedBatchProofOrBuilder.java @@ -0,0 +1,37 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: cosmos/ics23/v1/proofs.proto + +package com.cosmos.ics23.v1; + +public interface CompressedBatchProofOrBuilder extends + // @@protoc_insertion_point(interface_extends:cosmos.ics23.v1.CompressedBatchProof) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * repeated .cosmos.ics23.v1.CompressedBatchEntry entries = 1 [json_name = "entries"]; + */ + java.util.List + getEntriesList(); + /** + * repeated .cosmos.ics23.v1.CompressedBatchEntry entries = 1 [json_name = "entries"]; + */ + com.cosmos.ics23.v1.CompressedBatchEntry getEntries(int index); + /** + * repeated .cosmos.ics23.v1.CompressedBatchEntry entries = 1 [json_name = "entries"]; + */ + int getEntriesCount(); + + /** + * repeated .cosmos.ics23.v1.InnerOp lookup_inners = 2 [json_name = "lookupInners"]; + */ + java.util.List + getLookupInnersList(); + /** + * repeated .cosmos.ics23.v1.InnerOp lookup_inners = 2 [json_name = "lookupInners"]; + */ + com.cosmos.ics23.v1.InnerOp getLookupInners(int index); + /** + * repeated .cosmos.ics23.v1.InnerOp lookup_inners = 2 [json_name = "lookupInners"]; + */ + int getLookupInnersCount(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/CompressedExistenceProof.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/CompressedExistenceProof.java new file mode 100644 index 000000000..fd66a79f9 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/CompressedExistenceProof.java @@ -0,0 +1,590 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: cosmos/ics23/v1/proofs.proto + +package com.cosmos.ics23.v1; + +/** + * Protobuf type {@code cosmos.ics23.v1.CompressedExistenceProof} + */ +public final class CompressedExistenceProof extends + com.google.protobuf.GeneratedMessageLite< + CompressedExistenceProof, CompressedExistenceProof.Builder> implements + // @@protoc_insertion_point(message_implements:cosmos.ics23.v1.CompressedExistenceProof) + CompressedExistenceProofOrBuilder { + private CompressedExistenceProof() { + key_ = com.google.protobuf.ByteString.EMPTY; + value_ = com.google.protobuf.ByteString.EMPTY; + path_ = emptyIntList(); + } + public static final int KEY_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString key_; + /** + * bytes key = 1 [json_name = "key"]; + * @return The key. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKey() { + return key_; + } + /** + * bytes key = 1 [json_name = "key"]; + * @param value The key to set. + */ + private void setKey(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + key_ = value; + } + /** + * bytes key = 1 [json_name = "key"]; + */ + private void clearKey() { + + key_ = getDefaultInstance().getKey(); + } + + public static final int VALUE_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString value_; + /** + * bytes value = 2 [json_name = "value"]; + * @return The value. + */ + @java.lang.Override + public com.google.protobuf.ByteString getValue() { + return value_; + } + /** + * bytes value = 2 [json_name = "value"]; + * @param value The value to set. + */ + private void setValue(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + value_ = value; + } + /** + * bytes value = 2 [json_name = "value"]; + */ + private void clearValue() { + + value_ = getDefaultInstance().getValue(); + } + + public static final int LEAF_FIELD_NUMBER = 3; + private com.cosmos.ics23.v1.LeafOp leaf_; + /** + * .cosmos.ics23.v1.LeafOp leaf = 3 [json_name = "leaf"]; + */ + @java.lang.Override + public boolean hasLeaf() { + return leaf_ != null; + } + /** + * .cosmos.ics23.v1.LeafOp leaf = 3 [json_name = "leaf"]; + */ + @java.lang.Override + public com.cosmos.ics23.v1.LeafOp getLeaf() { + return leaf_ == null ? com.cosmos.ics23.v1.LeafOp.getDefaultInstance() : leaf_; + } + /** + * .cosmos.ics23.v1.LeafOp leaf = 3 [json_name = "leaf"]; + */ + private void setLeaf(com.cosmos.ics23.v1.LeafOp value) { + value.getClass(); + leaf_ = value; + + } + /** + * .cosmos.ics23.v1.LeafOp leaf = 3 [json_name = "leaf"]; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeLeaf(com.cosmos.ics23.v1.LeafOp value) { + value.getClass(); + if (leaf_ != null && + leaf_ != com.cosmos.ics23.v1.LeafOp.getDefaultInstance()) { + leaf_ = + com.cosmos.ics23.v1.LeafOp.newBuilder(leaf_).mergeFrom(value).buildPartial(); + } else { + leaf_ = value; + } + + } + /** + * .cosmos.ics23.v1.LeafOp leaf = 3 [json_name = "leaf"]; + */ + private void clearLeaf() { leaf_ = null; + + } + + public static final int PATH_FIELD_NUMBER = 4; + private com.google.protobuf.Internal.IntList path_; + /** + *
+   * these are indexes into the lookup_inners table in CompressedBatchProof
+   * 
+ * + * repeated int32 path = 4 [json_name = "path"]; + * @return A list containing the path. + */ + @java.lang.Override + public java.util.List + getPathList() { + return path_; + } + /** + *
+   * these are indexes into the lookup_inners table in CompressedBatchProof
+   * 
+ * + * repeated int32 path = 4 [json_name = "path"]; + * @return The count of path. + */ + @java.lang.Override + public int getPathCount() { + return path_.size(); + } + /** + *
+   * these are indexes into the lookup_inners table in CompressedBatchProof
+   * 
+ * + * repeated int32 path = 4 [json_name = "path"]; + * @param index The index of the element to return. + * @return The path at the given index. + */ + @java.lang.Override + public int getPath(int index) { + return path_.getInt(index); + } + private int pathMemoizedSerializedSize = -1; + private void ensurePathIsMutable() { + com.google.protobuf.Internal.IntList tmp = path_; + if (!tmp.isModifiable()) { + path_ = + com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp); + } + } + /** + *
+   * these are indexes into the lookup_inners table in CompressedBatchProof
+   * 
+ * + * repeated int32 path = 4 [json_name = "path"]; + * @param index The index to set the value at. + * @param value The path to set. + */ + private void setPath( + int index, int value) { + ensurePathIsMutable(); + path_.setInt(index, value); + } + /** + *
+   * these are indexes into the lookup_inners table in CompressedBatchProof
+   * 
+ * + * repeated int32 path = 4 [json_name = "path"]; + * @param value The path to add. + */ + private void addPath(int value) { + ensurePathIsMutable(); + path_.addInt(value); + } + /** + *
+   * these are indexes into the lookup_inners table in CompressedBatchProof
+   * 
+ * + * repeated int32 path = 4 [json_name = "path"]; + * @param values The path to add. + */ + private void addAllPath( + java.lang.Iterable values) { + ensurePathIsMutable(); + com.google.protobuf.AbstractMessageLite.addAll( + values, path_); + } + /** + *
+   * these are indexes into the lookup_inners table in CompressedBatchProof
+   * 
+ * + * repeated int32 path = 4 [json_name = "path"]; + */ + private void clearPath() { + path_ = emptyIntList(); + } + + public static com.cosmos.ics23.v1.CompressedExistenceProof parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.cosmos.ics23.v1.CompressedExistenceProof parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.cosmos.ics23.v1.CompressedExistenceProof parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.cosmos.ics23.v1.CompressedExistenceProof parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.cosmos.ics23.v1.CompressedExistenceProof parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.cosmos.ics23.v1.CompressedExistenceProof parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.cosmos.ics23.v1.CompressedExistenceProof parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.cosmos.ics23.v1.CompressedExistenceProof parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.cosmos.ics23.v1.CompressedExistenceProof parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.cosmos.ics23.v1.CompressedExistenceProof parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.cosmos.ics23.v1.CompressedExistenceProof parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.cosmos.ics23.v1.CompressedExistenceProof parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.cosmos.ics23.v1.CompressedExistenceProof prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + * Protobuf type {@code cosmos.ics23.v1.CompressedExistenceProof} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.cosmos.ics23.v1.CompressedExistenceProof, Builder> implements + // @@protoc_insertion_point(builder_implements:cosmos.ics23.v1.CompressedExistenceProof) + com.cosmos.ics23.v1.CompressedExistenceProofOrBuilder { + // Construct using com.cosmos.ics23.v1.CompressedExistenceProof.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * bytes key = 1 [json_name = "key"]; + * @return The key. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKey() { + return instance.getKey(); + } + /** + * bytes key = 1 [json_name = "key"]; + * @param value The key to set. + * @return This builder for chaining. + */ + public Builder setKey(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setKey(value); + return this; + } + /** + * bytes key = 1 [json_name = "key"]; + * @return This builder for chaining. + */ + public Builder clearKey() { + copyOnWrite(); + instance.clearKey(); + return this; + } + + /** + * bytes value = 2 [json_name = "value"]; + * @return The value. + */ + @java.lang.Override + public com.google.protobuf.ByteString getValue() { + return instance.getValue(); + } + /** + * bytes value = 2 [json_name = "value"]; + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setValue(value); + return this; + } + /** + * bytes value = 2 [json_name = "value"]; + * @return This builder for chaining. + */ + public Builder clearValue() { + copyOnWrite(); + instance.clearValue(); + return this; + } + + /** + * .cosmos.ics23.v1.LeafOp leaf = 3 [json_name = "leaf"]; + */ + @java.lang.Override + public boolean hasLeaf() { + return instance.hasLeaf(); + } + /** + * .cosmos.ics23.v1.LeafOp leaf = 3 [json_name = "leaf"]; + */ + @java.lang.Override + public com.cosmos.ics23.v1.LeafOp getLeaf() { + return instance.getLeaf(); + } + /** + * .cosmos.ics23.v1.LeafOp leaf = 3 [json_name = "leaf"]; + */ + public Builder setLeaf(com.cosmos.ics23.v1.LeafOp value) { + copyOnWrite(); + instance.setLeaf(value); + return this; + } + /** + * .cosmos.ics23.v1.LeafOp leaf = 3 [json_name = "leaf"]; + */ + public Builder setLeaf( + com.cosmos.ics23.v1.LeafOp.Builder builderForValue) { + copyOnWrite(); + instance.setLeaf(builderForValue.build()); + return this; + } + /** + * .cosmos.ics23.v1.LeafOp leaf = 3 [json_name = "leaf"]; + */ + public Builder mergeLeaf(com.cosmos.ics23.v1.LeafOp value) { + copyOnWrite(); + instance.mergeLeaf(value); + return this; + } + /** + * .cosmos.ics23.v1.LeafOp leaf = 3 [json_name = "leaf"]; + */ + public Builder clearLeaf() { copyOnWrite(); + instance.clearLeaf(); + return this; + } + + /** + *
+     * these are indexes into the lookup_inners table in CompressedBatchProof
+     * 
+ * + * repeated int32 path = 4 [json_name = "path"]; + * @return A list containing the path. + */ + @java.lang.Override + public java.util.List + getPathList() { + return java.util.Collections.unmodifiableList( + instance.getPathList()); + } + /** + *
+     * these are indexes into the lookup_inners table in CompressedBatchProof
+     * 
+ * + * repeated int32 path = 4 [json_name = "path"]; + * @return The count of path. + */ + @java.lang.Override + public int getPathCount() { + return instance.getPathCount(); + } + /** + *
+     * these are indexes into the lookup_inners table in CompressedBatchProof
+     * 
+ * + * repeated int32 path = 4 [json_name = "path"]; + * @param index The index of the element to return. + * @return The path at the given index. + */ + @java.lang.Override + public int getPath(int index) { + return instance.getPath(index); + } + /** + *
+     * these are indexes into the lookup_inners table in CompressedBatchProof
+     * 
+ * + * repeated int32 path = 4 [json_name = "path"]; + * @param value The path to set. + * @return This builder for chaining. + */ + public Builder setPath( + int index, int value) { + copyOnWrite(); + instance.setPath(index, value); + return this; + } + /** + *
+     * these are indexes into the lookup_inners table in CompressedBatchProof
+     * 
+ * + * repeated int32 path = 4 [json_name = "path"]; + * @param value The path to add. + * @return This builder for chaining. + */ + public Builder addPath(int value) { + copyOnWrite(); + instance.addPath(value); + return this; + } + /** + *
+     * these are indexes into the lookup_inners table in CompressedBatchProof
+     * 
+ * + * repeated int32 path = 4 [json_name = "path"]; + * @param values The path to add. + * @return This builder for chaining. + */ + public Builder addAllPath( + java.lang.Iterable values) { + copyOnWrite(); + instance.addAllPath(values); + return this; + } + /** + *
+     * these are indexes into the lookup_inners table in CompressedBatchProof
+     * 
+ * + * repeated int32 path = 4 [json_name = "path"]; + * @return This builder for chaining. + */ + public Builder clearPath() { + copyOnWrite(); + instance.clearPath(); + return this; + } + + // @@protoc_insertion_point(builder_scope:cosmos.ics23.v1.CompressedExistenceProof) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.cosmos.ics23.v1.CompressedExistenceProof(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "key_", + "value_", + "leaf_", + "path_", + }; + java.lang.String info = + "\u0000\u0004\u0000\u0000\u0001\u0004\u0004\u0000\u0001\u0000\u0001\n\u0002\n\u0003" + + "\t\u0004\'"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.cosmos.ics23.v1.CompressedExistenceProof.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:cosmos.ics23.v1.CompressedExistenceProof) + private static final com.cosmos.ics23.v1.CompressedExistenceProof DEFAULT_INSTANCE; + static { + CompressedExistenceProof defaultInstance = new CompressedExistenceProof(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + CompressedExistenceProof.class, defaultInstance); + } + + public static com.cosmos.ics23.v1.CompressedExistenceProof getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/CompressedExistenceProofOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/CompressedExistenceProofOrBuilder.java new file mode 100644 index 000000000..b7b4c73ab --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/CompressedExistenceProofOrBuilder.java @@ -0,0 +1,61 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: cosmos/ics23/v1/proofs.proto + +package com.cosmos.ics23.v1; + +public interface CompressedExistenceProofOrBuilder extends + // @@protoc_insertion_point(interface_extends:cosmos.ics23.v1.CompressedExistenceProof) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * bytes key = 1 [json_name = "key"]; + * @return The key. + */ + com.google.protobuf.ByteString getKey(); + + /** + * bytes value = 2 [json_name = "value"]; + * @return The value. + */ + com.google.protobuf.ByteString getValue(); + + /** + * .cosmos.ics23.v1.LeafOp leaf = 3 [json_name = "leaf"]; + * @return Whether the leaf field is set. + */ + boolean hasLeaf(); + /** + * .cosmos.ics23.v1.LeafOp leaf = 3 [json_name = "leaf"]; + * @return The leaf. + */ + com.cosmos.ics23.v1.LeafOp getLeaf(); + + /** + *
+   * these are indexes into the lookup_inners table in CompressedBatchProof
+   * 
+ * + * repeated int32 path = 4 [json_name = "path"]; + * @return A list containing the path. + */ + java.util.List getPathList(); + /** + *
+   * these are indexes into the lookup_inners table in CompressedBatchProof
+   * 
+ * + * repeated int32 path = 4 [json_name = "path"]; + * @return The count of path. + */ + int getPathCount(); + /** + *
+   * these are indexes into the lookup_inners table in CompressedBatchProof
+   * 
+ * + * repeated int32 path = 4 [json_name = "path"]; + * @param index The index of the element to return. + * @return The path at the given index. + */ + int getPath(int index); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/CompressedNonExistenceProof.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/CompressedNonExistenceProof.java new file mode 100644 index 000000000..de88b6a19 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/CompressedNonExistenceProof.java @@ -0,0 +1,453 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: cosmos/ics23/v1/proofs.proto + +package com.cosmos.ics23.v1; + +/** + * Protobuf type {@code cosmos.ics23.v1.CompressedNonExistenceProof} + */ +public final class CompressedNonExistenceProof extends + com.google.protobuf.GeneratedMessageLite< + CompressedNonExistenceProof, CompressedNonExistenceProof.Builder> implements + // @@protoc_insertion_point(message_implements:cosmos.ics23.v1.CompressedNonExistenceProof) + CompressedNonExistenceProofOrBuilder { + private CompressedNonExistenceProof() { + key_ = com.google.protobuf.ByteString.EMPTY; + } + public static final int KEY_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString key_; + /** + *
+   * TODO: remove this as unnecessary??? we prove a range
+   * 
+ * + * bytes key = 1 [json_name = "key"]; + * @return The key. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKey() { + return key_; + } + /** + *
+   * TODO: remove this as unnecessary??? we prove a range
+   * 
+ * + * bytes key = 1 [json_name = "key"]; + * @param value The key to set. + */ + private void setKey(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + key_ = value; + } + /** + *
+   * TODO: remove this as unnecessary??? we prove a range
+   * 
+ * + * bytes key = 1 [json_name = "key"]; + */ + private void clearKey() { + + key_ = getDefaultInstance().getKey(); + } + + public static final int LEFT_FIELD_NUMBER = 2; + private com.cosmos.ics23.v1.CompressedExistenceProof left_; + /** + * .cosmos.ics23.v1.CompressedExistenceProof left = 2 [json_name = "left"]; + */ + @java.lang.Override + public boolean hasLeft() { + return left_ != null; + } + /** + * .cosmos.ics23.v1.CompressedExistenceProof left = 2 [json_name = "left"]; + */ + @java.lang.Override + public com.cosmos.ics23.v1.CompressedExistenceProof getLeft() { + return left_ == null ? com.cosmos.ics23.v1.CompressedExistenceProof.getDefaultInstance() : left_; + } + /** + * .cosmos.ics23.v1.CompressedExistenceProof left = 2 [json_name = "left"]; + */ + private void setLeft(com.cosmos.ics23.v1.CompressedExistenceProof value) { + value.getClass(); + left_ = value; + + } + /** + * .cosmos.ics23.v1.CompressedExistenceProof left = 2 [json_name = "left"]; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeLeft(com.cosmos.ics23.v1.CompressedExistenceProof value) { + value.getClass(); + if (left_ != null && + left_ != com.cosmos.ics23.v1.CompressedExistenceProof.getDefaultInstance()) { + left_ = + com.cosmos.ics23.v1.CompressedExistenceProof.newBuilder(left_).mergeFrom(value).buildPartial(); + } else { + left_ = value; + } + + } + /** + * .cosmos.ics23.v1.CompressedExistenceProof left = 2 [json_name = "left"]; + */ + private void clearLeft() { left_ = null; + + } + + public static final int RIGHT_FIELD_NUMBER = 3; + private com.cosmos.ics23.v1.CompressedExistenceProof right_; + /** + * .cosmos.ics23.v1.CompressedExistenceProof right = 3 [json_name = "right"]; + */ + @java.lang.Override + public boolean hasRight() { + return right_ != null; + } + /** + * .cosmos.ics23.v1.CompressedExistenceProof right = 3 [json_name = "right"]; + */ + @java.lang.Override + public com.cosmos.ics23.v1.CompressedExistenceProof getRight() { + return right_ == null ? com.cosmos.ics23.v1.CompressedExistenceProof.getDefaultInstance() : right_; + } + /** + * .cosmos.ics23.v1.CompressedExistenceProof right = 3 [json_name = "right"]; + */ + private void setRight(com.cosmos.ics23.v1.CompressedExistenceProof value) { + value.getClass(); + right_ = value; + + } + /** + * .cosmos.ics23.v1.CompressedExistenceProof right = 3 [json_name = "right"]; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeRight(com.cosmos.ics23.v1.CompressedExistenceProof value) { + value.getClass(); + if (right_ != null && + right_ != com.cosmos.ics23.v1.CompressedExistenceProof.getDefaultInstance()) { + right_ = + com.cosmos.ics23.v1.CompressedExistenceProof.newBuilder(right_).mergeFrom(value).buildPartial(); + } else { + right_ = value; + } + + } + /** + * .cosmos.ics23.v1.CompressedExistenceProof right = 3 [json_name = "right"]; + */ + private void clearRight() { right_ = null; + + } + + public static com.cosmos.ics23.v1.CompressedNonExistenceProof parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.cosmos.ics23.v1.CompressedNonExistenceProof parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.cosmos.ics23.v1.CompressedNonExistenceProof parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.cosmos.ics23.v1.CompressedNonExistenceProof parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.cosmos.ics23.v1.CompressedNonExistenceProof parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.cosmos.ics23.v1.CompressedNonExistenceProof parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.cosmos.ics23.v1.CompressedNonExistenceProof parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.cosmos.ics23.v1.CompressedNonExistenceProof parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.cosmos.ics23.v1.CompressedNonExistenceProof parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.cosmos.ics23.v1.CompressedNonExistenceProof parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.cosmos.ics23.v1.CompressedNonExistenceProof parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.cosmos.ics23.v1.CompressedNonExistenceProof parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.cosmos.ics23.v1.CompressedNonExistenceProof prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + * Protobuf type {@code cosmos.ics23.v1.CompressedNonExistenceProof} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.cosmos.ics23.v1.CompressedNonExistenceProof, Builder> implements + // @@protoc_insertion_point(builder_implements:cosmos.ics23.v1.CompressedNonExistenceProof) + com.cosmos.ics23.v1.CompressedNonExistenceProofOrBuilder { + // Construct using com.cosmos.ics23.v1.CompressedNonExistenceProof.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + *
+     * TODO: remove this as unnecessary??? we prove a range
+     * 
+ * + * bytes key = 1 [json_name = "key"]; + * @return The key. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKey() { + return instance.getKey(); + } + /** + *
+     * TODO: remove this as unnecessary??? we prove a range
+     * 
+ * + * bytes key = 1 [json_name = "key"]; + * @param value The key to set. + * @return This builder for chaining. + */ + public Builder setKey(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setKey(value); + return this; + } + /** + *
+     * TODO: remove this as unnecessary??? we prove a range
+     * 
+ * + * bytes key = 1 [json_name = "key"]; + * @return This builder for chaining. + */ + public Builder clearKey() { + copyOnWrite(); + instance.clearKey(); + return this; + } + + /** + * .cosmos.ics23.v1.CompressedExistenceProof left = 2 [json_name = "left"]; + */ + @java.lang.Override + public boolean hasLeft() { + return instance.hasLeft(); + } + /** + * .cosmos.ics23.v1.CompressedExistenceProof left = 2 [json_name = "left"]; + */ + @java.lang.Override + public com.cosmos.ics23.v1.CompressedExistenceProof getLeft() { + return instance.getLeft(); + } + /** + * .cosmos.ics23.v1.CompressedExistenceProof left = 2 [json_name = "left"]; + */ + public Builder setLeft(com.cosmos.ics23.v1.CompressedExistenceProof value) { + copyOnWrite(); + instance.setLeft(value); + return this; + } + /** + * .cosmos.ics23.v1.CompressedExistenceProof left = 2 [json_name = "left"]; + */ + public Builder setLeft( + com.cosmos.ics23.v1.CompressedExistenceProof.Builder builderForValue) { + copyOnWrite(); + instance.setLeft(builderForValue.build()); + return this; + } + /** + * .cosmos.ics23.v1.CompressedExistenceProof left = 2 [json_name = "left"]; + */ + public Builder mergeLeft(com.cosmos.ics23.v1.CompressedExistenceProof value) { + copyOnWrite(); + instance.mergeLeft(value); + return this; + } + /** + * .cosmos.ics23.v1.CompressedExistenceProof left = 2 [json_name = "left"]; + */ + public Builder clearLeft() { copyOnWrite(); + instance.clearLeft(); + return this; + } + + /** + * .cosmos.ics23.v1.CompressedExistenceProof right = 3 [json_name = "right"]; + */ + @java.lang.Override + public boolean hasRight() { + return instance.hasRight(); + } + /** + * .cosmos.ics23.v1.CompressedExistenceProof right = 3 [json_name = "right"]; + */ + @java.lang.Override + public com.cosmos.ics23.v1.CompressedExistenceProof getRight() { + return instance.getRight(); + } + /** + * .cosmos.ics23.v1.CompressedExistenceProof right = 3 [json_name = "right"]; + */ + public Builder setRight(com.cosmos.ics23.v1.CompressedExistenceProof value) { + copyOnWrite(); + instance.setRight(value); + return this; + } + /** + * .cosmos.ics23.v1.CompressedExistenceProof right = 3 [json_name = "right"]; + */ + public Builder setRight( + com.cosmos.ics23.v1.CompressedExistenceProof.Builder builderForValue) { + copyOnWrite(); + instance.setRight(builderForValue.build()); + return this; + } + /** + * .cosmos.ics23.v1.CompressedExistenceProof right = 3 [json_name = "right"]; + */ + public Builder mergeRight(com.cosmos.ics23.v1.CompressedExistenceProof value) { + copyOnWrite(); + instance.mergeRight(value); + return this; + } + /** + * .cosmos.ics23.v1.CompressedExistenceProof right = 3 [json_name = "right"]; + */ + public Builder clearRight() { copyOnWrite(); + instance.clearRight(); + return this; + } + + // @@protoc_insertion_point(builder_scope:cosmos.ics23.v1.CompressedNonExistenceProof) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.cosmos.ics23.v1.CompressedNonExistenceProof(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "key_", + "left_", + "right_", + }; + java.lang.String info = + "\u0000\u0003\u0000\u0000\u0001\u0003\u0003\u0000\u0000\u0000\u0001\n\u0002\t\u0003" + + "\t"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.cosmos.ics23.v1.CompressedNonExistenceProof.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:cosmos.ics23.v1.CompressedNonExistenceProof) + private static final com.cosmos.ics23.v1.CompressedNonExistenceProof DEFAULT_INSTANCE; + static { + CompressedNonExistenceProof defaultInstance = new CompressedNonExistenceProof(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + CompressedNonExistenceProof.class, defaultInstance); + } + + public static com.cosmos.ics23.v1.CompressedNonExistenceProof getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/CompressedNonExistenceProofOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/CompressedNonExistenceProofOrBuilder.java new file mode 100644 index 000000000..4a45c39f2 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/CompressedNonExistenceProofOrBuilder.java @@ -0,0 +1,41 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: cosmos/ics23/v1/proofs.proto + +package com.cosmos.ics23.v1; + +public interface CompressedNonExistenceProofOrBuilder extends + // @@protoc_insertion_point(interface_extends:cosmos.ics23.v1.CompressedNonExistenceProof) + com.google.protobuf.MessageLiteOrBuilder { + + /** + *
+   * TODO: remove this as unnecessary??? we prove a range
+   * 
+ * + * bytes key = 1 [json_name = "key"]; + * @return The key. + */ + com.google.protobuf.ByteString getKey(); + + /** + * .cosmos.ics23.v1.CompressedExistenceProof left = 2 [json_name = "left"]; + * @return Whether the left field is set. + */ + boolean hasLeft(); + /** + * .cosmos.ics23.v1.CompressedExistenceProof left = 2 [json_name = "left"]; + * @return The left. + */ + com.cosmos.ics23.v1.CompressedExistenceProof getLeft(); + + /** + * .cosmos.ics23.v1.CompressedExistenceProof right = 3 [json_name = "right"]; + * @return Whether the right field is set. + */ + boolean hasRight(); + /** + * .cosmos.ics23.v1.CompressedExistenceProof right = 3 [json_name = "right"]; + * @return The right. + */ + com.cosmos.ics23.v1.CompressedExistenceProof getRight(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/ExistenceProof.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/ExistenceProof.java new file mode 100644 index 000000000..7d5757298 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/ExistenceProof.java @@ -0,0 +1,631 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: cosmos/ics23/v1/proofs.proto + +package com.cosmos.ics23.v1; + +/** + *
+ **
+ *ExistenceProof takes a key and a value and a set of steps to perform on it.
+ *The result of peforming all these steps will provide a "root hash", which can
+ *be compared to the value in a header.
+ *Since it is computationally infeasible to produce a hash collission for any of the used
+ *cryptographic hash functions, if someone can provide a series of operations to transform
+ *a given key and value into a root hash that matches some trusted root, these key and values
+ *must be in the referenced merkle tree.
+ *The only possible issue is maliablity in LeafOp, such as providing extra prefix data,
+ *which should be controlled by a spec. Eg. with lengthOp as NONE,
+ *prefix = FOO, key = BAR, value = CHOICE
+ *and
+ *prefix = F, key = OOBAR, value = CHOICE
+ *would produce the same value.
+ *With LengthOp this is tricker but not impossible. Which is why the "leafPrefixEqual" field
+ *in the ProofSpec is valuable to prevent this mutability. And why all trees should
+ *length-prefix the data before hashing it.
+ * 
+ * + * Protobuf type {@code cosmos.ics23.v1.ExistenceProof} + */ +public final class ExistenceProof extends + com.google.protobuf.GeneratedMessageLite< + ExistenceProof, ExistenceProof.Builder> implements + // @@protoc_insertion_point(message_implements:cosmos.ics23.v1.ExistenceProof) + ExistenceProofOrBuilder { + private ExistenceProof() { + key_ = com.google.protobuf.ByteString.EMPTY; + value_ = com.google.protobuf.ByteString.EMPTY; + path_ = emptyProtobufList(); + } + public static final int KEY_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString key_; + /** + * bytes key = 1 [json_name = "key"]; + * @return The key. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKey() { + return key_; + } + /** + * bytes key = 1 [json_name = "key"]; + * @param value The key to set. + */ + private void setKey(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + key_ = value; + } + /** + * bytes key = 1 [json_name = "key"]; + */ + private void clearKey() { + + key_ = getDefaultInstance().getKey(); + } + + public static final int VALUE_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString value_; + /** + * bytes value = 2 [json_name = "value"]; + * @return The value. + */ + @java.lang.Override + public com.google.protobuf.ByteString getValue() { + return value_; + } + /** + * bytes value = 2 [json_name = "value"]; + * @param value The value to set. + */ + private void setValue(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + value_ = value; + } + /** + * bytes value = 2 [json_name = "value"]; + */ + private void clearValue() { + + value_ = getDefaultInstance().getValue(); + } + + public static final int LEAF_FIELD_NUMBER = 3; + private com.cosmos.ics23.v1.LeafOp leaf_; + /** + * .cosmos.ics23.v1.LeafOp leaf = 3 [json_name = "leaf"]; + */ + @java.lang.Override + public boolean hasLeaf() { + return leaf_ != null; + } + /** + * .cosmos.ics23.v1.LeafOp leaf = 3 [json_name = "leaf"]; + */ + @java.lang.Override + public com.cosmos.ics23.v1.LeafOp getLeaf() { + return leaf_ == null ? com.cosmos.ics23.v1.LeafOp.getDefaultInstance() : leaf_; + } + /** + * .cosmos.ics23.v1.LeafOp leaf = 3 [json_name = "leaf"]; + */ + private void setLeaf(com.cosmos.ics23.v1.LeafOp value) { + value.getClass(); + leaf_ = value; + + } + /** + * .cosmos.ics23.v1.LeafOp leaf = 3 [json_name = "leaf"]; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeLeaf(com.cosmos.ics23.v1.LeafOp value) { + value.getClass(); + if (leaf_ != null && + leaf_ != com.cosmos.ics23.v1.LeafOp.getDefaultInstance()) { + leaf_ = + com.cosmos.ics23.v1.LeafOp.newBuilder(leaf_).mergeFrom(value).buildPartial(); + } else { + leaf_ = value; + } + + } + /** + * .cosmos.ics23.v1.LeafOp leaf = 3 [json_name = "leaf"]; + */ + private void clearLeaf() { leaf_ = null; + + } + + public static final int PATH_FIELD_NUMBER = 4; + private com.google.protobuf.Internal.ProtobufList path_; + /** + * repeated .cosmos.ics23.v1.InnerOp path = 4 [json_name = "path"]; + */ + @java.lang.Override + public java.util.List getPathList() { + return path_; + } + /** + * repeated .cosmos.ics23.v1.InnerOp path = 4 [json_name = "path"]; + */ + public java.util.List + getPathOrBuilderList() { + return path_; + } + /** + * repeated .cosmos.ics23.v1.InnerOp path = 4 [json_name = "path"]; + */ + @java.lang.Override + public int getPathCount() { + return path_.size(); + } + /** + * repeated .cosmos.ics23.v1.InnerOp path = 4 [json_name = "path"]; + */ + @java.lang.Override + public com.cosmos.ics23.v1.InnerOp getPath(int index) { + return path_.get(index); + } + /** + * repeated .cosmos.ics23.v1.InnerOp path = 4 [json_name = "path"]; + */ + public com.cosmos.ics23.v1.InnerOpOrBuilder getPathOrBuilder( + int index) { + return path_.get(index); + } + private void ensurePathIsMutable() { + com.google.protobuf.Internal.ProtobufList tmp = path_; + if (!tmp.isModifiable()) { + path_ = + com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp); + } + } + + /** + * repeated .cosmos.ics23.v1.InnerOp path = 4 [json_name = "path"]; + */ + private void setPath( + int index, com.cosmos.ics23.v1.InnerOp value) { + value.getClass(); + ensurePathIsMutable(); + path_.set(index, value); + } + /** + * repeated .cosmos.ics23.v1.InnerOp path = 4 [json_name = "path"]; + */ + private void addPath(com.cosmos.ics23.v1.InnerOp value) { + value.getClass(); + ensurePathIsMutable(); + path_.add(value); + } + /** + * repeated .cosmos.ics23.v1.InnerOp path = 4 [json_name = "path"]; + */ + private void addPath( + int index, com.cosmos.ics23.v1.InnerOp value) { + value.getClass(); + ensurePathIsMutable(); + path_.add(index, value); + } + /** + * repeated .cosmos.ics23.v1.InnerOp path = 4 [json_name = "path"]; + */ + private void addAllPath( + java.lang.Iterable values) { + ensurePathIsMutable(); + com.google.protobuf.AbstractMessageLite.addAll( + values, path_); + } + /** + * repeated .cosmos.ics23.v1.InnerOp path = 4 [json_name = "path"]; + */ + private void clearPath() { + path_ = emptyProtobufList(); + } + /** + * repeated .cosmos.ics23.v1.InnerOp path = 4 [json_name = "path"]; + */ + private void removePath(int index) { + ensurePathIsMutable(); + path_.remove(index); + } + + public static com.cosmos.ics23.v1.ExistenceProof parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.cosmos.ics23.v1.ExistenceProof parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.cosmos.ics23.v1.ExistenceProof parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.cosmos.ics23.v1.ExistenceProof parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.cosmos.ics23.v1.ExistenceProof parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.cosmos.ics23.v1.ExistenceProof parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.cosmos.ics23.v1.ExistenceProof parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.cosmos.ics23.v1.ExistenceProof parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.cosmos.ics23.v1.ExistenceProof parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.cosmos.ics23.v1.ExistenceProof parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.cosmos.ics23.v1.ExistenceProof parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.cosmos.ics23.v1.ExistenceProof parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.cosmos.ics23.v1.ExistenceProof prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+   **
+   *ExistenceProof takes a key and a value and a set of steps to perform on it.
+   *The result of peforming all these steps will provide a "root hash", which can
+   *be compared to the value in a header.
+   *Since it is computationally infeasible to produce a hash collission for any of the used
+   *cryptographic hash functions, if someone can provide a series of operations to transform
+   *a given key and value into a root hash that matches some trusted root, these key and values
+   *must be in the referenced merkle tree.
+   *The only possible issue is maliablity in LeafOp, such as providing extra prefix data,
+   *which should be controlled by a spec. Eg. with lengthOp as NONE,
+   *prefix = FOO, key = BAR, value = CHOICE
+   *and
+   *prefix = F, key = OOBAR, value = CHOICE
+   *would produce the same value.
+   *With LengthOp this is tricker but not impossible. Which is why the "leafPrefixEqual" field
+   *in the ProofSpec is valuable to prevent this mutability. And why all trees should
+   *length-prefix the data before hashing it.
+   * 
+ * + * Protobuf type {@code cosmos.ics23.v1.ExistenceProof} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.cosmos.ics23.v1.ExistenceProof, Builder> implements + // @@protoc_insertion_point(builder_implements:cosmos.ics23.v1.ExistenceProof) + com.cosmos.ics23.v1.ExistenceProofOrBuilder { + // Construct using com.cosmos.ics23.v1.ExistenceProof.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * bytes key = 1 [json_name = "key"]; + * @return The key. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKey() { + return instance.getKey(); + } + /** + * bytes key = 1 [json_name = "key"]; + * @param value The key to set. + * @return This builder for chaining. + */ + public Builder setKey(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setKey(value); + return this; + } + /** + * bytes key = 1 [json_name = "key"]; + * @return This builder for chaining. + */ + public Builder clearKey() { + copyOnWrite(); + instance.clearKey(); + return this; + } + + /** + * bytes value = 2 [json_name = "value"]; + * @return The value. + */ + @java.lang.Override + public com.google.protobuf.ByteString getValue() { + return instance.getValue(); + } + /** + * bytes value = 2 [json_name = "value"]; + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setValue(value); + return this; + } + /** + * bytes value = 2 [json_name = "value"]; + * @return This builder for chaining. + */ + public Builder clearValue() { + copyOnWrite(); + instance.clearValue(); + return this; + } + + /** + * .cosmos.ics23.v1.LeafOp leaf = 3 [json_name = "leaf"]; + */ + @java.lang.Override + public boolean hasLeaf() { + return instance.hasLeaf(); + } + /** + * .cosmos.ics23.v1.LeafOp leaf = 3 [json_name = "leaf"]; + */ + @java.lang.Override + public com.cosmos.ics23.v1.LeafOp getLeaf() { + return instance.getLeaf(); + } + /** + * .cosmos.ics23.v1.LeafOp leaf = 3 [json_name = "leaf"]; + */ + public Builder setLeaf(com.cosmos.ics23.v1.LeafOp value) { + copyOnWrite(); + instance.setLeaf(value); + return this; + } + /** + * .cosmos.ics23.v1.LeafOp leaf = 3 [json_name = "leaf"]; + */ + public Builder setLeaf( + com.cosmos.ics23.v1.LeafOp.Builder builderForValue) { + copyOnWrite(); + instance.setLeaf(builderForValue.build()); + return this; + } + /** + * .cosmos.ics23.v1.LeafOp leaf = 3 [json_name = "leaf"]; + */ + public Builder mergeLeaf(com.cosmos.ics23.v1.LeafOp value) { + copyOnWrite(); + instance.mergeLeaf(value); + return this; + } + /** + * .cosmos.ics23.v1.LeafOp leaf = 3 [json_name = "leaf"]; + */ + public Builder clearLeaf() { copyOnWrite(); + instance.clearLeaf(); + return this; + } + + /** + * repeated .cosmos.ics23.v1.InnerOp path = 4 [json_name = "path"]; + */ + @java.lang.Override + public java.util.List getPathList() { + return java.util.Collections.unmodifiableList( + instance.getPathList()); + } + /** + * repeated .cosmos.ics23.v1.InnerOp path = 4 [json_name = "path"]; + */ + @java.lang.Override + public int getPathCount() { + return instance.getPathCount(); + }/** + * repeated .cosmos.ics23.v1.InnerOp path = 4 [json_name = "path"]; + */ + @java.lang.Override + public com.cosmos.ics23.v1.InnerOp getPath(int index) { + return instance.getPath(index); + } + /** + * repeated .cosmos.ics23.v1.InnerOp path = 4 [json_name = "path"]; + */ + public Builder setPath( + int index, com.cosmos.ics23.v1.InnerOp value) { + copyOnWrite(); + instance.setPath(index, value); + return this; + } + /** + * repeated .cosmos.ics23.v1.InnerOp path = 4 [json_name = "path"]; + */ + public Builder setPath( + int index, com.cosmos.ics23.v1.InnerOp.Builder builderForValue) { + copyOnWrite(); + instance.setPath(index, + builderForValue.build()); + return this; + } + /** + * repeated .cosmos.ics23.v1.InnerOp path = 4 [json_name = "path"]; + */ + public Builder addPath(com.cosmos.ics23.v1.InnerOp value) { + copyOnWrite(); + instance.addPath(value); + return this; + } + /** + * repeated .cosmos.ics23.v1.InnerOp path = 4 [json_name = "path"]; + */ + public Builder addPath( + int index, com.cosmos.ics23.v1.InnerOp value) { + copyOnWrite(); + instance.addPath(index, value); + return this; + } + /** + * repeated .cosmos.ics23.v1.InnerOp path = 4 [json_name = "path"]; + */ + public Builder addPath( + com.cosmos.ics23.v1.InnerOp.Builder builderForValue) { + copyOnWrite(); + instance.addPath(builderForValue.build()); + return this; + } + /** + * repeated .cosmos.ics23.v1.InnerOp path = 4 [json_name = "path"]; + */ + public Builder addPath( + int index, com.cosmos.ics23.v1.InnerOp.Builder builderForValue) { + copyOnWrite(); + instance.addPath(index, + builderForValue.build()); + return this; + } + /** + * repeated .cosmos.ics23.v1.InnerOp path = 4 [json_name = "path"]; + */ + public Builder addAllPath( + java.lang.Iterable values) { + copyOnWrite(); + instance.addAllPath(values); + return this; + } + /** + * repeated .cosmos.ics23.v1.InnerOp path = 4 [json_name = "path"]; + */ + public Builder clearPath() { + copyOnWrite(); + instance.clearPath(); + return this; + } + /** + * repeated .cosmos.ics23.v1.InnerOp path = 4 [json_name = "path"]; + */ + public Builder removePath(int index) { + copyOnWrite(); + instance.removePath(index); + return this; + } + + // @@protoc_insertion_point(builder_scope:cosmos.ics23.v1.ExistenceProof) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.cosmos.ics23.v1.ExistenceProof(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "key_", + "value_", + "leaf_", + "path_", + com.cosmos.ics23.v1.InnerOp.class, + }; + java.lang.String info = + "\u0000\u0004\u0000\u0000\u0001\u0004\u0004\u0000\u0001\u0000\u0001\n\u0002\n\u0003" + + "\t\u0004\u001b"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.cosmos.ics23.v1.ExistenceProof.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:cosmos.ics23.v1.ExistenceProof) + private static final com.cosmos.ics23.v1.ExistenceProof DEFAULT_INSTANCE; + static { + ExistenceProof defaultInstance = new ExistenceProof(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + ExistenceProof.class, defaultInstance); + } + + public static com.cosmos.ics23.v1.ExistenceProof getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/ExistenceProofOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/ExistenceProofOrBuilder.java new file mode 100644 index 000000000..d48b99067 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/ExistenceProofOrBuilder.java @@ -0,0 +1,46 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: cosmos/ics23/v1/proofs.proto + +package com.cosmos.ics23.v1; + +public interface ExistenceProofOrBuilder extends + // @@protoc_insertion_point(interface_extends:cosmos.ics23.v1.ExistenceProof) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * bytes key = 1 [json_name = "key"]; + * @return The key. + */ + com.google.protobuf.ByteString getKey(); + + /** + * bytes value = 2 [json_name = "value"]; + * @return The value. + */ + com.google.protobuf.ByteString getValue(); + + /** + * .cosmos.ics23.v1.LeafOp leaf = 3 [json_name = "leaf"]; + * @return Whether the leaf field is set. + */ + boolean hasLeaf(); + /** + * .cosmos.ics23.v1.LeafOp leaf = 3 [json_name = "leaf"]; + * @return The leaf. + */ + com.cosmos.ics23.v1.LeafOp getLeaf(); + + /** + * repeated .cosmos.ics23.v1.InnerOp path = 4 [json_name = "path"]; + */ + java.util.List + getPathList(); + /** + * repeated .cosmos.ics23.v1.InnerOp path = 4 [json_name = "path"]; + */ + com.cosmos.ics23.v1.InnerOp getPath(int index); + /** + * repeated .cosmos.ics23.v1.InnerOp path = 4 [json_name = "path"]; + */ + int getPathCount(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/HashOp.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/HashOp.java new file mode 100644 index 000000000..72126e068 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/HashOp.java @@ -0,0 +1,155 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: cosmos/ics23/v1/proofs.proto + +package com.cosmos.ics23.v1; + +/** + * Protobuf enum {@code cosmos.ics23.v1.HashOp} + */ +public enum HashOp + implements com.google.protobuf.Internal.EnumLite { + /** + *
+   * NO_HASH is the default if no data passed. Note this is an illegal argument some places.
+   * 
+ * + * NO_HASH = 0; + */ + NO_HASH(0), + /** + * SHA256 = 1; + */ + SHA256(1), + /** + * SHA512 = 2; + */ + SHA512(2), + /** + * KECCAK = 3; + */ + KECCAK(3), + /** + * RIPEMD160 = 4; + */ + RIPEMD160(4), + /** + *
+   * ripemd160(sha256(x))
+   * 
+ * + * BITCOIN = 5; + */ + BITCOIN(5), + /** + * SHA512_256 = 6; + */ + SHA512_256(6), + UNRECOGNIZED(-1), + ; + + /** + *
+   * NO_HASH is the default if no data passed. Note this is an illegal argument some places.
+   * 
+ * + * NO_HASH = 0; + */ + public static final int NO_HASH_VALUE = 0; + /** + * SHA256 = 1; + */ + public static final int SHA256_VALUE = 1; + /** + * SHA512 = 2; + */ + public static final int SHA512_VALUE = 2; + /** + * KECCAK = 3; + */ + public static final int KECCAK_VALUE = 3; + /** + * RIPEMD160 = 4; + */ + public static final int RIPEMD160_VALUE = 4; + /** + *
+   * ripemd160(sha256(x))
+   * 
+ * + * BITCOIN = 5; + */ + public static final int BITCOIN_VALUE = 5; + /** + * SHA512_256 = 6; + */ + public static final int SHA512_256_VALUE = 6; + + + @java.lang.Override + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static HashOp valueOf(int value) { + return forNumber(value); + } + + public static HashOp forNumber(int value) { + switch (value) { + case 0: return NO_HASH; + case 1: return SHA256; + case 2: return SHA512; + case 3: return KECCAK; + case 4: return RIPEMD160; + case 5: return BITCOIN; + case 6: return SHA512_256; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + HashOp> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + @java.lang.Override + public HashOp findValueByNumber(int number) { + return HashOp.forNumber(number); + } + }; + + public static com.google.protobuf.Internal.EnumVerifier + internalGetVerifier() { + return HashOpVerifier.INSTANCE; + } + + private static final class HashOpVerifier implements + com.google.protobuf.Internal.EnumVerifier { + static final com.google.protobuf.Internal.EnumVerifier INSTANCE = new HashOpVerifier(); + @java.lang.Override + public boolean isInRange(int number) { + return HashOp.forNumber(number) != null; + } + }; + + private final int value; + + private HashOp(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:cosmos.ics23.v1.HashOp) +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/InnerOp.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/InnerOp.java new file mode 100644 index 000000000..b0222ce7c --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/InnerOp.java @@ -0,0 +1,417 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: cosmos/ics23/v1/proofs.proto + +package com.cosmos.ics23.v1; + +/** + *
+ **
+ *InnerOp represents a merkle-proof step that is not a leaf.
+ *It represents concatenating two children and hashing them to provide the next result.
+ *The result of the previous step is passed in, so the signature of this op is:
+ *innerOp(child) -> output
+ *The result of applying InnerOp should be:
+ *output = op.hash(op.prefix || child || op.suffix)
+ *where the || operator is concatenation of binary data,
+ *and child is the result of hashing all the tree below this step.
+ *Any special data, like prepending child with the length, or prepending the entire operation with
+ *some value to differentiate from leaf nodes, should be included in prefix and suffix.
+ *If either of prefix or suffix is empty, we just treat it as an empty string
+ * 
+ * + * Protobuf type {@code cosmos.ics23.v1.InnerOp} + */ +public final class InnerOp extends + com.google.protobuf.GeneratedMessageLite< + InnerOp, InnerOp.Builder> implements + // @@protoc_insertion_point(message_implements:cosmos.ics23.v1.InnerOp) + InnerOpOrBuilder { + private InnerOp() { + prefix_ = com.google.protobuf.ByteString.EMPTY; + suffix_ = com.google.protobuf.ByteString.EMPTY; + } + public static final int HASH_FIELD_NUMBER = 1; + private int hash_; + /** + * .cosmos.ics23.v1.HashOp hash = 1 [json_name = "hash"]; + * @return The enum numeric value on the wire for hash. + */ + @java.lang.Override + public int getHashValue() { + return hash_; + } + /** + * .cosmos.ics23.v1.HashOp hash = 1 [json_name = "hash"]; + * @return The hash. + */ + @java.lang.Override + public com.cosmos.ics23.v1.HashOp getHash() { + com.cosmos.ics23.v1.HashOp result = com.cosmos.ics23.v1.HashOp.forNumber(hash_); + return result == null ? com.cosmos.ics23.v1.HashOp.UNRECOGNIZED : result; + } + /** + * .cosmos.ics23.v1.HashOp hash = 1 [json_name = "hash"]; + * @param value The enum numeric value on the wire for hash to set. + */ + private void setHashValue(int value) { + hash_ = value; + } + /** + * .cosmos.ics23.v1.HashOp hash = 1 [json_name = "hash"]; + * @param value The hash to set. + */ + private void setHash(com.cosmos.ics23.v1.HashOp value) { + hash_ = value.getNumber(); + + } + /** + * .cosmos.ics23.v1.HashOp hash = 1 [json_name = "hash"]; + */ + private void clearHash() { + + hash_ = 0; + } + + public static final int PREFIX_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString prefix_; + /** + * bytes prefix = 2 [json_name = "prefix"]; + * @return The prefix. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPrefix() { + return prefix_; + } + /** + * bytes prefix = 2 [json_name = "prefix"]; + * @param value The prefix to set. + */ + private void setPrefix(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + prefix_ = value; + } + /** + * bytes prefix = 2 [json_name = "prefix"]; + */ + private void clearPrefix() { + + prefix_ = getDefaultInstance().getPrefix(); + } + + public static final int SUFFIX_FIELD_NUMBER = 3; + private com.google.protobuf.ByteString suffix_; + /** + * bytes suffix = 3 [json_name = "suffix"]; + * @return The suffix. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSuffix() { + return suffix_; + } + /** + * bytes suffix = 3 [json_name = "suffix"]; + * @param value The suffix to set. + */ + private void setSuffix(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + suffix_ = value; + } + /** + * bytes suffix = 3 [json_name = "suffix"]; + */ + private void clearSuffix() { + + suffix_ = getDefaultInstance().getSuffix(); + } + + public static com.cosmos.ics23.v1.InnerOp parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.cosmos.ics23.v1.InnerOp parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.cosmos.ics23.v1.InnerOp parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.cosmos.ics23.v1.InnerOp parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.cosmos.ics23.v1.InnerOp parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.cosmos.ics23.v1.InnerOp parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.cosmos.ics23.v1.InnerOp parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.cosmos.ics23.v1.InnerOp parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.cosmos.ics23.v1.InnerOp parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.cosmos.ics23.v1.InnerOp parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.cosmos.ics23.v1.InnerOp parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.cosmos.ics23.v1.InnerOp parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.cosmos.ics23.v1.InnerOp prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+   **
+   *InnerOp represents a merkle-proof step that is not a leaf.
+   *It represents concatenating two children and hashing them to provide the next result.
+   *The result of the previous step is passed in, so the signature of this op is:
+   *innerOp(child) -> output
+   *The result of applying InnerOp should be:
+   *output = op.hash(op.prefix || child || op.suffix)
+   *where the || operator is concatenation of binary data,
+   *and child is the result of hashing all the tree below this step.
+   *Any special data, like prepending child with the length, or prepending the entire operation with
+   *some value to differentiate from leaf nodes, should be included in prefix and suffix.
+   *If either of prefix or suffix is empty, we just treat it as an empty string
+   * 
+ * + * Protobuf type {@code cosmos.ics23.v1.InnerOp} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.cosmos.ics23.v1.InnerOp, Builder> implements + // @@protoc_insertion_point(builder_implements:cosmos.ics23.v1.InnerOp) + com.cosmos.ics23.v1.InnerOpOrBuilder { + // Construct using com.cosmos.ics23.v1.InnerOp.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * .cosmos.ics23.v1.HashOp hash = 1 [json_name = "hash"]; + * @return The enum numeric value on the wire for hash. + */ + @java.lang.Override + public int getHashValue() { + return instance.getHashValue(); + } + /** + * .cosmos.ics23.v1.HashOp hash = 1 [json_name = "hash"]; + * @param value The hash to set. + * @return This builder for chaining. + */ + public Builder setHashValue(int value) { + copyOnWrite(); + instance.setHashValue(value); + return this; + } + /** + * .cosmos.ics23.v1.HashOp hash = 1 [json_name = "hash"]; + * @return The hash. + */ + @java.lang.Override + public com.cosmos.ics23.v1.HashOp getHash() { + return instance.getHash(); + } + /** + * .cosmos.ics23.v1.HashOp hash = 1 [json_name = "hash"]; + * @param value The enum numeric value on the wire for hash to set. + * @return This builder for chaining. + */ + public Builder setHash(com.cosmos.ics23.v1.HashOp value) { + copyOnWrite(); + instance.setHash(value); + return this; + } + /** + * .cosmos.ics23.v1.HashOp hash = 1 [json_name = "hash"]; + * @return This builder for chaining. + */ + public Builder clearHash() { + copyOnWrite(); + instance.clearHash(); + return this; + } + + /** + * bytes prefix = 2 [json_name = "prefix"]; + * @return The prefix. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPrefix() { + return instance.getPrefix(); + } + /** + * bytes prefix = 2 [json_name = "prefix"]; + * @param value The prefix to set. + * @return This builder for chaining. + */ + public Builder setPrefix(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setPrefix(value); + return this; + } + /** + * bytes prefix = 2 [json_name = "prefix"]; + * @return This builder for chaining. + */ + public Builder clearPrefix() { + copyOnWrite(); + instance.clearPrefix(); + return this; + } + + /** + * bytes suffix = 3 [json_name = "suffix"]; + * @return The suffix. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSuffix() { + return instance.getSuffix(); + } + /** + * bytes suffix = 3 [json_name = "suffix"]; + * @param value The suffix to set. + * @return This builder for chaining. + */ + public Builder setSuffix(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setSuffix(value); + return this; + } + /** + * bytes suffix = 3 [json_name = "suffix"]; + * @return This builder for chaining. + */ + public Builder clearSuffix() { + copyOnWrite(); + instance.clearSuffix(); + return this; + } + + // @@protoc_insertion_point(builder_scope:cosmos.ics23.v1.InnerOp) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.cosmos.ics23.v1.InnerOp(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "hash_", + "prefix_", + "suffix_", + }; + java.lang.String info = + "\u0000\u0003\u0000\u0000\u0001\u0003\u0003\u0000\u0000\u0000\u0001\f\u0002\n\u0003" + + "\n"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.cosmos.ics23.v1.InnerOp.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:cosmos.ics23.v1.InnerOp) + private static final com.cosmos.ics23.v1.InnerOp DEFAULT_INSTANCE; + static { + InnerOp defaultInstance = new InnerOp(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + InnerOp.class, defaultInstance); + } + + public static com.cosmos.ics23.v1.InnerOp getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/InnerOpOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/InnerOpOrBuilder.java new file mode 100644 index 000000000..359b38420 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/InnerOpOrBuilder.java @@ -0,0 +1,32 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: cosmos/ics23/v1/proofs.proto + +package com.cosmos.ics23.v1; + +public interface InnerOpOrBuilder extends + // @@protoc_insertion_point(interface_extends:cosmos.ics23.v1.InnerOp) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * .cosmos.ics23.v1.HashOp hash = 1 [json_name = "hash"]; + * @return The enum numeric value on the wire for hash. + */ + int getHashValue(); + /** + * .cosmos.ics23.v1.HashOp hash = 1 [json_name = "hash"]; + * @return The hash. + */ + com.cosmos.ics23.v1.HashOp getHash(); + + /** + * bytes prefix = 2 [json_name = "prefix"]; + * @return The prefix. + */ + com.google.protobuf.ByteString getPrefix(); + + /** + * bytes suffix = 3 [json_name = "suffix"]; + * @return The suffix. + */ + com.google.protobuf.ByteString getSuffix(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/InnerSpec.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/InnerSpec.java new file mode 100644 index 000000000..426b028b1 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/InnerSpec.java @@ -0,0 +1,803 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: cosmos/ics23/v1/proofs.proto + +package com.cosmos.ics23.v1; + +/** + *
+ *InnerSpec contains all store-specific structure info to determine if two proofs from a
+ *given store are neighbors.
+ *This enables:
+ *isLeftMost(spec: InnerSpec, op: InnerOp)
+ *isRightMost(spec: InnerSpec, op: InnerOp)
+ *isLeftNeighbor(spec: InnerSpec, left: InnerOp, right: InnerOp)
+ * 
+ * + * Protobuf type {@code cosmos.ics23.v1.InnerSpec} + */ +public final class InnerSpec extends + com.google.protobuf.GeneratedMessageLite< + InnerSpec, InnerSpec.Builder> implements + // @@protoc_insertion_point(message_implements:cosmos.ics23.v1.InnerSpec) + InnerSpecOrBuilder { + private InnerSpec() { + childOrder_ = emptyIntList(); + emptyChild_ = com.google.protobuf.ByteString.EMPTY; + } + public static final int CHILD_ORDER_FIELD_NUMBER = 1; + private com.google.protobuf.Internal.IntList childOrder_; + /** + *
+   * Child order is the ordering of the children node, must count from 0
+   * iavl tree is [0, 1] (left then right)
+   * merk is [0, 2, 1] (left, right, here)
+   * 
+ * + * repeated int32 child_order = 1 [json_name = "childOrder"]; + * @return A list containing the childOrder. + */ + @java.lang.Override + public java.util.List + getChildOrderList() { + return childOrder_; + } + /** + *
+   * Child order is the ordering of the children node, must count from 0
+   * iavl tree is [0, 1] (left then right)
+   * merk is [0, 2, 1] (left, right, here)
+   * 
+ * + * repeated int32 child_order = 1 [json_name = "childOrder"]; + * @return The count of childOrder. + */ + @java.lang.Override + public int getChildOrderCount() { + return childOrder_.size(); + } + /** + *
+   * Child order is the ordering of the children node, must count from 0
+   * iavl tree is [0, 1] (left then right)
+   * merk is [0, 2, 1] (left, right, here)
+   * 
+ * + * repeated int32 child_order = 1 [json_name = "childOrder"]; + * @param index The index of the element to return. + * @return The childOrder at the given index. + */ + @java.lang.Override + public int getChildOrder(int index) { + return childOrder_.getInt(index); + } + private int childOrderMemoizedSerializedSize = -1; + private void ensureChildOrderIsMutable() { + com.google.protobuf.Internal.IntList tmp = childOrder_; + if (!tmp.isModifiable()) { + childOrder_ = + com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp); + } + } + /** + *
+   * Child order is the ordering of the children node, must count from 0
+   * iavl tree is [0, 1] (left then right)
+   * merk is [0, 2, 1] (left, right, here)
+   * 
+ * + * repeated int32 child_order = 1 [json_name = "childOrder"]; + * @param index The index to set the value at. + * @param value The childOrder to set. + */ + private void setChildOrder( + int index, int value) { + ensureChildOrderIsMutable(); + childOrder_.setInt(index, value); + } + /** + *
+   * Child order is the ordering of the children node, must count from 0
+   * iavl tree is [0, 1] (left then right)
+   * merk is [0, 2, 1] (left, right, here)
+   * 
+ * + * repeated int32 child_order = 1 [json_name = "childOrder"]; + * @param value The childOrder to add. + */ + private void addChildOrder(int value) { + ensureChildOrderIsMutable(); + childOrder_.addInt(value); + } + /** + *
+   * Child order is the ordering of the children node, must count from 0
+   * iavl tree is [0, 1] (left then right)
+   * merk is [0, 2, 1] (left, right, here)
+   * 
+ * + * repeated int32 child_order = 1 [json_name = "childOrder"]; + * @param values The childOrder to add. + */ + private void addAllChildOrder( + java.lang.Iterable values) { + ensureChildOrderIsMutable(); + com.google.protobuf.AbstractMessageLite.addAll( + values, childOrder_); + } + /** + *
+   * Child order is the ordering of the children node, must count from 0
+   * iavl tree is [0, 1] (left then right)
+   * merk is [0, 2, 1] (left, right, here)
+   * 
+ * + * repeated int32 child_order = 1 [json_name = "childOrder"]; + */ + private void clearChildOrder() { + childOrder_ = emptyIntList(); + } + + public static final int CHILD_SIZE_FIELD_NUMBER = 2; + private int childSize_; + /** + * int32 child_size = 2 [json_name = "childSize"]; + * @return The childSize. + */ + @java.lang.Override + public int getChildSize() { + return childSize_; + } + /** + * int32 child_size = 2 [json_name = "childSize"]; + * @param value The childSize to set. + */ + private void setChildSize(int value) { + + childSize_ = value; + } + /** + * int32 child_size = 2 [json_name = "childSize"]; + */ + private void clearChildSize() { + + childSize_ = 0; + } + + public static final int MIN_PREFIX_LENGTH_FIELD_NUMBER = 3; + private int minPrefixLength_; + /** + * int32 min_prefix_length = 3 [json_name = "minPrefixLength"]; + * @return The minPrefixLength. + */ + @java.lang.Override + public int getMinPrefixLength() { + return minPrefixLength_; + } + /** + * int32 min_prefix_length = 3 [json_name = "minPrefixLength"]; + * @param value The minPrefixLength to set. + */ + private void setMinPrefixLength(int value) { + + minPrefixLength_ = value; + } + /** + * int32 min_prefix_length = 3 [json_name = "minPrefixLength"]; + */ + private void clearMinPrefixLength() { + + minPrefixLength_ = 0; + } + + public static final int MAX_PREFIX_LENGTH_FIELD_NUMBER = 4; + private int maxPrefixLength_; + /** + * int32 max_prefix_length = 4 [json_name = "maxPrefixLength"]; + * @return The maxPrefixLength. + */ + @java.lang.Override + public int getMaxPrefixLength() { + return maxPrefixLength_; + } + /** + * int32 max_prefix_length = 4 [json_name = "maxPrefixLength"]; + * @param value The maxPrefixLength to set. + */ + private void setMaxPrefixLength(int value) { + + maxPrefixLength_ = value; + } + /** + * int32 max_prefix_length = 4 [json_name = "maxPrefixLength"]; + */ + private void clearMaxPrefixLength() { + + maxPrefixLength_ = 0; + } + + public static final int EMPTY_CHILD_FIELD_NUMBER = 5; + private com.google.protobuf.ByteString emptyChild_; + /** + *
+   * empty child is the prehash image that is used when one child is nil (eg. 20 bytes of 0)
+   * 
+ * + * bytes empty_child = 5 [json_name = "emptyChild"]; + * @return The emptyChild. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEmptyChild() { + return emptyChild_; + } + /** + *
+   * empty child is the prehash image that is used when one child is nil (eg. 20 bytes of 0)
+   * 
+ * + * bytes empty_child = 5 [json_name = "emptyChild"]; + * @param value The emptyChild to set. + */ + private void setEmptyChild(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + emptyChild_ = value; + } + /** + *
+   * empty child is the prehash image that is used when one child is nil (eg. 20 bytes of 0)
+   * 
+ * + * bytes empty_child = 5 [json_name = "emptyChild"]; + */ + private void clearEmptyChild() { + + emptyChild_ = getDefaultInstance().getEmptyChild(); + } + + public static final int HASH_FIELD_NUMBER = 6; + private int hash_; + /** + *
+   * hash is the algorithm that must be used for each InnerOp
+   * 
+ * + * .cosmos.ics23.v1.HashOp hash = 6 [json_name = "hash"]; + * @return The enum numeric value on the wire for hash. + */ + @java.lang.Override + public int getHashValue() { + return hash_; + } + /** + *
+   * hash is the algorithm that must be used for each InnerOp
+   * 
+ * + * .cosmos.ics23.v1.HashOp hash = 6 [json_name = "hash"]; + * @return The hash. + */ + @java.lang.Override + public com.cosmos.ics23.v1.HashOp getHash() { + com.cosmos.ics23.v1.HashOp result = com.cosmos.ics23.v1.HashOp.forNumber(hash_); + return result == null ? com.cosmos.ics23.v1.HashOp.UNRECOGNIZED : result; + } + /** + *
+   * hash is the algorithm that must be used for each InnerOp
+   * 
+ * + * .cosmos.ics23.v1.HashOp hash = 6 [json_name = "hash"]; + * @param value The enum numeric value on the wire for hash to set. + */ + private void setHashValue(int value) { + hash_ = value; + } + /** + *
+   * hash is the algorithm that must be used for each InnerOp
+   * 
+ * + * .cosmos.ics23.v1.HashOp hash = 6 [json_name = "hash"]; + * @param value The hash to set. + */ + private void setHash(com.cosmos.ics23.v1.HashOp value) { + hash_ = value.getNumber(); + + } + /** + *
+   * hash is the algorithm that must be used for each InnerOp
+   * 
+ * + * .cosmos.ics23.v1.HashOp hash = 6 [json_name = "hash"]; + */ + private void clearHash() { + + hash_ = 0; + } + + public static com.cosmos.ics23.v1.InnerSpec parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.cosmos.ics23.v1.InnerSpec parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.cosmos.ics23.v1.InnerSpec parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.cosmos.ics23.v1.InnerSpec parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.cosmos.ics23.v1.InnerSpec parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.cosmos.ics23.v1.InnerSpec parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.cosmos.ics23.v1.InnerSpec parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.cosmos.ics23.v1.InnerSpec parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.cosmos.ics23.v1.InnerSpec parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.cosmos.ics23.v1.InnerSpec parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.cosmos.ics23.v1.InnerSpec parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.cosmos.ics23.v1.InnerSpec parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.cosmos.ics23.v1.InnerSpec prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+   *InnerSpec contains all store-specific structure info to determine if two proofs from a
+   *given store are neighbors.
+   *This enables:
+   *isLeftMost(spec: InnerSpec, op: InnerOp)
+   *isRightMost(spec: InnerSpec, op: InnerOp)
+   *isLeftNeighbor(spec: InnerSpec, left: InnerOp, right: InnerOp)
+   * 
+ * + * Protobuf type {@code cosmos.ics23.v1.InnerSpec} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.cosmos.ics23.v1.InnerSpec, Builder> implements + // @@protoc_insertion_point(builder_implements:cosmos.ics23.v1.InnerSpec) + com.cosmos.ics23.v1.InnerSpecOrBuilder { + // Construct using com.cosmos.ics23.v1.InnerSpec.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + *
+     * Child order is the ordering of the children node, must count from 0
+     * iavl tree is [0, 1] (left then right)
+     * merk is [0, 2, 1] (left, right, here)
+     * 
+ * + * repeated int32 child_order = 1 [json_name = "childOrder"]; + * @return A list containing the childOrder. + */ + @java.lang.Override + public java.util.List + getChildOrderList() { + return java.util.Collections.unmodifiableList( + instance.getChildOrderList()); + } + /** + *
+     * Child order is the ordering of the children node, must count from 0
+     * iavl tree is [0, 1] (left then right)
+     * merk is [0, 2, 1] (left, right, here)
+     * 
+ * + * repeated int32 child_order = 1 [json_name = "childOrder"]; + * @return The count of childOrder. + */ + @java.lang.Override + public int getChildOrderCount() { + return instance.getChildOrderCount(); + } + /** + *
+     * Child order is the ordering of the children node, must count from 0
+     * iavl tree is [0, 1] (left then right)
+     * merk is [0, 2, 1] (left, right, here)
+     * 
+ * + * repeated int32 child_order = 1 [json_name = "childOrder"]; + * @param index The index of the element to return. + * @return The childOrder at the given index. + */ + @java.lang.Override + public int getChildOrder(int index) { + return instance.getChildOrder(index); + } + /** + *
+     * Child order is the ordering of the children node, must count from 0
+     * iavl tree is [0, 1] (left then right)
+     * merk is [0, 2, 1] (left, right, here)
+     * 
+ * + * repeated int32 child_order = 1 [json_name = "childOrder"]; + * @param value The childOrder to set. + * @return This builder for chaining. + */ + public Builder setChildOrder( + int index, int value) { + copyOnWrite(); + instance.setChildOrder(index, value); + return this; + } + /** + *
+     * Child order is the ordering of the children node, must count from 0
+     * iavl tree is [0, 1] (left then right)
+     * merk is [0, 2, 1] (left, right, here)
+     * 
+ * + * repeated int32 child_order = 1 [json_name = "childOrder"]; + * @param value The childOrder to add. + * @return This builder for chaining. + */ + public Builder addChildOrder(int value) { + copyOnWrite(); + instance.addChildOrder(value); + return this; + } + /** + *
+     * Child order is the ordering of the children node, must count from 0
+     * iavl tree is [0, 1] (left then right)
+     * merk is [0, 2, 1] (left, right, here)
+     * 
+ * + * repeated int32 child_order = 1 [json_name = "childOrder"]; + * @param values The childOrder to add. + * @return This builder for chaining. + */ + public Builder addAllChildOrder( + java.lang.Iterable values) { + copyOnWrite(); + instance.addAllChildOrder(values); + return this; + } + /** + *
+     * Child order is the ordering of the children node, must count from 0
+     * iavl tree is [0, 1] (left then right)
+     * merk is [0, 2, 1] (left, right, here)
+     * 
+ * + * repeated int32 child_order = 1 [json_name = "childOrder"]; + * @return This builder for chaining. + */ + public Builder clearChildOrder() { + copyOnWrite(); + instance.clearChildOrder(); + return this; + } + + /** + * int32 child_size = 2 [json_name = "childSize"]; + * @return The childSize. + */ + @java.lang.Override + public int getChildSize() { + return instance.getChildSize(); + } + /** + * int32 child_size = 2 [json_name = "childSize"]; + * @param value The childSize to set. + * @return This builder for chaining. + */ + public Builder setChildSize(int value) { + copyOnWrite(); + instance.setChildSize(value); + return this; + } + /** + * int32 child_size = 2 [json_name = "childSize"]; + * @return This builder for chaining. + */ + public Builder clearChildSize() { + copyOnWrite(); + instance.clearChildSize(); + return this; + } + + /** + * int32 min_prefix_length = 3 [json_name = "minPrefixLength"]; + * @return The minPrefixLength. + */ + @java.lang.Override + public int getMinPrefixLength() { + return instance.getMinPrefixLength(); + } + /** + * int32 min_prefix_length = 3 [json_name = "minPrefixLength"]; + * @param value The minPrefixLength to set. + * @return This builder for chaining. + */ + public Builder setMinPrefixLength(int value) { + copyOnWrite(); + instance.setMinPrefixLength(value); + return this; + } + /** + * int32 min_prefix_length = 3 [json_name = "minPrefixLength"]; + * @return This builder for chaining. + */ + public Builder clearMinPrefixLength() { + copyOnWrite(); + instance.clearMinPrefixLength(); + return this; + } + + /** + * int32 max_prefix_length = 4 [json_name = "maxPrefixLength"]; + * @return The maxPrefixLength. + */ + @java.lang.Override + public int getMaxPrefixLength() { + return instance.getMaxPrefixLength(); + } + /** + * int32 max_prefix_length = 4 [json_name = "maxPrefixLength"]; + * @param value The maxPrefixLength to set. + * @return This builder for chaining. + */ + public Builder setMaxPrefixLength(int value) { + copyOnWrite(); + instance.setMaxPrefixLength(value); + return this; + } + /** + * int32 max_prefix_length = 4 [json_name = "maxPrefixLength"]; + * @return This builder for chaining. + */ + public Builder clearMaxPrefixLength() { + copyOnWrite(); + instance.clearMaxPrefixLength(); + return this; + } + + /** + *
+     * empty child is the prehash image that is used when one child is nil (eg. 20 bytes of 0)
+     * 
+ * + * bytes empty_child = 5 [json_name = "emptyChild"]; + * @return The emptyChild. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEmptyChild() { + return instance.getEmptyChild(); + } + /** + *
+     * empty child is the prehash image that is used when one child is nil (eg. 20 bytes of 0)
+     * 
+ * + * bytes empty_child = 5 [json_name = "emptyChild"]; + * @param value The emptyChild to set. + * @return This builder for chaining. + */ + public Builder setEmptyChild(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setEmptyChild(value); + return this; + } + /** + *
+     * empty child is the prehash image that is used when one child is nil (eg. 20 bytes of 0)
+     * 
+ * + * bytes empty_child = 5 [json_name = "emptyChild"]; + * @return This builder for chaining. + */ + public Builder clearEmptyChild() { + copyOnWrite(); + instance.clearEmptyChild(); + return this; + } + + /** + *
+     * hash is the algorithm that must be used for each InnerOp
+     * 
+ * + * .cosmos.ics23.v1.HashOp hash = 6 [json_name = "hash"]; + * @return The enum numeric value on the wire for hash. + */ + @java.lang.Override + public int getHashValue() { + return instance.getHashValue(); + } + /** + *
+     * hash is the algorithm that must be used for each InnerOp
+     * 
+ * + * .cosmos.ics23.v1.HashOp hash = 6 [json_name = "hash"]; + * @param value The hash to set. + * @return This builder for chaining. + */ + public Builder setHashValue(int value) { + copyOnWrite(); + instance.setHashValue(value); + return this; + } + /** + *
+     * hash is the algorithm that must be used for each InnerOp
+     * 
+ * + * .cosmos.ics23.v1.HashOp hash = 6 [json_name = "hash"]; + * @return The hash. + */ + @java.lang.Override + public com.cosmos.ics23.v1.HashOp getHash() { + return instance.getHash(); + } + /** + *
+     * hash is the algorithm that must be used for each InnerOp
+     * 
+ * + * .cosmos.ics23.v1.HashOp hash = 6 [json_name = "hash"]; + * @param value The enum numeric value on the wire for hash to set. + * @return This builder for chaining. + */ + public Builder setHash(com.cosmos.ics23.v1.HashOp value) { + copyOnWrite(); + instance.setHash(value); + return this; + } + /** + *
+     * hash is the algorithm that must be used for each InnerOp
+     * 
+ * + * .cosmos.ics23.v1.HashOp hash = 6 [json_name = "hash"]; + * @return This builder for chaining. + */ + public Builder clearHash() { + copyOnWrite(); + instance.clearHash(); + return this; + } + + // @@protoc_insertion_point(builder_scope:cosmos.ics23.v1.InnerSpec) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.cosmos.ics23.v1.InnerSpec(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "childOrder_", + "childSize_", + "minPrefixLength_", + "maxPrefixLength_", + "emptyChild_", + "hash_", + }; + java.lang.String info = + "\u0000\u0006\u0000\u0000\u0001\u0006\u0006\u0000\u0001\u0000\u0001\'\u0002\u0004" + + "\u0003\u0004\u0004\u0004\u0005\n\u0006\f"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.cosmos.ics23.v1.InnerSpec.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:cosmos.ics23.v1.InnerSpec) + private static final com.cosmos.ics23.v1.InnerSpec DEFAULT_INSTANCE; + static { + InnerSpec defaultInstance = new InnerSpec(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + InnerSpec.class, defaultInstance); + } + + public static com.cosmos.ics23.v1.InnerSpec getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/InnerSpecOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/InnerSpecOrBuilder.java new file mode 100644 index 000000000..47330a54d --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/InnerSpecOrBuilder.java @@ -0,0 +1,91 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: cosmos/ics23/v1/proofs.proto + +package com.cosmos.ics23.v1; + +public interface InnerSpecOrBuilder extends + // @@protoc_insertion_point(interface_extends:cosmos.ics23.v1.InnerSpec) + com.google.protobuf.MessageLiteOrBuilder { + + /** + *
+   * Child order is the ordering of the children node, must count from 0
+   * iavl tree is [0, 1] (left then right)
+   * merk is [0, 2, 1] (left, right, here)
+   * 
+ * + * repeated int32 child_order = 1 [json_name = "childOrder"]; + * @return A list containing the childOrder. + */ + java.util.List getChildOrderList(); + /** + *
+   * Child order is the ordering of the children node, must count from 0
+   * iavl tree is [0, 1] (left then right)
+   * merk is [0, 2, 1] (left, right, here)
+   * 
+ * + * repeated int32 child_order = 1 [json_name = "childOrder"]; + * @return The count of childOrder. + */ + int getChildOrderCount(); + /** + *
+   * Child order is the ordering of the children node, must count from 0
+   * iavl tree is [0, 1] (left then right)
+   * merk is [0, 2, 1] (left, right, here)
+   * 
+ * + * repeated int32 child_order = 1 [json_name = "childOrder"]; + * @param index The index of the element to return. + * @return The childOrder at the given index. + */ + int getChildOrder(int index); + + /** + * int32 child_size = 2 [json_name = "childSize"]; + * @return The childSize. + */ + int getChildSize(); + + /** + * int32 min_prefix_length = 3 [json_name = "minPrefixLength"]; + * @return The minPrefixLength. + */ + int getMinPrefixLength(); + + /** + * int32 max_prefix_length = 4 [json_name = "maxPrefixLength"]; + * @return The maxPrefixLength. + */ + int getMaxPrefixLength(); + + /** + *
+   * empty child is the prehash image that is used when one child is nil (eg. 20 bytes of 0)
+   * 
+ * + * bytes empty_child = 5 [json_name = "emptyChild"]; + * @return The emptyChild. + */ + com.google.protobuf.ByteString getEmptyChild(); + + /** + *
+   * hash is the algorithm that must be used for each InnerOp
+   * 
+ * + * .cosmos.ics23.v1.HashOp hash = 6 [json_name = "hash"]; + * @return The enum numeric value on the wire for hash. + */ + int getHashValue(); + /** + *
+   * hash is the algorithm that must be used for each InnerOp
+   * 
+ * + * .cosmos.ics23.v1.HashOp hash = 6 [json_name = "hash"]; + * @return The hash. + */ + com.cosmos.ics23.v1.HashOp getHash(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/LeafOp.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/LeafOp.java new file mode 100644 index 000000000..56e83a596 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/LeafOp.java @@ -0,0 +1,657 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: cosmos/ics23/v1/proofs.proto + +package com.cosmos.ics23.v1; + +/** + *
+ **
+ *LeafOp represents the raw key-value data we wish to prove, and
+ *must be flexible to represent the internal transformation from
+ *the original key-value pairs into the basis hash, for many existing
+ *merkle trees.
+ *key and value are passed in. So that the signature of this operation is:
+ *leafOp(key, value) -> output
+ *To process this, first prehash the keys and values if needed (ANY means no hash in this case):
+ *hkey = prehashKey(key)
+ *hvalue = prehashValue(value)
+ *Then combine the bytes, and hash it
+ *output = hash(prefix || length(hkey) || hkey || length(hvalue) || hvalue)
+ * 
+ * + * Protobuf type {@code cosmos.ics23.v1.LeafOp} + */ +public final class LeafOp extends + com.google.protobuf.GeneratedMessageLite< + LeafOp, LeafOp.Builder> implements + // @@protoc_insertion_point(message_implements:cosmos.ics23.v1.LeafOp) + LeafOpOrBuilder { + private LeafOp() { + prefix_ = com.google.protobuf.ByteString.EMPTY; + } + public static final int HASH_FIELD_NUMBER = 1; + private int hash_; + /** + * .cosmos.ics23.v1.HashOp hash = 1 [json_name = "hash"]; + * @return The enum numeric value on the wire for hash. + */ + @java.lang.Override + public int getHashValue() { + return hash_; + } + /** + * .cosmos.ics23.v1.HashOp hash = 1 [json_name = "hash"]; + * @return The hash. + */ + @java.lang.Override + public com.cosmos.ics23.v1.HashOp getHash() { + com.cosmos.ics23.v1.HashOp result = com.cosmos.ics23.v1.HashOp.forNumber(hash_); + return result == null ? com.cosmos.ics23.v1.HashOp.UNRECOGNIZED : result; + } + /** + * .cosmos.ics23.v1.HashOp hash = 1 [json_name = "hash"]; + * @param value The enum numeric value on the wire for hash to set. + */ + private void setHashValue(int value) { + hash_ = value; + } + /** + * .cosmos.ics23.v1.HashOp hash = 1 [json_name = "hash"]; + * @param value The hash to set. + */ + private void setHash(com.cosmos.ics23.v1.HashOp value) { + hash_ = value.getNumber(); + + } + /** + * .cosmos.ics23.v1.HashOp hash = 1 [json_name = "hash"]; + */ + private void clearHash() { + + hash_ = 0; + } + + public static final int PREHASH_KEY_FIELD_NUMBER = 2; + private int prehashKey_; + /** + * .cosmos.ics23.v1.HashOp prehash_key = 2 [json_name = "prehashKey"]; + * @return The enum numeric value on the wire for prehashKey. + */ + @java.lang.Override + public int getPrehashKeyValue() { + return prehashKey_; + } + /** + * .cosmos.ics23.v1.HashOp prehash_key = 2 [json_name = "prehashKey"]; + * @return The prehashKey. + */ + @java.lang.Override + public com.cosmos.ics23.v1.HashOp getPrehashKey() { + com.cosmos.ics23.v1.HashOp result = com.cosmos.ics23.v1.HashOp.forNumber(prehashKey_); + return result == null ? com.cosmos.ics23.v1.HashOp.UNRECOGNIZED : result; + } + /** + * .cosmos.ics23.v1.HashOp prehash_key = 2 [json_name = "prehashKey"]; + * @param value The enum numeric value on the wire for prehashKey to set. + */ + private void setPrehashKeyValue(int value) { + prehashKey_ = value; + } + /** + * .cosmos.ics23.v1.HashOp prehash_key = 2 [json_name = "prehashKey"]; + * @param value The prehashKey to set. + */ + private void setPrehashKey(com.cosmos.ics23.v1.HashOp value) { + prehashKey_ = value.getNumber(); + + } + /** + * .cosmos.ics23.v1.HashOp prehash_key = 2 [json_name = "prehashKey"]; + */ + private void clearPrehashKey() { + + prehashKey_ = 0; + } + + public static final int PREHASH_VALUE_FIELD_NUMBER = 3; + private int prehashValue_; + /** + * .cosmos.ics23.v1.HashOp prehash_value = 3 [json_name = "prehashValue"]; + * @return The enum numeric value on the wire for prehashValue. + */ + @java.lang.Override + public int getPrehashValueValue() { + return prehashValue_; + } + /** + * .cosmos.ics23.v1.HashOp prehash_value = 3 [json_name = "prehashValue"]; + * @return The prehashValue. + */ + @java.lang.Override + public com.cosmos.ics23.v1.HashOp getPrehashValue() { + com.cosmos.ics23.v1.HashOp result = com.cosmos.ics23.v1.HashOp.forNumber(prehashValue_); + return result == null ? com.cosmos.ics23.v1.HashOp.UNRECOGNIZED : result; + } + /** + * .cosmos.ics23.v1.HashOp prehash_value = 3 [json_name = "prehashValue"]; + * @param value The enum numeric value on the wire for prehashValue to set. + */ + private void setPrehashValueValue(int value) { + prehashValue_ = value; + } + /** + * .cosmos.ics23.v1.HashOp prehash_value = 3 [json_name = "prehashValue"]; + * @param value The prehashValue to set. + */ + private void setPrehashValue(com.cosmos.ics23.v1.HashOp value) { + prehashValue_ = value.getNumber(); + + } + /** + * .cosmos.ics23.v1.HashOp prehash_value = 3 [json_name = "prehashValue"]; + */ + private void clearPrehashValue() { + + prehashValue_ = 0; + } + + public static final int LENGTH_FIELD_NUMBER = 4; + private int length_; + /** + * .cosmos.ics23.v1.LengthOp length = 4 [json_name = "length"]; + * @return The enum numeric value on the wire for length. + */ + @java.lang.Override + public int getLengthValue() { + return length_; + } + /** + * .cosmos.ics23.v1.LengthOp length = 4 [json_name = "length"]; + * @return The length. + */ + @java.lang.Override + public com.cosmos.ics23.v1.LengthOp getLength() { + com.cosmos.ics23.v1.LengthOp result = com.cosmos.ics23.v1.LengthOp.forNumber(length_); + return result == null ? com.cosmos.ics23.v1.LengthOp.UNRECOGNIZED : result; + } + /** + * .cosmos.ics23.v1.LengthOp length = 4 [json_name = "length"]; + * @param value The enum numeric value on the wire for length to set. + */ + private void setLengthValue(int value) { + length_ = value; + } + /** + * .cosmos.ics23.v1.LengthOp length = 4 [json_name = "length"]; + * @param value The length to set. + */ + private void setLength(com.cosmos.ics23.v1.LengthOp value) { + length_ = value.getNumber(); + + } + /** + * .cosmos.ics23.v1.LengthOp length = 4 [json_name = "length"]; + */ + private void clearLength() { + + length_ = 0; + } + + public static final int PREFIX_FIELD_NUMBER = 5; + private com.google.protobuf.ByteString prefix_; + /** + *
+   * prefix is a fixed bytes that may optionally be included at the beginning to differentiate
+   * a leaf node from an inner node.
+   * 
+ * + * bytes prefix = 5 [json_name = "prefix"]; + * @return The prefix. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPrefix() { + return prefix_; + } + /** + *
+   * prefix is a fixed bytes that may optionally be included at the beginning to differentiate
+   * a leaf node from an inner node.
+   * 
+ * + * bytes prefix = 5 [json_name = "prefix"]; + * @param value The prefix to set. + */ + private void setPrefix(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + prefix_ = value; + } + /** + *
+   * prefix is a fixed bytes that may optionally be included at the beginning to differentiate
+   * a leaf node from an inner node.
+   * 
+ * + * bytes prefix = 5 [json_name = "prefix"]; + */ + private void clearPrefix() { + + prefix_ = getDefaultInstance().getPrefix(); + } + + public static com.cosmos.ics23.v1.LeafOp parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.cosmos.ics23.v1.LeafOp parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.cosmos.ics23.v1.LeafOp parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.cosmos.ics23.v1.LeafOp parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.cosmos.ics23.v1.LeafOp parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.cosmos.ics23.v1.LeafOp parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.cosmos.ics23.v1.LeafOp parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.cosmos.ics23.v1.LeafOp parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.cosmos.ics23.v1.LeafOp parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.cosmos.ics23.v1.LeafOp parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.cosmos.ics23.v1.LeafOp parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.cosmos.ics23.v1.LeafOp parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.cosmos.ics23.v1.LeafOp prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+   **
+   *LeafOp represents the raw key-value data we wish to prove, and
+   *must be flexible to represent the internal transformation from
+   *the original key-value pairs into the basis hash, for many existing
+   *merkle trees.
+   *key and value are passed in. So that the signature of this operation is:
+   *leafOp(key, value) -> output
+   *To process this, first prehash the keys and values if needed (ANY means no hash in this case):
+   *hkey = prehashKey(key)
+   *hvalue = prehashValue(value)
+   *Then combine the bytes, and hash it
+   *output = hash(prefix || length(hkey) || hkey || length(hvalue) || hvalue)
+   * 
+ * + * Protobuf type {@code cosmos.ics23.v1.LeafOp} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.cosmos.ics23.v1.LeafOp, Builder> implements + // @@protoc_insertion_point(builder_implements:cosmos.ics23.v1.LeafOp) + com.cosmos.ics23.v1.LeafOpOrBuilder { + // Construct using com.cosmos.ics23.v1.LeafOp.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * .cosmos.ics23.v1.HashOp hash = 1 [json_name = "hash"]; + * @return The enum numeric value on the wire for hash. + */ + @java.lang.Override + public int getHashValue() { + return instance.getHashValue(); + } + /** + * .cosmos.ics23.v1.HashOp hash = 1 [json_name = "hash"]; + * @param value The hash to set. + * @return This builder for chaining. + */ + public Builder setHashValue(int value) { + copyOnWrite(); + instance.setHashValue(value); + return this; + } + /** + * .cosmos.ics23.v1.HashOp hash = 1 [json_name = "hash"]; + * @return The hash. + */ + @java.lang.Override + public com.cosmos.ics23.v1.HashOp getHash() { + return instance.getHash(); + } + /** + * .cosmos.ics23.v1.HashOp hash = 1 [json_name = "hash"]; + * @param value The enum numeric value on the wire for hash to set. + * @return This builder for chaining. + */ + public Builder setHash(com.cosmos.ics23.v1.HashOp value) { + copyOnWrite(); + instance.setHash(value); + return this; + } + /** + * .cosmos.ics23.v1.HashOp hash = 1 [json_name = "hash"]; + * @return This builder for chaining. + */ + public Builder clearHash() { + copyOnWrite(); + instance.clearHash(); + return this; + } + + /** + * .cosmos.ics23.v1.HashOp prehash_key = 2 [json_name = "prehashKey"]; + * @return The enum numeric value on the wire for prehashKey. + */ + @java.lang.Override + public int getPrehashKeyValue() { + return instance.getPrehashKeyValue(); + } + /** + * .cosmos.ics23.v1.HashOp prehash_key = 2 [json_name = "prehashKey"]; + * @param value The prehashKey to set. + * @return This builder for chaining. + */ + public Builder setPrehashKeyValue(int value) { + copyOnWrite(); + instance.setPrehashKeyValue(value); + return this; + } + /** + * .cosmos.ics23.v1.HashOp prehash_key = 2 [json_name = "prehashKey"]; + * @return The prehashKey. + */ + @java.lang.Override + public com.cosmos.ics23.v1.HashOp getPrehashKey() { + return instance.getPrehashKey(); + } + /** + * .cosmos.ics23.v1.HashOp prehash_key = 2 [json_name = "prehashKey"]; + * @param value The enum numeric value on the wire for prehashKey to set. + * @return This builder for chaining. + */ + public Builder setPrehashKey(com.cosmos.ics23.v1.HashOp value) { + copyOnWrite(); + instance.setPrehashKey(value); + return this; + } + /** + * .cosmos.ics23.v1.HashOp prehash_key = 2 [json_name = "prehashKey"]; + * @return This builder for chaining. + */ + public Builder clearPrehashKey() { + copyOnWrite(); + instance.clearPrehashKey(); + return this; + } + + /** + * .cosmos.ics23.v1.HashOp prehash_value = 3 [json_name = "prehashValue"]; + * @return The enum numeric value on the wire for prehashValue. + */ + @java.lang.Override + public int getPrehashValueValue() { + return instance.getPrehashValueValue(); + } + /** + * .cosmos.ics23.v1.HashOp prehash_value = 3 [json_name = "prehashValue"]; + * @param value The prehashValue to set. + * @return This builder for chaining. + */ + public Builder setPrehashValueValue(int value) { + copyOnWrite(); + instance.setPrehashValueValue(value); + return this; + } + /** + * .cosmos.ics23.v1.HashOp prehash_value = 3 [json_name = "prehashValue"]; + * @return The prehashValue. + */ + @java.lang.Override + public com.cosmos.ics23.v1.HashOp getPrehashValue() { + return instance.getPrehashValue(); + } + /** + * .cosmos.ics23.v1.HashOp prehash_value = 3 [json_name = "prehashValue"]; + * @param value The enum numeric value on the wire for prehashValue to set. + * @return This builder for chaining. + */ + public Builder setPrehashValue(com.cosmos.ics23.v1.HashOp value) { + copyOnWrite(); + instance.setPrehashValue(value); + return this; + } + /** + * .cosmos.ics23.v1.HashOp prehash_value = 3 [json_name = "prehashValue"]; + * @return This builder for chaining. + */ + public Builder clearPrehashValue() { + copyOnWrite(); + instance.clearPrehashValue(); + return this; + } + + /** + * .cosmos.ics23.v1.LengthOp length = 4 [json_name = "length"]; + * @return The enum numeric value on the wire for length. + */ + @java.lang.Override + public int getLengthValue() { + return instance.getLengthValue(); + } + /** + * .cosmos.ics23.v1.LengthOp length = 4 [json_name = "length"]; + * @param value The length to set. + * @return This builder for chaining. + */ + public Builder setLengthValue(int value) { + copyOnWrite(); + instance.setLengthValue(value); + return this; + } + /** + * .cosmos.ics23.v1.LengthOp length = 4 [json_name = "length"]; + * @return The length. + */ + @java.lang.Override + public com.cosmos.ics23.v1.LengthOp getLength() { + return instance.getLength(); + } + /** + * .cosmos.ics23.v1.LengthOp length = 4 [json_name = "length"]; + * @param value The enum numeric value on the wire for length to set. + * @return This builder for chaining. + */ + public Builder setLength(com.cosmos.ics23.v1.LengthOp value) { + copyOnWrite(); + instance.setLength(value); + return this; + } + /** + * .cosmos.ics23.v1.LengthOp length = 4 [json_name = "length"]; + * @return This builder for chaining. + */ + public Builder clearLength() { + copyOnWrite(); + instance.clearLength(); + return this; + } + + /** + *
+     * prefix is a fixed bytes that may optionally be included at the beginning to differentiate
+     * a leaf node from an inner node.
+     * 
+ * + * bytes prefix = 5 [json_name = "prefix"]; + * @return The prefix. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPrefix() { + return instance.getPrefix(); + } + /** + *
+     * prefix is a fixed bytes that may optionally be included at the beginning to differentiate
+     * a leaf node from an inner node.
+     * 
+ * + * bytes prefix = 5 [json_name = "prefix"]; + * @param value The prefix to set. + * @return This builder for chaining. + */ + public Builder setPrefix(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setPrefix(value); + return this; + } + /** + *
+     * prefix is a fixed bytes that may optionally be included at the beginning to differentiate
+     * a leaf node from an inner node.
+     * 
+ * + * bytes prefix = 5 [json_name = "prefix"]; + * @return This builder for chaining. + */ + public Builder clearPrefix() { + copyOnWrite(); + instance.clearPrefix(); + return this; + } + + // @@protoc_insertion_point(builder_scope:cosmos.ics23.v1.LeafOp) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.cosmos.ics23.v1.LeafOp(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "hash_", + "prehashKey_", + "prehashValue_", + "length_", + "prefix_", + }; + java.lang.String info = + "\u0000\u0005\u0000\u0000\u0001\u0005\u0005\u0000\u0000\u0000\u0001\f\u0002\f\u0003" + + "\f\u0004\f\u0005\n"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.cosmos.ics23.v1.LeafOp.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:cosmos.ics23.v1.LeafOp) + private static final com.cosmos.ics23.v1.LeafOp DEFAULT_INSTANCE; + static { + LeafOp defaultInstance = new LeafOp(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + LeafOp.class, defaultInstance); + } + + public static com.cosmos.ics23.v1.LeafOp getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/LeafOpOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/LeafOpOrBuilder.java new file mode 100644 index 000000000..280eb1cdc --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/LeafOpOrBuilder.java @@ -0,0 +1,64 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: cosmos/ics23/v1/proofs.proto + +package com.cosmos.ics23.v1; + +public interface LeafOpOrBuilder extends + // @@protoc_insertion_point(interface_extends:cosmos.ics23.v1.LeafOp) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * .cosmos.ics23.v1.HashOp hash = 1 [json_name = "hash"]; + * @return The enum numeric value on the wire for hash. + */ + int getHashValue(); + /** + * .cosmos.ics23.v1.HashOp hash = 1 [json_name = "hash"]; + * @return The hash. + */ + com.cosmos.ics23.v1.HashOp getHash(); + + /** + * .cosmos.ics23.v1.HashOp prehash_key = 2 [json_name = "prehashKey"]; + * @return The enum numeric value on the wire for prehashKey. + */ + int getPrehashKeyValue(); + /** + * .cosmos.ics23.v1.HashOp prehash_key = 2 [json_name = "prehashKey"]; + * @return The prehashKey. + */ + com.cosmos.ics23.v1.HashOp getPrehashKey(); + + /** + * .cosmos.ics23.v1.HashOp prehash_value = 3 [json_name = "prehashValue"]; + * @return The enum numeric value on the wire for prehashValue. + */ + int getPrehashValueValue(); + /** + * .cosmos.ics23.v1.HashOp prehash_value = 3 [json_name = "prehashValue"]; + * @return The prehashValue. + */ + com.cosmos.ics23.v1.HashOp getPrehashValue(); + + /** + * .cosmos.ics23.v1.LengthOp length = 4 [json_name = "length"]; + * @return The enum numeric value on the wire for length. + */ + int getLengthValue(); + /** + * .cosmos.ics23.v1.LengthOp length = 4 [json_name = "length"]; + * @return The length. + */ + com.cosmos.ics23.v1.LengthOp getLength(); + + /** + *
+   * prefix is a fixed bytes that may optionally be included at the beginning to differentiate
+   * a leaf node from an inner node.
+   * 
+ * + * bytes prefix = 5 [json_name = "prefix"]; + * @return The prefix. + */ + com.google.protobuf.ByteString getPrefix(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/LengthOp.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/LengthOp.java new file mode 100644 index 000000000..0ba745860 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/LengthOp.java @@ -0,0 +1,237 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: cosmos/ics23/v1/proofs.proto + +package com.cosmos.ics23.v1; + +/** + *
+ **
+ *LengthOp defines how to process the key and value of the LeafOp
+ *to include length information. After encoding the length with the given
+ *algorithm, the length will be prepended to the key and value bytes.
+ *(Each one with it's own encoded length)
+ * 
+ * + * Protobuf enum {@code cosmos.ics23.v1.LengthOp} + */ +public enum LengthOp + implements com.google.protobuf.Internal.EnumLite { + /** + *
+   * NO_PREFIX don't include any length info
+   * 
+ * + * NO_PREFIX = 0; + */ + NO_PREFIX(0), + /** + *
+   * VAR_PROTO uses protobuf (and go-amino) varint encoding of the length
+   * 
+ * + * VAR_PROTO = 1; + */ + VAR_PROTO(1), + /** + *
+   * VAR_RLP uses rlp int encoding of the length
+   * 
+ * + * VAR_RLP = 2; + */ + VAR_RLP(2), + /** + *
+   * FIXED32_BIG uses big-endian encoding of the length as a 32 bit integer
+   * 
+ * + * FIXED32_BIG = 3; + */ + FIXED32_BIG(3), + /** + *
+   * FIXED32_LITTLE uses little-endian encoding of the length as a 32 bit integer
+   * 
+ * + * FIXED32_LITTLE = 4; + */ + FIXED32_LITTLE(4), + /** + *
+   * FIXED64_BIG uses big-endian encoding of the length as a 64 bit integer
+   * 
+ * + * FIXED64_BIG = 5; + */ + FIXED64_BIG(5), + /** + *
+   * FIXED64_LITTLE uses little-endian encoding of the length as a 64 bit integer
+   * 
+ * + * FIXED64_LITTLE = 6; + */ + FIXED64_LITTLE(6), + /** + *
+   * REQUIRE_32_BYTES is like NONE, but will fail if the input is not exactly 32 bytes (sha256 output)
+   * 
+ * + * REQUIRE_32_BYTES = 7; + */ + REQUIRE_32_BYTES(7), + /** + *
+   * REQUIRE_64_BYTES is like NONE, but will fail if the input is not exactly 64 bytes (sha512 output)
+   * 
+ * + * REQUIRE_64_BYTES = 8; + */ + REQUIRE_64_BYTES(8), + UNRECOGNIZED(-1), + ; + + /** + *
+   * NO_PREFIX don't include any length info
+   * 
+ * + * NO_PREFIX = 0; + */ + public static final int NO_PREFIX_VALUE = 0; + /** + *
+   * VAR_PROTO uses protobuf (and go-amino) varint encoding of the length
+   * 
+ * + * VAR_PROTO = 1; + */ + public static final int VAR_PROTO_VALUE = 1; + /** + *
+   * VAR_RLP uses rlp int encoding of the length
+   * 
+ * + * VAR_RLP = 2; + */ + public static final int VAR_RLP_VALUE = 2; + /** + *
+   * FIXED32_BIG uses big-endian encoding of the length as a 32 bit integer
+   * 
+ * + * FIXED32_BIG = 3; + */ + public static final int FIXED32_BIG_VALUE = 3; + /** + *
+   * FIXED32_LITTLE uses little-endian encoding of the length as a 32 bit integer
+   * 
+ * + * FIXED32_LITTLE = 4; + */ + public static final int FIXED32_LITTLE_VALUE = 4; + /** + *
+   * FIXED64_BIG uses big-endian encoding of the length as a 64 bit integer
+   * 
+ * + * FIXED64_BIG = 5; + */ + public static final int FIXED64_BIG_VALUE = 5; + /** + *
+   * FIXED64_LITTLE uses little-endian encoding of the length as a 64 bit integer
+   * 
+ * + * FIXED64_LITTLE = 6; + */ + public static final int FIXED64_LITTLE_VALUE = 6; + /** + *
+   * REQUIRE_32_BYTES is like NONE, but will fail if the input is not exactly 32 bytes (sha256 output)
+   * 
+ * + * REQUIRE_32_BYTES = 7; + */ + public static final int REQUIRE_32_BYTES_VALUE = 7; + /** + *
+   * REQUIRE_64_BYTES is like NONE, but will fail if the input is not exactly 64 bytes (sha512 output)
+   * 
+ * + * REQUIRE_64_BYTES = 8; + */ + public static final int REQUIRE_64_BYTES_VALUE = 8; + + + @java.lang.Override + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static LengthOp valueOf(int value) { + return forNumber(value); + } + + public static LengthOp forNumber(int value) { + switch (value) { + case 0: return NO_PREFIX; + case 1: return VAR_PROTO; + case 2: return VAR_RLP; + case 3: return FIXED32_BIG; + case 4: return FIXED32_LITTLE; + case 5: return FIXED64_BIG; + case 6: return FIXED64_LITTLE; + case 7: return REQUIRE_32_BYTES; + case 8: return REQUIRE_64_BYTES; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + LengthOp> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + @java.lang.Override + public LengthOp findValueByNumber(int number) { + return LengthOp.forNumber(number); + } + }; + + public static com.google.protobuf.Internal.EnumVerifier + internalGetVerifier() { + return LengthOpVerifier.INSTANCE; + } + + private static final class LengthOpVerifier implements + com.google.protobuf.Internal.EnumVerifier { + static final com.google.protobuf.Internal.EnumVerifier INSTANCE = new LengthOpVerifier(); + @java.lang.Override + public boolean isInRange(int number) { + return LengthOp.forNumber(number) != null; + } + }; + + private final int value; + + private LengthOp(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:cosmos.ics23.v1.LengthOp) +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/NonExistenceProof.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/NonExistenceProof.java new file mode 100644 index 000000000..bcedc7ac5 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/NonExistenceProof.java @@ -0,0 +1,465 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: cosmos/ics23/v1/proofs.proto + +package com.cosmos.ics23.v1; + +/** + *
+ *NonExistenceProof takes a proof of two neighbors, one left of the desired key,
+ *one right of the desired key. If both proofs are valid AND they are neighbors,
+ *then there is no valid proof for the given key.
+ * 
+ * + * Protobuf type {@code cosmos.ics23.v1.NonExistenceProof} + */ +public final class NonExistenceProof extends + com.google.protobuf.GeneratedMessageLite< + NonExistenceProof, NonExistenceProof.Builder> implements + // @@protoc_insertion_point(message_implements:cosmos.ics23.v1.NonExistenceProof) + NonExistenceProofOrBuilder { + private NonExistenceProof() { + key_ = com.google.protobuf.ByteString.EMPTY; + } + public static final int KEY_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString key_; + /** + *
+   * TODO: remove this as unnecessary??? we prove a range
+   * 
+ * + * bytes key = 1 [json_name = "key"]; + * @return The key. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKey() { + return key_; + } + /** + *
+   * TODO: remove this as unnecessary??? we prove a range
+   * 
+ * + * bytes key = 1 [json_name = "key"]; + * @param value The key to set. + */ + private void setKey(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + key_ = value; + } + /** + *
+   * TODO: remove this as unnecessary??? we prove a range
+   * 
+ * + * bytes key = 1 [json_name = "key"]; + */ + private void clearKey() { + + key_ = getDefaultInstance().getKey(); + } + + public static final int LEFT_FIELD_NUMBER = 2; + private com.cosmos.ics23.v1.ExistenceProof left_; + /** + * .cosmos.ics23.v1.ExistenceProof left = 2 [json_name = "left"]; + */ + @java.lang.Override + public boolean hasLeft() { + return left_ != null; + } + /** + * .cosmos.ics23.v1.ExistenceProof left = 2 [json_name = "left"]; + */ + @java.lang.Override + public com.cosmos.ics23.v1.ExistenceProof getLeft() { + return left_ == null ? com.cosmos.ics23.v1.ExistenceProof.getDefaultInstance() : left_; + } + /** + * .cosmos.ics23.v1.ExistenceProof left = 2 [json_name = "left"]; + */ + private void setLeft(com.cosmos.ics23.v1.ExistenceProof value) { + value.getClass(); + left_ = value; + + } + /** + * .cosmos.ics23.v1.ExistenceProof left = 2 [json_name = "left"]; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeLeft(com.cosmos.ics23.v1.ExistenceProof value) { + value.getClass(); + if (left_ != null && + left_ != com.cosmos.ics23.v1.ExistenceProof.getDefaultInstance()) { + left_ = + com.cosmos.ics23.v1.ExistenceProof.newBuilder(left_).mergeFrom(value).buildPartial(); + } else { + left_ = value; + } + + } + /** + * .cosmos.ics23.v1.ExistenceProof left = 2 [json_name = "left"]; + */ + private void clearLeft() { left_ = null; + + } + + public static final int RIGHT_FIELD_NUMBER = 3; + private com.cosmos.ics23.v1.ExistenceProof right_; + /** + * .cosmos.ics23.v1.ExistenceProof right = 3 [json_name = "right"]; + */ + @java.lang.Override + public boolean hasRight() { + return right_ != null; + } + /** + * .cosmos.ics23.v1.ExistenceProof right = 3 [json_name = "right"]; + */ + @java.lang.Override + public com.cosmos.ics23.v1.ExistenceProof getRight() { + return right_ == null ? com.cosmos.ics23.v1.ExistenceProof.getDefaultInstance() : right_; + } + /** + * .cosmos.ics23.v1.ExistenceProof right = 3 [json_name = "right"]; + */ + private void setRight(com.cosmos.ics23.v1.ExistenceProof value) { + value.getClass(); + right_ = value; + + } + /** + * .cosmos.ics23.v1.ExistenceProof right = 3 [json_name = "right"]; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeRight(com.cosmos.ics23.v1.ExistenceProof value) { + value.getClass(); + if (right_ != null && + right_ != com.cosmos.ics23.v1.ExistenceProof.getDefaultInstance()) { + right_ = + com.cosmos.ics23.v1.ExistenceProof.newBuilder(right_).mergeFrom(value).buildPartial(); + } else { + right_ = value; + } + + } + /** + * .cosmos.ics23.v1.ExistenceProof right = 3 [json_name = "right"]; + */ + private void clearRight() { right_ = null; + + } + + public static com.cosmos.ics23.v1.NonExistenceProof parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.cosmos.ics23.v1.NonExistenceProof parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.cosmos.ics23.v1.NonExistenceProof parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.cosmos.ics23.v1.NonExistenceProof parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.cosmos.ics23.v1.NonExistenceProof parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.cosmos.ics23.v1.NonExistenceProof parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.cosmos.ics23.v1.NonExistenceProof parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.cosmos.ics23.v1.NonExistenceProof parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.cosmos.ics23.v1.NonExistenceProof parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.cosmos.ics23.v1.NonExistenceProof parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.cosmos.ics23.v1.NonExistenceProof parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.cosmos.ics23.v1.NonExistenceProof parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.cosmos.ics23.v1.NonExistenceProof prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+   *NonExistenceProof takes a proof of two neighbors, one left of the desired key,
+   *one right of the desired key. If both proofs are valid AND they are neighbors,
+   *then there is no valid proof for the given key.
+   * 
+ * + * Protobuf type {@code cosmos.ics23.v1.NonExistenceProof} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.cosmos.ics23.v1.NonExistenceProof, Builder> implements + // @@protoc_insertion_point(builder_implements:cosmos.ics23.v1.NonExistenceProof) + com.cosmos.ics23.v1.NonExistenceProofOrBuilder { + // Construct using com.cosmos.ics23.v1.NonExistenceProof.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + *
+     * TODO: remove this as unnecessary??? we prove a range
+     * 
+ * + * bytes key = 1 [json_name = "key"]; + * @return The key. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKey() { + return instance.getKey(); + } + /** + *
+     * TODO: remove this as unnecessary??? we prove a range
+     * 
+ * + * bytes key = 1 [json_name = "key"]; + * @param value The key to set. + * @return This builder for chaining. + */ + public Builder setKey(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setKey(value); + return this; + } + /** + *
+     * TODO: remove this as unnecessary??? we prove a range
+     * 
+ * + * bytes key = 1 [json_name = "key"]; + * @return This builder for chaining. + */ + public Builder clearKey() { + copyOnWrite(); + instance.clearKey(); + return this; + } + + /** + * .cosmos.ics23.v1.ExistenceProof left = 2 [json_name = "left"]; + */ + @java.lang.Override + public boolean hasLeft() { + return instance.hasLeft(); + } + /** + * .cosmos.ics23.v1.ExistenceProof left = 2 [json_name = "left"]; + */ + @java.lang.Override + public com.cosmos.ics23.v1.ExistenceProof getLeft() { + return instance.getLeft(); + } + /** + * .cosmos.ics23.v1.ExistenceProof left = 2 [json_name = "left"]; + */ + public Builder setLeft(com.cosmos.ics23.v1.ExistenceProof value) { + copyOnWrite(); + instance.setLeft(value); + return this; + } + /** + * .cosmos.ics23.v1.ExistenceProof left = 2 [json_name = "left"]; + */ + public Builder setLeft( + com.cosmos.ics23.v1.ExistenceProof.Builder builderForValue) { + copyOnWrite(); + instance.setLeft(builderForValue.build()); + return this; + } + /** + * .cosmos.ics23.v1.ExistenceProof left = 2 [json_name = "left"]; + */ + public Builder mergeLeft(com.cosmos.ics23.v1.ExistenceProof value) { + copyOnWrite(); + instance.mergeLeft(value); + return this; + } + /** + * .cosmos.ics23.v1.ExistenceProof left = 2 [json_name = "left"]; + */ + public Builder clearLeft() { copyOnWrite(); + instance.clearLeft(); + return this; + } + + /** + * .cosmos.ics23.v1.ExistenceProof right = 3 [json_name = "right"]; + */ + @java.lang.Override + public boolean hasRight() { + return instance.hasRight(); + } + /** + * .cosmos.ics23.v1.ExistenceProof right = 3 [json_name = "right"]; + */ + @java.lang.Override + public com.cosmos.ics23.v1.ExistenceProof getRight() { + return instance.getRight(); + } + /** + * .cosmos.ics23.v1.ExistenceProof right = 3 [json_name = "right"]; + */ + public Builder setRight(com.cosmos.ics23.v1.ExistenceProof value) { + copyOnWrite(); + instance.setRight(value); + return this; + } + /** + * .cosmos.ics23.v1.ExistenceProof right = 3 [json_name = "right"]; + */ + public Builder setRight( + com.cosmos.ics23.v1.ExistenceProof.Builder builderForValue) { + copyOnWrite(); + instance.setRight(builderForValue.build()); + return this; + } + /** + * .cosmos.ics23.v1.ExistenceProof right = 3 [json_name = "right"]; + */ + public Builder mergeRight(com.cosmos.ics23.v1.ExistenceProof value) { + copyOnWrite(); + instance.mergeRight(value); + return this; + } + /** + * .cosmos.ics23.v1.ExistenceProof right = 3 [json_name = "right"]; + */ + public Builder clearRight() { copyOnWrite(); + instance.clearRight(); + return this; + } + + // @@protoc_insertion_point(builder_scope:cosmos.ics23.v1.NonExistenceProof) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.cosmos.ics23.v1.NonExistenceProof(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "key_", + "left_", + "right_", + }; + java.lang.String info = + "\u0000\u0003\u0000\u0000\u0001\u0003\u0003\u0000\u0000\u0000\u0001\n\u0002\t\u0003" + + "\t"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.cosmos.ics23.v1.NonExistenceProof.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:cosmos.ics23.v1.NonExistenceProof) + private static final com.cosmos.ics23.v1.NonExistenceProof DEFAULT_INSTANCE; + static { + NonExistenceProof defaultInstance = new NonExistenceProof(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + NonExistenceProof.class, defaultInstance); + } + + public static com.cosmos.ics23.v1.NonExistenceProof getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/NonExistenceProofOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/NonExistenceProofOrBuilder.java new file mode 100644 index 000000000..e6c2eafb2 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/NonExistenceProofOrBuilder.java @@ -0,0 +1,41 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: cosmos/ics23/v1/proofs.proto + +package com.cosmos.ics23.v1; + +public interface NonExistenceProofOrBuilder extends + // @@protoc_insertion_point(interface_extends:cosmos.ics23.v1.NonExistenceProof) + com.google.protobuf.MessageLiteOrBuilder { + + /** + *
+   * TODO: remove this as unnecessary??? we prove a range
+   * 
+ * + * bytes key = 1 [json_name = "key"]; + * @return The key. + */ + com.google.protobuf.ByteString getKey(); + + /** + * .cosmos.ics23.v1.ExistenceProof left = 2 [json_name = "left"]; + * @return Whether the left field is set. + */ + boolean hasLeft(); + /** + * .cosmos.ics23.v1.ExistenceProof left = 2 [json_name = "left"]; + * @return The left. + */ + com.cosmos.ics23.v1.ExistenceProof getLeft(); + + /** + * .cosmos.ics23.v1.ExistenceProof right = 3 [json_name = "right"]; + * @return Whether the right field is set. + */ + boolean hasRight(); + /** + * .cosmos.ics23.v1.ExistenceProof right = 3 [json_name = "right"]; + * @return The right. + */ + com.cosmos.ics23.v1.ExistenceProof getRight(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/ProofSpec.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/ProofSpec.java new file mode 100644 index 000000000..ac8dd70cc --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/ProofSpec.java @@ -0,0 +1,609 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: cosmos/ics23/v1/proofs.proto + +package com.cosmos.ics23.v1; + +/** + *
+ **
+ *ProofSpec defines what the expected parameters are for a given proof type.
+ *This can be stored in the client and used to validate any incoming proofs.
+ *verify(ProofSpec, Proof) -> Proof | Error
+ *As demonstrated in tests, if we don't fix the algorithm used to calculate the
+ *LeafHash for a given tree, there are many possible key-value pairs that can
+ *generate a given hash (by interpretting the preimage differently).
+ *We need this for proper security, requires client knows a priori what
+ *tree format server uses. But not in code, rather a configuration object.
+ * 
+ * + * Protobuf type {@code cosmos.ics23.v1.ProofSpec} + */ +public final class ProofSpec extends + com.google.protobuf.GeneratedMessageLite< + ProofSpec, ProofSpec.Builder> implements + // @@protoc_insertion_point(message_implements:cosmos.ics23.v1.ProofSpec) + ProofSpecOrBuilder { + private ProofSpec() { + } + public static final int LEAF_SPEC_FIELD_NUMBER = 1; + private com.cosmos.ics23.v1.LeafOp leafSpec_; + /** + *
+   * any field in the ExistenceProof must be the same as in this spec.
+   * except Prefix, which is just the first bytes of prefix (spec can be longer)
+   * 
+ * + * .cosmos.ics23.v1.LeafOp leaf_spec = 1 [json_name = "leafSpec"]; + */ + @java.lang.Override + public boolean hasLeafSpec() { + return leafSpec_ != null; + } + /** + *
+   * any field in the ExistenceProof must be the same as in this spec.
+   * except Prefix, which is just the first bytes of prefix (spec can be longer)
+   * 
+ * + * .cosmos.ics23.v1.LeafOp leaf_spec = 1 [json_name = "leafSpec"]; + */ + @java.lang.Override + public com.cosmos.ics23.v1.LeafOp getLeafSpec() { + return leafSpec_ == null ? com.cosmos.ics23.v1.LeafOp.getDefaultInstance() : leafSpec_; + } + /** + *
+   * any field in the ExistenceProof must be the same as in this spec.
+   * except Prefix, which is just the first bytes of prefix (spec can be longer)
+   * 
+ * + * .cosmos.ics23.v1.LeafOp leaf_spec = 1 [json_name = "leafSpec"]; + */ + private void setLeafSpec(com.cosmos.ics23.v1.LeafOp value) { + value.getClass(); + leafSpec_ = value; + + } + /** + *
+   * any field in the ExistenceProof must be the same as in this spec.
+   * except Prefix, which is just the first bytes of prefix (spec can be longer)
+   * 
+ * + * .cosmos.ics23.v1.LeafOp leaf_spec = 1 [json_name = "leafSpec"]; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeLeafSpec(com.cosmos.ics23.v1.LeafOp value) { + value.getClass(); + if (leafSpec_ != null && + leafSpec_ != com.cosmos.ics23.v1.LeafOp.getDefaultInstance()) { + leafSpec_ = + com.cosmos.ics23.v1.LeafOp.newBuilder(leafSpec_).mergeFrom(value).buildPartial(); + } else { + leafSpec_ = value; + } + + } + /** + *
+   * any field in the ExistenceProof must be the same as in this spec.
+   * except Prefix, which is just the first bytes of prefix (spec can be longer)
+   * 
+ * + * .cosmos.ics23.v1.LeafOp leaf_spec = 1 [json_name = "leafSpec"]; + */ + private void clearLeafSpec() { leafSpec_ = null; + + } + + public static final int INNER_SPEC_FIELD_NUMBER = 2; + private com.cosmos.ics23.v1.InnerSpec innerSpec_; + /** + * .cosmos.ics23.v1.InnerSpec inner_spec = 2 [json_name = "innerSpec"]; + */ + @java.lang.Override + public boolean hasInnerSpec() { + return innerSpec_ != null; + } + /** + * .cosmos.ics23.v1.InnerSpec inner_spec = 2 [json_name = "innerSpec"]; + */ + @java.lang.Override + public com.cosmos.ics23.v1.InnerSpec getInnerSpec() { + return innerSpec_ == null ? com.cosmos.ics23.v1.InnerSpec.getDefaultInstance() : innerSpec_; + } + /** + * .cosmos.ics23.v1.InnerSpec inner_spec = 2 [json_name = "innerSpec"]; + */ + private void setInnerSpec(com.cosmos.ics23.v1.InnerSpec value) { + value.getClass(); + innerSpec_ = value; + + } + /** + * .cosmos.ics23.v1.InnerSpec inner_spec = 2 [json_name = "innerSpec"]; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeInnerSpec(com.cosmos.ics23.v1.InnerSpec value) { + value.getClass(); + if (innerSpec_ != null && + innerSpec_ != com.cosmos.ics23.v1.InnerSpec.getDefaultInstance()) { + innerSpec_ = + com.cosmos.ics23.v1.InnerSpec.newBuilder(innerSpec_).mergeFrom(value).buildPartial(); + } else { + innerSpec_ = value; + } + + } + /** + * .cosmos.ics23.v1.InnerSpec inner_spec = 2 [json_name = "innerSpec"]; + */ + private void clearInnerSpec() { innerSpec_ = null; + + } + + public static final int MAX_DEPTH_FIELD_NUMBER = 3; + private int maxDepth_; + /** + *
+   * max_depth (if > 0) is the maximum number of InnerOps allowed (mainly for fixed-depth tries)
+   * 
+ * + * int32 max_depth = 3 [json_name = "maxDepth"]; + * @return The maxDepth. + */ + @java.lang.Override + public int getMaxDepth() { + return maxDepth_; + } + /** + *
+   * max_depth (if > 0) is the maximum number of InnerOps allowed (mainly for fixed-depth tries)
+   * 
+ * + * int32 max_depth = 3 [json_name = "maxDepth"]; + * @param value The maxDepth to set. + */ + private void setMaxDepth(int value) { + + maxDepth_ = value; + } + /** + *
+   * max_depth (if > 0) is the maximum number of InnerOps allowed (mainly for fixed-depth tries)
+   * 
+ * + * int32 max_depth = 3 [json_name = "maxDepth"]; + */ + private void clearMaxDepth() { + + maxDepth_ = 0; + } + + public static final int MIN_DEPTH_FIELD_NUMBER = 4; + private int minDepth_; + /** + *
+   * min_depth (if > 0) is the minimum number of InnerOps allowed (mainly for fixed-depth tries)
+   * 
+ * + * int32 min_depth = 4 [json_name = "minDepth"]; + * @return The minDepth. + */ + @java.lang.Override + public int getMinDepth() { + return minDepth_; + } + /** + *
+   * min_depth (if > 0) is the minimum number of InnerOps allowed (mainly for fixed-depth tries)
+   * 
+ * + * int32 min_depth = 4 [json_name = "minDepth"]; + * @param value The minDepth to set. + */ + private void setMinDepth(int value) { + + minDepth_ = value; + } + /** + *
+   * min_depth (if > 0) is the minimum number of InnerOps allowed (mainly for fixed-depth tries)
+   * 
+ * + * int32 min_depth = 4 [json_name = "minDepth"]; + */ + private void clearMinDepth() { + + minDepth_ = 0; + } + + public static com.cosmos.ics23.v1.ProofSpec parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.cosmos.ics23.v1.ProofSpec parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.cosmos.ics23.v1.ProofSpec parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.cosmos.ics23.v1.ProofSpec parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.cosmos.ics23.v1.ProofSpec parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.cosmos.ics23.v1.ProofSpec parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.cosmos.ics23.v1.ProofSpec parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.cosmos.ics23.v1.ProofSpec parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.cosmos.ics23.v1.ProofSpec parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.cosmos.ics23.v1.ProofSpec parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.cosmos.ics23.v1.ProofSpec parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.cosmos.ics23.v1.ProofSpec parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.cosmos.ics23.v1.ProofSpec prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+   **
+   *ProofSpec defines what the expected parameters are for a given proof type.
+   *This can be stored in the client and used to validate any incoming proofs.
+   *verify(ProofSpec, Proof) -> Proof | Error
+   *As demonstrated in tests, if we don't fix the algorithm used to calculate the
+   *LeafHash for a given tree, there are many possible key-value pairs that can
+   *generate a given hash (by interpretting the preimage differently).
+   *We need this for proper security, requires client knows a priori what
+   *tree format server uses. But not in code, rather a configuration object.
+   * 
+ * + * Protobuf type {@code cosmos.ics23.v1.ProofSpec} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.cosmos.ics23.v1.ProofSpec, Builder> implements + // @@protoc_insertion_point(builder_implements:cosmos.ics23.v1.ProofSpec) + com.cosmos.ics23.v1.ProofSpecOrBuilder { + // Construct using com.cosmos.ics23.v1.ProofSpec.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + *
+     * any field in the ExistenceProof must be the same as in this spec.
+     * except Prefix, which is just the first bytes of prefix (spec can be longer)
+     * 
+ * + * .cosmos.ics23.v1.LeafOp leaf_spec = 1 [json_name = "leafSpec"]; + */ + @java.lang.Override + public boolean hasLeafSpec() { + return instance.hasLeafSpec(); + } + /** + *
+     * any field in the ExistenceProof must be the same as in this spec.
+     * except Prefix, which is just the first bytes of prefix (spec can be longer)
+     * 
+ * + * .cosmos.ics23.v1.LeafOp leaf_spec = 1 [json_name = "leafSpec"]; + */ + @java.lang.Override + public com.cosmos.ics23.v1.LeafOp getLeafSpec() { + return instance.getLeafSpec(); + } + /** + *
+     * any field in the ExistenceProof must be the same as in this spec.
+     * except Prefix, which is just the first bytes of prefix (spec can be longer)
+     * 
+ * + * .cosmos.ics23.v1.LeafOp leaf_spec = 1 [json_name = "leafSpec"]; + */ + public Builder setLeafSpec(com.cosmos.ics23.v1.LeafOp value) { + copyOnWrite(); + instance.setLeafSpec(value); + return this; + } + /** + *
+     * any field in the ExistenceProof must be the same as in this spec.
+     * except Prefix, which is just the first bytes of prefix (spec can be longer)
+     * 
+ * + * .cosmos.ics23.v1.LeafOp leaf_spec = 1 [json_name = "leafSpec"]; + */ + public Builder setLeafSpec( + com.cosmos.ics23.v1.LeafOp.Builder builderForValue) { + copyOnWrite(); + instance.setLeafSpec(builderForValue.build()); + return this; + } + /** + *
+     * any field in the ExistenceProof must be the same as in this spec.
+     * except Prefix, which is just the first bytes of prefix (spec can be longer)
+     * 
+ * + * .cosmos.ics23.v1.LeafOp leaf_spec = 1 [json_name = "leafSpec"]; + */ + public Builder mergeLeafSpec(com.cosmos.ics23.v1.LeafOp value) { + copyOnWrite(); + instance.mergeLeafSpec(value); + return this; + } + /** + *
+     * any field in the ExistenceProof must be the same as in this spec.
+     * except Prefix, which is just the first bytes of prefix (spec can be longer)
+     * 
+ * + * .cosmos.ics23.v1.LeafOp leaf_spec = 1 [json_name = "leafSpec"]; + */ + public Builder clearLeafSpec() { copyOnWrite(); + instance.clearLeafSpec(); + return this; + } + + /** + * .cosmos.ics23.v1.InnerSpec inner_spec = 2 [json_name = "innerSpec"]; + */ + @java.lang.Override + public boolean hasInnerSpec() { + return instance.hasInnerSpec(); + } + /** + * .cosmos.ics23.v1.InnerSpec inner_spec = 2 [json_name = "innerSpec"]; + */ + @java.lang.Override + public com.cosmos.ics23.v1.InnerSpec getInnerSpec() { + return instance.getInnerSpec(); + } + /** + * .cosmos.ics23.v1.InnerSpec inner_spec = 2 [json_name = "innerSpec"]; + */ + public Builder setInnerSpec(com.cosmos.ics23.v1.InnerSpec value) { + copyOnWrite(); + instance.setInnerSpec(value); + return this; + } + /** + * .cosmos.ics23.v1.InnerSpec inner_spec = 2 [json_name = "innerSpec"]; + */ + public Builder setInnerSpec( + com.cosmos.ics23.v1.InnerSpec.Builder builderForValue) { + copyOnWrite(); + instance.setInnerSpec(builderForValue.build()); + return this; + } + /** + * .cosmos.ics23.v1.InnerSpec inner_spec = 2 [json_name = "innerSpec"]; + */ + public Builder mergeInnerSpec(com.cosmos.ics23.v1.InnerSpec value) { + copyOnWrite(); + instance.mergeInnerSpec(value); + return this; + } + /** + * .cosmos.ics23.v1.InnerSpec inner_spec = 2 [json_name = "innerSpec"]; + */ + public Builder clearInnerSpec() { copyOnWrite(); + instance.clearInnerSpec(); + return this; + } + + /** + *
+     * max_depth (if > 0) is the maximum number of InnerOps allowed (mainly for fixed-depth tries)
+     * 
+ * + * int32 max_depth = 3 [json_name = "maxDepth"]; + * @return The maxDepth. + */ + @java.lang.Override + public int getMaxDepth() { + return instance.getMaxDepth(); + } + /** + *
+     * max_depth (if > 0) is the maximum number of InnerOps allowed (mainly for fixed-depth tries)
+     * 
+ * + * int32 max_depth = 3 [json_name = "maxDepth"]; + * @param value The maxDepth to set. + * @return This builder for chaining. + */ + public Builder setMaxDepth(int value) { + copyOnWrite(); + instance.setMaxDepth(value); + return this; + } + /** + *
+     * max_depth (if > 0) is the maximum number of InnerOps allowed (mainly for fixed-depth tries)
+     * 
+ * + * int32 max_depth = 3 [json_name = "maxDepth"]; + * @return This builder for chaining. + */ + public Builder clearMaxDepth() { + copyOnWrite(); + instance.clearMaxDepth(); + return this; + } + + /** + *
+     * min_depth (if > 0) is the minimum number of InnerOps allowed (mainly for fixed-depth tries)
+     * 
+ * + * int32 min_depth = 4 [json_name = "minDepth"]; + * @return The minDepth. + */ + @java.lang.Override + public int getMinDepth() { + return instance.getMinDepth(); + } + /** + *
+     * min_depth (if > 0) is the minimum number of InnerOps allowed (mainly for fixed-depth tries)
+     * 
+ * + * int32 min_depth = 4 [json_name = "minDepth"]; + * @param value The minDepth to set. + * @return This builder for chaining. + */ + public Builder setMinDepth(int value) { + copyOnWrite(); + instance.setMinDepth(value); + return this; + } + /** + *
+     * min_depth (if > 0) is the minimum number of InnerOps allowed (mainly for fixed-depth tries)
+     * 
+ * + * int32 min_depth = 4 [json_name = "minDepth"]; + * @return This builder for chaining. + */ + public Builder clearMinDepth() { + copyOnWrite(); + instance.clearMinDepth(); + return this; + } + + // @@protoc_insertion_point(builder_scope:cosmos.ics23.v1.ProofSpec) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.cosmos.ics23.v1.ProofSpec(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "leafSpec_", + "innerSpec_", + "maxDepth_", + "minDepth_", + }; + java.lang.String info = + "\u0000\u0004\u0000\u0000\u0001\u0004\u0004\u0000\u0000\u0000\u0001\t\u0002\t\u0003" + + "\u0004\u0004\u0004"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.cosmos.ics23.v1.ProofSpec.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:cosmos.ics23.v1.ProofSpec) + private static final com.cosmos.ics23.v1.ProofSpec DEFAULT_INSTANCE; + static { + ProofSpec defaultInstance = new ProofSpec(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + ProofSpec.class, defaultInstance); + } + + public static com.cosmos.ics23.v1.ProofSpec getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/ProofSpecOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/ProofSpecOrBuilder.java new file mode 100644 index 000000000..0474e959a --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/ProofSpecOrBuilder.java @@ -0,0 +1,61 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: cosmos/ics23/v1/proofs.proto + +package com.cosmos.ics23.v1; + +public interface ProofSpecOrBuilder extends + // @@protoc_insertion_point(interface_extends:cosmos.ics23.v1.ProofSpec) + com.google.protobuf.MessageLiteOrBuilder { + + /** + *
+   * any field in the ExistenceProof must be the same as in this spec.
+   * except Prefix, which is just the first bytes of prefix (spec can be longer)
+   * 
+ * + * .cosmos.ics23.v1.LeafOp leaf_spec = 1 [json_name = "leafSpec"]; + * @return Whether the leafSpec field is set. + */ + boolean hasLeafSpec(); + /** + *
+   * any field in the ExistenceProof must be the same as in this spec.
+   * except Prefix, which is just the first bytes of prefix (spec can be longer)
+   * 
+ * + * .cosmos.ics23.v1.LeafOp leaf_spec = 1 [json_name = "leafSpec"]; + * @return The leafSpec. + */ + com.cosmos.ics23.v1.LeafOp getLeafSpec(); + + /** + * .cosmos.ics23.v1.InnerSpec inner_spec = 2 [json_name = "innerSpec"]; + * @return Whether the innerSpec field is set. + */ + boolean hasInnerSpec(); + /** + * .cosmos.ics23.v1.InnerSpec inner_spec = 2 [json_name = "innerSpec"]; + * @return The innerSpec. + */ + com.cosmos.ics23.v1.InnerSpec getInnerSpec(); + + /** + *
+   * max_depth (if > 0) is the maximum number of InnerOps allowed (mainly for fixed-depth tries)
+   * 
+ * + * int32 max_depth = 3 [json_name = "maxDepth"]; + * @return The maxDepth. + */ + int getMaxDepth(); + + /** + *
+   * min_depth (if > 0) is the minimum number of InnerOps allowed (mainly for fixed-depth tries)
+   * 
+ * + * int32 min_depth = 4 [json_name = "minDepth"]; + * @return The minDepth. + */ + int getMinDepth(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/ProofsProto.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/ProofsProto.java new file mode 100644 index 000000000..ccf4bd65c --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/ProofsProto.java @@ -0,0 +1,16 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: cosmos/ics23/v1/proofs.proto + +package com.cosmos.ics23.v1; + +public final class ProofsProto { + private ProofsProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + static { + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/upgrade/v1beta1/CancelSoftwareUpgradeProposal.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/upgrade/v1beta1/CancelSoftwareUpgradeProposal.java new file mode 100644 index 000000000..7010f5392 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/upgrade/v1beta1/CancelSoftwareUpgradeProposal.java @@ -0,0 +1,474 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: cosmos/upgrade/v1beta1/upgrade.proto + +package com.cosmos.upgrade.v1beta1; + +/** + *
+ * CancelSoftwareUpgradeProposal is a gov Content type for cancelling a software
+ * upgrade.
+ * Deprecated: This legacy proposal is deprecated in favor of Msg-based gov
+ * proposals, see MsgCancelUpgrade.
+ * 
+ * + * Protobuf type {@code cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal} + */ +@java.lang.Deprecated public final class CancelSoftwareUpgradeProposal extends + com.google.protobuf.GeneratedMessageLite< + CancelSoftwareUpgradeProposal, CancelSoftwareUpgradeProposal.Builder> implements + // @@protoc_insertion_point(message_implements:cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal) + CancelSoftwareUpgradeProposalOrBuilder { + private CancelSoftwareUpgradeProposal() { + title_ = ""; + description_ = ""; + } + public static final int TITLE_FIELD_NUMBER = 1; + private java.lang.String title_; + /** + *
+   * title of the proposal
+   * 
+ * + * string title = 1 [json_name = "title"]; + * @return The title. + */ + @java.lang.Override + public java.lang.String getTitle() { + return title_; + } + /** + *
+   * title of the proposal
+   * 
+ * + * string title = 1 [json_name = "title"]; + * @return The bytes for title. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTitleBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(title_); + } + /** + *
+   * title of the proposal
+   * 
+ * + * string title = 1 [json_name = "title"]; + * @param value The title to set. + */ + private void setTitle( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + title_ = value; + } + /** + *
+   * title of the proposal
+   * 
+ * + * string title = 1 [json_name = "title"]; + */ + private void clearTitle() { + + title_ = getDefaultInstance().getTitle(); + } + /** + *
+   * title of the proposal
+   * 
+ * + * string title = 1 [json_name = "title"]; + * @param value The bytes for title to set. + */ + private void setTitleBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + title_ = value.toStringUtf8(); + + } + + public static final int DESCRIPTION_FIELD_NUMBER = 2; + private java.lang.String description_; + /** + *
+   * description of the proposal
+   * 
+ * + * string description = 2 [json_name = "description"]; + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + return description_; + } + /** + *
+   * description of the proposal
+   * 
+ * + * string description = 2 [json_name = "description"]; + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDescriptionBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(description_); + } + /** + *
+   * description of the proposal
+   * 
+ * + * string description = 2 [json_name = "description"]; + * @param value The description to set. + */ + private void setDescription( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + description_ = value; + } + /** + *
+   * description of the proposal
+   * 
+ * + * string description = 2 [json_name = "description"]; + */ + private void clearDescription() { + + description_ = getDefaultInstance().getDescription(); + } + /** + *
+   * description of the proposal
+   * 
+ * + * string description = 2 [json_name = "description"]; + * @param value The bytes for description to set. + */ + private void setDescriptionBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + description_ = value.toStringUtf8(); + + } + + public static com.cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+   * CancelSoftwareUpgradeProposal is a gov Content type for cancelling a software
+   * upgrade.
+   * Deprecated: This legacy proposal is deprecated in favor of Msg-based gov
+   * proposals, see MsgCancelUpgrade.
+   * 
+ * + * Protobuf type {@code cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal, Builder> implements + // @@protoc_insertion_point(builder_implements:cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal) + com.cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposalOrBuilder { + // Construct using com.cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + *
+     * title of the proposal
+     * 
+ * + * string title = 1 [json_name = "title"]; + * @return The title. + */ + @java.lang.Override + public java.lang.String getTitle() { + return instance.getTitle(); + } + /** + *
+     * title of the proposal
+     * 
+ * + * string title = 1 [json_name = "title"]; + * @return The bytes for title. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTitleBytes() { + return instance.getTitleBytes(); + } + /** + *
+     * title of the proposal
+     * 
+ * + * string title = 1 [json_name = "title"]; + * @param value The title to set. + * @return This builder for chaining. + */ + public Builder setTitle( + java.lang.String value) { + copyOnWrite(); + instance.setTitle(value); + return this; + } + /** + *
+     * title of the proposal
+     * 
+ * + * string title = 1 [json_name = "title"]; + * @return This builder for chaining. + */ + public Builder clearTitle() { + copyOnWrite(); + instance.clearTitle(); + return this; + } + /** + *
+     * title of the proposal
+     * 
+ * + * string title = 1 [json_name = "title"]; + * @param value The bytes for title to set. + * @return This builder for chaining. + */ + public Builder setTitleBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setTitleBytes(value); + return this; + } + + /** + *
+     * description of the proposal
+     * 
+ * + * string description = 2 [json_name = "description"]; + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + return instance.getDescription(); + } + /** + *
+     * description of the proposal
+     * 
+ * + * string description = 2 [json_name = "description"]; + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDescriptionBytes() { + return instance.getDescriptionBytes(); + } + /** + *
+     * description of the proposal
+     * 
+ * + * string description = 2 [json_name = "description"]; + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription( + java.lang.String value) { + copyOnWrite(); + instance.setDescription(value); + return this; + } + /** + *
+     * description of the proposal
+     * 
+ * + * string description = 2 [json_name = "description"]; + * @return This builder for chaining. + */ + public Builder clearDescription() { + copyOnWrite(); + instance.clearDescription(); + return this; + } + /** + *
+     * description of the proposal
+     * 
+ * + * string description = 2 [json_name = "description"]; + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setDescriptionBytes(value); + return this; + } + + // @@protoc_insertion_point(builder_scope:cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "title_", + "description_", + }; + java.lang.String info = + "\u0000\u0002\u0000\u0000\u0001\u0002\u0002\u0000\u0000\u0000\u0001\u0208\u0002\u0208" + + ""; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal) + private static final com.cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal DEFAULT_INSTANCE; + static { + CancelSoftwareUpgradeProposal defaultInstance = new CancelSoftwareUpgradeProposal(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + CancelSoftwareUpgradeProposal.class, defaultInstance); + } + + public static com.cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/upgrade/v1beta1/CancelSoftwareUpgradeProposalOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/upgrade/v1beta1/CancelSoftwareUpgradeProposalOrBuilder.java new file mode 100644 index 000000000..98433c695 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/upgrade/v1beta1/CancelSoftwareUpgradeProposalOrBuilder.java @@ -0,0 +1,49 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: cosmos/upgrade/v1beta1/upgrade.proto + +package com.cosmos.upgrade.v1beta1; + +@java.lang.Deprecated public interface CancelSoftwareUpgradeProposalOrBuilder extends + // @@protoc_insertion_point(interface_extends:cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal) + com.google.protobuf.MessageLiteOrBuilder { + + /** + *
+   * title of the proposal
+   * 
+ * + * string title = 1 [json_name = "title"]; + * @return The title. + */ + java.lang.String getTitle(); + /** + *
+   * title of the proposal
+   * 
+ * + * string title = 1 [json_name = "title"]; + * @return The bytes for title. + */ + com.google.protobuf.ByteString + getTitleBytes(); + + /** + *
+   * description of the proposal
+   * 
+ * + * string description = 2 [json_name = "description"]; + * @return The description. + */ + java.lang.String getDescription(); + /** + *
+   * description of the proposal
+   * 
+ * + * string description = 2 [json_name = "description"]; + * @return The bytes for description. + */ + com.google.protobuf.ByteString + getDescriptionBytes(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/upgrade/v1beta1/ModuleVersion.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/upgrade/v1beta1/ModuleVersion.java new file mode 100644 index 000000000..099f0312e --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/upgrade/v1beta1/ModuleVersion.java @@ -0,0 +1,411 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: cosmos/upgrade/v1beta1/upgrade.proto + +package com.cosmos.upgrade.v1beta1; + +/** + *
+ * ModuleVersion specifies a module and its consensus version.
+ * Since: cosmos-sdk 0.43
+ * 
+ * + * Protobuf type {@code cosmos.upgrade.v1beta1.ModuleVersion} + */ +public final class ModuleVersion extends + com.google.protobuf.GeneratedMessageLite< + ModuleVersion, ModuleVersion.Builder> implements + // @@protoc_insertion_point(message_implements:cosmos.upgrade.v1beta1.ModuleVersion) + ModuleVersionOrBuilder { + private ModuleVersion() { + name_ = ""; + } + public static final int NAME_FIELD_NUMBER = 1; + private java.lang.String name_; + /** + *
+   * name of the app module
+   * 
+ * + * string name = 1 [json_name = "name"]; + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + return name_; + } + /** + *
+   * name of the app module
+   * 
+ * + * string name = 1 [json_name = "name"]; + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNameBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(name_); + } + /** + *
+   * name of the app module
+   * 
+ * + * string name = 1 [json_name = "name"]; + * @param value The name to set. + */ + private void setName( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + name_ = value; + } + /** + *
+   * name of the app module
+   * 
+ * + * string name = 1 [json_name = "name"]; + */ + private void clearName() { + + name_ = getDefaultInstance().getName(); + } + /** + *
+   * name of the app module
+   * 
+ * + * string name = 1 [json_name = "name"]; + * @param value The bytes for name to set. + */ + private void setNameBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + name_ = value.toStringUtf8(); + + } + + public static final int VERSION_FIELD_NUMBER = 2; + private long version_; + /** + *
+   * consensus version of the app module
+   * 
+ * + * uint64 version = 2 [json_name = "version"]; + * @return The version. + */ + @java.lang.Override + public long getVersion() { + return version_; + } + /** + *
+   * consensus version of the app module
+   * 
+ * + * uint64 version = 2 [json_name = "version"]; + * @param value The version to set. + */ + private void setVersion(long value) { + + version_ = value; + } + /** + *
+   * consensus version of the app module
+   * 
+ * + * uint64 version = 2 [json_name = "version"]; + */ + private void clearVersion() { + + version_ = 0L; + } + + public static com.cosmos.upgrade.v1beta1.ModuleVersion parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.cosmos.upgrade.v1beta1.ModuleVersion parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.cosmos.upgrade.v1beta1.ModuleVersion parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.cosmos.upgrade.v1beta1.ModuleVersion parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.cosmos.upgrade.v1beta1.ModuleVersion parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.cosmos.upgrade.v1beta1.ModuleVersion parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.cosmos.upgrade.v1beta1.ModuleVersion parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.cosmos.upgrade.v1beta1.ModuleVersion parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.cosmos.upgrade.v1beta1.ModuleVersion parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.cosmos.upgrade.v1beta1.ModuleVersion parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.cosmos.upgrade.v1beta1.ModuleVersion parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.cosmos.upgrade.v1beta1.ModuleVersion parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.cosmos.upgrade.v1beta1.ModuleVersion prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+   * ModuleVersion specifies a module and its consensus version.
+   * Since: cosmos-sdk 0.43
+   * 
+ * + * Protobuf type {@code cosmos.upgrade.v1beta1.ModuleVersion} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.cosmos.upgrade.v1beta1.ModuleVersion, Builder> implements + // @@protoc_insertion_point(builder_implements:cosmos.upgrade.v1beta1.ModuleVersion) + com.cosmos.upgrade.v1beta1.ModuleVersionOrBuilder { + // Construct using com.cosmos.upgrade.v1beta1.ModuleVersion.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + *
+     * name of the app module
+     * 
+ * + * string name = 1 [json_name = "name"]; + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + return instance.getName(); + } + /** + *
+     * name of the app module
+     * 
+ * + * string name = 1 [json_name = "name"]; + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNameBytes() { + return instance.getNameBytes(); + } + /** + *
+     * name of the app module
+     * 
+ * + * string name = 1 [json_name = "name"]; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + copyOnWrite(); + instance.setName(value); + return this; + } + /** + *
+     * name of the app module
+     * 
+ * + * string name = 1 [json_name = "name"]; + * @return This builder for chaining. + */ + public Builder clearName() { + copyOnWrite(); + instance.clearName(); + return this; + } + /** + *
+     * name of the app module
+     * 
+ * + * string name = 1 [json_name = "name"]; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setNameBytes(value); + return this; + } + + /** + *
+     * consensus version of the app module
+     * 
+ * + * uint64 version = 2 [json_name = "version"]; + * @return The version. + */ + @java.lang.Override + public long getVersion() { + return instance.getVersion(); + } + /** + *
+     * consensus version of the app module
+     * 
+ * + * uint64 version = 2 [json_name = "version"]; + * @param value The version to set. + * @return This builder for chaining. + */ + public Builder setVersion(long value) { + copyOnWrite(); + instance.setVersion(value); + return this; + } + /** + *
+     * consensus version of the app module
+     * 
+ * + * uint64 version = 2 [json_name = "version"]; + * @return This builder for chaining. + */ + public Builder clearVersion() { + copyOnWrite(); + instance.clearVersion(); + return this; + } + + // @@protoc_insertion_point(builder_scope:cosmos.upgrade.v1beta1.ModuleVersion) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.cosmos.upgrade.v1beta1.ModuleVersion(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "name_", + "version_", + }; + java.lang.String info = + "\u0000\u0002\u0000\u0000\u0001\u0002\u0002\u0000\u0000\u0000\u0001\u0208\u0002\u0003" + + ""; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.cosmos.upgrade.v1beta1.ModuleVersion.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:cosmos.upgrade.v1beta1.ModuleVersion) + private static final com.cosmos.upgrade.v1beta1.ModuleVersion DEFAULT_INSTANCE; + static { + ModuleVersion defaultInstance = new ModuleVersion(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + ModuleVersion.class, defaultInstance); + } + + public static com.cosmos.upgrade.v1beta1.ModuleVersion getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/upgrade/v1beta1/ModuleVersionOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/upgrade/v1beta1/ModuleVersionOrBuilder.java new file mode 100644 index 000000000..fde6e4104 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/upgrade/v1beta1/ModuleVersionOrBuilder.java @@ -0,0 +1,39 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: cosmos/upgrade/v1beta1/upgrade.proto + +package com.cosmos.upgrade.v1beta1; + +public interface ModuleVersionOrBuilder extends + // @@protoc_insertion_point(interface_extends:cosmos.upgrade.v1beta1.ModuleVersion) + com.google.protobuf.MessageLiteOrBuilder { + + /** + *
+   * name of the app module
+   * 
+ * + * string name = 1 [json_name = "name"]; + * @return The name. + */ + java.lang.String getName(); + /** + *
+   * name of the app module
+   * 
+ * + * string name = 1 [json_name = "name"]; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
+   * consensus version of the app module
+   * 
+ * + * uint64 version = 2 [json_name = "version"]; + * @return The version. + */ + long getVersion(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/upgrade/v1beta1/Plan.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/upgrade/v1beta1/Plan.java new file mode 100644 index 000000000..0317f90dd --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/upgrade/v1beta1/Plan.java @@ -0,0 +1,937 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: cosmos/upgrade/v1beta1/upgrade.proto + +package com.cosmos.upgrade.v1beta1; + +/** + *
+ * Plan specifies information about a planned upgrade and when it should occur.
+ * 
+ * + * Protobuf type {@code cosmos.upgrade.v1beta1.Plan} + */ +public final class Plan extends + com.google.protobuf.GeneratedMessageLite< + Plan, Plan.Builder> implements + // @@protoc_insertion_point(message_implements:cosmos.upgrade.v1beta1.Plan) + PlanOrBuilder { + private Plan() { + name_ = ""; + info_ = ""; + } + public static final int NAME_FIELD_NUMBER = 1; + private java.lang.String name_; + /** + *
+   * Sets the name for the upgrade. This name will be used by the upgraded
+   * version of the software to apply any special "on-upgrade" commands during
+   * the first BeginBlock method after the upgrade is applied. It is also used
+   * to detect whether a software version can handle a given upgrade. If no
+   * upgrade handler with this name has been set in the software, it will be
+   * assumed that the software is out-of-date when the upgrade Time or Height is
+   * reached and the software will exit.
+   * 
+ * + * string name = 1 [json_name = "name"]; + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + return name_; + } + /** + *
+   * Sets the name for the upgrade. This name will be used by the upgraded
+   * version of the software to apply any special "on-upgrade" commands during
+   * the first BeginBlock method after the upgrade is applied. It is also used
+   * to detect whether a software version can handle a given upgrade. If no
+   * upgrade handler with this name has been set in the software, it will be
+   * assumed that the software is out-of-date when the upgrade Time or Height is
+   * reached and the software will exit.
+   * 
+ * + * string name = 1 [json_name = "name"]; + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNameBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(name_); + } + /** + *
+   * Sets the name for the upgrade. This name will be used by the upgraded
+   * version of the software to apply any special "on-upgrade" commands during
+   * the first BeginBlock method after the upgrade is applied. It is also used
+   * to detect whether a software version can handle a given upgrade. If no
+   * upgrade handler with this name has been set in the software, it will be
+   * assumed that the software is out-of-date when the upgrade Time or Height is
+   * reached and the software will exit.
+   * 
+ * + * string name = 1 [json_name = "name"]; + * @param value The name to set. + */ + private void setName( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + name_ = value; + } + /** + *
+   * Sets the name for the upgrade. This name will be used by the upgraded
+   * version of the software to apply any special "on-upgrade" commands during
+   * the first BeginBlock method after the upgrade is applied. It is also used
+   * to detect whether a software version can handle a given upgrade. If no
+   * upgrade handler with this name has been set in the software, it will be
+   * assumed that the software is out-of-date when the upgrade Time or Height is
+   * reached and the software will exit.
+   * 
+ * + * string name = 1 [json_name = "name"]; + */ + private void clearName() { + + name_ = getDefaultInstance().getName(); + } + /** + *
+   * Sets the name for the upgrade. This name will be used by the upgraded
+   * version of the software to apply any special "on-upgrade" commands during
+   * the first BeginBlock method after the upgrade is applied. It is also used
+   * to detect whether a software version can handle a given upgrade. If no
+   * upgrade handler with this name has been set in the software, it will be
+   * assumed that the software is out-of-date when the upgrade Time or Height is
+   * reached and the software will exit.
+   * 
+ * + * string name = 1 [json_name = "name"]; + * @param value The bytes for name to set. + */ + private void setNameBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + name_ = value.toStringUtf8(); + + } + + public static final int TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp time_; + /** + *
+   * Deprecated: Time based upgrades have been deprecated. Time based upgrade logic
+   * has been removed from the SDK.
+   * If this field is not empty, an error will be thrown.
+   * 
+ * + * .google.protobuf.Timestamp time = 2 [json_name = "time", deprecated = true, (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true, (.amino.dont_omitempty) = true]; + */ + @java.lang.Override + @java.lang.Deprecated public boolean hasTime() { + return time_ != null; + } + /** + *
+   * Deprecated: Time based upgrades have been deprecated. Time based upgrade logic
+   * has been removed from the SDK.
+   * If this field is not empty, an error will be thrown.
+   * 
+ * + * .google.protobuf.Timestamp time = 2 [json_name = "time", deprecated = true, (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true, (.amino.dont_omitempty) = true]; + */ + @java.lang.Override + @java.lang.Deprecated public com.google.protobuf.Timestamp getTime() { + return time_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : time_; + } + /** + *
+   * Deprecated: Time based upgrades have been deprecated. Time based upgrade logic
+   * has been removed from the SDK.
+   * If this field is not empty, an error will be thrown.
+   * 
+ * + * .google.protobuf.Timestamp time = 2 [json_name = "time", deprecated = true, (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true, (.amino.dont_omitempty) = true]; + */ + private void setTime(com.google.protobuf.Timestamp value) { + value.getClass(); + time_ = value; + + } + /** + *
+   * Deprecated: Time based upgrades have been deprecated. Time based upgrade logic
+   * has been removed from the SDK.
+   * If this field is not empty, an error will be thrown.
+   * 
+ * + * .google.protobuf.Timestamp time = 2 [json_name = "time", deprecated = true, (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true, (.amino.dont_omitempty) = true]; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeTime(com.google.protobuf.Timestamp value) { + value.getClass(); + if (time_ != null && + time_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + time_ = + com.google.protobuf.Timestamp.newBuilder(time_).mergeFrom(value).buildPartial(); + } else { + time_ = value; + } + + } + /** + *
+   * Deprecated: Time based upgrades have been deprecated. Time based upgrade logic
+   * has been removed from the SDK.
+   * If this field is not empty, an error will be thrown.
+   * 
+ * + * .google.protobuf.Timestamp time = 2 [json_name = "time", deprecated = true, (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true, (.amino.dont_omitempty) = true]; + */ + private void clearTime() { time_ = null; + + } + + public static final int HEIGHT_FIELD_NUMBER = 3; + private long height_; + /** + *
+   * The height at which the upgrade must be performed.
+   * 
+ * + * int64 height = 3 [json_name = "height"]; + * @return The height. + */ + @java.lang.Override + public long getHeight() { + return height_; + } + /** + *
+   * The height at which the upgrade must be performed.
+   * 
+ * + * int64 height = 3 [json_name = "height"]; + * @param value The height to set. + */ + private void setHeight(long value) { + + height_ = value; + } + /** + *
+   * The height at which the upgrade must be performed.
+   * 
+ * + * int64 height = 3 [json_name = "height"]; + */ + private void clearHeight() { + + height_ = 0L; + } + + public static final int INFO_FIELD_NUMBER = 4; + private java.lang.String info_; + /** + *
+   * Any application specific upgrade info to be included on-chain
+   * such as a git commit that validators could automatically upgrade to
+   * 
+ * + * string info = 4 [json_name = "info"]; + * @return The info. + */ + @java.lang.Override + public java.lang.String getInfo() { + return info_; + } + /** + *
+   * Any application specific upgrade info to be included on-chain
+   * such as a git commit that validators could automatically upgrade to
+   * 
+ * + * string info = 4 [json_name = "info"]; + * @return The bytes for info. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getInfoBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(info_); + } + /** + *
+   * Any application specific upgrade info to be included on-chain
+   * such as a git commit that validators could automatically upgrade to
+   * 
+ * + * string info = 4 [json_name = "info"]; + * @param value The info to set. + */ + private void setInfo( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + info_ = value; + } + /** + *
+   * Any application specific upgrade info to be included on-chain
+   * such as a git commit that validators could automatically upgrade to
+   * 
+ * + * string info = 4 [json_name = "info"]; + */ + private void clearInfo() { + + info_ = getDefaultInstance().getInfo(); + } + /** + *
+   * Any application specific upgrade info to be included on-chain
+   * such as a git commit that validators could automatically upgrade to
+   * 
+ * + * string info = 4 [json_name = "info"]; + * @param value The bytes for info to set. + */ + private void setInfoBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + info_ = value.toStringUtf8(); + + } + + public static final int UPGRADED_CLIENT_STATE_FIELD_NUMBER = 5; + private com.google.protobuf.Any upgradedClientState_; + /** + *
+   * Deprecated: UpgradedClientState field has been deprecated. IBC upgrade logic has been
+   * moved to the IBC module in the sub module 02-client.
+   * If this field is not empty, an error will be thrown.
+   * 
+ * + * .google.protobuf.Any upgraded_client_state = 5 [json_name = "upgradedClientState", deprecated = true]; + */ + @java.lang.Override + @java.lang.Deprecated public boolean hasUpgradedClientState() { + return upgradedClientState_ != null; + } + /** + *
+   * Deprecated: UpgradedClientState field has been deprecated. IBC upgrade logic has been
+   * moved to the IBC module in the sub module 02-client.
+   * If this field is not empty, an error will be thrown.
+   * 
+ * + * .google.protobuf.Any upgraded_client_state = 5 [json_name = "upgradedClientState", deprecated = true]; + */ + @java.lang.Override + @java.lang.Deprecated public com.google.protobuf.Any getUpgradedClientState() { + return upgradedClientState_ == null ? com.google.protobuf.Any.getDefaultInstance() : upgradedClientState_; + } + /** + *
+   * Deprecated: UpgradedClientState field has been deprecated. IBC upgrade logic has been
+   * moved to the IBC module in the sub module 02-client.
+   * If this field is not empty, an error will be thrown.
+   * 
+ * + * .google.protobuf.Any upgraded_client_state = 5 [json_name = "upgradedClientState", deprecated = true]; + */ + private void setUpgradedClientState(com.google.protobuf.Any value) { + value.getClass(); + upgradedClientState_ = value; + + } + /** + *
+   * Deprecated: UpgradedClientState field has been deprecated. IBC upgrade logic has been
+   * moved to the IBC module in the sub module 02-client.
+   * If this field is not empty, an error will be thrown.
+   * 
+ * + * .google.protobuf.Any upgraded_client_state = 5 [json_name = "upgradedClientState", deprecated = true]; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeUpgradedClientState(com.google.protobuf.Any value) { + value.getClass(); + if (upgradedClientState_ != null && + upgradedClientState_ != com.google.protobuf.Any.getDefaultInstance()) { + upgradedClientState_ = + com.google.protobuf.Any.newBuilder(upgradedClientState_).mergeFrom(value).buildPartial(); + } else { + upgradedClientState_ = value; + } + + } + /** + *
+   * Deprecated: UpgradedClientState field has been deprecated. IBC upgrade logic has been
+   * moved to the IBC module in the sub module 02-client.
+   * If this field is not empty, an error will be thrown.
+   * 
+ * + * .google.protobuf.Any upgraded_client_state = 5 [json_name = "upgradedClientState", deprecated = true]; + */ + private void clearUpgradedClientState() { upgradedClientState_ = null; + + } + + public static com.cosmos.upgrade.v1beta1.Plan parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.cosmos.upgrade.v1beta1.Plan parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.cosmos.upgrade.v1beta1.Plan parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.cosmos.upgrade.v1beta1.Plan parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.cosmos.upgrade.v1beta1.Plan parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.cosmos.upgrade.v1beta1.Plan parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.cosmos.upgrade.v1beta1.Plan parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.cosmos.upgrade.v1beta1.Plan parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.cosmos.upgrade.v1beta1.Plan parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.cosmos.upgrade.v1beta1.Plan parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.cosmos.upgrade.v1beta1.Plan parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.cosmos.upgrade.v1beta1.Plan parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.cosmos.upgrade.v1beta1.Plan prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+   * Plan specifies information about a planned upgrade and when it should occur.
+   * 
+ * + * Protobuf type {@code cosmos.upgrade.v1beta1.Plan} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.cosmos.upgrade.v1beta1.Plan, Builder> implements + // @@protoc_insertion_point(builder_implements:cosmos.upgrade.v1beta1.Plan) + com.cosmos.upgrade.v1beta1.PlanOrBuilder { + // Construct using com.cosmos.upgrade.v1beta1.Plan.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + *
+     * Sets the name for the upgrade. This name will be used by the upgraded
+     * version of the software to apply any special "on-upgrade" commands during
+     * the first BeginBlock method after the upgrade is applied. It is also used
+     * to detect whether a software version can handle a given upgrade. If no
+     * upgrade handler with this name has been set in the software, it will be
+     * assumed that the software is out-of-date when the upgrade Time or Height is
+     * reached and the software will exit.
+     * 
+ * + * string name = 1 [json_name = "name"]; + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + return instance.getName(); + } + /** + *
+     * Sets the name for the upgrade. This name will be used by the upgraded
+     * version of the software to apply any special "on-upgrade" commands during
+     * the first BeginBlock method after the upgrade is applied. It is also used
+     * to detect whether a software version can handle a given upgrade. If no
+     * upgrade handler with this name has been set in the software, it will be
+     * assumed that the software is out-of-date when the upgrade Time or Height is
+     * reached and the software will exit.
+     * 
+ * + * string name = 1 [json_name = "name"]; + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNameBytes() { + return instance.getNameBytes(); + } + /** + *
+     * Sets the name for the upgrade. This name will be used by the upgraded
+     * version of the software to apply any special "on-upgrade" commands during
+     * the first BeginBlock method after the upgrade is applied. It is also used
+     * to detect whether a software version can handle a given upgrade. If no
+     * upgrade handler with this name has been set in the software, it will be
+     * assumed that the software is out-of-date when the upgrade Time or Height is
+     * reached and the software will exit.
+     * 
+ * + * string name = 1 [json_name = "name"]; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + copyOnWrite(); + instance.setName(value); + return this; + } + /** + *
+     * Sets the name for the upgrade. This name will be used by the upgraded
+     * version of the software to apply any special "on-upgrade" commands during
+     * the first BeginBlock method after the upgrade is applied. It is also used
+     * to detect whether a software version can handle a given upgrade. If no
+     * upgrade handler with this name has been set in the software, it will be
+     * assumed that the software is out-of-date when the upgrade Time or Height is
+     * reached and the software will exit.
+     * 
+ * + * string name = 1 [json_name = "name"]; + * @return This builder for chaining. + */ + public Builder clearName() { + copyOnWrite(); + instance.clearName(); + return this; + } + /** + *
+     * Sets the name for the upgrade. This name will be used by the upgraded
+     * version of the software to apply any special "on-upgrade" commands during
+     * the first BeginBlock method after the upgrade is applied. It is also used
+     * to detect whether a software version can handle a given upgrade. If no
+     * upgrade handler with this name has been set in the software, it will be
+     * assumed that the software is out-of-date when the upgrade Time or Height is
+     * reached and the software will exit.
+     * 
+ * + * string name = 1 [json_name = "name"]; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setNameBytes(value); + return this; + } + + /** + *
+     * Deprecated: Time based upgrades have been deprecated. Time based upgrade logic
+     * has been removed from the SDK.
+     * If this field is not empty, an error will be thrown.
+     * 
+ * + * .google.protobuf.Timestamp time = 2 [json_name = "time", deprecated = true, (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true, (.amino.dont_omitempty) = true]; + */ + @java.lang.Override + @java.lang.Deprecated public boolean hasTime() { + return instance.hasTime(); + } + /** + *
+     * Deprecated: Time based upgrades have been deprecated. Time based upgrade logic
+     * has been removed from the SDK.
+     * If this field is not empty, an error will be thrown.
+     * 
+ * + * .google.protobuf.Timestamp time = 2 [json_name = "time", deprecated = true, (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true, (.amino.dont_omitempty) = true]; + */ + @java.lang.Override + @java.lang.Deprecated public com.google.protobuf.Timestamp getTime() { + return instance.getTime(); + } + /** + *
+     * Deprecated: Time based upgrades have been deprecated. Time based upgrade logic
+     * has been removed from the SDK.
+     * If this field is not empty, an error will be thrown.
+     * 
+ * + * .google.protobuf.Timestamp time = 2 [json_name = "time", deprecated = true, (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true, (.amino.dont_omitempty) = true]; + */ + @java.lang.Deprecated public Builder setTime(com.google.protobuf.Timestamp value) { + copyOnWrite(); + instance.setTime(value); + return this; + } + /** + *
+     * Deprecated: Time based upgrades have been deprecated. Time based upgrade logic
+     * has been removed from the SDK.
+     * If this field is not empty, an error will be thrown.
+     * 
+ * + * .google.protobuf.Timestamp time = 2 [json_name = "time", deprecated = true, (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true, (.amino.dont_omitempty) = true]; + */ + @java.lang.Deprecated public Builder setTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + copyOnWrite(); + instance.setTime(builderForValue.build()); + return this; + } + /** + *
+     * Deprecated: Time based upgrades have been deprecated. Time based upgrade logic
+     * has been removed from the SDK.
+     * If this field is not empty, an error will be thrown.
+     * 
+ * + * .google.protobuf.Timestamp time = 2 [json_name = "time", deprecated = true, (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true, (.amino.dont_omitempty) = true]; + */ + @java.lang.Deprecated public Builder mergeTime(com.google.protobuf.Timestamp value) { + copyOnWrite(); + instance.mergeTime(value); + return this; + } + /** + *
+     * Deprecated: Time based upgrades have been deprecated. Time based upgrade logic
+     * has been removed from the SDK.
+     * If this field is not empty, an error will be thrown.
+     * 
+ * + * .google.protobuf.Timestamp time = 2 [json_name = "time", deprecated = true, (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true, (.amino.dont_omitempty) = true]; + */ + @java.lang.Deprecated public Builder clearTime() { copyOnWrite(); + instance.clearTime(); + return this; + } + + /** + *
+     * The height at which the upgrade must be performed.
+     * 
+ * + * int64 height = 3 [json_name = "height"]; + * @return The height. + */ + @java.lang.Override + public long getHeight() { + return instance.getHeight(); + } + /** + *
+     * The height at which the upgrade must be performed.
+     * 
+ * + * int64 height = 3 [json_name = "height"]; + * @param value The height to set. + * @return This builder for chaining. + */ + public Builder setHeight(long value) { + copyOnWrite(); + instance.setHeight(value); + return this; + } + /** + *
+     * The height at which the upgrade must be performed.
+     * 
+ * + * int64 height = 3 [json_name = "height"]; + * @return This builder for chaining. + */ + public Builder clearHeight() { + copyOnWrite(); + instance.clearHeight(); + return this; + } + + /** + *
+     * Any application specific upgrade info to be included on-chain
+     * such as a git commit that validators could automatically upgrade to
+     * 
+ * + * string info = 4 [json_name = "info"]; + * @return The info. + */ + @java.lang.Override + public java.lang.String getInfo() { + return instance.getInfo(); + } + /** + *
+     * Any application specific upgrade info to be included on-chain
+     * such as a git commit that validators could automatically upgrade to
+     * 
+ * + * string info = 4 [json_name = "info"]; + * @return The bytes for info. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getInfoBytes() { + return instance.getInfoBytes(); + } + /** + *
+     * Any application specific upgrade info to be included on-chain
+     * such as a git commit that validators could automatically upgrade to
+     * 
+ * + * string info = 4 [json_name = "info"]; + * @param value The info to set. + * @return This builder for chaining. + */ + public Builder setInfo( + java.lang.String value) { + copyOnWrite(); + instance.setInfo(value); + return this; + } + /** + *
+     * Any application specific upgrade info to be included on-chain
+     * such as a git commit that validators could automatically upgrade to
+     * 
+ * + * string info = 4 [json_name = "info"]; + * @return This builder for chaining. + */ + public Builder clearInfo() { + copyOnWrite(); + instance.clearInfo(); + return this; + } + /** + *
+     * Any application specific upgrade info to be included on-chain
+     * such as a git commit that validators could automatically upgrade to
+     * 
+ * + * string info = 4 [json_name = "info"]; + * @param value The bytes for info to set. + * @return This builder for chaining. + */ + public Builder setInfoBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setInfoBytes(value); + return this; + } + + /** + *
+     * Deprecated: UpgradedClientState field has been deprecated. IBC upgrade logic has been
+     * moved to the IBC module in the sub module 02-client.
+     * If this field is not empty, an error will be thrown.
+     * 
+ * + * .google.protobuf.Any upgraded_client_state = 5 [json_name = "upgradedClientState", deprecated = true]; + */ + @java.lang.Override + @java.lang.Deprecated public boolean hasUpgradedClientState() { + return instance.hasUpgradedClientState(); + } + /** + *
+     * Deprecated: UpgradedClientState field has been deprecated. IBC upgrade logic has been
+     * moved to the IBC module in the sub module 02-client.
+     * If this field is not empty, an error will be thrown.
+     * 
+ * + * .google.protobuf.Any upgraded_client_state = 5 [json_name = "upgradedClientState", deprecated = true]; + */ + @java.lang.Override + @java.lang.Deprecated public com.google.protobuf.Any getUpgradedClientState() { + return instance.getUpgradedClientState(); + } + /** + *
+     * Deprecated: UpgradedClientState field has been deprecated. IBC upgrade logic has been
+     * moved to the IBC module in the sub module 02-client.
+     * If this field is not empty, an error will be thrown.
+     * 
+ * + * .google.protobuf.Any upgraded_client_state = 5 [json_name = "upgradedClientState", deprecated = true]; + */ + @java.lang.Deprecated public Builder setUpgradedClientState(com.google.protobuf.Any value) { + copyOnWrite(); + instance.setUpgradedClientState(value); + return this; + } + /** + *
+     * Deprecated: UpgradedClientState field has been deprecated. IBC upgrade logic has been
+     * moved to the IBC module in the sub module 02-client.
+     * If this field is not empty, an error will be thrown.
+     * 
+ * + * .google.protobuf.Any upgraded_client_state = 5 [json_name = "upgradedClientState", deprecated = true]; + */ + @java.lang.Deprecated public Builder setUpgradedClientState( + com.google.protobuf.Any.Builder builderForValue) { + copyOnWrite(); + instance.setUpgradedClientState(builderForValue.build()); + return this; + } + /** + *
+     * Deprecated: UpgradedClientState field has been deprecated. IBC upgrade logic has been
+     * moved to the IBC module in the sub module 02-client.
+     * If this field is not empty, an error will be thrown.
+     * 
+ * + * .google.protobuf.Any upgraded_client_state = 5 [json_name = "upgradedClientState", deprecated = true]; + */ + @java.lang.Deprecated public Builder mergeUpgradedClientState(com.google.protobuf.Any value) { + copyOnWrite(); + instance.mergeUpgradedClientState(value); + return this; + } + /** + *
+     * Deprecated: UpgradedClientState field has been deprecated. IBC upgrade logic has been
+     * moved to the IBC module in the sub module 02-client.
+     * If this field is not empty, an error will be thrown.
+     * 
+ * + * .google.protobuf.Any upgraded_client_state = 5 [json_name = "upgradedClientState", deprecated = true]; + */ + @java.lang.Deprecated public Builder clearUpgradedClientState() { copyOnWrite(); + instance.clearUpgradedClientState(); + return this; + } + + // @@protoc_insertion_point(builder_scope:cosmos.upgrade.v1beta1.Plan) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.cosmos.upgrade.v1beta1.Plan(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "name_", + "time_", + "height_", + "info_", + "upgradedClientState_", + }; + java.lang.String info = + "\u0000\u0005\u0000\u0000\u0001\u0005\u0005\u0000\u0000\u0000\u0001\u0208\u0002\t" + + "\u0003\u0002\u0004\u0208\u0005\t"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.cosmos.upgrade.v1beta1.Plan.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:cosmos.upgrade.v1beta1.Plan) + private static final com.cosmos.upgrade.v1beta1.Plan DEFAULT_INSTANCE; + static { + Plan defaultInstance = new Plan(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + Plan.class, defaultInstance); + } + + public static com.cosmos.upgrade.v1beta1.Plan getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/upgrade/v1beta1/PlanOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/upgrade/v1beta1/PlanOrBuilder.java new file mode 100644 index 000000000..c4e2ee0db --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/upgrade/v1beta1/PlanOrBuilder.java @@ -0,0 +1,127 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: cosmos/upgrade/v1beta1/upgrade.proto + +package com.cosmos.upgrade.v1beta1; + +public interface PlanOrBuilder extends + // @@protoc_insertion_point(interface_extends:cosmos.upgrade.v1beta1.Plan) + com.google.protobuf.MessageLiteOrBuilder { + + /** + *
+   * Sets the name for the upgrade. This name will be used by the upgraded
+   * version of the software to apply any special "on-upgrade" commands during
+   * the first BeginBlock method after the upgrade is applied. It is also used
+   * to detect whether a software version can handle a given upgrade. If no
+   * upgrade handler with this name has been set in the software, it will be
+   * assumed that the software is out-of-date when the upgrade Time or Height is
+   * reached and the software will exit.
+   * 
+ * + * string name = 1 [json_name = "name"]; + * @return The name. + */ + java.lang.String getName(); + /** + *
+   * Sets the name for the upgrade. This name will be used by the upgraded
+   * version of the software to apply any special "on-upgrade" commands during
+   * the first BeginBlock method after the upgrade is applied. It is also used
+   * to detect whether a software version can handle a given upgrade. If no
+   * upgrade handler with this name has been set in the software, it will be
+   * assumed that the software is out-of-date when the upgrade Time or Height is
+   * reached and the software will exit.
+   * 
+ * + * string name = 1 [json_name = "name"]; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
+   * Deprecated: Time based upgrades have been deprecated. Time based upgrade logic
+   * has been removed from the SDK.
+   * If this field is not empty, an error will be thrown.
+   * 
+ * + * .google.protobuf.Timestamp time = 2 [json_name = "time", deprecated = true, (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true, (.amino.dont_omitempty) = true]; + * @deprecated cosmos.upgrade.v1beta1.Plan.time is deprecated. + * See cosmos/upgrade/v1beta1/upgrade.proto;l=30 + * @return Whether the time field is set. + */ + @java.lang.Deprecated boolean hasTime(); + /** + *
+   * Deprecated: Time based upgrades have been deprecated. Time based upgrade logic
+   * has been removed from the SDK.
+   * If this field is not empty, an error will be thrown.
+   * 
+ * + * .google.protobuf.Timestamp time = 2 [json_name = "time", deprecated = true, (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true, (.amino.dont_omitempty) = true]; + * @deprecated cosmos.upgrade.v1beta1.Plan.time is deprecated. + * See cosmos/upgrade/v1beta1/upgrade.proto;l=30 + * @return The time. + */ + @java.lang.Deprecated com.google.protobuf.Timestamp getTime(); + + /** + *
+   * The height at which the upgrade must be performed.
+   * 
+ * + * int64 height = 3 [json_name = "height"]; + * @return The height. + */ + long getHeight(); + + /** + *
+   * Any application specific upgrade info to be included on-chain
+   * such as a git commit that validators could automatically upgrade to
+   * 
+ * + * string info = 4 [json_name = "info"]; + * @return The info. + */ + java.lang.String getInfo(); + /** + *
+   * Any application specific upgrade info to be included on-chain
+   * such as a git commit that validators could automatically upgrade to
+   * 
+ * + * string info = 4 [json_name = "info"]; + * @return The bytes for info. + */ + com.google.protobuf.ByteString + getInfoBytes(); + + /** + *
+   * Deprecated: UpgradedClientState field has been deprecated. IBC upgrade logic has been
+   * moved to the IBC module in the sub module 02-client.
+   * If this field is not empty, an error will be thrown.
+   * 
+ * + * .google.protobuf.Any upgraded_client_state = 5 [json_name = "upgradedClientState", deprecated = true]; + * @deprecated cosmos.upgrade.v1beta1.Plan.upgraded_client_state is deprecated. + * See cosmos/upgrade/v1beta1/upgrade.proto;l=43 + * @return Whether the upgradedClientState field is set. + */ + @java.lang.Deprecated boolean hasUpgradedClientState(); + /** + *
+   * Deprecated: UpgradedClientState field has been deprecated. IBC upgrade logic has been
+   * moved to the IBC module in the sub module 02-client.
+   * If this field is not empty, an error will be thrown.
+   * 
+ * + * .google.protobuf.Any upgraded_client_state = 5 [json_name = "upgradedClientState", deprecated = true]; + * @deprecated cosmos.upgrade.v1beta1.Plan.upgraded_client_state is deprecated. + * See cosmos/upgrade/v1beta1/upgrade.proto;l=43 + * @return The upgradedClientState. + */ + @java.lang.Deprecated com.google.protobuf.Any getUpgradedClientState(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/upgrade/v1beta1/SoftwareUpgradeProposal.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/upgrade/v1beta1/SoftwareUpgradeProposal.java new file mode 100644 index 000000000..0e7d04d8f --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/upgrade/v1beta1/SoftwareUpgradeProposal.java @@ -0,0 +1,612 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: cosmos/upgrade/v1beta1/upgrade.proto + +package com.cosmos.upgrade.v1beta1; + +/** + *
+ * SoftwareUpgradeProposal is a gov Content type for initiating a software
+ * upgrade.
+ * Deprecated: This legacy proposal is deprecated in favor of Msg-based gov
+ * proposals, see MsgSoftwareUpgrade.
+ * 
+ * + * Protobuf type {@code cosmos.upgrade.v1beta1.SoftwareUpgradeProposal} + */ +@java.lang.Deprecated public final class SoftwareUpgradeProposal extends + com.google.protobuf.GeneratedMessageLite< + SoftwareUpgradeProposal, SoftwareUpgradeProposal.Builder> implements + // @@protoc_insertion_point(message_implements:cosmos.upgrade.v1beta1.SoftwareUpgradeProposal) + SoftwareUpgradeProposalOrBuilder { + private SoftwareUpgradeProposal() { + title_ = ""; + description_ = ""; + } + public static final int TITLE_FIELD_NUMBER = 1; + private java.lang.String title_; + /** + *
+   * title of the proposal
+   * 
+ * + * string title = 1 [json_name = "title"]; + * @return The title. + */ + @java.lang.Override + public java.lang.String getTitle() { + return title_; + } + /** + *
+   * title of the proposal
+   * 
+ * + * string title = 1 [json_name = "title"]; + * @return The bytes for title. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTitleBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(title_); + } + /** + *
+   * title of the proposal
+   * 
+ * + * string title = 1 [json_name = "title"]; + * @param value The title to set. + */ + private void setTitle( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + title_ = value; + } + /** + *
+   * title of the proposal
+   * 
+ * + * string title = 1 [json_name = "title"]; + */ + private void clearTitle() { + + title_ = getDefaultInstance().getTitle(); + } + /** + *
+   * title of the proposal
+   * 
+ * + * string title = 1 [json_name = "title"]; + * @param value The bytes for title to set. + */ + private void setTitleBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + title_ = value.toStringUtf8(); + + } + + public static final int DESCRIPTION_FIELD_NUMBER = 2; + private java.lang.String description_; + /** + *
+   * description of the proposal
+   * 
+ * + * string description = 2 [json_name = "description"]; + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + return description_; + } + /** + *
+   * description of the proposal
+   * 
+ * + * string description = 2 [json_name = "description"]; + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDescriptionBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(description_); + } + /** + *
+   * description of the proposal
+   * 
+ * + * string description = 2 [json_name = "description"]; + * @param value The description to set. + */ + private void setDescription( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + description_ = value; + } + /** + *
+   * description of the proposal
+   * 
+ * + * string description = 2 [json_name = "description"]; + */ + private void clearDescription() { + + description_ = getDefaultInstance().getDescription(); + } + /** + *
+   * description of the proposal
+   * 
+ * + * string description = 2 [json_name = "description"]; + * @param value The bytes for description to set. + */ + private void setDescriptionBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + description_ = value.toStringUtf8(); + + } + + public static final int PLAN_FIELD_NUMBER = 3; + private com.cosmos.upgrade.v1beta1.Plan plan_; + /** + *
+   * plan of the proposal
+   * 
+ * + * .cosmos.upgrade.v1beta1.Plan plan = 3 [json_name = "plan", (.gogoproto.nullable) = false, (.amino.dont_omitempty) = true]; + */ + @java.lang.Override + public boolean hasPlan() { + return plan_ != null; + } + /** + *
+   * plan of the proposal
+   * 
+ * + * .cosmos.upgrade.v1beta1.Plan plan = 3 [json_name = "plan", (.gogoproto.nullable) = false, (.amino.dont_omitempty) = true]; + */ + @java.lang.Override + public com.cosmos.upgrade.v1beta1.Plan getPlan() { + return plan_ == null ? com.cosmos.upgrade.v1beta1.Plan.getDefaultInstance() : plan_; + } + /** + *
+   * plan of the proposal
+   * 
+ * + * .cosmos.upgrade.v1beta1.Plan plan = 3 [json_name = "plan", (.gogoproto.nullable) = false, (.amino.dont_omitempty) = true]; + */ + private void setPlan(com.cosmos.upgrade.v1beta1.Plan value) { + value.getClass(); + plan_ = value; + + } + /** + *
+   * plan of the proposal
+   * 
+ * + * .cosmos.upgrade.v1beta1.Plan plan = 3 [json_name = "plan", (.gogoproto.nullable) = false, (.amino.dont_omitempty) = true]; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergePlan(com.cosmos.upgrade.v1beta1.Plan value) { + value.getClass(); + if (plan_ != null && + plan_ != com.cosmos.upgrade.v1beta1.Plan.getDefaultInstance()) { + plan_ = + com.cosmos.upgrade.v1beta1.Plan.newBuilder(plan_).mergeFrom(value).buildPartial(); + } else { + plan_ = value; + } + + } + /** + *
+   * plan of the proposal
+   * 
+ * + * .cosmos.upgrade.v1beta1.Plan plan = 3 [json_name = "plan", (.gogoproto.nullable) = false, (.amino.dont_omitempty) = true]; + */ + private void clearPlan() { plan_ = null; + + } + + public static com.cosmos.upgrade.v1beta1.SoftwareUpgradeProposal parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.cosmos.upgrade.v1beta1.SoftwareUpgradeProposal parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.cosmos.upgrade.v1beta1.SoftwareUpgradeProposal parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.cosmos.upgrade.v1beta1.SoftwareUpgradeProposal parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.cosmos.upgrade.v1beta1.SoftwareUpgradeProposal parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.cosmos.upgrade.v1beta1.SoftwareUpgradeProposal parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.cosmos.upgrade.v1beta1.SoftwareUpgradeProposal parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.cosmos.upgrade.v1beta1.SoftwareUpgradeProposal parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.cosmos.upgrade.v1beta1.SoftwareUpgradeProposal parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.cosmos.upgrade.v1beta1.SoftwareUpgradeProposal parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.cosmos.upgrade.v1beta1.SoftwareUpgradeProposal parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.cosmos.upgrade.v1beta1.SoftwareUpgradeProposal parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.cosmos.upgrade.v1beta1.SoftwareUpgradeProposal prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+   * SoftwareUpgradeProposal is a gov Content type for initiating a software
+   * upgrade.
+   * Deprecated: This legacy proposal is deprecated in favor of Msg-based gov
+   * proposals, see MsgSoftwareUpgrade.
+   * 
+ * + * Protobuf type {@code cosmos.upgrade.v1beta1.SoftwareUpgradeProposal} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.cosmos.upgrade.v1beta1.SoftwareUpgradeProposal, Builder> implements + // @@protoc_insertion_point(builder_implements:cosmos.upgrade.v1beta1.SoftwareUpgradeProposal) + com.cosmos.upgrade.v1beta1.SoftwareUpgradeProposalOrBuilder { + // Construct using com.cosmos.upgrade.v1beta1.SoftwareUpgradeProposal.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + *
+     * title of the proposal
+     * 
+ * + * string title = 1 [json_name = "title"]; + * @return The title. + */ + @java.lang.Override + public java.lang.String getTitle() { + return instance.getTitle(); + } + /** + *
+     * title of the proposal
+     * 
+ * + * string title = 1 [json_name = "title"]; + * @return The bytes for title. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTitleBytes() { + return instance.getTitleBytes(); + } + /** + *
+     * title of the proposal
+     * 
+ * + * string title = 1 [json_name = "title"]; + * @param value The title to set. + * @return This builder for chaining. + */ + public Builder setTitle( + java.lang.String value) { + copyOnWrite(); + instance.setTitle(value); + return this; + } + /** + *
+     * title of the proposal
+     * 
+ * + * string title = 1 [json_name = "title"]; + * @return This builder for chaining. + */ + public Builder clearTitle() { + copyOnWrite(); + instance.clearTitle(); + return this; + } + /** + *
+     * title of the proposal
+     * 
+ * + * string title = 1 [json_name = "title"]; + * @param value The bytes for title to set. + * @return This builder for chaining. + */ + public Builder setTitleBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setTitleBytes(value); + return this; + } + + /** + *
+     * description of the proposal
+     * 
+ * + * string description = 2 [json_name = "description"]; + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + return instance.getDescription(); + } + /** + *
+     * description of the proposal
+     * 
+ * + * string description = 2 [json_name = "description"]; + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDescriptionBytes() { + return instance.getDescriptionBytes(); + } + /** + *
+     * description of the proposal
+     * 
+ * + * string description = 2 [json_name = "description"]; + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription( + java.lang.String value) { + copyOnWrite(); + instance.setDescription(value); + return this; + } + /** + *
+     * description of the proposal
+     * 
+ * + * string description = 2 [json_name = "description"]; + * @return This builder for chaining. + */ + public Builder clearDescription() { + copyOnWrite(); + instance.clearDescription(); + return this; + } + /** + *
+     * description of the proposal
+     * 
+ * + * string description = 2 [json_name = "description"]; + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setDescriptionBytes(value); + return this; + } + + /** + *
+     * plan of the proposal
+     * 
+ * + * .cosmos.upgrade.v1beta1.Plan plan = 3 [json_name = "plan", (.gogoproto.nullable) = false, (.amino.dont_omitempty) = true]; + */ + @java.lang.Override + public boolean hasPlan() { + return instance.hasPlan(); + } + /** + *
+     * plan of the proposal
+     * 
+ * + * .cosmos.upgrade.v1beta1.Plan plan = 3 [json_name = "plan", (.gogoproto.nullable) = false, (.amino.dont_omitempty) = true]; + */ + @java.lang.Override + public com.cosmos.upgrade.v1beta1.Plan getPlan() { + return instance.getPlan(); + } + /** + *
+     * plan of the proposal
+     * 
+ * + * .cosmos.upgrade.v1beta1.Plan plan = 3 [json_name = "plan", (.gogoproto.nullable) = false, (.amino.dont_omitempty) = true]; + */ + public Builder setPlan(com.cosmos.upgrade.v1beta1.Plan value) { + copyOnWrite(); + instance.setPlan(value); + return this; + } + /** + *
+     * plan of the proposal
+     * 
+ * + * .cosmos.upgrade.v1beta1.Plan plan = 3 [json_name = "plan", (.gogoproto.nullable) = false, (.amino.dont_omitempty) = true]; + */ + public Builder setPlan( + com.cosmos.upgrade.v1beta1.Plan.Builder builderForValue) { + copyOnWrite(); + instance.setPlan(builderForValue.build()); + return this; + } + /** + *
+     * plan of the proposal
+     * 
+ * + * .cosmos.upgrade.v1beta1.Plan plan = 3 [json_name = "plan", (.gogoproto.nullable) = false, (.amino.dont_omitempty) = true]; + */ + public Builder mergePlan(com.cosmos.upgrade.v1beta1.Plan value) { + copyOnWrite(); + instance.mergePlan(value); + return this; + } + /** + *
+     * plan of the proposal
+     * 
+ * + * .cosmos.upgrade.v1beta1.Plan plan = 3 [json_name = "plan", (.gogoproto.nullable) = false, (.amino.dont_omitempty) = true]; + */ + public Builder clearPlan() { copyOnWrite(); + instance.clearPlan(); + return this; + } + + // @@protoc_insertion_point(builder_scope:cosmos.upgrade.v1beta1.SoftwareUpgradeProposal) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.cosmos.upgrade.v1beta1.SoftwareUpgradeProposal(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "title_", + "description_", + "plan_", + }; + java.lang.String info = + "\u0000\u0003\u0000\u0000\u0001\u0003\u0003\u0000\u0000\u0000\u0001\u0208\u0002\u0208" + + "\u0003\t"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.cosmos.upgrade.v1beta1.SoftwareUpgradeProposal.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:cosmos.upgrade.v1beta1.SoftwareUpgradeProposal) + private static final com.cosmos.upgrade.v1beta1.SoftwareUpgradeProposal DEFAULT_INSTANCE; + static { + SoftwareUpgradeProposal defaultInstance = new SoftwareUpgradeProposal(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + SoftwareUpgradeProposal.class, defaultInstance); + } + + public static com.cosmos.upgrade.v1beta1.SoftwareUpgradeProposal getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/upgrade/v1beta1/SoftwareUpgradeProposalOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/upgrade/v1beta1/SoftwareUpgradeProposalOrBuilder.java new file mode 100644 index 000000000..c00373107 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/upgrade/v1beta1/SoftwareUpgradeProposalOrBuilder.java @@ -0,0 +1,68 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: cosmos/upgrade/v1beta1/upgrade.proto + +package com.cosmos.upgrade.v1beta1; + +@java.lang.Deprecated public interface SoftwareUpgradeProposalOrBuilder extends + // @@protoc_insertion_point(interface_extends:cosmos.upgrade.v1beta1.SoftwareUpgradeProposal) + com.google.protobuf.MessageLiteOrBuilder { + + /** + *
+   * title of the proposal
+   * 
+ * + * string title = 1 [json_name = "title"]; + * @return The title. + */ + java.lang.String getTitle(); + /** + *
+   * title of the proposal
+   * 
+ * + * string title = 1 [json_name = "title"]; + * @return The bytes for title. + */ + com.google.protobuf.ByteString + getTitleBytes(); + + /** + *
+   * description of the proposal
+   * 
+ * + * string description = 2 [json_name = "description"]; + * @return The description. + */ + java.lang.String getDescription(); + /** + *
+   * description of the proposal
+   * 
+ * + * string description = 2 [json_name = "description"]; + * @return The bytes for description. + */ + com.google.protobuf.ByteString + getDescriptionBytes(); + + /** + *
+   * plan of the proposal
+   * 
+ * + * .cosmos.upgrade.v1beta1.Plan plan = 3 [json_name = "plan", (.gogoproto.nullable) = false, (.amino.dont_omitempty) = true]; + * @return Whether the plan field is set. + */ + boolean hasPlan(); + /** + *
+   * plan of the proposal
+   * 
+ * + * .cosmos.upgrade.v1beta1.Plan plan = 3 [json_name = "plan", (.gogoproto.nullable) = false, (.amino.dont_omitempty) = true]; + * @return The plan. + */ + com.cosmos.upgrade.v1beta1.Plan getPlan(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/upgrade/v1beta1/UpgradeProto.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/upgrade/v1beta1/UpgradeProto.java new file mode 100644 index 000000000..25aa9dc4c --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/upgrade/v1beta1/UpgradeProto.java @@ -0,0 +1,16 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: cosmos/upgrade/v1beta1/upgrade.proto + +package com.cosmos.upgrade.v1beta1; + +public final class UpgradeProto { + private UpgradeProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + static { + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos_proto/CosmosProto.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos_proto/CosmosProto.java new file mode 100644 index 000000000..0b2bf75a6 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos_proto/CosmosProto.java @@ -0,0 +1,140 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: cosmos_proto/cosmos.proto + +package com.cosmos_proto; + +public final class CosmosProto { + private CosmosProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + registry.add(com.cosmos_proto.CosmosProto.implementsInterface); + registry.add(com.cosmos_proto.CosmosProto.acceptsInterface); + registry.add(com.cosmos_proto.CosmosProto.scalar); + registry.add(com.cosmos_proto.CosmosProto.declareInterface); + registry.add(com.cosmos_proto.CosmosProto.declareScalar); + } + public static final int IMPLEMENTS_INTERFACE_FIELD_NUMBER = 93001; + /** + *
+   * implements_interface is used to indicate the type name of the interface
+   * that a message implements so that it can be used in google.protobuf.Any
+   * fields that accept that interface. A message can implement multiple
+   * interfaces. Interfaces should be declared using a declare_interface
+   * file option.
+   * 
+ * + * extend .google.protobuf.MessageOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.MessageOptions, + java.util.List> implementsInterface = com.google.protobuf.GeneratedMessageLite + .newRepeatedGeneratedExtension( + com.google.protobuf.DescriptorProtos.MessageOptions.getDefaultInstance(), + null, + null, + 93001, + com.google.protobuf.WireFormat.FieldType.STRING, + false, + java.lang.String.class); + public static final int ACCEPTS_INTERFACE_FIELD_NUMBER = 93001; + /** + *
+   * accepts_interface is used to annotate that a google.protobuf.Any
+   * field accepts messages that implement the specified interface.
+   * Interfaces should be declared using a declare_interface file option.
+   * 
+ * + * extend .google.protobuf.FieldOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FieldOptions, + java.lang.String> acceptsInterface = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.FieldOptions.getDefaultInstance(), + "", + null, + null, + 93001, + com.google.protobuf.WireFormat.FieldType.STRING, + java.lang.String.class); + public static final int SCALAR_FIELD_NUMBER = 93002; + /** + *
+   * scalar is used to indicate that this field follows the formatting defined
+   * by the named scalar which should be declared with declare_scalar. Code
+   * generators may choose to use this information to map this field to a
+   * language-specific type representing the scalar.
+   * 
+ * + * extend .google.protobuf.FieldOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FieldOptions, + java.lang.String> scalar = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.FieldOptions.getDefaultInstance(), + "", + null, + null, + 93002, + com.google.protobuf.WireFormat.FieldType.STRING, + java.lang.String.class); + public static final int DECLARE_INTERFACE_FIELD_NUMBER = 793021; + /** + *
+   * declare_interface declares an interface type to be used with
+   * accepts_interface and implements_interface. Interface names are
+   * expected to follow the following convention such that their declaration
+   * can be discovered by tools: for a given interface type a.b.C, it is
+   * expected that the declaration will be found in a protobuf file named
+   * a/b/interfaces.proto in the file descriptor set.
+   * 
+ * + * extend .google.protobuf.FileOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FileOptions, + java.util.List> declareInterface = com.google.protobuf.GeneratedMessageLite + .newRepeatedGeneratedExtension( + com.google.protobuf.DescriptorProtos.FileOptions.getDefaultInstance(), + com.cosmos_proto.InterfaceDescriptor.getDefaultInstance(), + null, + 793021, + com.google.protobuf.WireFormat.FieldType.MESSAGE, + false, + com.cosmos_proto.InterfaceDescriptor.class); + public static final int DECLARE_SCALAR_FIELD_NUMBER = 793022; + /** + *
+   * declare_scalar declares a scalar type to be used with
+   * the scalar field option. Scalar names are
+   * expected to follow the following convention such that their declaration
+   * can be discovered by tools: for a given scalar type a.b.C, it is
+   * expected that the declaration will be found in a protobuf file named
+   * a/b/scalars.proto in the file descriptor set.
+   * 
+ * + * extend .google.protobuf.FileOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FileOptions, + java.util.List> declareScalar = com.google.protobuf.GeneratedMessageLite + .newRepeatedGeneratedExtension( + com.google.protobuf.DescriptorProtos.FileOptions.getDefaultInstance(), + com.cosmos_proto.ScalarDescriptor.getDefaultInstance(), + null, + 793022, + com.google.protobuf.WireFormat.FieldType.MESSAGE, + false, + com.cosmos_proto.ScalarDescriptor.class); + + static { + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos_proto/InterfaceDescriptor.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos_proto/InterfaceDescriptor.java new file mode 100644 index 000000000..5d11e0b26 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos_proto/InterfaceDescriptor.java @@ -0,0 +1,510 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: cosmos_proto/cosmos.proto + +package com.cosmos_proto; + +/** + *
+ * InterfaceDescriptor describes an interface type to be used with
+ * accepts_interface and implements_interface and declared by declare_interface.
+ * 
+ * + * Protobuf type {@code cosmos_proto.InterfaceDescriptor} + */ +public final class InterfaceDescriptor extends + com.google.protobuf.GeneratedMessageLite< + InterfaceDescriptor, InterfaceDescriptor.Builder> implements + // @@protoc_insertion_point(message_implements:cosmos_proto.InterfaceDescriptor) + InterfaceDescriptorOrBuilder { + private InterfaceDescriptor() { + name_ = ""; + description_ = ""; + } + public static final int NAME_FIELD_NUMBER = 1; + private java.lang.String name_; + /** + *
+   * name is the name of the interface. It should be a short-name (without
+   * a period) such that the fully qualified name of the interface will be
+   * package.name, ex. for the package a.b and interface named C, the
+   * fully-qualified name will be a.b.C.
+   * 
+ * + * string name = 1 [json_name = "name"]; + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + return name_; + } + /** + *
+   * name is the name of the interface. It should be a short-name (without
+   * a period) such that the fully qualified name of the interface will be
+   * package.name, ex. for the package a.b and interface named C, the
+   * fully-qualified name will be a.b.C.
+   * 
+ * + * string name = 1 [json_name = "name"]; + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNameBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(name_); + } + /** + *
+   * name is the name of the interface. It should be a short-name (without
+   * a period) such that the fully qualified name of the interface will be
+   * package.name, ex. for the package a.b and interface named C, the
+   * fully-qualified name will be a.b.C.
+   * 
+ * + * string name = 1 [json_name = "name"]; + * @param value The name to set. + */ + private void setName( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + name_ = value; + } + /** + *
+   * name is the name of the interface. It should be a short-name (without
+   * a period) such that the fully qualified name of the interface will be
+   * package.name, ex. for the package a.b and interface named C, the
+   * fully-qualified name will be a.b.C.
+   * 
+ * + * string name = 1 [json_name = "name"]; + */ + private void clearName() { + + name_ = getDefaultInstance().getName(); + } + /** + *
+   * name is the name of the interface. It should be a short-name (without
+   * a period) such that the fully qualified name of the interface will be
+   * package.name, ex. for the package a.b and interface named C, the
+   * fully-qualified name will be a.b.C.
+   * 
+ * + * string name = 1 [json_name = "name"]; + * @param value The bytes for name to set. + */ + private void setNameBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + name_ = value.toStringUtf8(); + + } + + public static final int DESCRIPTION_FIELD_NUMBER = 2; + private java.lang.String description_; + /** + *
+   * description is a human-readable description of the interface and its
+   * purpose.
+   * 
+ * + * string description = 2 [json_name = "description"]; + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + return description_; + } + /** + *
+   * description is a human-readable description of the interface and its
+   * purpose.
+   * 
+ * + * string description = 2 [json_name = "description"]; + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDescriptionBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(description_); + } + /** + *
+   * description is a human-readable description of the interface and its
+   * purpose.
+   * 
+ * + * string description = 2 [json_name = "description"]; + * @param value The description to set. + */ + private void setDescription( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + description_ = value; + } + /** + *
+   * description is a human-readable description of the interface and its
+   * purpose.
+   * 
+ * + * string description = 2 [json_name = "description"]; + */ + private void clearDescription() { + + description_ = getDefaultInstance().getDescription(); + } + /** + *
+   * description is a human-readable description of the interface and its
+   * purpose.
+   * 
+ * + * string description = 2 [json_name = "description"]; + * @param value The bytes for description to set. + */ + private void setDescriptionBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + description_ = value.toStringUtf8(); + + } + + public static com.cosmos_proto.InterfaceDescriptor parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.cosmos_proto.InterfaceDescriptor parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.cosmos_proto.InterfaceDescriptor parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.cosmos_proto.InterfaceDescriptor parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.cosmos_proto.InterfaceDescriptor parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.cosmos_proto.InterfaceDescriptor parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.cosmos_proto.InterfaceDescriptor parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.cosmos_proto.InterfaceDescriptor parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.cosmos_proto.InterfaceDescriptor parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.cosmos_proto.InterfaceDescriptor parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.cosmos_proto.InterfaceDescriptor parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.cosmos_proto.InterfaceDescriptor parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.cosmos_proto.InterfaceDescriptor prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+   * InterfaceDescriptor describes an interface type to be used with
+   * accepts_interface and implements_interface and declared by declare_interface.
+   * 
+ * + * Protobuf type {@code cosmos_proto.InterfaceDescriptor} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.cosmos_proto.InterfaceDescriptor, Builder> implements + // @@protoc_insertion_point(builder_implements:cosmos_proto.InterfaceDescriptor) + com.cosmos_proto.InterfaceDescriptorOrBuilder { + // Construct using com.cosmos_proto.InterfaceDescriptor.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + *
+     * name is the name of the interface. It should be a short-name (without
+     * a period) such that the fully qualified name of the interface will be
+     * package.name, ex. for the package a.b and interface named C, the
+     * fully-qualified name will be a.b.C.
+     * 
+ * + * string name = 1 [json_name = "name"]; + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + return instance.getName(); + } + /** + *
+     * name is the name of the interface. It should be a short-name (without
+     * a period) such that the fully qualified name of the interface will be
+     * package.name, ex. for the package a.b and interface named C, the
+     * fully-qualified name will be a.b.C.
+     * 
+ * + * string name = 1 [json_name = "name"]; + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNameBytes() { + return instance.getNameBytes(); + } + /** + *
+     * name is the name of the interface. It should be a short-name (without
+     * a period) such that the fully qualified name of the interface will be
+     * package.name, ex. for the package a.b and interface named C, the
+     * fully-qualified name will be a.b.C.
+     * 
+ * + * string name = 1 [json_name = "name"]; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + copyOnWrite(); + instance.setName(value); + return this; + } + /** + *
+     * name is the name of the interface. It should be a short-name (without
+     * a period) such that the fully qualified name of the interface will be
+     * package.name, ex. for the package a.b and interface named C, the
+     * fully-qualified name will be a.b.C.
+     * 
+ * + * string name = 1 [json_name = "name"]; + * @return This builder for chaining. + */ + public Builder clearName() { + copyOnWrite(); + instance.clearName(); + return this; + } + /** + *
+     * name is the name of the interface. It should be a short-name (without
+     * a period) such that the fully qualified name of the interface will be
+     * package.name, ex. for the package a.b and interface named C, the
+     * fully-qualified name will be a.b.C.
+     * 
+ * + * string name = 1 [json_name = "name"]; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setNameBytes(value); + return this; + } + + /** + *
+     * description is a human-readable description of the interface and its
+     * purpose.
+     * 
+ * + * string description = 2 [json_name = "description"]; + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + return instance.getDescription(); + } + /** + *
+     * description is a human-readable description of the interface and its
+     * purpose.
+     * 
+ * + * string description = 2 [json_name = "description"]; + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDescriptionBytes() { + return instance.getDescriptionBytes(); + } + /** + *
+     * description is a human-readable description of the interface and its
+     * purpose.
+     * 
+ * + * string description = 2 [json_name = "description"]; + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription( + java.lang.String value) { + copyOnWrite(); + instance.setDescription(value); + return this; + } + /** + *
+     * description is a human-readable description of the interface and its
+     * purpose.
+     * 
+ * + * string description = 2 [json_name = "description"]; + * @return This builder for chaining. + */ + public Builder clearDescription() { + copyOnWrite(); + instance.clearDescription(); + return this; + } + /** + *
+     * description is a human-readable description of the interface and its
+     * purpose.
+     * 
+ * + * string description = 2 [json_name = "description"]; + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setDescriptionBytes(value); + return this; + } + + // @@protoc_insertion_point(builder_scope:cosmos_proto.InterfaceDescriptor) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.cosmos_proto.InterfaceDescriptor(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "name_", + "description_", + }; + java.lang.String info = + "\u0000\u0002\u0000\u0000\u0001\u0002\u0002\u0000\u0000\u0000\u0001\u0208\u0002\u0208" + + ""; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.cosmos_proto.InterfaceDescriptor.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:cosmos_proto.InterfaceDescriptor) + private static final com.cosmos_proto.InterfaceDescriptor DEFAULT_INSTANCE; + static { + InterfaceDescriptor defaultInstance = new InterfaceDescriptor(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + InterfaceDescriptor.class, defaultInstance); + } + + public static com.cosmos_proto.InterfaceDescriptor getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos_proto/InterfaceDescriptorOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos_proto/InterfaceDescriptorOrBuilder.java new file mode 100644 index 000000000..dfeb76afe --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos_proto/InterfaceDescriptorOrBuilder.java @@ -0,0 +1,57 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: cosmos_proto/cosmos.proto + +package com.cosmos_proto; + +public interface InterfaceDescriptorOrBuilder extends + // @@protoc_insertion_point(interface_extends:cosmos_proto.InterfaceDescriptor) + com.google.protobuf.MessageLiteOrBuilder { + + /** + *
+   * name is the name of the interface. It should be a short-name (without
+   * a period) such that the fully qualified name of the interface will be
+   * package.name, ex. for the package a.b and interface named C, the
+   * fully-qualified name will be a.b.C.
+   * 
+ * + * string name = 1 [json_name = "name"]; + * @return The name. + */ + java.lang.String getName(); + /** + *
+   * name is the name of the interface. It should be a short-name (without
+   * a period) such that the fully qualified name of the interface will be
+   * package.name, ex. for the package a.b and interface named C, the
+   * fully-qualified name will be a.b.C.
+   * 
+ * + * string name = 1 [json_name = "name"]; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
+   * description is a human-readable description of the interface and its
+   * purpose.
+   * 
+ * + * string description = 2 [json_name = "description"]; + * @return The description. + */ + java.lang.String getDescription(); + /** + *
+   * description is a human-readable description of the interface and its
+   * purpose.
+   * 
+ * + * string description = 2 [json_name = "description"]; + * @return The bytes for description. + */ + com.google.protobuf.ByteString + getDescriptionBytes(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos_proto/ScalarDescriptor.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos_proto/ScalarDescriptor.java new file mode 100644 index 000000000..2b3ec259d --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos_proto/ScalarDescriptor.java @@ -0,0 +1,949 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: cosmos_proto/cosmos.proto + +package com.cosmos_proto; + +/** + *
+ * ScalarDescriptor describes an scalar type to be used with
+ * the scalar field option and declared by declare_scalar.
+ * Scalars extend simple protobuf built-in types with additional
+ * syntax and semantics, for instance to represent big integers.
+ * Scalars should ideally define an encoding such that there is only one
+ * valid syntactical representation for a given semantic meaning,
+ * i.e. the encoding should be deterministic.
+ * 
+ * + * Protobuf type {@code cosmos_proto.ScalarDescriptor} + */ +public final class ScalarDescriptor extends + com.google.protobuf.GeneratedMessageLite< + ScalarDescriptor, ScalarDescriptor.Builder> implements + // @@protoc_insertion_point(message_implements:cosmos_proto.ScalarDescriptor) + ScalarDescriptorOrBuilder { + private ScalarDescriptor() { + name_ = ""; + description_ = ""; + fieldType_ = emptyIntList(); + } + public static final int NAME_FIELD_NUMBER = 1; + private java.lang.String name_; + /** + *
+   * name is the name of the scalar. It should be a short-name (without
+   * a period) such that the fully qualified name of the scalar will be
+   * package.name, ex. for the package a.b and scalar named C, the
+   * fully-qualified name will be a.b.C.
+   * 
+ * + * string name = 1 [json_name = "name"]; + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + return name_; + } + /** + *
+   * name is the name of the scalar. It should be a short-name (without
+   * a period) such that the fully qualified name of the scalar will be
+   * package.name, ex. for the package a.b and scalar named C, the
+   * fully-qualified name will be a.b.C.
+   * 
+ * + * string name = 1 [json_name = "name"]; + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNameBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(name_); + } + /** + *
+   * name is the name of the scalar. It should be a short-name (without
+   * a period) such that the fully qualified name of the scalar will be
+   * package.name, ex. for the package a.b and scalar named C, the
+   * fully-qualified name will be a.b.C.
+   * 
+ * + * string name = 1 [json_name = "name"]; + * @param value The name to set. + */ + private void setName( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + name_ = value; + } + /** + *
+   * name is the name of the scalar. It should be a short-name (without
+   * a period) such that the fully qualified name of the scalar will be
+   * package.name, ex. for the package a.b and scalar named C, the
+   * fully-qualified name will be a.b.C.
+   * 
+ * + * string name = 1 [json_name = "name"]; + */ + private void clearName() { + + name_ = getDefaultInstance().getName(); + } + /** + *
+   * name is the name of the scalar. It should be a short-name (without
+   * a period) such that the fully qualified name of the scalar will be
+   * package.name, ex. for the package a.b and scalar named C, the
+   * fully-qualified name will be a.b.C.
+   * 
+ * + * string name = 1 [json_name = "name"]; + * @param value The bytes for name to set. + */ + private void setNameBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + name_ = value.toStringUtf8(); + + } + + public static final int DESCRIPTION_FIELD_NUMBER = 2; + private java.lang.String description_; + /** + *
+   * description is a human-readable description of the scalar and its
+   * encoding format. For instance a big integer or decimal scalar should
+   * specify precisely the expected encoding format.
+   * 
+ * + * string description = 2 [json_name = "description"]; + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + return description_; + } + /** + *
+   * description is a human-readable description of the scalar and its
+   * encoding format. For instance a big integer or decimal scalar should
+   * specify precisely the expected encoding format.
+   * 
+ * + * string description = 2 [json_name = "description"]; + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDescriptionBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(description_); + } + /** + *
+   * description is a human-readable description of the scalar and its
+   * encoding format. For instance a big integer or decimal scalar should
+   * specify precisely the expected encoding format.
+   * 
+ * + * string description = 2 [json_name = "description"]; + * @param value The description to set. + */ + private void setDescription( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + description_ = value; + } + /** + *
+   * description is a human-readable description of the scalar and its
+   * encoding format. For instance a big integer or decimal scalar should
+   * specify precisely the expected encoding format.
+   * 
+ * + * string description = 2 [json_name = "description"]; + */ + private void clearDescription() { + + description_ = getDefaultInstance().getDescription(); + } + /** + *
+   * description is a human-readable description of the scalar and its
+   * encoding format. For instance a big integer or decimal scalar should
+   * specify precisely the expected encoding format.
+   * 
+ * + * string description = 2 [json_name = "description"]; + * @param value The bytes for description to set. + */ + private void setDescriptionBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + description_ = value.toStringUtf8(); + + } + + public static final int FIELD_TYPE_FIELD_NUMBER = 3; + private com.google.protobuf.Internal.IntList fieldType_; + private static final com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, com.cosmos_proto.ScalarType> fieldType_converter_ = + new com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, com.cosmos_proto.ScalarType>() { + @java.lang.Override + public com.cosmos_proto.ScalarType convert(java.lang.Integer from) { + com.cosmos_proto.ScalarType result = com.cosmos_proto.ScalarType.forNumber(from); + return result == null ? com.cosmos_proto.ScalarType.UNRECOGNIZED : result; + } + }; + /** + *
+   * field_type is the type of field with which this scalar can be used.
+   * Scalars can be used with one and only one type of field so that
+   * encoding standards and simple and clear. Currently only string and
+   * bytes fields are supported for scalars.
+   * 
+ * + * repeated .cosmos_proto.ScalarType field_type = 3 [json_name = "fieldType"]; + * @return A list containing the fieldType. + */ + @java.lang.Override + public java.util.List getFieldTypeList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, com.cosmos_proto.ScalarType>(fieldType_, fieldType_converter_); + } + /** + *
+   * field_type is the type of field with which this scalar can be used.
+   * Scalars can be used with one and only one type of field so that
+   * encoding standards and simple and clear. Currently only string and
+   * bytes fields are supported for scalars.
+   * 
+ * + * repeated .cosmos_proto.ScalarType field_type = 3 [json_name = "fieldType"]; + * @return The count of fieldType. + */ + @java.lang.Override + public int getFieldTypeCount() { + return fieldType_.size(); + } + /** + *
+   * field_type is the type of field with which this scalar can be used.
+   * Scalars can be used with one and only one type of field so that
+   * encoding standards and simple and clear. Currently only string and
+   * bytes fields are supported for scalars.
+   * 
+ * + * repeated .cosmos_proto.ScalarType field_type = 3 [json_name = "fieldType"]; + * @param index The index of the element to return. + * @return The fieldType at the given index. + */ + @java.lang.Override + public com.cosmos_proto.ScalarType getFieldType(int index) { + com.cosmos_proto.ScalarType result = com.cosmos_proto.ScalarType.forNumber(fieldType_.getInt(index)); + return result == null ? com.cosmos_proto.ScalarType.UNRECOGNIZED : result; + } + /** + *
+   * field_type is the type of field with which this scalar can be used.
+   * Scalars can be used with one and only one type of field so that
+   * encoding standards and simple and clear. Currently only string and
+   * bytes fields are supported for scalars.
+   * 
+ * + * repeated .cosmos_proto.ScalarType field_type = 3 [json_name = "fieldType"]; + * @return A list containing the enum numeric values on the wire for fieldType. + */ + @java.lang.Override + public java.util.List + getFieldTypeValueList() { + return fieldType_; + } + /** + *
+   * field_type is the type of field with which this scalar can be used.
+   * Scalars can be used with one and only one type of field so that
+   * encoding standards and simple and clear. Currently only string and
+   * bytes fields are supported for scalars.
+   * 
+ * + * repeated .cosmos_proto.ScalarType field_type = 3 [json_name = "fieldType"]; + * @param index The index of the value to return. + * @return The enum numeric value on the wire of fieldType at the given index. + */ + @java.lang.Override + public int getFieldTypeValue(int index) { + return fieldType_.getInt(index); + } + private int fieldTypeMemoizedSerializedSize; + private void ensureFieldTypeIsMutable() { + com.google.protobuf.Internal.IntList tmp = fieldType_; + if (!tmp.isModifiable()) { + fieldType_ = + com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp); + } + } + /** + *
+   * field_type is the type of field with which this scalar can be used.
+   * Scalars can be used with one and only one type of field so that
+   * encoding standards and simple and clear. Currently only string and
+   * bytes fields are supported for scalars.
+   * 
+ * + * repeated .cosmos_proto.ScalarType field_type = 3 [json_name = "fieldType"]; + * @param index The index to set the value at. + * @param value The fieldType to set. + */ + private void setFieldType( + int index, com.cosmos_proto.ScalarType value) { + value.getClass(); + ensureFieldTypeIsMutable(); + fieldType_.setInt(index, value.getNumber()); + } + /** + *
+   * field_type is the type of field with which this scalar can be used.
+   * Scalars can be used with one and only one type of field so that
+   * encoding standards and simple and clear. Currently only string and
+   * bytes fields are supported for scalars.
+   * 
+ * + * repeated .cosmos_proto.ScalarType field_type = 3 [json_name = "fieldType"]; + * @param value The fieldType to add. + */ + private void addFieldType(com.cosmos_proto.ScalarType value) { + value.getClass(); + ensureFieldTypeIsMutable(); + fieldType_.addInt(value.getNumber()); + } + /** + *
+   * field_type is the type of field with which this scalar can be used.
+   * Scalars can be used with one and only one type of field so that
+   * encoding standards and simple and clear. Currently only string and
+   * bytes fields are supported for scalars.
+   * 
+ * + * repeated .cosmos_proto.ScalarType field_type = 3 [json_name = "fieldType"]; + * @param values The fieldType to add. + */ + private void addAllFieldType( + java.lang.Iterable values) { + ensureFieldTypeIsMutable(); + for (com.cosmos_proto.ScalarType value : values) { + fieldType_.addInt(value.getNumber()); + } + } + /** + *
+   * field_type is the type of field with which this scalar can be used.
+   * Scalars can be used with one and only one type of field so that
+   * encoding standards and simple and clear. Currently only string and
+   * bytes fields are supported for scalars.
+   * 
+ * + * repeated .cosmos_proto.ScalarType field_type = 3 [json_name = "fieldType"]; + */ + private void clearFieldType() { + fieldType_ = emptyIntList(); + } + /** + *
+   * field_type is the type of field with which this scalar can be used.
+   * Scalars can be used with one and only one type of field so that
+   * encoding standards and simple and clear. Currently only string and
+   * bytes fields are supported for scalars.
+   * 
+ * + * repeated .cosmos_proto.ScalarType field_type = 3 [json_name = "fieldType"]; + * @param value The enum numeric value on the wire for fieldType to set. + */ + private void setFieldTypeValue( + int index, int value) { + ensureFieldTypeIsMutable(); + fieldType_.setInt(index, value); + } + /** + *
+   * field_type is the type of field with which this scalar can be used.
+   * Scalars can be used with one and only one type of field so that
+   * encoding standards and simple and clear. Currently only string and
+   * bytes fields are supported for scalars.
+   * 
+ * + * repeated .cosmos_proto.ScalarType field_type = 3 [json_name = "fieldType"]; + * @param value The enum numeric value on the wire for fieldType to add. + */ + private void addFieldTypeValue(int value) { + ensureFieldTypeIsMutable(); + fieldType_.addInt(value); + } + /** + *
+   * field_type is the type of field with which this scalar can be used.
+   * Scalars can be used with one and only one type of field so that
+   * encoding standards and simple and clear. Currently only string and
+   * bytes fields are supported for scalars.
+   * 
+ * + * repeated .cosmos_proto.ScalarType field_type = 3 [json_name = "fieldType"]; + * @param values The enum numeric values on the wire for fieldType to add. + */ + private void addAllFieldTypeValue( + java.lang.Iterable values) { + ensureFieldTypeIsMutable(); + for (int value : values) { + fieldType_.addInt(value); + } + } + + public static com.cosmos_proto.ScalarDescriptor parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.cosmos_proto.ScalarDescriptor parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.cosmos_proto.ScalarDescriptor parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.cosmos_proto.ScalarDescriptor parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.cosmos_proto.ScalarDescriptor parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.cosmos_proto.ScalarDescriptor parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.cosmos_proto.ScalarDescriptor parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.cosmos_proto.ScalarDescriptor parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.cosmos_proto.ScalarDescriptor parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.cosmos_proto.ScalarDescriptor parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.cosmos_proto.ScalarDescriptor parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.cosmos_proto.ScalarDescriptor parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.cosmos_proto.ScalarDescriptor prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+   * ScalarDescriptor describes an scalar type to be used with
+   * the scalar field option and declared by declare_scalar.
+   * Scalars extend simple protobuf built-in types with additional
+   * syntax and semantics, for instance to represent big integers.
+   * Scalars should ideally define an encoding such that there is only one
+   * valid syntactical representation for a given semantic meaning,
+   * i.e. the encoding should be deterministic.
+   * 
+ * + * Protobuf type {@code cosmos_proto.ScalarDescriptor} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.cosmos_proto.ScalarDescriptor, Builder> implements + // @@protoc_insertion_point(builder_implements:cosmos_proto.ScalarDescriptor) + com.cosmos_proto.ScalarDescriptorOrBuilder { + // Construct using com.cosmos_proto.ScalarDescriptor.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + *
+     * name is the name of the scalar. It should be a short-name (without
+     * a period) such that the fully qualified name of the scalar will be
+     * package.name, ex. for the package a.b and scalar named C, the
+     * fully-qualified name will be a.b.C.
+     * 
+ * + * string name = 1 [json_name = "name"]; + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + return instance.getName(); + } + /** + *
+     * name is the name of the scalar. It should be a short-name (without
+     * a period) such that the fully qualified name of the scalar will be
+     * package.name, ex. for the package a.b and scalar named C, the
+     * fully-qualified name will be a.b.C.
+     * 
+ * + * string name = 1 [json_name = "name"]; + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNameBytes() { + return instance.getNameBytes(); + } + /** + *
+     * name is the name of the scalar. It should be a short-name (without
+     * a period) such that the fully qualified name of the scalar will be
+     * package.name, ex. for the package a.b and scalar named C, the
+     * fully-qualified name will be a.b.C.
+     * 
+ * + * string name = 1 [json_name = "name"]; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + copyOnWrite(); + instance.setName(value); + return this; + } + /** + *
+     * name is the name of the scalar. It should be a short-name (without
+     * a period) such that the fully qualified name of the scalar will be
+     * package.name, ex. for the package a.b and scalar named C, the
+     * fully-qualified name will be a.b.C.
+     * 
+ * + * string name = 1 [json_name = "name"]; + * @return This builder for chaining. + */ + public Builder clearName() { + copyOnWrite(); + instance.clearName(); + return this; + } + /** + *
+     * name is the name of the scalar. It should be a short-name (without
+     * a period) such that the fully qualified name of the scalar will be
+     * package.name, ex. for the package a.b and scalar named C, the
+     * fully-qualified name will be a.b.C.
+     * 
+ * + * string name = 1 [json_name = "name"]; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setNameBytes(value); + return this; + } + + /** + *
+     * description is a human-readable description of the scalar and its
+     * encoding format. For instance a big integer or decimal scalar should
+     * specify precisely the expected encoding format.
+     * 
+ * + * string description = 2 [json_name = "description"]; + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + return instance.getDescription(); + } + /** + *
+     * description is a human-readable description of the scalar and its
+     * encoding format. For instance a big integer or decimal scalar should
+     * specify precisely the expected encoding format.
+     * 
+ * + * string description = 2 [json_name = "description"]; + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDescriptionBytes() { + return instance.getDescriptionBytes(); + } + /** + *
+     * description is a human-readable description of the scalar and its
+     * encoding format. For instance a big integer or decimal scalar should
+     * specify precisely the expected encoding format.
+     * 
+ * + * string description = 2 [json_name = "description"]; + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription( + java.lang.String value) { + copyOnWrite(); + instance.setDescription(value); + return this; + } + /** + *
+     * description is a human-readable description of the scalar and its
+     * encoding format. For instance a big integer or decimal scalar should
+     * specify precisely the expected encoding format.
+     * 
+ * + * string description = 2 [json_name = "description"]; + * @return This builder for chaining. + */ + public Builder clearDescription() { + copyOnWrite(); + instance.clearDescription(); + return this; + } + /** + *
+     * description is a human-readable description of the scalar and its
+     * encoding format. For instance a big integer or decimal scalar should
+     * specify precisely the expected encoding format.
+     * 
+ * + * string description = 2 [json_name = "description"]; + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setDescriptionBytes(value); + return this; + } + + /** + *
+     * field_type is the type of field with which this scalar can be used.
+     * Scalars can be used with one and only one type of field so that
+     * encoding standards and simple and clear. Currently only string and
+     * bytes fields are supported for scalars.
+     * 
+ * + * repeated .cosmos_proto.ScalarType field_type = 3 [json_name = "fieldType"]; + * @return A list containing the fieldType. + */ + @java.lang.Override + public java.util.List getFieldTypeList() { + return instance.getFieldTypeList(); + } + /** + *
+     * field_type is the type of field with which this scalar can be used.
+     * Scalars can be used with one and only one type of field so that
+     * encoding standards and simple and clear. Currently only string and
+     * bytes fields are supported for scalars.
+     * 
+ * + * repeated .cosmos_proto.ScalarType field_type = 3 [json_name = "fieldType"]; + * @return The count of fieldType. + */ + @java.lang.Override + public int getFieldTypeCount() { + return instance.getFieldTypeCount(); + } + /** + *
+     * field_type is the type of field with which this scalar can be used.
+     * Scalars can be used with one and only one type of field so that
+     * encoding standards and simple and clear. Currently only string and
+     * bytes fields are supported for scalars.
+     * 
+ * + * repeated .cosmos_proto.ScalarType field_type = 3 [json_name = "fieldType"]; + * @param index The index of the element to return. + * @return The fieldType at the given index. + */ + @java.lang.Override + public com.cosmos_proto.ScalarType getFieldType(int index) { + return instance.getFieldType(index); + } + /** + *
+     * field_type is the type of field with which this scalar can be used.
+     * Scalars can be used with one and only one type of field so that
+     * encoding standards and simple and clear. Currently only string and
+     * bytes fields are supported for scalars.
+     * 
+ * + * repeated .cosmos_proto.ScalarType field_type = 3 [json_name = "fieldType"]; + * @param index The index to set the value at. + * @param value The fieldType to set. + * @return This builder for chaining. + */ + public Builder setFieldType( + int index, com.cosmos_proto.ScalarType value) { + copyOnWrite(); + instance.setFieldType(index, value); + return this; + } + /** + *
+     * field_type is the type of field with which this scalar can be used.
+     * Scalars can be used with one and only one type of field so that
+     * encoding standards and simple and clear. Currently only string and
+     * bytes fields are supported for scalars.
+     * 
+ * + * repeated .cosmos_proto.ScalarType field_type = 3 [json_name = "fieldType"]; + * @param value The fieldType to add. + * @return This builder for chaining. + */ + public Builder addFieldType(com.cosmos_proto.ScalarType value) { + copyOnWrite(); + instance.addFieldType(value); + return this; + } + /** + *
+     * field_type is the type of field with which this scalar can be used.
+     * Scalars can be used with one and only one type of field so that
+     * encoding standards and simple and clear. Currently only string and
+     * bytes fields are supported for scalars.
+     * 
+ * + * repeated .cosmos_proto.ScalarType field_type = 3 [json_name = "fieldType"]; + * @param values The fieldType to add. + * @return This builder for chaining. + */ + public Builder addAllFieldType( + java.lang.Iterable values) { + copyOnWrite(); + instance.addAllFieldType(values); return this; + } + /** + *
+     * field_type is the type of field with which this scalar can be used.
+     * Scalars can be used with one and only one type of field so that
+     * encoding standards and simple and clear. Currently only string and
+     * bytes fields are supported for scalars.
+     * 
+ * + * repeated .cosmos_proto.ScalarType field_type = 3 [json_name = "fieldType"]; + * @return This builder for chaining. + */ + public Builder clearFieldType() { + copyOnWrite(); + instance.clearFieldType(); + return this; + } + /** + *
+     * field_type is the type of field with which this scalar can be used.
+     * Scalars can be used with one and only one type of field so that
+     * encoding standards and simple and clear. Currently only string and
+     * bytes fields are supported for scalars.
+     * 
+ * + * repeated .cosmos_proto.ScalarType field_type = 3 [json_name = "fieldType"]; + * @return A list containing the enum numeric values on the wire for fieldType. + */ + @java.lang.Override + public java.util.List + getFieldTypeValueList() { + return java.util.Collections.unmodifiableList( + instance.getFieldTypeValueList()); + } + /** + *
+     * field_type is the type of field with which this scalar can be used.
+     * Scalars can be used with one and only one type of field so that
+     * encoding standards and simple and clear. Currently only string and
+     * bytes fields are supported for scalars.
+     * 
+ * + * repeated .cosmos_proto.ScalarType field_type = 3 [json_name = "fieldType"]; + * @param index The index of the value to return. + * @return The enum numeric value on the wire of fieldType at the given index. + */ + @java.lang.Override + public int getFieldTypeValue(int index) { + return instance.getFieldTypeValue(index); + } + /** + *
+     * field_type is the type of field with which this scalar can be used.
+     * Scalars can be used with one and only one type of field so that
+     * encoding standards and simple and clear. Currently only string and
+     * bytes fields are supported for scalars.
+     * 
+ * + * repeated .cosmos_proto.ScalarType field_type = 3 [json_name = "fieldType"]; + * @param index The index to set the value at. + * @param value The enum numeric value on the wire for fieldType to set. + * @return This builder for chaining. + */ + public Builder setFieldTypeValue( + int index, int value) { + copyOnWrite(); + instance.setFieldTypeValue(index, value); + return this; + } + /** + *
+     * field_type is the type of field with which this scalar can be used.
+     * Scalars can be used with one and only one type of field so that
+     * encoding standards and simple and clear. Currently only string and
+     * bytes fields are supported for scalars.
+     * 
+ * + * repeated .cosmos_proto.ScalarType field_type = 3 [json_name = "fieldType"]; + * @param value The enum numeric value on the wire for fieldType to add. + * @return This builder for chaining. + */ + public Builder addFieldTypeValue(int value) { + instance.addFieldTypeValue(value); + return this; + } + /** + *
+     * field_type is the type of field with which this scalar can be used.
+     * Scalars can be used with one and only one type of field so that
+     * encoding standards and simple and clear. Currently only string and
+     * bytes fields are supported for scalars.
+     * 
+ * + * repeated .cosmos_proto.ScalarType field_type = 3 [json_name = "fieldType"]; + * @param values The enum numeric values on the wire for fieldType to add. + * @return This builder for chaining. + */ + public Builder addAllFieldTypeValue( + java.lang.Iterable values) { + copyOnWrite(); + instance.addAllFieldTypeValue(values); + return this; + } + + // @@protoc_insertion_point(builder_scope:cosmos_proto.ScalarDescriptor) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.cosmos_proto.ScalarDescriptor(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "name_", + "description_", + "fieldType_", + }; + java.lang.String info = + "\u0000\u0003\u0000\u0000\u0001\u0003\u0003\u0000\u0001\u0000\u0001\u0208\u0002\u0208" + + "\u0003,"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.cosmos_proto.ScalarDescriptor.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:cosmos_proto.ScalarDescriptor) + private static final com.cosmos_proto.ScalarDescriptor DEFAULT_INSTANCE; + static { + ScalarDescriptor defaultInstance = new ScalarDescriptor(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + ScalarDescriptor.class, defaultInstance); + } + + public static com.cosmos_proto.ScalarDescriptor getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos_proto/ScalarDescriptorOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos_proto/ScalarDescriptorOrBuilder.java new file mode 100644 index 000000000..9cae4f68f --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos_proto/ScalarDescriptorOrBuilder.java @@ -0,0 +1,123 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: cosmos_proto/cosmos.proto + +package com.cosmos_proto; + +public interface ScalarDescriptorOrBuilder extends + // @@protoc_insertion_point(interface_extends:cosmos_proto.ScalarDescriptor) + com.google.protobuf.MessageLiteOrBuilder { + + /** + *
+   * name is the name of the scalar. It should be a short-name (without
+   * a period) such that the fully qualified name of the scalar will be
+   * package.name, ex. for the package a.b and scalar named C, the
+   * fully-qualified name will be a.b.C.
+   * 
+ * + * string name = 1 [json_name = "name"]; + * @return The name. + */ + java.lang.String getName(); + /** + *
+   * name is the name of the scalar. It should be a short-name (without
+   * a period) such that the fully qualified name of the scalar will be
+   * package.name, ex. for the package a.b and scalar named C, the
+   * fully-qualified name will be a.b.C.
+   * 
+ * + * string name = 1 [json_name = "name"]; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
+   * description is a human-readable description of the scalar and its
+   * encoding format. For instance a big integer or decimal scalar should
+   * specify precisely the expected encoding format.
+   * 
+ * + * string description = 2 [json_name = "description"]; + * @return The description. + */ + java.lang.String getDescription(); + /** + *
+   * description is a human-readable description of the scalar and its
+   * encoding format. For instance a big integer or decimal scalar should
+   * specify precisely the expected encoding format.
+   * 
+ * + * string description = 2 [json_name = "description"]; + * @return The bytes for description. + */ + com.google.protobuf.ByteString + getDescriptionBytes(); + + /** + *
+   * field_type is the type of field with which this scalar can be used.
+   * Scalars can be used with one and only one type of field so that
+   * encoding standards and simple and clear. Currently only string and
+   * bytes fields are supported for scalars.
+   * 
+ * + * repeated .cosmos_proto.ScalarType field_type = 3 [json_name = "fieldType"]; + * @return A list containing the fieldType. + */ + java.util.List getFieldTypeList(); + /** + *
+   * field_type is the type of field with which this scalar can be used.
+   * Scalars can be used with one and only one type of field so that
+   * encoding standards and simple and clear. Currently only string and
+   * bytes fields are supported for scalars.
+   * 
+ * + * repeated .cosmos_proto.ScalarType field_type = 3 [json_name = "fieldType"]; + * @return The count of fieldType. + */ + int getFieldTypeCount(); + /** + *
+   * field_type is the type of field with which this scalar can be used.
+   * Scalars can be used with one and only one type of field so that
+   * encoding standards and simple and clear. Currently only string and
+   * bytes fields are supported for scalars.
+   * 
+ * + * repeated .cosmos_proto.ScalarType field_type = 3 [json_name = "fieldType"]; + * @param index The index of the element to return. + * @return The fieldType at the given index. + */ + com.cosmos_proto.ScalarType getFieldType(int index); + /** + *
+   * field_type is the type of field with which this scalar can be used.
+   * Scalars can be used with one and only one type of field so that
+   * encoding standards and simple and clear. Currently only string and
+   * bytes fields are supported for scalars.
+   * 
+ * + * repeated .cosmos_proto.ScalarType field_type = 3 [json_name = "fieldType"]; + * @return A list containing the enum numeric values on the wire for fieldType. + */ + java.util.List + getFieldTypeValueList(); + /** + *
+   * field_type is the type of field with which this scalar can be used.
+   * Scalars can be used with one and only one type of field so that
+   * encoding standards and simple and clear. Currently only string and
+   * bytes fields are supported for scalars.
+   * 
+ * + * repeated .cosmos_proto.ScalarType field_type = 3 [json_name = "fieldType"]; + * @param index The index of the value to return. + * @return The enum numeric value on the wire of fieldType at the given index. + */ + int getFieldTypeValue(int index); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos_proto/ScalarType.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos_proto/ScalarType.java new file mode 100644 index 000000000..3be018a0f --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos_proto/ScalarType.java @@ -0,0 +1,103 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: cosmos_proto/cosmos.proto + +package com.cosmos_proto; + +/** + * Protobuf enum {@code cosmos_proto.ScalarType} + */ +public enum ScalarType + implements com.google.protobuf.Internal.EnumLite { + /** + * SCALAR_TYPE_UNSPECIFIED = 0; + */ + SCALAR_TYPE_UNSPECIFIED(0), + /** + * SCALAR_TYPE_STRING = 1; + */ + SCALAR_TYPE_STRING(1), + /** + * SCALAR_TYPE_BYTES = 2; + */ + SCALAR_TYPE_BYTES(2), + UNRECOGNIZED(-1), + ; + + /** + * SCALAR_TYPE_UNSPECIFIED = 0; + */ + public static final int SCALAR_TYPE_UNSPECIFIED_VALUE = 0; + /** + * SCALAR_TYPE_STRING = 1; + */ + public static final int SCALAR_TYPE_STRING_VALUE = 1; + /** + * SCALAR_TYPE_BYTES = 2; + */ + public static final int SCALAR_TYPE_BYTES_VALUE = 2; + + + @java.lang.Override + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ScalarType valueOf(int value) { + return forNumber(value); + } + + public static ScalarType forNumber(int value) { + switch (value) { + case 0: return SCALAR_TYPE_UNSPECIFIED; + case 1: return SCALAR_TYPE_STRING; + case 2: return SCALAR_TYPE_BYTES; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + ScalarType> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + @java.lang.Override + public ScalarType findValueByNumber(int number) { + return ScalarType.forNumber(number); + } + }; + + public static com.google.protobuf.Internal.EnumVerifier + internalGetVerifier() { + return ScalarTypeVerifier.INSTANCE; + } + + private static final class ScalarTypeVerifier implements + com.google.protobuf.Internal.EnumVerifier { + static final com.google.protobuf.Internal.EnumVerifier INSTANCE = new ScalarTypeVerifier(); + @java.lang.Override + public boolean isInRange(int number) { + return ScalarType.forNumber(number) != null; + } + }; + + private final int value; + + private ScalarType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:cosmos_proto.ScalarType) +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/gogoproto/GogoProto.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/gogoproto/GogoProto.java new file mode 100644 index 000000000..b48ab7f99 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/gogoproto/GogoProto.java @@ -0,0 +1,1325 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: gogoproto/gogo.proto + +package com.gogoproto; + +public final class GogoProto { + private GogoProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + registry.add(com.gogoproto.GogoProto.goprotoEnumPrefix); + registry.add(com.gogoproto.GogoProto.goprotoEnumStringer); + registry.add(com.gogoproto.GogoProto.enumStringer); + registry.add(com.gogoproto.GogoProto.enumCustomname); + registry.add(com.gogoproto.GogoProto.enumdecl); + registry.add(com.gogoproto.GogoProto.enumvalueCustomname); + registry.add(com.gogoproto.GogoProto.goprotoGettersAll); + registry.add(com.gogoproto.GogoProto.goprotoEnumPrefixAll); + registry.add(com.gogoproto.GogoProto.goprotoStringerAll); + registry.add(com.gogoproto.GogoProto.verboseEqualAll); + registry.add(com.gogoproto.GogoProto.faceAll); + registry.add(com.gogoproto.GogoProto.gostringAll); + registry.add(com.gogoproto.GogoProto.populateAll); + registry.add(com.gogoproto.GogoProto.stringerAll); + registry.add(com.gogoproto.GogoProto.onlyoneAll); + registry.add(com.gogoproto.GogoProto.equalAll); + registry.add(com.gogoproto.GogoProto.descriptionAll); + registry.add(com.gogoproto.GogoProto.testgenAll); + registry.add(com.gogoproto.GogoProto.benchgenAll); + registry.add(com.gogoproto.GogoProto.marshalerAll); + registry.add(com.gogoproto.GogoProto.unmarshalerAll); + registry.add(com.gogoproto.GogoProto.stableMarshalerAll); + registry.add(com.gogoproto.GogoProto.sizerAll); + registry.add(com.gogoproto.GogoProto.goprotoEnumStringerAll); + registry.add(com.gogoproto.GogoProto.enumStringerAll); + registry.add(com.gogoproto.GogoProto.unsafeMarshalerAll); + registry.add(com.gogoproto.GogoProto.unsafeUnmarshalerAll); + registry.add(com.gogoproto.GogoProto.goprotoExtensionsMapAll); + registry.add(com.gogoproto.GogoProto.goprotoUnrecognizedAll); + registry.add(com.gogoproto.GogoProto.gogoprotoImport); + registry.add(com.gogoproto.GogoProto.protosizerAll); + registry.add(com.gogoproto.GogoProto.compareAll); + registry.add(com.gogoproto.GogoProto.typedeclAll); + registry.add(com.gogoproto.GogoProto.enumdeclAll); + registry.add(com.gogoproto.GogoProto.goprotoRegistration); + registry.add(com.gogoproto.GogoProto.messagenameAll); + registry.add(com.gogoproto.GogoProto.goprotoSizecacheAll); + registry.add(com.gogoproto.GogoProto.goprotoUnkeyedAll); + registry.add(com.gogoproto.GogoProto.goprotoGetters); + registry.add(com.gogoproto.GogoProto.goprotoStringer); + registry.add(com.gogoproto.GogoProto.verboseEqual); + registry.add(com.gogoproto.GogoProto.face); + registry.add(com.gogoproto.GogoProto.gostring); + registry.add(com.gogoproto.GogoProto.populate); + registry.add(com.gogoproto.GogoProto.stringer); + registry.add(com.gogoproto.GogoProto.onlyone); + registry.add(com.gogoproto.GogoProto.equal); + registry.add(com.gogoproto.GogoProto.description); + registry.add(com.gogoproto.GogoProto.testgen); + registry.add(com.gogoproto.GogoProto.benchgen); + registry.add(com.gogoproto.GogoProto.marshaler); + registry.add(com.gogoproto.GogoProto.unmarshaler); + registry.add(com.gogoproto.GogoProto.stableMarshaler); + registry.add(com.gogoproto.GogoProto.sizer); + registry.add(com.gogoproto.GogoProto.unsafeMarshaler); + registry.add(com.gogoproto.GogoProto.unsafeUnmarshaler); + registry.add(com.gogoproto.GogoProto.goprotoExtensionsMap); + registry.add(com.gogoproto.GogoProto.goprotoUnrecognized); + registry.add(com.gogoproto.GogoProto.protosizer); + registry.add(com.gogoproto.GogoProto.compare); + registry.add(com.gogoproto.GogoProto.typedecl); + registry.add(com.gogoproto.GogoProto.messagename); + registry.add(com.gogoproto.GogoProto.goprotoSizecache); + registry.add(com.gogoproto.GogoProto.goprotoUnkeyed); + registry.add(com.gogoproto.GogoProto.nullable); + registry.add(com.gogoproto.GogoProto.embed); + registry.add(com.gogoproto.GogoProto.customtype); + registry.add(com.gogoproto.GogoProto.customname); + registry.add(com.gogoproto.GogoProto.jsontag); + registry.add(com.gogoproto.GogoProto.moretags); + registry.add(com.gogoproto.GogoProto.casttype); + registry.add(com.gogoproto.GogoProto.castkey); + registry.add(com.gogoproto.GogoProto.castvalue); + registry.add(com.gogoproto.GogoProto.stdtime); + registry.add(com.gogoproto.GogoProto.stdduration); + registry.add(com.gogoproto.GogoProto.wktpointer); + registry.add(com.gogoproto.GogoProto.castrepeated); + } + public static final int GOPROTO_ENUM_PREFIX_FIELD_NUMBER = 62001; + /** + * extend .google.protobuf.EnumOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.EnumOptions, + java.lang.Boolean> goprotoEnumPrefix = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.EnumOptions.getDefaultInstance(), + false, + null, + null, + 62001, + com.google.protobuf.WireFormat.FieldType.BOOL, + java.lang.Boolean.class); + public static final int GOPROTO_ENUM_STRINGER_FIELD_NUMBER = 62021; + /** + * extend .google.protobuf.EnumOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.EnumOptions, + java.lang.Boolean> goprotoEnumStringer = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.EnumOptions.getDefaultInstance(), + false, + null, + null, + 62021, + com.google.protobuf.WireFormat.FieldType.BOOL, + java.lang.Boolean.class); + public static final int ENUM_STRINGER_FIELD_NUMBER = 62022; + /** + * extend .google.protobuf.EnumOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.EnumOptions, + java.lang.Boolean> enumStringer = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.EnumOptions.getDefaultInstance(), + false, + null, + null, + 62022, + com.google.protobuf.WireFormat.FieldType.BOOL, + java.lang.Boolean.class); + public static final int ENUM_CUSTOMNAME_FIELD_NUMBER = 62023; + /** + * extend .google.protobuf.EnumOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.EnumOptions, + java.lang.String> enumCustomname = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.EnumOptions.getDefaultInstance(), + "", + null, + null, + 62023, + com.google.protobuf.WireFormat.FieldType.STRING, + java.lang.String.class); + public static final int ENUMDECL_FIELD_NUMBER = 62024; + /** + * extend .google.protobuf.EnumOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.EnumOptions, + java.lang.Boolean> enumdecl = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.EnumOptions.getDefaultInstance(), + false, + null, + null, + 62024, + com.google.protobuf.WireFormat.FieldType.BOOL, + java.lang.Boolean.class); + public static final int ENUMVALUE_CUSTOMNAME_FIELD_NUMBER = 66001; + /** + * extend .google.protobuf.EnumValueOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.EnumValueOptions, + java.lang.String> enumvalueCustomname = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.EnumValueOptions.getDefaultInstance(), + "", + null, + null, + 66001, + com.google.protobuf.WireFormat.FieldType.STRING, + java.lang.String.class); + public static final int GOPROTO_GETTERS_ALL_FIELD_NUMBER = 63001; + /** + * extend .google.protobuf.FileOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FileOptions, + java.lang.Boolean> goprotoGettersAll = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.FileOptions.getDefaultInstance(), + false, + null, + null, + 63001, + com.google.protobuf.WireFormat.FieldType.BOOL, + java.lang.Boolean.class); + public static final int GOPROTO_ENUM_PREFIX_ALL_FIELD_NUMBER = 63002; + /** + * extend .google.protobuf.FileOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FileOptions, + java.lang.Boolean> goprotoEnumPrefixAll = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.FileOptions.getDefaultInstance(), + false, + null, + null, + 63002, + com.google.protobuf.WireFormat.FieldType.BOOL, + java.lang.Boolean.class); + public static final int GOPROTO_STRINGER_ALL_FIELD_NUMBER = 63003; + /** + * extend .google.protobuf.FileOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FileOptions, + java.lang.Boolean> goprotoStringerAll = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.FileOptions.getDefaultInstance(), + false, + null, + null, + 63003, + com.google.protobuf.WireFormat.FieldType.BOOL, + java.lang.Boolean.class); + public static final int VERBOSE_EQUAL_ALL_FIELD_NUMBER = 63004; + /** + * extend .google.protobuf.FileOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FileOptions, + java.lang.Boolean> verboseEqualAll = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.FileOptions.getDefaultInstance(), + false, + null, + null, + 63004, + com.google.protobuf.WireFormat.FieldType.BOOL, + java.lang.Boolean.class); + public static final int FACE_ALL_FIELD_NUMBER = 63005; + /** + * extend .google.protobuf.FileOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FileOptions, + java.lang.Boolean> faceAll = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.FileOptions.getDefaultInstance(), + false, + null, + null, + 63005, + com.google.protobuf.WireFormat.FieldType.BOOL, + java.lang.Boolean.class); + public static final int GOSTRING_ALL_FIELD_NUMBER = 63006; + /** + * extend .google.protobuf.FileOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FileOptions, + java.lang.Boolean> gostringAll = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.FileOptions.getDefaultInstance(), + false, + null, + null, + 63006, + com.google.protobuf.WireFormat.FieldType.BOOL, + java.lang.Boolean.class); + public static final int POPULATE_ALL_FIELD_NUMBER = 63007; + /** + * extend .google.protobuf.FileOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FileOptions, + java.lang.Boolean> populateAll = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.FileOptions.getDefaultInstance(), + false, + null, + null, + 63007, + com.google.protobuf.WireFormat.FieldType.BOOL, + java.lang.Boolean.class); + public static final int STRINGER_ALL_FIELD_NUMBER = 63008; + /** + * extend .google.protobuf.FileOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FileOptions, + java.lang.Boolean> stringerAll = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.FileOptions.getDefaultInstance(), + false, + null, + null, + 63008, + com.google.protobuf.WireFormat.FieldType.BOOL, + java.lang.Boolean.class); + public static final int ONLYONE_ALL_FIELD_NUMBER = 63009; + /** + * extend .google.protobuf.FileOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FileOptions, + java.lang.Boolean> onlyoneAll = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.FileOptions.getDefaultInstance(), + false, + null, + null, + 63009, + com.google.protobuf.WireFormat.FieldType.BOOL, + java.lang.Boolean.class); + public static final int EQUAL_ALL_FIELD_NUMBER = 63013; + /** + * extend .google.protobuf.FileOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FileOptions, + java.lang.Boolean> equalAll = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.FileOptions.getDefaultInstance(), + false, + null, + null, + 63013, + com.google.protobuf.WireFormat.FieldType.BOOL, + java.lang.Boolean.class); + public static final int DESCRIPTION_ALL_FIELD_NUMBER = 63014; + /** + * extend .google.protobuf.FileOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FileOptions, + java.lang.Boolean> descriptionAll = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.FileOptions.getDefaultInstance(), + false, + null, + null, + 63014, + com.google.protobuf.WireFormat.FieldType.BOOL, + java.lang.Boolean.class); + public static final int TESTGEN_ALL_FIELD_NUMBER = 63015; + /** + * extend .google.protobuf.FileOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FileOptions, + java.lang.Boolean> testgenAll = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.FileOptions.getDefaultInstance(), + false, + null, + null, + 63015, + com.google.protobuf.WireFormat.FieldType.BOOL, + java.lang.Boolean.class); + public static final int BENCHGEN_ALL_FIELD_NUMBER = 63016; + /** + * extend .google.protobuf.FileOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FileOptions, + java.lang.Boolean> benchgenAll = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.FileOptions.getDefaultInstance(), + false, + null, + null, + 63016, + com.google.protobuf.WireFormat.FieldType.BOOL, + java.lang.Boolean.class); + public static final int MARSHALER_ALL_FIELD_NUMBER = 63017; + /** + * extend .google.protobuf.FileOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FileOptions, + java.lang.Boolean> marshalerAll = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.FileOptions.getDefaultInstance(), + false, + null, + null, + 63017, + com.google.protobuf.WireFormat.FieldType.BOOL, + java.lang.Boolean.class); + public static final int UNMARSHALER_ALL_FIELD_NUMBER = 63018; + /** + * extend .google.protobuf.FileOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FileOptions, + java.lang.Boolean> unmarshalerAll = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.FileOptions.getDefaultInstance(), + false, + null, + null, + 63018, + com.google.protobuf.WireFormat.FieldType.BOOL, + java.lang.Boolean.class); + public static final int STABLE_MARSHALER_ALL_FIELD_NUMBER = 63019; + /** + * extend .google.protobuf.FileOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FileOptions, + java.lang.Boolean> stableMarshalerAll = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.FileOptions.getDefaultInstance(), + false, + null, + null, + 63019, + com.google.protobuf.WireFormat.FieldType.BOOL, + java.lang.Boolean.class); + public static final int SIZER_ALL_FIELD_NUMBER = 63020; + /** + * extend .google.protobuf.FileOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FileOptions, + java.lang.Boolean> sizerAll = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.FileOptions.getDefaultInstance(), + false, + null, + null, + 63020, + com.google.protobuf.WireFormat.FieldType.BOOL, + java.lang.Boolean.class); + public static final int GOPROTO_ENUM_STRINGER_ALL_FIELD_NUMBER = 63021; + /** + * extend .google.protobuf.FileOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FileOptions, + java.lang.Boolean> goprotoEnumStringerAll = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.FileOptions.getDefaultInstance(), + false, + null, + null, + 63021, + com.google.protobuf.WireFormat.FieldType.BOOL, + java.lang.Boolean.class); + public static final int ENUM_STRINGER_ALL_FIELD_NUMBER = 63022; + /** + * extend .google.protobuf.FileOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FileOptions, + java.lang.Boolean> enumStringerAll = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.FileOptions.getDefaultInstance(), + false, + null, + null, + 63022, + com.google.protobuf.WireFormat.FieldType.BOOL, + java.lang.Boolean.class); + public static final int UNSAFE_MARSHALER_ALL_FIELD_NUMBER = 63023; + /** + * extend .google.protobuf.FileOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FileOptions, + java.lang.Boolean> unsafeMarshalerAll = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.FileOptions.getDefaultInstance(), + false, + null, + null, + 63023, + com.google.protobuf.WireFormat.FieldType.BOOL, + java.lang.Boolean.class); + public static final int UNSAFE_UNMARSHALER_ALL_FIELD_NUMBER = 63024; + /** + * extend .google.protobuf.FileOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FileOptions, + java.lang.Boolean> unsafeUnmarshalerAll = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.FileOptions.getDefaultInstance(), + false, + null, + null, + 63024, + com.google.protobuf.WireFormat.FieldType.BOOL, + java.lang.Boolean.class); + public static final int GOPROTO_EXTENSIONS_MAP_ALL_FIELD_NUMBER = 63025; + /** + * extend .google.protobuf.FileOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FileOptions, + java.lang.Boolean> goprotoExtensionsMapAll = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.FileOptions.getDefaultInstance(), + false, + null, + null, + 63025, + com.google.protobuf.WireFormat.FieldType.BOOL, + java.lang.Boolean.class); + public static final int GOPROTO_UNRECOGNIZED_ALL_FIELD_NUMBER = 63026; + /** + * extend .google.protobuf.FileOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FileOptions, + java.lang.Boolean> goprotoUnrecognizedAll = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.FileOptions.getDefaultInstance(), + false, + null, + null, + 63026, + com.google.protobuf.WireFormat.FieldType.BOOL, + java.lang.Boolean.class); + public static final int GOGOPROTO_IMPORT_FIELD_NUMBER = 63027; + /** + * extend .google.protobuf.FileOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FileOptions, + java.lang.Boolean> gogoprotoImport = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.FileOptions.getDefaultInstance(), + false, + null, + null, + 63027, + com.google.protobuf.WireFormat.FieldType.BOOL, + java.lang.Boolean.class); + public static final int PROTOSIZER_ALL_FIELD_NUMBER = 63028; + /** + * extend .google.protobuf.FileOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FileOptions, + java.lang.Boolean> protosizerAll = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.FileOptions.getDefaultInstance(), + false, + null, + null, + 63028, + com.google.protobuf.WireFormat.FieldType.BOOL, + java.lang.Boolean.class); + public static final int COMPARE_ALL_FIELD_NUMBER = 63029; + /** + * extend .google.protobuf.FileOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FileOptions, + java.lang.Boolean> compareAll = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.FileOptions.getDefaultInstance(), + false, + null, + null, + 63029, + com.google.protobuf.WireFormat.FieldType.BOOL, + java.lang.Boolean.class); + public static final int TYPEDECL_ALL_FIELD_NUMBER = 63030; + /** + * extend .google.protobuf.FileOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FileOptions, + java.lang.Boolean> typedeclAll = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.FileOptions.getDefaultInstance(), + false, + null, + null, + 63030, + com.google.protobuf.WireFormat.FieldType.BOOL, + java.lang.Boolean.class); + public static final int ENUMDECL_ALL_FIELD_NUMBER = 63031; + /** + * extend .google.protobuf.FileOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FileOptions, + java.lang.Boolean> enumdeclAll = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.FileOptions.getDefaultInstance(), + false, + null, + null, + 63031, + com.google.protobuf.WireFormat.FieldType.BOOL, + java.lang.Boolean.class); + public static final int GOPROTO_REGISTRATION_FIELD_NUMBER = 63032; + /** + * extend .google.protobuf.FileOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FileOptions, + java.lang.Boolean> goprotoRegistration = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.FileOptions.getDefaultInstance(), + false, + null, + null, + 63032, + com.google.protobuf.WireFormat.FieldType.BOOL, + java.lang.Boolean.class); + public static final int MESSAGENAME_ALL_FIELD_NUMBER = 63033; + /** + * extend .google.protobuf.FileOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FileOptions, + java.lang.Boolean> messagenameAll = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.FileOptions.getDefaultInstance(), + false, + null, + null, + 63033, + com.google.protobuf.WireFormat.FieldType.BOOL, + java.lang.Boolean.class); + public static final int GOPROTO_SIZECACHE_ALL_FIELD_NUMBER = 63034; + /** + * extend .google.protobuf.FileOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FileOptions, + java.lang.Boolean> goprotoSizecacheAll = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.FileOptions.getDefaultInstance(), + false, + null, + null, + 63034, + com.google.protobuf.WireFormat.FieldType.BOOL, + java.lang.Boolean.class); + public static final int GOPROTO_UNKEYED_ALL_FIELD_NUMBER = 63035; + /** + * extend .google.protobuf.FileOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FileOptions, + java.lang.Boolean> goprotoUnkeyedAll = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.FileOptions.getDefaultInstance(), + false, + null, + null, + 63035, + com.google.protobuf.WireFormat.FieldType.BOOL, + java.lang.Boolean.class); + public static final int GOPROTO_GETTERS_FIELD_NUMBER = 64001; + /** + * extend .google.protobuf.MessageOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.MessageOptions, + java.lang.Boolean> goprotoGetters = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.MessageOptions.getDefaultInstance(), + false, + null, + null, + 64001, + com.google.protobuf.WireFormat.FieldType.BOOL, + java.lang.Boolean.class); + public static final int GOPROTO_STRINGER_FIELD_NUMBER = 64003; + /** + * extend .google.protobuf.MessageOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.MessageOptions, + java.lang.Boolean> goprotoStringer = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.MessageOptions.getDefaultInstance(), + false, + null, + null, + 64003, + com.google.protobuf.WireFormat.FieldType.BOOL, + java.lang.Boolean.class); + public static final int VERBOSE_EQUAL_FIELD_NUMBER = 64004; + /** + * extend .google.protobuf.MessageOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.MessageOptions, + java.lang.Boolean> verboseEqual = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.MessageOptions.getDefaultInstance(), + false, + null, + null, + 64004, + com.google.protobuf.WireFormat.FieldType.BOOL, + java.lang.Boolean.class); + public static final int FACE_FIELD_NUMBER = 64005; + /** + * extend .google.protobuf.MessageOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.MessageOptions, + java.lang.Boolean> face = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.MessageOptions.getDefaultInstance(), + false, + null, + null, + 64005, + com.google.protobuf.WireFormat.FieldType.BOOL, + java.lang.Boolean.class); + public static final int GOSTRING_FIELD_NUMBER = 64006; + /** + * extend .google.protobuf.MessageOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.MessageOptions, + java.lang.Boolean> gostring = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.MessageOptions.getDefaultInstance(), + false, + null, + null, + 64006, + com.google.protobuf.WireFormat.FieldType.BOOL, + java.lang.Boolean.class); + public static final int POPULATE_FIELD_NUMBER = 64007; + /** + * extend .google.protobuf.MessageOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.MessageOptions, + java.lang.Boolean> populate = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.MessageOptions.getDefaultInstance(), + false, + null, + null, + 64007, + com.google.protobuf.WireFormat.FieldType.BOOL, + java.lang.Boolean.class); + public static final int STRINGER_FIELD_NUMBER = 67008; + /** + * extend .google.protobuf.MessageOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.MessageOptions, + java.lang.Boolean> stringer = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.MessageOptions.getDefaultInstance(), + false, + null, + null, + 67008, + com.google.protobuf.WireFormat.FieldType.BOOL, + java.lang.Boolean.class); + public static final int ONLYONE_FIELD_NUMBER = 64009; + /** + * extend .google.protobuf.MessageOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.MessageOptions, + java.lang.Boolean> onlyone = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.MessageOptions.getDefaultInstance(), + false, + null, + null, + 64009, + com.google.protobuf.WireFormat.FieldType.BOOL, + java.lang.Boolean.class); + public static final int EQUAL_FIELD_NUMBER = 64013; + /** + * extend .google.protobuf.MessageOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.MessageOptions, + java.lang.Boolean> equal = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.MessageOptions.getDefaultInstance(), + false, + null, + null, + 64013, + com.google.protobuf.WireFormat.FieldType.BOOL, + java.lang.Boolean.class); + public static final int DESCRIPTION_FIELD_NUMBER = 64014; + /** + * extend .google.protobuf.MessageOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.MessageOptions, + java.lang.Boolean> description = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.MessageOptions.getDefaultInstance(), + false, + null, + null, + 64014, + com.google.protobuf.WireFormat.FieldType.BOOL, + java.lang.Boolean.class); + public static final int TESTGEN_FIELD_NUMBER = 64015; + /** + * extend .google.protobuf.MessageOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.MessageOptions, + java.lang.Boolean> testgen = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.MessageOptions.getDefaultInstance(), + false, + null, + null, + 64015, + com.google.protobuf.WireFormat.FieldType.BOOL, + java.lang.Boolean.class); + public static final int BENCHGEN_FIELD_NUMBER = 64016; + /** + * extend .google.protobuf.MessageOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.MessageOptions, + java.lang.Boolean> benchgen = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.MessageOptions.getDefaultInstance(), + false, + null, + null, + 64016, + com.google.protobuf.WireFormat.FieldType.BOOL, + java.lang.Boolean.class); + public static final int MARSHALER_FIELD_NUMBER = 64017; + /** + * extend .google.protobuf.MessageOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.MessageOptions, + java.lang.Boolean> marshaler = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.MessageOptions.getDefaultInstance(), + false, + null, + null, + 64017, + com.google.protobuf.WireFormat.FieldType.BOOL, + java.lang.Boolean.class); + public static final int UNMARSHALER_FIELD_NUMBER = 64018; + /** + * extend .google.protobuf.MessageOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.MessageOptions, + java.lang.Boolean> unmarshaler = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.MessageOptions.getDefaultInstance(), + false, + null, + null, + 64018, + com.google.protobuf.WireFormat.FieldType.BOOL, + java.lang.Boolean.class); + public static final int STABLE_MARSHALER_FIELD_NUMBER = 64019; + /** + * extend .google.protobuf.MessageOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.MessageOptions, + java.lang.Boolean> stableMarshaler = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.MessageOptions.getDefaultInstance(), + false, + null, + null, + 64019, + com.google.protobuf.WireFormat.FieldType.BOOL, + java.lang.Boolean.class); + public static final int SIZER_FIELD_NUMBER = 64020; + /** + * extend .google.protobuf.MessageOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.MessageOptions, + java.lang.Boolean> sizer = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.MessageOptions.getDefaultInstance(), + false, + null, + null, + 64020, + com.google.protobuf.WireFormat.FieldType.BOOL, + java.lang.Boolean.class); + public static final int UNSAFE_MARSHALER_FIELD_NUMBER = 64023; + /** + * extend .google.protobuf.MessageOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.MessageOptions, + java.lang.Boolean> unsafeMarshaler = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.MessageOptions.getDefaultInstance(), + false, + null, + null, + 64023, + com.google.protobuf.WireFormat.FieldType.BOOL, + java.lang.Boolean.class); + public static final int UNSAFE_UNMARSHALER_FIELD_NUMBER = 64024; + /** + * extend .google.protobuf.MessageOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.MessageOptions, + java.lang.Boolean> unsafeUnmarshaler = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.MessageOptions.getDefaultInstance(), + false, + null, + null, + 64024, + com.google.protobuf.WireFormat.FieldType.BOOL, + java.lang.Boolean.class); + public static final int GOPROTO_EXTENSIONS_MAP_FIELD_NUMBER = 64025; + /** + * extend .google.protobuf.MessageOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.MessageOptions, + java.lang.Boolean> goprotoExtensionsMap = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.MessageOptions.getDefaultInstance(), + false, + null, + null, + 64025, + com.google.protobuf.WireFormat.FieldType.BOOL, + java.lang.Boolean.class); + public static final int GOPROTO_UNRECOGNIZED_FIELD_NUMBER = 64026; + /** + * extend .google.protobuf.MessageOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.MessageOptions, + java.lang.Boolean> goprotoUnrecognized = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.MessageOptions.getDefaultInstance(), + false, + null, + null, + 64026, + com.google.protobuf.WireFormat.FieldType.BOOL, + java.lang.Boolean.class); + public static final int PROTOSIZER_FIELD_NUMBER = 64028; + /** + * extend .google.protobuf.MessageOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.MessageOptions, + java.lang.Boolean> protosizer = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.MessageOptions.getDefaultInstance(), + false, + null, + null, + 64028, + com.google.protobuf.WireFormat.FieldType.BOOL, + java.lang.Boolean.class); + public static final int COMPARE_FIELD_NUMBER = 64029; + /** + * extend .google.protobuf.MessageOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.MessageOptions, + java.lang.Boolean> compare = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.MessageOptions.getDefaultInstance(), + false, + null, + null, + 64029, + com.google.protobuf.WireFormat.FieldType.BOOL, + java.lang.Boolean.class); + public static final int TYPEDECL_FIELD_NUMBER = 64030; + /** + * extend .google.protobuf.MessageOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.MessageOptions, + java.lang.Boolean> typedecl = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.MessageOptions.getDefaultInstance(), + false, + null, + null, + 64030, + com.google.protobuf.WireFormat.FieldType.BOOL, + java.lang.Boolean.class); + public static final int MESSAGENAME_FIELD_NUMBER = 64033; + /** + * extend .google.protobuf.MessageOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.MessageOptions, + java.lang.Boolean> messagename = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.MessageOptions.getDefaultInstance(), + false, + null, + null, + 64033, + com.google.protobuf.WireFormat.FieldType.BOOL, + java.lang.Boolean.class); + public static final int GOPROTO_SIZECACHE_FIELD_NUMBER = 64034; + /** + * extend .google.protobuf.MessageOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.MessageOptions, + java.lang.Boolean> goprotoSizecache = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.MessageOptions.getDefaultInstance(), + false, + null, + null, + 64034, + com.google.protobuf.WireFormat.FieldType.BOOL, + java.lang.Boolean.class); + public static final int GOPROTO_UNKEYED_FIELD_NUMBER = 64035; + /** + * extend .google.protobuf.MessageOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.MessageOptions, + java.lang.Boolean> goprotoUnkeyed = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.MessageOptions.getDefaultInstance(), + false, + null, + null, + 64035, + com.google.protobuf.WireFormat.FieldType.BOOL, + java.lang.Boolean.class); + public static final int NULLABLE_FIELD_NUMBER = 65001; + /** + * extend .google.protobuf.FieldOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FieldOptions, + java.lang.Boolean> nullable = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.FieldOptions.getDefaultInstance(), + false, + null, + null, + 65001, + com.google.protobuf.WireFormat.FieldType.BOOL, + java.lang.Boolean.class); + public static final int EMBED_FIELD_NUMBER = 65002; + /** + * extend .google.protobuf.FieldOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FieldOptions, + java.lang.Boolean> embed = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.FieldOptions.getDefaultInstance(), + false, + null, + null, + 65002, + com.google.protobuf.WireFormat.FieldType.BOOL, + java.lang.Boolean.class); + public static final int CUSTOMTYPE_FIELD_NUMBER = 65003; + /** + * extend .google.protobuf.FieldOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FieldOptions, + java.lang.String> customtype = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.FieldOptions.getDefaultInstance(), + "", + null, + null, + 65003, + com.google.protobuf.WireFormat.FieldType.STRING, + java.lang.String.class); + public static final int CUSTOMNAME_FIELD_NUMBER = 65004; + /** + * extend .google.protobuf.FieldOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FieldOptions, + java.lang.String> customname = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.FieldOptions.getDefaultInstance(), + "", + null, + null, + 65004, + com.google.protobuf.WireFormat.FieldType.STRING, + java.lang.String.class); + public static final int JSONTAG_FIELD_NUMBER = 65005; + /** + * extend .google.protobuf.FieldOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FieldOptions, + java.lang.String> jsontag = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.FieldOptions.getDefaultInstance(), + "", + null, + null, + 65005, + com.google.protobuf.WireFormat.FieldType.STRING, + java.lang.String.class); + public static final int MORETAGS_FIELD_NUMBER = 65006; + /** + * extend .google.protobuf.FieldOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FieldOptions, + java.lang.String> moretags = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.FieldOptions.getDefaultInstance(), + "", + null, + null, + 65006, + com.google.protobuf.WireFormat.FieldType.STRING, + java.lang.String.class); + public static final int CASTTYPE_FIELD_NUMBER = 65007; + /** + * extend .google.protobuf.FieldOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FieldOptions, + java.lang.String> casttype = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.FieldOptions.getDefaultInstance(), + "", + null, + null, + 65007, + com.google.protobuf.WireFormat.FieldType.STRING, + java.lang.String.class); + public static final int CASTKEY_FIELD_NUMBER = 65008; + /** + * extend .google.protobuf.FieldOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FieldOptions, + java.lang.String> castkey = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.FieldOptions.getDefaultInstance(), + "", + null, + null, + 65008, + com.google.protobuf.WireFormat.FieldType.STRING, + java.lang.String.class); + public static final int CASTVALUE_FIELD_NUMBER = 65009; + /** + * extend .google.protobuf.FieldOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FieldOptions, + java.lang.String> castvalue = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.FieldOptions.getDefaultInstance(), + "", + null, + null, + 65009, + com.google.protobuf.WireFormat.FieldType.STRING, + java.lang.String.class); + public static final int STDTIME_FIELD_NUMBER = 65010; + /** + * extend .google.protobuf.FieldOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FieldOptions, + java.lang.Boolean> stdtime = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.FieldOptions.getDefaultInstance(), + false, + null, + null, + 65010, + com.google.protobuf.WireFormat.FieldType.BOOL, + java.lang.Boolean.class); + public static final int STDDURATION_FIELD_NUMBER = 65011; + /** + * extend .google.protobuf.FieldOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FieldOptions, + java.lang.Boolean> stdduration = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.FieldOptions.getDefaultInstance(), + false, + null, + null, + 65011, + com.google.protobuf.WireFormat.FieldType.BOOL, + java.lang.Boolean.class); + public static final int WKTPOINTER_FIELD_NUMBER = 65012; + /** + * extend .google.protobuf.FieldOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FieldOptions, + java.lang.Boolean> wktpointer = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.FieldOptions.getDefaultInstance(), + false, + null, + null, + 65012, + com.google.protobuf.WireFormat.FieldType.BOOL, + java.lang.Boolean.class); + public static final int CASTREPEATED_FIELD_NUMBER = 65013; + /** + * extend .google.protobuf.FieldOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FieldOptions, + java.lang.String> castrepeated = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + com.google.protobuf.DescriptorProtos.FieldOptions.getDefaultInstance(), + "", + null, + null, + 65013, + com.google.protobuf.WireFormat.FieldType.STRING, + java.lang.String.class); + + static { + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/ClientConsensusStates.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/ClientConsensusStates.java new file mode 100644 index 000000000..ff72d4a68 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/ClientConsensusStates.java @@ -0,0 +1,623 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: ibc/core/client/v1/client.proto + +package com.ibc.core.client.v1; + +/** + *
+ * ClientConsensusStates defines all the stored consensus states for a given
+ * client.
+ * 
+ * + * Protobuf type {@code ibc.core.client.v1.ClientConsensusStates} + */ +public final class ClientConsensusStates extends + com.google.protobuf.GeneratedMessageLite< + ClientConsensusStates, ClientConsensusStates.Builder> implements + // @@protoc_insertion_point(message_implements:ibc.core.client.v1.ClientConsensusStates) + ClientConsensusStatesOrBuilder { + private ClientConsensusStates() { + clientId_ = ""; + consensusStates_ = emptyProtobufList(); + } + public static final int CLIENT_ID_FIELD_NUMBER = 1; + private java.lang.String clientId_; + /** + *
+   * client identifier
+   * 
+ * + * string client_id = 1 [json_name = "clientId"]; + * @return The clientId. + */ + @java.lang.Override + public java.lang.String getClientId() { + return clientId_; + } + /** + *
+   * client identifier
+   * 
+ * + * string client_id = 1 [json_name = "clientId"]; + * @return The bytes for clientId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getClientIdBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(clientId_); + } + /** + *
+   * client identifier
+   * 
+ * + * string client_id = 1 [json_name = "clientId"]; + * @param value The clientId to set. + */ + private void setClientId( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + clientId_ = value; + } + /** + *
+   * client identifier
+   * 
+ * + * string client_id = 1 [json_name = "clientId"]; + */ + private void clearClientId() { + + clientId_ = getDefaultInstance().getClientId(); + } + /** + *
+   * client identifier
+   * 
+ * + * string client_id = 1 [json_name = "clientId"]; + * @param value The bytes for clientId to set. + */ + private void setClientIdBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + clientId_ = value.toStringUtf8(); + + } + + public static final int CONSENSUS_STATES_FIELD_NUMBER = 2; + private com.google.protobuf.Internal.ProtobufList consensusStates_; + /** + *
+   * consensus states and their heights associated with the client
+   * 
+ * + * repeated .ibc.core.client.v1.ConsensusStateWithHeight consensus_states = 2 [json_name = "consensusStates", (.gogoproto.nullable) = false]; + */ + @java.lang.Override + public java.util.List getConsensusStatesList() { + return consensusStates_; + } + /** + *
+   * consensus states and their heights associated with the client
+   * 
+ * + * repeated .ibc.core.client.v1.ConsensusStateWithHeight consensus_states = 2 [json_name = "consensusStates", (.gogoproto.nullable) = false]; + */ + public java.util.List + getConsensusStatesOrBuilderList() { + return consensusStates_; + } + /** + *
+   * consensus states and their heights associated with the client
+   * 
+ * + * repeated .ibc.core.client.v1.ConsensusStateWithHeight consensus_states = 2 [json_name = "consensusStates", (.gogoproto.nullable) = false]; + */ + @java.lang.Override + public int getConsensusStatesCount() { + return consensusStates_.size(); + } + /** + *
+   * consensus states and their heights associated with the client
+   * 
+ * + * repeated .ibc.core.client.v1.ConsensusStateWithHeight consensus_states = 2 [json_name = "consensusStates", (.gogoproto.nullable) = false]; + */ + @java.lang.Override + public com.ibc.core.client.v1.ConsensusStateWithHeight getConsensusStates(int index) { + return consensusStates_.get(index); + } + /** + *
+   * consensus states and their heights associated with the client
+   * 
+ * + * repeated .ibc.core.client.v1.ConsensusStateWithHeight consensus_states = 2 [json_name = "consensusStates", (.gogoproto.nullable) = false]; + */ + public com.ibc.core.client.v1.ConsensusStateWithHeightOrBuilder getConsensusStatesOrBuilder( + int index) { + return consensusStates_.get(index); + } + private void ensureConsensusStatesIsMutable() { + com.google.protobuf.Internal.ProtobufList tmp = consensusStates_; + if (!tmp.isModifiable()) { + consensusStates_ = + com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp); + } + } + + /** + *
+   * consensus states and their heights associated with the client
+   * 
+ * + * repeated .ibc.core.client.v1.ConsensusStateWithHeight consensus_states = 2 [json_name = "consensusStates", (.gogoproto.nullable) = false]; + */ + private void setConsensusStates( + int index, com.ibc.core.client.v1.ConsensusStateWithHeight value) { + value.getClass(); + ensureConsensusStatesIsMutable(); + consensusStates_.set(index, value); + } + /** + *
+   * consensus states and their heights associated with the client
+   * 
+ * + * repeated .ibc.core.client.v1.ConsensusStateWithHeight consensus_states = 2 [json_name = "consensusStates", (.gogoproto.nullable) = false]; + */ + private void addConsensusStates(com.ibc.core.client.v1.ConsensusStateWithHeight value) { + value.getClass(); + ensureConsensusStatesIsMutable(); + consensusStates_.add(value); + } + /** + *
+   * consensus states and their heights associated with the client
+   * 
+ * + * repeated .ibc.core.client.v1.ConsensusStateWithHeight consensus_states = 2 [json_name = "consensusStates", (.gogoproto.nullable) = false]; + */ + private void addConsensusStates( + int index, com.ibc.core.client.v1.ConsensusStateWithHeight value) { + value.getClass(); + ensureConsensusStatesIsMutable(); + consensusStates_.add(index, value); + } + /** + *
+   * consensus states and their heights associated with the client
+   * 
+ * + * repeated .ibc.core.client.v1.ConsensusStateWithHeight consensus_states = 2 [json_name = "consensusStates", (.gogoproto.nullable) = false]; + */ + private void addAllConsensusStates( + java.lang.Iterable values) { + ensureConsensusStatesIsMutable(); + com.google.protobuf.AbstractMessageLite.addAll( + values, consensusStates_); + } + /** + *
+   * consensus states and their heights associated with the client
+   * 
+ * + * repeated .ibc.core.client.v1.ConsensusStateWithHeight consensus_states = 2 [json_name = "consensusStates", (.gogoproto.nullable) = false]; + */ + private void clearConsensusStates() { + consensusStates_ = emptyProtobufList(); + } + /** + *
+   * consensus states and their heights associated with the client
+   * 
+ * + * repeated .ibc.core.client.v1.ConsensusStateWithHeight consensus_states = 2 [json_name = "consensusStates", (.gogoproto.nullable) = false]; + */ + private void removeConsensusStates(int index) { + ensureConsensusStatesIsMutable(); + consensusStates_.remove(index); + } + + public static com.ibc.core.client.v1.ClientConsensusStates parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.ibc.core.client.v1.ClientConsensusStates parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.ibc.core.client.v1.ClientConsensusStates parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.ibc.core.client.v1.ClientConsensusStates parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.ibc.core.client.v1.ClientConsensusStates parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.ibc.core.client.v1.ClientConsensusStates parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.ibc.core.client.v1.ClientConsensusStates parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.ibc.core.client.v1.ClientConsensusStates parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.ibc.core.client.v1.ClientConsensusStates parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.ibc.core.client.v1.ClientConsensusStates parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.ibc.core.client.v1.ClientConsensusStates parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.ibc.core.client.v1.ClientConsensusStates parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.ibc.core.client.v1.ClientConsensusStates prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+   * ClientConsensusStates defines all the stored consensus states for a given
+   * client.
+   * 
+ * + * Protobuf type {@code ibc.core.client.v1.ClientConsensusStates} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.ibc.core.client.v1.ClientConsensusStates, Builder> implements + // @@protoc_insertion_point(builder_implements:ibc.core.client.v1.ClientConsensusStates) + com.ibc.core.client.v1.ClientConsensusStatesOrBuilder { + // Construct using com.ibc.core.client.v1.ClientConsensusStates.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + *
+     * client identifier
+     * 
+ * + * string client_id = 1 [json_name = "clientId"]; + * @return The clientId. + */ + @java.lang.Override + public java.lang.String getClientId() { + return instance.getClientId(); + } + /** + *
+     * client identifier
+     * 
+ * + * string client_id = 1 [json_name = "clientId"]; + * @return The bytes for clientId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getClientIdBytes() { + return instance.getClientIdBytes(); + } + /** + *
+     * client identifier
+     * 
+ * + * string client_id = 1 [json_name = "clientId"]; + * @param value The clientId to set. + * @return This builder for chaining. + */ + public Builder setClientId( + java.lang.String value) { + copyOnWrite(); + instance.setClientId(value); + return this; + } + /** + *
+     * client identifier
+     * 
+ * + * string client_id = 1 [json_name = "clientId"]; + * @return This builder for chaining. + */ + public Builder clearClientId() { + copyOnWrite(); + instance.clearClientId(); + return this; + } + /** + *
+     * client identifier
+     * 
+ * + * string client_id = 1 [json_name = "clientId"]; + * @param value The bytes for clientId to set. + * @return This builder for chaining. + */ + public Builder setClientIdBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setClientIdBytes(value); + return this; + } + + /** + *
+     * consensus states and their heights associated with the client
+     * 
+ * + * repeated .ibc.core.client.v1.ConsensusStateWithHeight consensus_states = 2 [json_name = "consensusStates", (.gogoproto.nullable) = false]; + */ + @java.lang.Override + public java.util.List getConsensusStatesList() { + return java.util.Collections.unmodifiableList( + instance.getConsensusStatesList()); + } + /** + *
+     * consensus states and their heights associated with the client
+     * 
+ * + * repeated .ibc.core.client.v1.ConsensusStateWithHeight consensus_states = 2 [json_name = "consensusStates", (.gogoproto.nullable) = false]; + */ + @java.lang.Override + public int getConsensusStatesCount() { + return instance.getConsensusStatesCount(); + }/** + *
+     * consensus states and their heights associated with the client
+     * 
+ * + * repeated .ibc.core.client.v1.ConsensusStateWithHeight consensus_states = 2 [json_name = "consensusStates", (.gogoproto.nullable) = false]; + */ + @java.lang.Override + public com.ibc.core.client.v1.ConsensusStateWithHeight getConsensusStates(int index) { + return instance.getConsensusStates(index); + } + /** + *
+     * consensus states and their heights associated with the client
+     * 
+ * + * repeated .ibc.core.client.v1.ConsensusStateWithHeight consensus_states = 2 [json_name = "consensusStates", (.gogoproto.nullable) = false]; + */ + public Builder setConsensusStates( + int index, com.ibc.core.client.v1.ConsensusStateWithHeight value) { + copyOnWrite(); + instance.setConsensusStates(index, value); + return this; + } + /** + *
+     * consensus states and their heights associated with the client
+     * 
+ * + * repeated .ibc.core.client.v1.ConsensusStateWithHeight consensus_states = 2 [json_name = "consensusStates", (.gogoproto.nullable) = false]; + */ + public Builder setConsensusStates( + int index, com.ibc.core.client.v1.ConsensusStateWithHeight.Builder builderForValue) { + copyOnWrite(); + instance.setConsensusStates(index, + builderForValue.build()); + return this; + } + /** + *
+     * consensus states and their heights associated with the client
+     * 
+ * + * repeated .ibc.core.client.v1.ConsensusStateWithHeight consensus_states = 2 [json_name = "consensusStates", (.gogoproto.nullable) = false]; + */ + public Builder addConsensusStates(com.ibc.core.client.v1.ConsensusStateWithHeight value) { + copyOnWrite(); + instance.addConsensusStates(value); + return this; + } + /** + *
+     * consensus states and their heights associated with the client
+     * 
+ * + * repeated .ibc.core.client.v1.ConsensusStateWithHeight consensus_states = 2 [json_name = "consensusStates", (.gogoproto.nullable) = false]; + */ + public Builder addConsensusStates( + int index, com.ibc.core.client.v1.ConsensusStateWithHeight value) { + copyOnWrite(); + instance.addConsensusStates(index, value); + return this; + } + /** + *
+     * consensus states and their heights associated with the client
+     * 
+ * + * repeated .ibc.core.client.v1.ConsensusStateWithHeight consensus_states = 2 [json_name = "consensusStates", (.gogoproto.nullable) = false]; + */ + public Builder addConsensusStates( + com.ibc.core.client.v1.ConsensusStateWithHeight.Builder builderForValue) { + copyOnWrite(); + instance.addConsensusStates(builderForValue.build()); + return this; + } + /** + *
+     * consensus states and their heights associated with the client
+     * 
+ * + * repeated .ibc.core.client.v1.ConsensusStateWithHeight consensus_states = 2 [json_name = "consensusStates", (.gogoproto.nullable) = false]; + */ + public Builder addConsensusStates( + int index, com.ibc.core.client.v1.ConsensusStateWithHeight.Builder builderForValue) { + copyOnWrite(); + instance.addConsensusStates(index, + builderForValue.build()); + return this; + } + /** + *
+     * consensus states and their heights associated with the client
+     * 
+ * + * repeated .ibc.core.client.v1.ConsensusStateWithHeight consensus_states = 2 [json_name = "consensusStates", (.gogoproto.nullable) = false]; + */ + public Builder addAllConsensusStates( + java.lang.Iterable values) { + copyOnWrite(); + instance.addAllConsensusStates(values); + return this; + } + /** + *
+     * consensus states and their heights associated with the client
+     * 
+ * + * repeated .ibc.core.client.v1.ConsensusStateWithHeight consensus_states = 2 [json_name = "consensusStates", (.gogoproto.nullable) = false]; + */ + public Builder clearConsensusStates() { + copyOnWrite(); + instance.clearConsensusStates(); + return this; + } + /** + *
+     * consensus states and their heights associated with the client
+     * 
+ * + * repeated .ibc.core.client.v1.ConsensusStateWithHeight consensus_states = 2 [json_name = "consensusStates", (.gogoproto.nullable) = false]; + */ + public Builder removeConsensusStates(int index) { + copyOnWrite(); + instance.removeConsensusStates(index); + return this; + } + + // @@protoc_insertion_point(builder_scope:ibc.core.client.v1.ClientConsensusStates) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.ibc.core.client.v1.ClientConsensusStates(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "clientId_", + "consensusStates_", + com.ibc.core.client.v1.ConsensusStateWithHeight.class, + }; + java.lang.String info = + "\u0000\u0002\u0000\u0000\u0001\u0002\u0002\u0000\u0001\u0000\u0001\u0208\u0002\u001b" + + ""; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.ibc.core.client.v1.ClientConsensusStates.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:ibc.core.client.v1.ClientConsensusStates) + private static final com.ibc.core.client.v1.ClientConsensusStates DEFAULT_INSTANCE; + static { + ClientConsensusStates defaultInstance = new ClientConsensusStates(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + ClientConsensusStates.class, defaultInstance); + } + + public static com.ibc.core.client.v1.ClientConsensusStates getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/ClientConsensusStatesOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/ClientConsensusStatesOrBuilder.java new file mode 100644 index 000000000..6cd74e196 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/ClientConsensusStatesOrBuilder.java @@ -0,0 +1,55 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: ibc/core/client/v1/client.proto + +package com.ibc.core.client.v1; + +public interface ClientConsensusStatesOrBuilder extends + // @@protoc_insertion_point(interface_extends:ibc.core.client.v1.ClientConsensusStates) + com.google.protobuf.MessageLiteOrBuilder { + + /** + *
+   * client identifier
+   * 
+ * + * string client_id = 1 [json_name = "clientId"]; + * @return The clientId. + */ + java.lang.String getClientId(); + /** + *
+   * client identifier
+   * 
+ * + * string client_id = 1 [json_name = "clientId"]; + * @return The bytes for clientId. + */ + com.google.protobuf.ByteString + getClientIdBytes(); + + /** + *
+   * consensus states and their heights associated with the client
+   * 
+ * + * repeated .ibc.core.client.v1.ConsensusStateWithHeight consensus_states = 2 [json_name = "consensusStates", (.gogoproto.nullable) = false]; + */ + java.util.List + getConsensusStatesList(); + /** + *
+   * consensus states and their heights associated with the client
+   * 
+ * + * repeated .ibc.core.client.v1.ConsensusStateWithHeight consensus_states = 2 [json_name = "consensusStates", (.gogoproto.nullable) = false]; + */ + com.ibc.core.client.v1.ConsensusStateWithHeight getConsensusStates(int index); + /** + *
+   * consensus states and their heights associated with the client
+   * 
+ * + * repeated .ibc.core.client.v1.ConsensusStateWithHeight consensus_states = 2 [json_name = "consensusStates", (.gogoproto.nullable) = false]; + */ + int getConsensusStatesCount(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/ClientProto.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/ClientProto.java new file mode 100644 index 000000000..537f5e362 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/ClientProto.java @@ -0,0 +1,16 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: ibc/core/client/v1/client.proto + +package com.ibc.core.client.v1; + +public final class ClientProto { + private ClientProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + static { + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/ClientUpdateProposal.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/ClientUpdateProposal.java new file mode 100644 index 000000000..f2f094450 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/ClientUpdateProposal.java @@ -0,0 +1,760 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: ibc/core/client/v1/client.proto + +package com.ibc.core.client.v1; + +/** + *
+ * ClientUpdateProposal is a governance proposal. If it passes, the substitute
+ * client's latest consensus state is copied over to the subject client. The proposal
+ * handler may fail if the subject and the substitute do not match in client and
+ * chain parameters (with exception to latest height, frozen height, and chain-id).
+ * 
+ * + * Protobuf type {@code ibc.core.client.v1.ClientUpdateProposal} + */ +public final class ClientUpdateProposal extends + com.google.protobuf.GeneratedMessageLite< + ClientUpdateProposal, ClientUpdateProposal.Builder> implements + // @@protoc_insertion_point(message_implements:ibc.core.client.v1.ClientUpdateProposal) + ClientUpdateProposalOrBuilder { + private ClientUpdateProposal() { + title_ = ""; + description_ = ""; + subjectClientId_ = ""; + substituteClientId_ = ""; + } + public static final int TITLE_FIELD_NUMBER = 1; + private java.lang.String title_; + /** + *
+   * the title of the update proposal
+   * 
+ * + * string title = 1 [json_name = "title"]; + * @return The title. + */ + @java.lang.Override + public java.lang.String getTitle() { + return title_; + } + /** + *
+   * the title of the update proposal
+   * 
+ * + * string title = 1 [json_name = "title"]; + * @return The bytes for title. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTitleBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(title_); + } + /** + *
+   * the title of the update proposal
+   * 
+ * + * string title = 1 [json_name = "title"]; + * @param value The title to set. + */ + private void setTitle( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + title_ = value; + } + /** + *
+   * the title of the update proposal
+   * 
+ * + * string title = 1 [json_name = "title"]; + */ + private void clearTitle() { + + title_ = getDefaultInstance().getTitle(); + } + /** + *
+   * the title of the update proposal
+   * 
+ * + * string title = 1 [json_name = "title"]; + * @param value The bytes for title to set. + */ + private void setTitleBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + title_ = value.toStringUtf8(); + + } + + public static final int DESCRIPTION_FIELD_NUMBER = 2; + private java.lang.String description_; + /** + *
+   * the description of the proposal
+   * 
+ * + * string description = 2 [json_name = "description"]; + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + return description_; + } + /** + *
+   * the description of the proposal
+   * 
+ * + * string description = 2 [json_name = "description"]; + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDescriptionBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(description_); + } + /** + *
+   * the description of the proposal
+   * 
+ * + * string description = 2 [json_name = "description"]; + * @param value The description to set. + */ + private void setDescription( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + description_ = value; + } + /** + *
+   * the description of the proposal
+   * 
+ * + * string description = 2 [json_name = "description"]; + */ + private void clearDescription() { + + description_ = getDefaultInstance().getDescription(); + } + /** + *
+   * the description of the proposal
+   * 
+ * + * string description = 2 [json_name = "description"]; + * @param value The bytes for description to set. + */ + private void setDescriptionBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + description_ = value.toStringUtf8(); + + } + + public static final int SUBJECT_CLIENT_ID_FIELD_NUMBER = 3; + private java.lang.String subjectClientId_; + /** + *
+   * the client identifier for the client to be updated if the proposal passes
+   * 
+ * + * string subject_client_id = 3 [json_name = "subjectClientId"]; + * @return The subjectClientId. + */ + @java.lang.Override + public java.lang.String getSubjectClientId() { + return subjectClientId_; + } + /** + *
+   * the client identifier for the client to be updated if the proposal passes
+   * 
+ * + * string subject_client_id = 3 [json_name = "subjectClientId"]; + * @return The bytes for subjectClientId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getSubjectClientIdBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(subjectClientId_); + } + /** + *
+   * the client identifier for the client to be updated if the proposal passes
+   * 
+ * + * string subject_client_id = 3 [json_name = "subjectClientId"]; + * @param value The subjectClientId to set. + */ + private void setSubjectClientId( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + subjectClientId_ = value; + } + /** + *
+   * the client identifier for the client to be updated if the proposal passes
+   * 
+ * + * string subject_client_id = 3 [json_name = "subjectClientId"]; + */ + private void clearSubjectClientId() { + + subjectClientId_ = getDefaultInstance().getSubjectClientId(); + } + /** + *
+   * the client identifier for the client to be updated if the proposal passes
+   * 
+ * + * string subject_client_id = 3 [json_name = "subjectClientId"]; + * @param value The bytes for subjectClientId to set. + */ + private void setSubjectClientIdBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + subjectClientId_ = value.toStringUtf8(); + + } + + public static final int SUBSTITUTE_CLIENT_ID_FIELD_NUMBER = 4; + private java.lang.String substituteClientId_; + /** + *
+   * the substitute client identifier for the client standing in for the subject
+   * client
+   * 
+ * + * string substitute_client_id = 4 [json_name = "substituteClientId"]; + * @return The substituteClientId. + */ + @java.lang.Override + public java.lang.String getSubstituteClientId() { + return substituteClientId_; + } + /** + *
+   * the substitute client identifier for the client standing in for the subject
+   * client
+   * 
+ * + * string substitute_client_id = 4 [json_name = "substituteClientId"]; + * @return The bytes for substituteClientId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getSubstituteClientIdBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(substituteClientId_); + } + /** + *
+   * the substitute client identifier for the client standing in for the subject
+   * client
+   * 
+ * + * string substitute_client_id = 4 [json_name = "substituteClientId"]; + * @param value The substituteClientId to set. + */ + private void setSubstituteClientId( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + substituteClientId_ = value; + } + /** + *
+   * the substitute client identifier for the client standing in for the subject
+   * client
+   * 
+ * + * string substitute_client_id = 4 [json_name = "substituteClientId"]; + */ + private void clearSubstituteClientId() { + + substituteClientId_ = getDefaultInstance().getSubstituteClientId(); + } + /** + *
+   * the substitute client identifier for the client standing in for the subject
+   * client
+   * 
+ * + * string substitute_client_id = 4 [json_name = "substituteClientId"]; + * @param value The bytes for substituteClientId to set. + */ + private void setSubstituteClientIdBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + substituteClientId_ = value.toStringUtf8(); + + } + + public static com.ibc.core.client.v1.ClientUpdateProposal parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.ibc.core.client.v1.ClientUpdateProposal parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.ibc.core.client.v1.ClientUpdateProposal parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.ibc.core.client.v1.ClientUpdateProposal parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.ibc.core.client.v1.ClientUpdateProposal parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.ibc.core.client.v1.ClientUpdateProposal parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.ibc.core.client.v1.ClientUpdateProposal parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.ibc.core.client.v1.ClientUpdateProposal parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.ibc.core.client.v1.ClientUpdateProposal parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.ibc.core.client.v1.ClientUpdateProposal parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.ibc.core.client.v1.ClientUpdateProposal parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.ibc.core.client.v1.ClientUpdateProposal parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.ibc.core.client.v1.ClientUpdateProposal prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+   * ClientUpdateProposal is a governance proposal. If it passes, the substitute
+   * client's latest consensus state is copied over to the subject client. The proposal
+   * handler may fail if the subject and the substitute do not match in client and
+   * chain parameters (with exception to latest height, frozen height, and chain-id).
+   * 
+ * + * Protobuf type {@code ibc.core.client.v1.ClientUpdateProposal} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.ibc.core.client.v1.ClientUpdateProposal, Builder> implements + // @@protoc_insertion_point(builder_implements:ibc.core.client.v1.ClientUpdateProposal) + com.ibc.core.client.v1.ClientUpdateProposalOrBuilder { + // Construct using com.ibc.core.client.v1.ClientUpdateProposal.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + *
+     * the title of the update proposal
+     * 
+ * + * string title = 1 [json_name = "title"]; + * @return The title. + */ + @java.lang.Override + public java.lang.String getTitle() { + return instance.getTitle(); + } + /** + *
+     * the title of the update proposal
+     * 
+ * + * string title = 1 [json_name = "title"]; + * @return The bytes for title. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTitleBytes() { + return instance.getTitleBytes(); + } + /** + *
+     * the title of the update proposal
+     * 
+ * + * string title = 1 [json_name = "title"]; + * @param value The title to set. + * @return This builder for chaining. + */ + public Builder setTitle( + java.lang.String value) { + copyOnWrite(); + instance.setTitle(value); + return this; + } + /** + *
+     * the title of the update proposal
+     * 
+ * + * string title = 1 [json_name = "title"]; + * @return This builder for chaining. + */ + public Builder clearTitle() { + copyOnWrite(); + instance.clearTitle(); + return this; + } + /** + *
+     * the title of the update proposal
+     * 
+ * + * string title = 1 [json_name = "title"]; + * @param value The bytes for title to set. + * @return This builder for chaining. + */ + public Builder setTitleBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setTitleBytes(value); + return this; + } + + /** + *
+     * the description of the proposal
+     * 
+ * + * string description = 2 [json_name = "description"]; + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + return instance.getDescription(); + } + /** + *
+     * the description of the proposal
+     * 
+ * + * string description = 2 [json_name = "description"]; + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDescriptionBytes() { + return instance.getDescriptionBytes(); + } + /** + *
+     * the description of the proposal
+     * 
+ * + * string description = 2 [json_name = "description"]; + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription( + java.lang.String value) { + copyOnWrite(); + instance.setDescription(value); + return this; + } + /** + *
+     * the description of the proposal
+     * 
+ * + * string description = 2 [json_name = "description"]; + * @return This builder for chaining. + */ + public Builder clearDescription() { + copyOnWrite(); + instance.clearDescription(); + return this; + } + /** + *
+     * the description of the proposal
+     * 
+ * + * string description = 2 [json_name = "description"]; + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setDescriptionBytes(value); + return this; + } + + /** + *
+     * the client identifier for the client to be updated if the proposal passes
+     * 
+ * + * string subject_client_id = 3 [json_name = "subjectClientId"]; + * @return The subjectClientId. + */ + @java.lang.Override + public java.lang.String getSubjectClientId() { + return instance.getSubjectClientId(); + } + /** + *
+     * the client identifier for the client to be updated if the proposal passes
+     * 
+ * + * string subject_client_id = 3 [json_name = "subjectClientId"]; + * @return The bytes for subjectClientId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getSubjectClientIdBytes() { + return instance.getSubjectClientIdBytes(); + } + /** + *
+     * the client identifier for the client to be updated if the proposal passes
+     * 
+ * + * string subject_client_id = 3 [json_name = "subjectClientId"]; + * @param value The subjectClientId to set. + * @return This builder for chaining. + */ + public Builder setSubjectClientId( + java.lang.String value) { + copyOnWrite(); + instance.setSubjectClientId(value); + return this; + } + /** + *
+     * the client identifier for the client to be updated if the proposal passes
+     * 
+ * + * string subject_client_id = 3 [json_name = "subjectClientId"]; + * @return This builder for chaining. + */ + public Builder clearSubjectClientId() { + copyOnWrite(); + instance.clearSubjectClientId(); + return this; + } + /** + *
+     * the client identifier for the client to be updated if the proposal passes
+     * 
+ * + * string subject_client_id = 3 [json_name = "subjectClientId"]; + * @param value The bytes for subjectClientId to set. + * @return This builder for chaining. + */ + public Builder setSubjectClientIdBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setSubjectClientIdBytes(value); + return this; + } + + /** + *
+     * the substitute client identifier for the client standing in for the subject
+     * client
+     * 
+ * + * string substitute_client_id = 4 [json_name = "substituteClientId"]; + * @return The substituteClientId. + */ + @java.lang.Override + public java.lang.String getSubstituteClientId() { + return instance.getSubstituteClientId(); + } + /** + *
+     * the substitute client identifier for the client standing in for the subject
+     * client
+     * 
+ * + * string substitute_client_id = 4 [json_name = "substituteClientId"]; + * @return The bytes for substituteClientId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getSubstituteClientIdBytes() { + return instance.getSubstituteClientIdBytes(); + } + /** + *
+     * the substitute client identifier for the client standing in for the subject
+     * client
+     * 
+ * + * string substitute_client_id = 4 [json_name = "substituteClientId"]; + * @param value The substituteClientId to set. + * @return This builder for chaining. + */ + public Builder setSubstituteClientId( + java.lang.String value) { + copyOnWrite(); + instance.setSubstituteClientId(value); + return this; + } + /** + *
+     * the substitute client identifier for the client standing in for the subject
+     * client
+     * 
+ * + * string substitute_client_id = 4 [json_name = "substituteClientId"]; + * @return This builder for chaining. + */ + public Builder clearSubstituteClientId() { + copyOnWrite(); + instance.clearSubstituteClientId(); + return this; + } + /** + *
+     * the substitute client identifier for the client standing in for the subject
+     * client
+     * 
+ * + * string substitute_client_id = 4 [json_name = "substituteClientId"]; + * @param value The bytes for substituteClientId to set. + * @return This builder for chaining. + */ + public Builder setSubstituteClientIdBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setSubstituteClientIdBytes(value); + return this; + } + + // @@protoc_insertion_point(builder_scope:ibc.core.client.v1.ClientUpdateProposal) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.ibc.core.client.v1.ClientUpdateProposal(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "title_", + "description_", + "subjectClientId_", + "substituteClientId_", + }; + java.lang.String info = + "\u0000\u0004\u0000\u0000\u0001\u0004\u0004\u0000\u0000\u0000\u0001\u0208\u0002\u0208" + + "\u0003\u0208\u0004\u0208"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.ibc.core.client.v1.ClientUpdateProposal.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:ibc.core.client.v1.ClientUpdateProposal) + private static final com.ibc.core.client.v1.ClientUpdateProposal DEFAULT_INSTANCE; + static { + ClientUpdateProposal defaultInstance = new ClientUpdateProposal(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + ClientUpdateProposal.class, defaultInstance); + } + + public static com.ibc.core.client.v1.ClientUpdateProposal getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/ClientUpdateProposalOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/ClientUpdateProposalOrBuilder.java new file mode 100644 index 000000000..3ce3c304a --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/ClientUpdateProposalOrBuilder.java @@ -0,0 +1,91 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: ibc/core/client/v1/client.proto + +package com.ibc.core.client.v1; + +public interface ClientUpdateProposalOrBuilder extends + // @@protoc_insertion_point(interface_extends:ibc.core.client.v1.ClientUpdateProposal) + com.google.protobuf.MessageLiteOrBuilder { + + /** + *
+   * the title of the update proposal
+   * 
+ * + * string title = 1 [json_name = "title"]; + * @return The title. + */ + java.lang.String getTitle(); + /** + *
+   * the title of the update proposal
+   * 
+ * + * string title = 1 [json_name = "title"]; + * @return The bytes for title. + */ + com.google.protobuf.ByteString + getTitleBytes(); + + /** + *
+   * the description of the proposal
+   * 
+ * + * string description = 2 [json_name = "description"]; + * @return The description. + */ + java.lang.String getDescription(); + /** + *
+   * the description of the proposal
+   * 
+ * + * string description = 2 [json_name = "description"]; + * @return The bytes for description. + */ + com.google.protobuf.ByteString + getDescriptionBytes(); + + /** + *
+   * the client identifier for the client to be updated if the proposal passes
+   * 
+ * + * string subject_client_id = 3 [json_name = "subjectClientId"]; + * @return The subjectClientId. + */ + java.lang.String getSubjectClientId(); + /** + *
+   * the client identifier for the client to be updated if the proposal passes
+   * 
+ * + * string subject_client_id = 3 [json_name = "subjectClientId"]; + * @return The bytes for subjectClientId. + */ + com.google.protobuf.ByteString + getSubjectClientIdBytes(); + + /** + *
+   * the substitute client identifier for the client standing in for the subject
+   * client
+   * 
+ * + * string substitute_client_id = 4 [json_name = "substituteClientId"]; + * @return The substituteClientId. + */ + java.lang.String getSubstituteClientId(); + /** + *
+   * the substitute client identifier for the client standing in for the subject
+   * client
+   * 
+ * + * string substitute_client_id = 4 [json_name = "substituteClientId"]; + * @return The bytes for substituteClientId. + */ + com.google.protobuf.ByteString + getSubstituteClientIdBytes(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/ConsensusStateWithHeight.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/ConsensusStateWithHeight.java new file mode 100644 index 000000000..d626811e2 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/ConsensusStateWithHeight.java @@ -0,0 +1,469 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: ibc/core/client/v1/client.proto + +package com.ibc.core.client.v1; + +/** + *
+ * ConsensusStateWithHeight defines a consensus state with an additional height
+ * field.
+ * 
+ * + * Protobuf type {@code ibc.core.client.v1.ConsensusStateWithHeight} + */ +public final class ConsensusStateWithHeight extends + com.google.protobuf.GeneratedMessageLite< + ConsensusStateWithHeight, ConsensusStateWithHeight.Builder> implements + // @@protoc_insertion_point(message_implements:ibc.core.client.v1.ConsensusStateWithHeight) + ConsensusStateWithHeightOrBuilder { + private ConsensusStateWithHeight() { + } + public static final int HEIGHT_FIELD_NUMBER = 1; + private com.ibc.core.client.v1.Height height_; + /** + *
+   * consensus state height
+   * 
+ * + * .ibc.core.client.v1.Height height = 1 [json_name = "height", (.gogoproto.nullable) = false]; + */ + @java.lang.Override + public boolean hasHeight() { + return height_ != null; + } + /** + *
+   * consensus state height
+   * 
+ * + * .ibc.core.client.v1.Height height = 1 [json_name = "height", (.gogoproto.nullable) = false]; + */ + @java.lang.Override + public com.ibc.core.client.v1.Height getHeight() { + return height_ == null ? com.ibc.core.client.v1.Height.getDefaultInstance() : height_; + } + /** + *
+   * consensus state height
+   * 
+ * + * .ibc.core.client.v1.Height height = 1 [json_name = "height", (.gogoproto.nullable) = false]; + */ + private void setHeight(com.ibc.core.client.v1.Height value) { + value.getClass(); + height_ = value; + + } + /** + *
+   * consensus state height
+   * 
+ * + * .ibc.core.client.v1.Height height = 1 [json_name = "height", (.gogoproto.nullable) = false]; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeHeight(com.ibc.core.client.v1.Height value) { + value.getClass(); + if (height_ != null && + height_ != com.ibc.core.client.v1.Height.getDefaultInstance()) { + height_ = + com.ibc.core.client.v1.Height.newBuilder(height_).mergeFrom(value).buildPartial(); + } else { + height_ = value; + } + + } + /** + *
+   * consensus state height
+   * 
+ * + * .ibc.core.client.v1.Height height = 1 [json_name = "height", (.gogoproto.nullable) = false]; + */ + private void clearHeight() { height_ = null; + + } + + public static final int CONSENSUS_STATE_FIELD_NUMBER = 2; + private com.google.protobuf.Any consensusState_; + /** + *
+   * consensus state
+   * 
+ * + * .google.protobuf.Any consensus_state = 2 [json_name = "consensusState"]; + */ + @java.lang.Override + public boolean hasConsensusState() { + return consensusState_ != null; + } + /** + *
+   * consensus state
+   * 
+ * + * .google.protobuf.Any consensus_state = 2 [json_name = "consensusState"]; + */ + @java.lang.Override + public com.google.protobuf.Any getConsensusState() { + return consensusState_ == null ? com.google.protobuf.Any.getDefaultInstance() : consensusState_; + } + /** + *
+   * consensus state
+   * 
+ * + * .google.protobuf.Any consensus_state = 2 [json_name = "consensusState"]; + */ + private void setConsensusState(com.google.protobuf.Any value) { + value.getClass(); + consensusState_ = value; + + } + /** + *
+   * consensus state
+   * 
+ * + * .google.protobuf.Any consensus_state = 2 [json_name = "consensusState"]; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeConsensusState(com.google.protobuf.Any value) { + value.getClass(); + if (consensusState_ != null && + consensusState_ != com.google.protobuf.Any.getDefaultInstance()) { + consensusState_ = + com.google.protobuf.Any.newBuilder(consensusState_).mergeFrom(value).buildPartial(); + } else { + consensusState_ = value; + } + + } + /** + *
+   * consensus state
+   * 
+ * + * .google.protobuf.Any consensus_state = 2 [json_name = "consensusState"]; + */ + private void clearConsensusState() { consensusState_ = null; + + } + + public static com.ibc.core.client.v1.ConsensusStateWithHeight parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.ibc.core.client.v1.ConsensusStateWithHeight parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.ibc.core.client.v1.ConsensusStateWithHeight parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.ibc.core.client.v1.ConsensusStateWithHeight parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.ibc.core.client.v1.ConsensusStateWithHeight parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.ibc.core.client.v1.ConsensusStateWithHeight parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.ibc.core.client.v1.ConsensusStateWithHeight parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.ibc.core.client.v1.ConsensusStateWithHeight parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.ibc.core.client.v1.ConsensusStateWithHeight parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.ibc.core.client.v1.ConsensusStateWithHeight parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.ibc.core.client.v1.ConsensusStateWithHeight parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.ibc.core.client.v1.ConsensusStateWithHeight parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.ibc.core.client.v1.ConsensusStateWithHeight prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+   * ConsensusStateWithHeight defines a consensus state with an additional height
+   * field.
+   * 
+ * + * Protobuf type {@code ibc.core.client.v1.ConsensusStateWithHeight} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.ibc.core.client.v1.ConsensusStateWithHeight, Builder> implements + // @@protoc_insertion_point(builder_implements:ibc.core.client.v1.ConsensusStateWithHeight) + com.ibc.core.client.v1.ConsensusStateWithHeightOrBuilder { + // Construct using com.ibc.core.client.v1.ConsensusStateWithHeight.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + *
+     * consensus state height
+     * 
+ * + * .ibc.core.client.v1.Height height = 1 [json_name = "height", (.gogoproto.nullable) = false]; + */ + @java.lang.Override + public boolean hasHeight() { + return instance.hasHeight(); + } + /** + *
+     * consensus state height
+     * 
+ * + * .ibc.core.client.v1.Height height = 1 [json_name = "height", (.gogoproto.nullable) = false]; + */ + @java.lang.Override + public com.ibc.core.client.v1.Height getHeight() { + return instance.getHeight(); + } + /** + *
+     * consensus state height
+     * 
+ * + * .ibc.core.client.v1.Height height = 1 [json_name = "height", (.gogoproto.nullable) = false]; + */ + public Builder setHeight(com.ibc.core.client.v1.Height value) { + copyOnWrite(); + instance.setHeight(value); + return this; + } + /** + *
+     * consensus state height
+     * 
+ * + * .ibc.core.client.v1.Height height = 1 [json_name = "height", (.gogoproto.nullable) = false]; + */ + public Builder setHeight( + com.ibc.core.client.v1.Height.Builder builderForValue) { + copyOnWrite(); + instance.setHeight(builderForValue.build()); + return this; + } + /** + *
+     * consensus state height
+     * 
+ * + * .ibc.core.client.v1.Height height = 1 [json_name = "height", (.gogoproto.nullable) = false]; + */ + public Builder mergeHeight(com.ibc.core.client.v1.Height value) { + copyOnWrite(); + instance.mergeHeight(value); + return this; + } + /** + *
+     * consensus state height
+     * 
+ * + * .ibc.core.client.v1.Height height = 1 [json_name = "height", (.gogoproto.nullable) = false]; + */ + public Builder clearHeight() { copyOnWrite(); + instance.clearHeight(); + return this; + } + + /** + *
+     * consensus state
+     * 
+ * + * .google.protobuf.Any consensus_state = 2 [json_name = "consensusState"]; + */ + @java.lang.Override + public boolean hasConsensusState() { + return instance.hasConsensusState(); + } + /** + *
+     * consensus state
+     * 
+ * + * .google.protobuf.Any consensus_state = 2 [json_name = "consensusState"]; + */ + @java.lang.Override + public com.google.protobuf.Any getConsensusState() { + return instance.getConsensusState(); + } + /** + *
+     * consensus state
+     * 
+ * + * .google.protobuf.Any consensus_state = 2 [json_name = "consensusState"]; + */ + public Builder setConsensusState(com.google.protobuf.Any value) { + copyOnWrite(); + instance.setConsensusState(value); + return this; + } + /** + *
+     * consensus state
+     * 
+ * + * .google.protobuf.Any consensus_state = 2 [json_name = "consensusState"]; + */ + public Builder setConsensusState( + com.google.protobuf.Any.Builder builderForValue) { + copyOnWrite(); + instance.setConsensusState(builderForValue.build()); + return this; + } + /** + *
+     * consensus state
+     * 
+ * + * .google.protobuf.Any consensus_state = 2 [json_name = "consensusState"]; + */ + public Builder mergeConsensusState(com.google.protobuf.Any value) { + copyOnWrite(); + instance.mergeConsensusState(value); + return this; + } + /** + *
+     * consensus state
+     * 
+ * + * .google.protobuf.Any consensus_state = 2 [json_name = "consensusState"]; + */ + public Builder clearConsensusState() { copyOnWrite(); + instance.clearConsensusState(); + return this; + } + + // @@protoc_insertion_point(builder_scope:ibc.core.client.v1.ConsensusStateWithHeight) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.ibc.core.client.v1.ConsensusStateWithHeight(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "height_", + "consensusState_", + }; + java.lang.String info = + "\u0000\u0002\u0000\u0000\u0001\u0002\u0002\u0000\u0000\u0000\u0001\t\u0002\t"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.ibc.core.client.v1.ConsensusStateWithHeight.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:ibc.core.client.v1.ConsensusStateWithHeight) + private static final com.ibc.core.client.v1.ConsensusStateWithHeight DEFAULT_INSTANCE; + static { + ConsensusStateWithHeight defaultInstance = new ConsensusStateWithHeight(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + ConsensusStateWithHeight.class, defaultInstance); + } + + public static com.ibc.core.client.v1.ConsensusStateWithHeight getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/ConsensusStateWithHeightOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/ConsensusStateWithHeightOrBuilder.java new file mode 100644 index 000000000..3050feb2b --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/ConsensusStateWithHeightOrBuilder.java @@ -0,0 +1,47 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: ibc/core/client/v1/client.proto + +package com.ibc.core.client.v1; + +public interface ConsensusStateWithHeightOrBuilder extends + // @@protoc_insertion_point(interface_extends:ibc.core.client.v1.ConsensusStateWithHeight) + com.google.protobuf.MessageLiteOrBuilder { + + /** + *
+   * consensus state height
+   * 
+ * + * .ibc.core.client.v1.Height height = 1 [json_name = "height", (.gogoproto.nullable) = false]; + * @return Whether the height field is set. + */ + boolean hasHeight(); + /** + *
+   * consensus state height
+   * 
+ * + * .ibc.core.client.v1.Height height = 1 [json_name = "height", (.gogoproto.nullable) = false]; + * @return The height. + */ + com.ibc.core.client.v1.Height getHeight(); + + /** + *
+   * consensus state
+   * 
+ * + * .google.protobuf.Any consensus_state = 2 [json_name = "consensusState"]; + * @return Whether the consensusState field is set. + */ + boolean hasConsensusState(); + /** + *
+   * consensus state
+   * 
+ * + * .google.protobuf.Any consensus_state = 2 [json_name = "consensusState"]; + * @return The consensusState. + */ + com.google.protobuf.Any getConsensusState(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/Height.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/Height.java new file mode 100644 index 000000000..2ff5f714d --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/Height.java @@ -0,0 +1,366 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: ibc/core/client/v1/client.proto + +package com.ibc.core.client.v1; + +/** + *
+ * Height is a monotonically increasing data type
+ * that can be compared against another Height for the purposes of updating and
+ * freezing clients
+ * Normally the RevisionHeight is incremented at each height while keeping
+ * RevisionNumber the same. However some consensus algorithms may choose to
+ * reset the height in certain conditions e.g. hard forks, state-machine
+ * breaking changes In these cases, the RevisionNumber is incremented so that
+ * height continues to be monitonically increasing even as the RevisionHeight
+ * gets reset
+ * 
+ * + * Protobuf type {@code ibc.core.client.v1.Height} + */ +public final class Height extends + com.google.protobuf.GeneratedMessageLite< + Height, Height.Builder> implements + // @@protoc_insertion_point(message_implements:ibc.core.client.v1.Height) + HeightOrBuilder { + private Height() { + } + public static final int REVISION_NUMBER_FIELD_NUMBER = 1; + private long revisionNumber_; + /** + *
+   * the revision that the client is currently on
+   * 
+ * + * uint64 revision_number = 1 [json_name = "revisionNumber"]; + * @return The revisionNumber. + */ + @java.lang.Override + public long getRevisionNumber() { + return revisionNumber_; + } + /** + *
+   * the revision that the client is currently on
+   * 
+ * + * uint64 revision_number = 1 [json_name = "revisionNumber"]; + * @param value The revisionNumber to set. + */ + private void setRevisionNumber(long value) { + + revisionNumber_ = value; + } + /** + *
+   * the revision that the client is currently on
+   * 
+ * + * uint64 revision_number = 1 [json_name = "revisionNumber"]; + */ + private void clearRevisionNumber() { + + revisionNumber_ = 0L; + } + + public static final int REVISION_HEIGHT_FIELD_NUMBER = 2; + private long revisionHeight_; + /** + *
+   * the height within the given revision
+   * 
+ * + * uint64 revision_height = 2 [json_name = "revisionHeight"]; + * @return The revisionHeight. + */ + @java.lang.Override + public long getRevisionHeight() { + return revisionHeight_; + } + /** + *
+   * the height within the given revision
+   * 
+ * + * uint64 revision_height = 2 [json_name = "revisionHeight"]; + * @param value The revisionHeight to set. + */ + private void setRevisionHeight(long value) { + + revisionHeight_ = value; + } + /** + *
+   * the height within the given revision
+   * 
+ * + * uint64 revision_height = 2 [json_name = "revisionHeight"]; + */ + private void clearRevisionHeight() { + + revisionHeight_ = 0L; + } + + public static com.ibc.core.client.v1.Height parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.ibc.core.client.v1.Height parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.ibc.core.client.v1.Height parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.ibc.core.client.v1.Height parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.ibc.core.client.v1.Height parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.ibc.core.client.v1.Height parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.ibc.core.client.v1.Height parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.ibc.core.client.v1.Height parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.ibc.core.client.v1.Height parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.ibc.core.client.v1.Height parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.ibc.core.client.v1.Height parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.ibc.core.client.v1.Height parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.ibc.core.client.v1.Height prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+   * Height is a monotonically increasing data type
+   * that can be compared against another Height for the purposes of updating and
+   * freezing clients
+   * Normally the RevisionHeight is incremented at each height while keeping
+   * RevisionNumber the same. However some consensus algorithms may choose to
+   * reset the height in certain conditions e.g. hard forks, state-machine
+   * breaking changes In these cases, the RevisionNumber is incremented so that
+   * height continues to be monitonically increasing even as the RevisionHeight
+   * gets reset
+   * 
+ * + * Protobuf type {@code ibc.core.client.v1.Height} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.ibc.core.client.v1.Height, Builder> implements + // @@protoc_insertion_point(builder_implements:ibc.core.client.v1.Height) + com.ibc.core.client.v1.HeightOrBuilder { + // Construct using com.ibc.core.client.v1.Height.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + *
+     * the revision that the client is currently on
+     * 
+ * + * uint64 revision_number = 1 [json_name = "revisionNumber"]; + * @return The revisionNumber. + */ + @java.lang.Override + public long getRevisionNumber() { + return instance.getRevisionNumber(); + } + /** + *
+     * the revision that the client is currently on
+     * 
+ * + * uint64 revision_number = 1 [json_name = "revisionNumber"]; + * @param value The revisionNumber to set. + * @return This builder for chaining. + */ + public Builder setRevisionNumber(long value) { + copyOnWrite(); + instance.setRevisionNumber(value); + return this; + } + /** + *
+     * the revision that the client is currently on
+     * 
+ * + * uint64 revision_number = 1 [json_name = "revisionNumber"]; + * @return This builder for chaining. + */ + public Builder clearRevisionNumber() { + copyOnWrite(); + instance.clearRevisionNumber(); + return this; + } + + /** + *
+     * the height within the given revision
+     * 
+ * + * uint64 revision_height = 2 [json_name = "revisionHeight"]; + * @return The revisionHeight. + */ + @java.lang.Override + public long getRevisionHeight() { + return instance.getRevisionHeight(); + } + /** + *
+     * the height within the given revision
+     * 
+ * + * uint64 revision_height = 2 [json_name = "revisionHeight"]; + * @param value The revisionHeight to set. + * @return This builder for chaining. + */ + public Builder setRevisionHeight(long value) { + copyOnWrite(); + instance.setRevisionHeight(value); + return this; + } + /** + *
+     * the height within the given revision
+     * 
+ * + * uint64 revision_height = 2 [json_name = "revisionHeight"]; + * @return This builder for chaining. + */ + public Builder clearRevisionHeight() { + copyOnWrite(); + instance.clearRevisionHeight(); + return this; + } + + // @@protoc_insertion_point(builder_scope:ibc.core.client.v1.Height) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.ibc.core.client.v1.Height(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "revisionNumber_", + "revisionHeight_", + }; + java.lang.String info = + "\u0000\u0002\u0000\u0000\u0001\u0002\u0002\u0000\u0000\u0000\u0001\u0003\u0002\u0003" + + ""; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.ibc.core.client.v1.Height.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:ibc.core.client.v1.Height) + private static final com.ibc.core.client.v1.Height DEFAULT_INSTANCE; + static { + Height defaultInstance = new Height(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + Height.class, defaultInstance); + } + + public static com.ibc.core.client.v1.Height getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/HeightOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/HeightOrBuilder.java new file mode 100644 index 000000000..eea1b73f6 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/HeightOrBuilder.java @@ -0,0 +1,29 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: ibc/core/client/v1/client.proto + +package com.ibc.core.client.v1; + +public interface HeightOrBuilder extends + // @@protoc_insertion_point(interface_extends:ibc.core.client.v1.Height) + com.google.protobuf.MessageLiteOrBuilder { + + /** + *
+   * the revision that the client is currently on
+   * 
+ * + * uint64 revision_number = 1 [json_name = "revisionNumber"]; + * @return The revisionNumber. + */ + long getRevisionNumber(); + + /** + *
+   * the height within the given revision
+   * 
+ * + * uint64 revision_height = 2 [json_name = "revisionHeight"]; + * @return The revisionHeight. + */ + long getRevisionHeight(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/IdentifiedClientState.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/IdentifiedClientState.java new file mode 100644 index 000000000..af49c3988 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/IdentifiedClientState.java @@ -0,0 +1,470 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: ibc/core/client/v1/client.proto + +package com.ibc.core.client.v1; + +/** + *
+ * IdentifiedClientState defines a client state with an additional client
+ * identifier field.
+ * 
+ * + * Protobuf type {@code ibc.core.client.v1.IdentifiedClientState} + */ +public final class IdentifiedClientState extends + com.google.protobuf.GeneratedMessageLite< + IdentifiedClientState, IdentifiedClientState.Builder> implements + // @@protoc_insertion_point(message_implements:ibc.core.client.v1.IdentifiedClientState) + IdentifiedClientStateOrBuilder { + private IdentifiedClientState() { + clientId_ = ""; + } + public static final int CLIENT_ID_FIELD_NUMBER = 1; + private java.lang.String clientId_; + /** + *
+   * client identifier
+   * 
+ * + * string client_id = 1 [json_name = "clientId"]; + * @return The clientId. + */ + @java.lang.Override + public java.lang.String getClientId() { + return clientId_; + } + /** + *
+   * client identifier
+   * 
+ * + * string client_id = 1 [json_name = "clientId"]; + * @return The bytes for clientId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getClientIdBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(clientId_); + } + /** + *
+   * client identifier
+   * 
+ * + * string client_id = 1 [json_name = "clientId"]; + * @param value The clientId to set. + */ + private void setClientId( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + clientId_ = value; + } + /** + *
+   * client identifier
+   * 
+ * + * string client_id = 1 [json_name = "clientId"]; + */ + private void clearClientId() { + + clientId_ = getDefaultInstance().getClientId(); + } + /** + *
+   * client identifier
+   * 
+ * + * string client_id = 1 [json_name = "clientId"]; + * @param value The bytes for clientId to set. + */ + private void setClientIdBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + clientId_ = value.toStringUtf8(); + + } + + public static final int CLIENT_STATE_FIELD_NUMBER = 2; + private com.google.protobuf.Any clientState_; + /** + *
+   * client state
+   * 
+ * + * .google.protobuf.Any client_state = 2 [json_name = "clientState"]; + */ + @java.lang.Override + public boolean hasClientState() { + return clientState_ != null; + } + /** + *
+   * client state
+   * 
+ * + * .google.protobuf.Any client_state = 2 [json_name = "clientState"]; + */ + @java.lang.Override + public com.google.protobuf.Any getClientState() { + return clientState_ == null ? com.google.protobuf.Any.getDefaultInstance() : clientState_; + } + /** + *
+   * client state
+   * 
+ * + * .google.protobuf.Any client_state = 2 [json_name = "clientState"]; + */ + private void setClientState(com.google.protobuf.Any value) { + value.getClass(); + clientState_ = value; + + } + /** + *
+   * client state
+   * 
+ * + * .google.protobuf.Any client_state = 2 [json_name = "clientState"]; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeClientState(com.google.protobuf.Any value) { + value.getClass(); + if (clientState_ != null && + clientState_ != com.google.protobuf.Any.getDefaultInstance()) { + clientState_ = + com.google.protobuf.Any.newBuilder(clientState_).mergeFrom(value).buildPartial(); + } else { + clientState_ = value; + } + + } + /** + *
+   * client state
+   * 
+ * + * .google.protobuf.Any client_state = 2 [json_name = "clientState"]; + */ + private void clearClientState() { clientState_ = null; + + } + + public static com.ibc.core.client.v1.IdentifiedClientState parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.ibc.core.client.v1.IdentifiedClientState parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.ibc.core.client.v1.IdentifiedClientState parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.ibc.core.client.v1.IdentifiedClientState parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.ibc.core.client.v1.IdentifiedClientState parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.ibc.core.client.v1.IdentifiedClientState parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.ibc.core.client.v1.IdentifiedClientState parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.ibc.core.client.v1.IdentifiedClientState parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.ibc.core.client.v1.IdentifiedClientState parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.ibc.core.client.v1.IdentifiedClientState parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.ibc.core.client.v1.IdentifiedClientState parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.ibc.core.client.v1.IdentifiedClientState parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.ibc.core.client.v1.IdentifiedClientState prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+   * IdentifiedClientState defines a client state with an additional client
+   * identifier field.
+   * 
+ * + * Protobuf type {@code ibc.core.client.v1.IdentifiedClientState} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.ibc.core.client.v1.IdentifiedClientState, Builder> implements + // @@protoc_insertion_point(builder_implements:ibc.core.client.v1.IdentifiedClientState) + com.ibc.core.client.v1.IdentifiedClientStateOrBuilder { + // Construct using com.ibc.core.client.v1.IdentifiedClientState.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + *
+     * client identifier
+     * 
+ * + * string client_id = 1 [json_name = "clientId"]; + * @return The clientId. + */ + @java.lang.Override + public java.lang.String getClientId() { + return instance.getClientId(); + } + /** + *
+     * client identifier
+     * 
+ * + * string client_id = 1 [json_name = "clientId"]; + * @return The bytes for clientId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getClientIdBytes() { + return instance.getClientIdBytes(); + } + /** + *
+     * client identifier
+     * 
+ * + * string client_id = 1 [json_name = "clientId"]; + * @param value The clientId to set. + * @return This builder for chaining. + */ + public Builder setClientId( + java.lang.String value) { + copyOnWrite(); + instance.setClientId(value); + return this; + } + /** + *
+     * client identifier
+     * 
+ * + * string client_id = 1 [json_name = "clientId"]; + * @return This builder for chaining. + */ + public Builder clearClientId() { + copyOnWrite(); + instance.clearClientId(); + return this; + } + /** + *
+     * client identifier
+     * 
+ * + * string client_id = 1 [json_name = "clientId"]; + * @param value The bytes for clientId to set. + * @return This builder for chaining. + */ + public Builder setClientIdBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setClientIdBytes(value); + return this; + } + + /** + *
+     * client state
+     * 
+ * + * .google.protobuf.Any client_state = 2 [json_name = "clientState"]; + */ + @java.lang.Override + public boolean hasClientState() { + return instance.hasClientState(); + } + /** + *
+     * client state
+     * 
+ * + * .google.protobuf.Any client_state = 2 [json_name = "clientState"]; + */ + @java.lang.Override + public com.google.protobuf.Any getClientState() { + return instance.getClientState(); + } + /** + *
+     * client state
+     * 
+ * + * .google.protobuf.Any client_state = 2 [json_name = "clientState"]; + */ + public Builder setClientState(com.google.protobuf.Any value) { + copyOnWrite(); + instance.setClientState(value); + return this; + } + /** + *
+     * client state
+     * 
+ * + * .google.protobuf.Any client_state = 2 [json_name = "clientState"]; + */ + public Builder setClientState( + com.google.protobuf.Any.Builder builderForValue) { + copyOnWrite(); + instance.setClientState(builderForValue.build()); + return this; + } + /** + *
+     * client state
+     * 
+ * + * .google.protobuf.Any client_state = 2 [json_name = "clientState"]; + */ + public Builder mergeClientState(com.google.protobuf.Any value) { + copyOnWrite(); + instance.mergeClientState(value); + return this; + } + /** + *
+     * client state
+     * 
+ * + * .google.protobuf.Any client_state = 2 [json_name = "clientState"]; + */ + public Builder clearClientState() { copyOnWrite(); + instance.clearClientState(); + return this; + } + + // @@protoc_insertion_point(builder_scope:ibc.core.client.v1.IdentifiedClientState) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.ibc.core.client.v1.IdentifiedClientState(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "clientId_", + "clientState_", + }; + java.lang.String info = + "\u0000\u0002\u0000\u0000\u0001\u0002\u0002\u0000\u0000\u0000\u0001\u0208\u0002\t" + + ""; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.ibc.core.client.v1.IdentifiedClientState.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:ibc.core.client.v1.IdentifiedClientState) + private static final com.ibc.core.client.v1.IdentifiedClientState DEFAULT_INSTANCE; + static { + IdentifiedClientState defaultInstance = new IdentifiedClientState(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + IdentifiedClientState.class, defaultInstance); + } + + public static com.ibc.core.client.v1.IdentifiedClientState getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/IdentifiedClientStateOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/IdentifiedClientStateOrBuilder.java new file mode 100644 index 000000000..2c71848c4 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/IdentifiedClientStateOrBuilder.java @@ -0,0 +1,48 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: ibc/core/client/v1/client.proto + +package com.ibc.core.client.v1; + +public interface IdentifiedClientStateOrBuilder extends + // @@protoc_insertion_point(interface_extends:ibc.core.client.v1.IdentifiedClientState) + com.google.protobuf.MessageLiteOrBuilder { + + /** + *
+   * client identifier
+   * 
+ * + * string client_id = 1 [json_name = "clientId"]; + * @return The clientId. + */ + java.lang.String getClientId(); + /** + *
+   * client identifier
+   * 
+ * + * string client_id = 1 [json_name = "clientId"]; + * @return The bytes for clientId. + */ + com.google.protobuf.ByteString + getClientIdBytes(); + + /** + *
+   * client state
+   * 
+ * + * .google.protobuf.Any client_state = 2 [json_name = "clientState"]; + * @return Whether the clientState field is set. + */ + boolean hasClientState(); + /** + *
+   * client state
+   * 
+ * + * .google.protobuf.Any client_state = 2 [json_name = "clientState"]; + * @return The clientState. + */ + com.google.protobuf.Any getClientState(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/Params.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/Params.java new file mode 100644 index 000000000..d3958203d --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/Params.java @@ -0,0 +1,486 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: ibc/core/client/v1/client.proto + +package com.ibc.core.client.v1; + +/** + *
+ * Params defines the set of IBC light client parameters.
+ * 
+ * + * Protobuf type {@code ibc.core.client.v1.Params} + */ +public final class Params extends + com.google.protobuf.GeneratedMessageLite< + Params, Params.Builder> implements + // @@protoc_insertion_point(message_implements:ibc.core.client.v1.Params) + ParamsOrBuilder { + private Params() { + allowedClients_ = com.google.protobuf.GeneratedMessageLite.emptyProtobufList(); + } + public static final int ALLOWED_CLIENTS_FIELD_NUMBER = 1; + private com.google.protobuf.Internal.ProtobufList allowedClients_; + /** + *
+   * allowed_clients defines the list of allowed client state types which can be created
+   * and interacted with. If a client type is removed from the allowed clients list, usage
+   * of this client will be disabled until it is added again to the list.
+   * 
+ * + * repeated string allowed_clients = 1 [json_name = "allowedClients"]; + * @return A list containing the allowedClients. + */ + @java.lang.Override + public java.util.List getAllowedClientsList() { + return allowedClients_; + } + /** + *
+   * allowed_clients defines the list of allowed client state types which can be created
+   * and interacted with. If a client type is removed from the allowed clients list, usage
+   * of this client will be disabled until it is added again to the list.
+   * 
+ * + * repeated string allowed_clients = 1 [json_name = "allowedClients"]; + * @return The count of allowedClients. + */ + @java.lang.Override + public int getAllowedClientsCount() { + return allowedClients_.size(); + } + /** + *
+   * allowed_clients defines the list of allowed client state types which can be created
+   * and interacted with. If a client type is removed from the allowed clients list, usage
+   * of this client will be disabled until it is added again to the list.
+   * 
+ * + * repeated string allowed_clients = 1 [json_name = "allowedClients"]; + * @param index The index of the element to return. + * @return The allowedClients at the given index. + */ + @java.lang.Override + public java.lang.String getAllowedClients(int index) { + return allowedClients_.get(index); + } + /** + *
+   * allowed_clients defines the list of allowed client state types which can be created
+   * and interacted with. If a client type is removed from the allowed clients list, usage
+   * of this client will be disabled until it is added again to the list.
+   * 
+ * + * repeated string allowed_clients = 1 [json_name = "allowedClients"]; + * @param index The index of the value to return. + * @return The bytes of the allowedClients at the given index. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getAllowedClientsBytes(int index) { + return com.google.protobuf.ByteString.copyFromUtf8( + allowedClients_.get(index)); + } + private void ensureAllowedClientsIsMutable() { + com.google.protobuf.Internal.ProtobufList tmp = + allowedClients_; if (!tmp.isModifiable()) { + allowedClients_ = + com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp); + } + } + /** + *
+   * allowed_clients defines the list of allowed client state types which can be created
+   * and interacted with. If a client type is removed from the allowed clients list, usage
+   * of this client will be disabled until it is added again to the list.
+   * 
+ * + * repeated string allowed_clients = 1 [json_name = "allowedClients"]; + * @param index The index to set the value at. + * @param value The allowedClients to set. + */ + private void setAllowedClients( + int index, java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + ensureAllowedClientsIsMutable(); + allowedClients_.set(index, value); + } + /** + *
+   * allowed_clients defines the list of allowed client state types which can be created
+   * and interacted with. If a client type is removed from the allowed clients list, usage
+   * of this client will be disabled until it is added again to the list.
+   * 
+ * + * repeated string allowed_clients = 1 [json_name = "allowedClients"]; + * @param value The allowedClients to add. + */ + private void addAllowedClients( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + ensureAllowedClientsIsMutable(); + allowedClients_.add(value); + } + /** + *
+   * allowed_clients defines the list of allowed client state types which can be created
+   * and interacted with. If a client type is removed from the allowed clients list, usage
+   * of this client will be disabled until it is added again to the list.
+   * 
+ * + * repeated string allowed_clients = 1 [json_name = "allowedClients"]; + * @param values The allowedClients to add. + */ + private void addAllAllowedClients( + java.lang.Iterable values) { + ensureAllowedClientsIsMutable(); + com.google.protobuf.AbstractMessageLite.addAll( + values, allowedClients_); + } + /** + *
+   * allowed_clients defines the list of allowed client state types which can be created
+   * and interacted with. If a client type is removed from the allowed clients list, usage
+   * of this client will be disabled until it is added again to the list.
+   * 
+ * + * repeated string allowed_clients = 1 [json_name = "allowedClients"]; + */ + private void clearAllowedClients() { + allowedClients_ = com.google.protobuf.GeneratedMessageLite.emptyProtobufList(); + } + /** + *
+   * allowed_clients defines the list of allowed client state types which can be created
+   * and interacted with. If a client type is removed from the allowed clients list, usage
+   * of this client will be disabled until it is added again to the list.
+   * 
+ * + * repeated string allowed_clients = 1 [json_name = "allowedClients"]; + * @param value The bytes of the allowedClients to add. + */ + private void addAllowedClientsBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + ensureAllowedClientsIsMutable(); + allowedClients_.add(value.toStringUtf8()); + } + + public static com.ibc.core.client.v1.Params parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.ibc.core.client.v1.Params parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.ibc.core.client.v1.Params parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.ibc.core.client.v1.Params parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.ibc.core.client.v1.Params parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.ibc.core.client.v1.Params parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.ibc.core.client.v1.Params parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.ibc.core.client.v1.Params parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.ibc.core.client.v1.Params parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.ibc.core.client.v1.Params parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.ibc.core.client.v1.Params parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.ibc.core.client.v1.Params parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.ibc.core.client.v1.Params prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+   * Params defines the set of IBC light client parameters.
+   * 
+ * + * Protobuf type {@code ibc.core.client.v1.Params} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.ibc.core.client.v1.Params, Builder> implements + // @@protoc_insertion_point(builder_implements:ibc.core.client.v1.Params) + com.ibc.core.client.v1.ParamsOrBuilder { + // Construct using com.ibc.core.client.v1.Params.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + *
+     * allowed_clients defines the list of allowed client state types which can be created
+     * and interacted with. If a client type is removed from the allowed clients list, usage
+     * of this client will be disabled until it is added again to the list.
+     * 
+ * + * repeated string allowed_clients = 1 [json_name = "allowedClients"]; + * @return A list containing the allowedClients. + */ + @java.lang.Override + public java.util.List + getAllowedClientsList() { + return java.util.Collections.unmodifiableList( + instance.getAllowedClientsList()); + } + /** + *
+     * allowed_clients defines the list of allowed client state types which can be created
+     * and interacted with. If a client type is removed from the allowed clients list, usage
+     * of this client will be disabled until it is added again to the list.
+     * 
+ * + * repeated string allowed_clients = 1 [json_name = "allowedClients"]; + * @return The count of allowedClients. + */ + @java.lang.Override + public int getAllowedClientsCount() { + return instance.getAllowedClientsCount(); + } + /** + *
+     * allowed_clients defines the list of allowed client state types which can be created
+     * and interacted with. If a client type is removed from the allowed clients list, usage
+     * of this client will be disabled until it is added again to the list.
+     * 
+ * + * repeated string allowed_clients = 1 [json_name = "allowedClients"]; + * @param index The index of the element to return. + * @return The allowedClients at the given index. + */ + @java.lang.Override + public java.lang.String getAllowedClients(int index) { + return instance.getAllowedClients(index); + } + /** + *
+     * allowed_clients defines the list of allowed client state types which can be created
+     * and interacted with. If a client type is removed from the allowed clients list, usage
+     * of this client will be disabled until it is added again to the list.
+     * 
+ * + * repeated string allowed_clients = 1 [json_name = "allowedClients"]; + * @param index The index of the value to return. + * @return The bytes of the allowedClients at the given index. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getAllowedClientsBytes(int index) { + return instance.getAllowedClientsBytes(index); + } + /** + *
+     * allowed_clients defines the list of allowed client state types which can be created
+     * and interacted with. If a client type is removed from the allowed clients list, usage
+     * of this client will be disabled until it is added again to the list.
+     * 
+ * + * repeated string allowed_clients = 1 [json_name = "allowedClients"]; + * @param index The index to set the value at. + * @param value The allowedClients to set. + * @return This builder for chaining. + */ + public Builder setAllowedClients( + int index, java.lang.String value) { + copyOnWrite(); + instance.setAllowedClients(index, value); + return this; + } + /** + *
+     * allowed_clients defines the list of allowed client state types which can be created
+     * and interacted with. If a client type is removed from the allowed clients list, usage
+     * of this client will be disabled until it is added again to the list.
+     * 
+ * + * repeated string allowed_clients = 1 [json_name = "allowedClients"]; + * @param value The allowedClients to add. + * @return This builder for chaining. + */ + public Builder addAllowedClients( + java.lang.String value) { + copyOnWrite(); + instance.addAllowedClients(value); + return this; + } + /** + *
+     * allowed_clients defines the list of allowed client state types which can be created
+     * and interacted with. If a client type is removed from the allowed clients list, usage
+     * of this client will be disabled until it is added again to the list.
+     * 
+ * + * repeated string allowed_clients = 1 [json_name = "allowedClients"]; + * @param values The allowedClients to add. + * @return This builder for chaining. + */ + public Builder addAllAllowedClients( + java.lang.Iterable values) { + copyOnWrite(); + instance.addAllAllowedClients(values); + return this; + } + /** + *
+     * allowed_clients defines the list of allowed client state types which can be created
+     * and interacted with. If a client type is removed from the allowed clients list, usage
+     * of this client will be disabled until it is added again to the list.
+     * 
+ * + * repeated string allowed_clients = 1 [json_name = "allowedClients"]; + * @return This builder for chaining. + */ + public Builder clearAllowedClients() { + copyOnWrite(); + instance.clearAllowedClients(); + return this; + } + /** + *
+     * allowed_clients defines the list of allowed client state types which can be created
+     * and interacted with. If a client type is removed from the allowed clients list, usage
+     * of this client will be disabled until it is added again to the list.
+     * 
+ * + * repeated string allowed_clients = 1 [json_name = "allowedClients"]; + * @param value The bytes of the allowedClients to add. + * @return This builder for chaining. + */ + public Builder addAllowedClientsBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.addAllowedClientsBytes(value); + return this; + } + + // @@protoc_insertion_point(builder_scope:ibc.core.client.v1.Params) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.ibc.core.client.v1.Params(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "allowedClients_", + }; + java.lang.String info = + "\u0000\u0001\u0000\u0000\u0001\u0001\u0001\u0000\u0001\u0000\u0001\u021a"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.ibc.core.client.v1.Params.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:ibc.core.client.v1.Params) + private static final com.ibc.core.client.v1.Params DEFAULT_INSTANCE; + static { + Params defaultInstance = new Params(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + Params.class, defaultInstance); + } + + public static com.ibc.core.client.v1.Params getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/ParamsOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/ParamsOrBuilder.java new file mode 100644 index 000000000..e5e56a30e --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/ParamsOrBuilder.java @@ -0,0 +1,58 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: ibc/core/client/v1/client.proto + +package com.ibc.core.client.v1; + +public interface ParamsOrBuilder extends + // @@protoc_insertion_point(interface_extends:ibc.core.client.v1.Params) + com.google.protobuf.MessageLiteOrBuilder { + + /** + *
+   * allowed_clients defines the list of allowed client state types which can be created
+   * and interacted with. If a client type is removed from the allowed clients list, usage
+   * of this client will be disabled until it is added again to the list.
+   * 
+ * + * repeated string allowed_clients = 1 [json_name = "allowedClients"]; + * @return A list containing the allowedClients. + */ + java.util.List + getAllowedClientsList(); + /** + *
+   * allowed_clients defines the list of allowed client state types which can be created
+   * and interacted with. If a client type is removed from the allowed clients list, usage
+   * of this client will be disabled until it is added again to the list.
+   * 
+ * + * repeated string allowed_clients = 1 [json_name = "allowedClients"]; + * @return The count of allowedClients. + */ + int getAllowedClientsCount(); + /** + *
+   * allowed_clients defines the list of allowed client state types which can be created
+   * and interacted with. If a client type is removed from the allowed clients list, usage
+   * of this client will be disabled until it is added again to the list.
+   * 
+ * + * repeated string allowed_clients = 1 [json_name = "allowedClients"]; + * @param index The index of the element to return. + * @return The allowedClients at the given index. + */ + java.lang.String getAllowedClients(int index); + /** + *
+   * allowed_clients defines the list of allowed client state types which can be created
+   * and interacted with. If a client type is removed from the allowed clients list, usage
+   * of this client will be disabled until it is added again to the list.
+   * 
+ * + * repeated string allowed_clients = 1 [json_name = "allowedClients"]; + * @param index The index of the element to return. + * @return The allowedClients at the given index. + */ + com.google.protobuf.ByteString + getAllowedClientsBytes(int index); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/UpgradeProposal.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/UpgradeProposal.java new file mode 100644 index 000000000..03cba59e0 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/UpgradeProposal.java @@ -0,0 +1,677 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: ibc/core/client/v1/client.proto + +package com.ibc.core.client.v1; + +/** + *
+ * UpgradeProposal is a gov Content type for initiating an IBC breaking
+ * upgrade.
+ * 
+ * + * Protobuf type {@code ibc.core.client.v1.UpgradeProposal} + */ +public final class UpgradeProposal extends + com.google.protobuf.GeneratedMessageLite< + UpgradeProposal, UpgradeProposal.Builder> implements + // @@protoc_insertion_point(message_implements:ibc.core.client.v1.UpgradeProposal) + UpgradeProposalOrBuilder { + private UpgradeProposal() { + title_ = ""; + description_ = ""; + } + public static final int TITLE_FIELD_NUMBER = 1; + private java.lang.String title_; + /** + * string title = 1 [json_name = "title"]; + * @return The title. + */ + @java.lang.Override + public java.lang.String getTitle() { + return title_; + } + /** + * string title = 1 [json_name = "title"]; + * @return The bytes for title. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTitleBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(title_); + } + /** + * string title = 1 [json_name = "title"]; + * @param value The title to set. + */ + private void setTitle( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + title_ = value; + } + /** + * string title = 1 [json_name = "title"]; + */ + private void clearTitle() { + + title_ = getDefaultInstance().getTitle(); + } + /** + * string title = 1 [json_name = "title"]; + * @param value The bytes for title to set. + */ + private void setTitleBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + title_ = value.toStringUtf8(); + + } + + public static final int DESCRIPTION_FIELD_NUMBER = 2; + private java.lang.String description_; + /** + * string description = 2 [json_name = "description"]; + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + return description_; + } + /** + * string description = 2 [json_name = "description"]; + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDescriptionBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(description_); + } + /** + * string description = 2 [json_name = "description"]; + * @param value The description to set. + */ + private void setDescription( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + description_ = value; + } + /** + * string description = 2 [json_name = "description"]; + */ + private void clearDescription() { + + description_ = getDefaultInstance().getDescription(); + } + /** + * string description = 2 [json_name = "description"]; + * @param value The bytes for description to set. + */ + private void setDescriptionBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + description_ = value.toStringUtf8(); + + } + + public static final int PLAN_FIELD_NUMBER = 3; + private com.cosmos.upgrade.v1beta1.Plan plan_; + /** + * .cosmos.upgrade.v1beta1.Plan plan = 3 [json_name = "plan", (.gogoproto.nullable) = false]; + */ + @java.lang.Override + public boolean hasPlan() { + return plan_ != null; + } + /** + * .cosmos.upgrade.v1beta1.Plan plan = 3 [json_name = "plan", (.gogoproto.nullable) = false]; + */ + @java.lang.Override + public com.cosmos.upgrade.v1beta1.Plan getPlan() { + return plan_ == null ? com.cosmos.upgrade.v1beta1.Plan.getDefaultInstance() : plan_; + } + /** + * .cosmos.upgrade.v1beta1.Plan plan = 3 [json_name = "plan", (.gogoproto.nullable) = false]; + */ + private void setPlan(com.cosmos.upgrade.v1beta1.Plan value) { + value.getClass(); + plan_ = value; + + } + /** + * .cosmos.upgrade.v1beta1.Plan plan = 3 [json_name = "plan", (.gogoproto.nullable) = false]; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergePlan(com.cosmos.upgrade.v1beta1.Plan value) { + value.getClass(); + if (plan_ != null && + plan_ != com.cosmos.upgrade.v1beta1.Plan.getDefaultInstance()) { + plan_ = + com.cosmos.upgrade.v1beta1.Plan.newBuilder(plan_).mergeFrom(value).buildPartial(); + } else { + plan_ = value; + } + + } + /** + * .cosmos.upgrade.v1beta1.Plan plan = 3 [json_name = "plan", (.gogoproto.nullable) = false]; + */ + private void clearPlan() { plan_ = null; + + } + + public static final int UPGRADED_CLIENT_STATE_FIELD_NUMBER = 4; + private com.google.protobuf.Any upgradedClientState_; + /** + *
+   * An UpgradedClientState must be provided to perform an IBC breaking upgrade.
+   * This will make the chain commit to the correct upgraded (self) client state
+   * before the upgrade occurs, so that connecting chains can verify that the
+   * new upgraded client is valid by verifying a proof on the previous version
+   * of the chain. This will allow IBC connections to persist smoothly across
+   * planned chain upgrades
+   * 
+ * + * .google.protobuf.Any upgraded_client_state = 4 [json_name = "upgradedClientState"]; + */ + @java.lang.Override + public boolean hasUpgradedClientState() { + return upgradedClientState_ != null; + } + /** + *
+   * An UpgradedClientState must be provided to perform an IBC breaking upgrade.
+   * This will make the chain commit to the correct upgraded (self) client state
+   * before the upgrade occurs, so that connecting chains can verify that the
+   * new upgraded client is valid by verifying a proof on the previous version
+   * of the chain. This will allow IBC connections to persist smoothly across
+   * planned chain upgrades
+   * 
+ * + * .google.protobuf.Any upgraded_client_state = 4 [json_name = "upgradedClientState"]; + */ + @java.lang.Override + public com.google.protobuf.Any getUpgradedClientState() { + return upgradedClientState_ == null ? com.google.protobuf.Any.getDefaultInstance() : upgradedClientState_; + } + /** + *
+   * An UpgradedClientState must be provided to perform an IBC breaking upgrade.
+   * This will make the chain commit to the correct upgraded (self) client state
+   * before the upgrade occurs, so that connecting chains can verify that the
+   * new upgraded client is valid by verifying a proof on the previous version
+   * of the chain. This will allow IBC connections to persist smoothly across
+   * planned chain upgrades
+   * 
+ * + * .google.protobuf.Any upgraded_client_state = 4 [json_name = "upgradedClientState"]; + */ + private void setUpgradedClientState(com.google.protobuf.Any value) { + value.getClass(); + upgradedClientState_ = value; + + } + /** + *
+   * An UpgradedClientState must be provided to perform an IBC breaking upgrade.
+   * This will make the chain commit to the correct upgraded (self) client state
+   * before the upgrade occurs, so that connecting chains can verify that the
+   * new upgraded client is valid by verifying a proof on the previous version
+   * of the chain. This will allow IBC connections to persist smoothly across
+   * planned chain upgrades
+   * 
+ * + * .google.protobuf.Any upgraded_client_state = 4 [json_name = "upgradedClientState"]; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeUpgradedClientState(com.google.protobuf.Any value) { + value.getClass(); + if (upgradedClientState_ != null && + upgradedClientState_ != com.google.protobuf.Any.getDefaultInstance()) { + upgradedClientState_ = + com.google.protobuf.Any.newBuilder(upgradedClientState_).mergeFrom(value).buildPartial(); + } else { + upgradedClientState_ = value; + } + + } + /** + *
+   * An UpgradedClientState must be provided to perform an IBC breaking upgrade.
+   * This will make the chain commit to the correct upgraded (self) client state
+   * before the upgrade occurs, so that connecting chains can verify that the
+   * new upgraded client is valid by verifying a proof on the previous version
+   * of the chain. This will allow IBC connections to persist smoothly across
+   * planned chain upgrades
+   * 
+ * + * .google.protobuf.Any upgraded_client_state = 4 [json_name = "upgradedClientState"]; + */ + private void clearUpgradedClientState() { upgradedClientState_ = null; + + } + + public static com.ibc.core.client.v1.UpgradeProposal parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.ibc.core.client.v1.UpgradeProposal parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.ibc.core.client.v1.UpgradeProposal parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.ibc.core.client.v1.UpgradeProposal parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.ibc.core.client.v1.UpgradeProposal parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.ibc.core.client.v1.UpgradeProposal parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.ibc.core.client.v1.UpgradeProposal parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.ibc.core.client.v1.UpgradeProposal parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.ibc.core.client.v1.UpgradeProposal parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.ibc.core.client.v1.UpgradeProposal parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.ibc.core.client.v1.UpgradeProposal parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.ibc.core.client.v1.UpgradeProposal parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.ibc.core.client.v1.UpgradeProposal prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+   * UpgradeProposal is a gov Content type for initiating an IBC breaking
+   * upgrade.
+   * 
+ * + * Protobuf type {@code ibc.core.client.v1.UpgradeProposal} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.ibc.core.client.v1.UpgradeProposal, Builder> implements + // @@protoc_insertion_point(builder_implements:ibc.core.client.v1.UpgradeProposal) + com.ibc.core.client.v1.UpgradeProposalOrBuilder { + // Construct using com.ibc.core.client.v1.UpgradeProposal.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * string title = 1 [json_name = "title"]; + * @return The title. + */ + @java.lang.Override + public java.lang.String getTitle() { + return instance.getTitle(); + } + /** + * string title = 1 [json_name = "title"]; + * @return The bytes for title. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTitleBytes() { + return instance.getTitleBytes(); + } + /** + * string title = 1 [json_name = "title"]; + * @param value The title to set. + * @return This builder for chaining. + */ + public Builder setTitle( + java.lang.String value) { + copyOnWrite(); + instance.setTitle(value); + return this; + } + /** + * string title = 1 [json_name = "title"]; + * @return This builder for chaining. + */ + public Builder clearTitle() { + copyOnWrite(); + instance.clearTitle(); + return this; + } + /** + * string title = 1 [json_name = "title"]; + * @param value The bytes for title to set. + * @return This builder for chaining. + */ + public Builder setTitleBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setTitleBytes(value); + return this; + } + + /** + * string description = 2 [json_name = "description"]; + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + return instance.getDescription(); + } + /** + * string description = 2 [json_name = "description"]; + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDescriptionBytes() { + return instance.getDescriptionBytes(); + } + /** + * string description = 2 [json_name = "description"]; + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription( + java.lang.String value) { + copyOnWrite(); + instance.setDescription(value); + return this; + } + /** + * string description = 2 [json_name = "description"]; + * @return This builder for chaining. + */ + public Builder clearDescription() { + copyOnWrite(); + instance.clearDescription(); + return this; + } + /** + * string description = 2 [json_name = "description"]; + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setDescriptionBytes(value); + return this; + } + + /** + * .cosmos.upgrade.v1beta1.Plan plan = 3 [json_name = "plan", (.gogoproto.nullable) = false]; + */ + @java.lang.Override + public boolean hasPlan() { + return instance.hasPlan(); + } + /** + * .cosmos.upgrade.v1beta1.Plan plan = 3 [json_name = "plan", (.gogoproto.nullable) = false]; + */ + @java.lang.Override + public com.cosmos.upgrade.v1beta1.Plan getPlan() { + return instance.getPlan(); + } + /** + * .cosmos.upgrade.v1beta1.Plan plan = 3 [json_name = "plan", (.gogoproto.nullable) = false]; + */ + public Builder setPlan(com.cosmos.upgrade.v1beta1.Plan value) { + copyOnWrite(); + instance.setPlan(value); + return this; + } + /** + * .cosmos.upgrade.v1beta1.Plan plan = 3 [json_name = "plan", (.gogoproto.nullable) = false]; + */ + public Builder setPlan( + com.cosmos.upgrade.v1beta1.Plan.Builder builderForValue) { + copyOnWrite(); + instance.setPlan(builderForValue.build()); + return this; + } + /** + * .cosmos.upgrade.v1beta1.Plan plan = 3 [json_name = "plan", (.gogoproto.nullable) = false]; + */ + public Builder mergePlan(com.cosmos.upgrade.v1beta1.Plan value) { + copyOnWrite(); + instance.mergePlan(value); + return this; + } + /** + * .cosmos.upgrade.v1beta1.Plan plan = 3 [json_name = "plan", (.gogoproto.nullable) = false]; + */ + public Builder clearPlan() { copyOnWrite(); + instance.clearPlan(); + return this; + } + + /** + *
+     * An UpgradedClientState must be provided to perform an IBC breaking upgrade.
+     * This will make the chain commit to the correct upgraded (self) client state
+     * before the upgrade occurs, so that connecting chains can verify that the
+     * new upgraded client is valid by verifying a proof on the previous version
+     * of the chain. This will allow IBC connections to persist smoothly across
+     * planned chain upgrades
+     * 
+ * + * .google.protobuf.Any upgraded_client_state = 4 [json_name = "upgradedClientState"]; + */ + @java.lang.Override + public boolean hasUpgradedClientState() { + return instance.hasUpgradedClientState(); + } + /** + *
+     * An UpgradedClientState must be provided to perform an IBC breaking upgrade.
+     * This will make the chain commit to the correct upgraded (self) client state
+     * before the upgrade occurs, so that connecting chains can verify that the
+     * new upgraded client is valid by verifying a proof on the previous version
+     * of the chain. This will allow IBC connections to persist smoothly across
+     * planned chain upgrades
+     * 
+ * + * .google.protobuf.Any upgraded_client_state = 4 [json_name = "upgradedClientState"]; + */ + @java.lang.Override + public com.google.protobuf.Any getUpgradedClientState() { + return instance.getUpgradedClientState(); + } + /** + *
+     * An UpgradedClientState must be provided to perform an IBC breaking upgrade.
+     * This will make the chain commit to the correct upgraded (self) client state
+     * before the upgrade occurs, so that connecting chains can verify that the
+     * new upgraded client is valid by verifying a proof on the previous version
+     * of the chain. This will allow IBC connections to persist smoothly across
+     * planned chain upgrades
+     * 
+ * + * .google.protobuf.Any upgraded_client_state = 4 [json_name = "upgradedClientState"]; + */ + public Builder setUpgradedClientState(com.google.protobuf.Any value) { + copyOnWrite(); + instance.setUpgradedClientState(value); + return this; + } + /** + *
+     * An UpgradedClientState must be provided to perform an IBC breaking upgrade.
+     * This will make the chain commit to the correct upgraded (self) client state
+     * before the upgrade occurs, so that connecting chains can verify that the
+     * new upgraded client is valid by verifying a proof on the previous version
+     * of the chain. This will allow IBC connections to persist smoothly across
+     * planned chain upgrades
+     * 
+ * + * .google.protobuf.Any upgraded_client_state = 4 [json_name = "upgradedClientState"]; + */ + public Builder setUpgradedClientState( + com.google.protobuf.Any.Builder builderForValue) { + copyOnWrite(); + instance.setUpgradedClientState(builderForValue.build()); + return this; + } + /** + *
+     * An UpgradedClientState must be provided to perform an IBC breaking upgrade.
+     * This will make the chain commit to the correct upgraded (self) client state
+     * before the upgrade occurs, so that connecting chains can verify that the
+     * new upgraded client is valid by verifying a proof on the previous version
+     * of the chain. This will allow IBC connections to persist smoothly across
+     * planned chain upgrades
+     * 
+ * + * .google.protobuf.Any upgraded_client_state = 4 [json_name = "upgradedClientState"]; + */ + public Builder mergeUpgradedClientState(com.google.protobuf.Any value) { + copyOnWrite(); + instance.mergeUpgradedClientState(value); + return this; + } + /** + *
+     * An UpgradedClientState must be provided to perform an IBC breaking upgrade.
+     * This will make the chain commit to the correct upgraded (self) client state
+     * before the upgrade occurs, so that connecting chains can verify that the
+     * new upgraded client is valid by verifying a proof on the previous version
+     * of the chain. This will allow IBC connections to persist smoothly across
+     * planned chain upgrades
+     * 
+ * + * .google.protobuf.Any upgraded_client_state = 4 [json_name = "upgradedClientState"]; + */ + public Builder clearUpgradedClientState() { copyOnWrite(); + instance.clearUpgradedClientState(); + return this; + } + + // @@protoc_insertion_point(builder_scope:ibc.core.client.v1.UpgradeProposal) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.ibc.core.client.v1.UpgradeProposal(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "title_", + "description_", + "plan_", + "upgradedClientState_", + }; + java.lang.String info = + "\u0000\u0004\u0000\u0000\u0001\u0004\u0004\u0000\u0000\u0000\u0001\u0208\u0002\u0208" + + "\u0003\t\u0004\t"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.ibc.core.client.v1.UpgradeProposal.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:ibc.core.client.v1.UpgradeProposal) + private static final com.ibc.core.client.v1.UpgradeProposal DEFAULT_INSTANCE; + static { + UpgradeProposal defaultInstance = new UpgradeProposal(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + UpgradeProposal.class, defaultInstance); + } + + public static com.ibc.core.client.v1.UpgradeProposal getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/UpgradeProposalOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/UpgradeProposalOrBuilder.java new file mode 100644 index 000000000..37092b152 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/UpgradeProposalOrBuilder.java @@ -0,0 +1,73 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: ibc/core/client/v1/client.proto + +package com.ibc.core.client.v1; + +public interface UpgradeProposalOrBuilder extends + // @@protoc_insertion_point(interface_extends:ibc.core.client.v1.UpgradeProposal) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * string title = 1 [json_name = "title"]; + * @return The title. + */ + java.lang.String getTitle(); + /** + * string title = 1 [json_name = "title"]; + * @return The bytes for title. + */ + com.google.protobuf.ByteString + getTitleBytes(); + + /** + * string description = 2 [json_name = "description"]; + * @return The description. + */ + java.lang.String getDescription(); + /** + * string description = 2 [json_name = "description"]; + * @return The bytes for description. + */ + com.google.protobuf.ByteString + getDescriptionBytes(); + + /** + * .cosmos.upgrade.v1beta1.Plan plan = 3 [json_name = "plan", (.gogoproto.nullable) = false]; + * @return Whether the plan field is set. + */ + boolean hasPlan(); + /** + * .cosmos.upgrade.v1beta1.Plan plan = 3 [json_name = "plan", (.gogoproto.nullable) = false]; + * @return The plan. + */ + com.cosmos.upgrade.v1beta1.Plan getPlan(); + + /** + *
+   * An UpgradedClientState must be provided to perform an IBC breaking upgrade.
+   * This will make the chain commit to the correct upgraded (self) client state
+   * before the upgrade occurs, so that connecting chains can verify that the
+   * new upgraded client is valid by verifying a proof on the previous version
+   * of the chain. This will allow IBC connections to persist smoothly across
+   * planned chain upgrades
+   * 
+ * + * .google.protobuf.Any upgraded_client_state = 4 [json_name = "upgradedClientState"]; + * @return Whether the upgradedClientState field is set. + */ + boolean hasUpgradedClientState(); + /** + *
+   * An UpgradedClientState must be provided to perform an IBC breaking upgrade.
+   * This will make the chain commit to the correct upgraded (self) client state
+   * before the upgrade occurs, so that connecting chains can verify that the
+   * new upgraded client is valid by verifying a proof on the previous version
+   * of the chain. This will allow IBC connections to persist smoothly across
+   * planned chain upgrades
+   * 
+ * + * .google.protobuf.Any upgraded_client_state = 4 [json_name = "upgradedClientState"]; + * @return The upgradedClientState. + */ + com.google.protobuf.Any getUpgradedClientState(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/commitment/v1/CommitmentProto.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/commitment/v1/CommitmentProto.java new file mode 100644 index 000000000..7ea33cb8d --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/commitment/v1/CommitmentProto.java @@ -0,0 +1,16 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: ibc/core/commitment/v1/commitment.proto + +package com.ibc.core.commitment.v1; + +public final class CommitmentProto { + private CommitmentProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + static { + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/commitment/v1/MerklePath.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/commitment/v1/MerklePath.java new file mode 100644 index 000000000..9df1cabd2 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/commitment/v1/MerklePath.java @@ -0,0 +1,382 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: ibc/core/commitment/v1/commitment.proto + +package com.ibc.core.commitment.v1; + +/** + *
+ * MerklePath is the path used to verify commitment proofs, which can be an
+ * arbitrary structured object (defined by a commitment type).
+ * MerklePath is represented from root-to-leaf
+ * 
+ * + * Protobuf type {@code ibc.core.commitment.v1.MerklePath} + */ +public final class MerklePath extends + com.google.protobuf.GeneratedMessageLite< + MerklePath, MerklePath.Builder> implements + // @@protoc_insertion_point(message_implements:ibc.core.commitment.v1.MerklePath) + MerklePathOrBuilder { + private MerklePath() { + keyPath_ = com.google.protobuf.GeneratedMessageLite.emptyProtobufList(); + } + public static final int KEY_PATH_FIELD_NUMBER = 1; + private com.google.protobuf.Internal.ProtobufList keyPath_; + /** + * repeated string key_path = 1 [json_name = "keyPath"]; + * @return A list containing the keyPath. + */ + @java.lang.Override + public java.util.List getKeyPathList() { + return keyPath_; + } + /** + * repeated string key_path = 1 [json_name = "keyPath"]; + * @return The count of keyPath. + */ + @java.lang.Override + public int getKeyPathCount() { + return keyPath_.size(); + } + /** + * repeated string key_path = 1 [json_name = "keyPath"]; + * @param index The index of the element to return. + * @return The keyPath at the given index. + */ + @java.lang.Override + public java.lang.String getKeyPath(int index) { + return keyPath_.get(index); + } + /** + * repeated string key_path = 1 [json_name = "keyPath"]; + * @param index The index of the value to return. + * @return The bytes of the keyPath at the given index. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getKeyPathBytes(int index) { + return com.google.protobuf.ByteString.copyFromUtf8( + keyPath_.get(index)); + } + private void ensureKeyPathIsMutable() { + com.google.protobuf.Internal.ProtobufList tmp = + keyPath_; if (!tmp.isModifiable()) { + keyPath_ = + com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp); + } + } + /** + * repeated string key_path = 1 [json_name = "keyPath"]; + * @param index The index to set the value at. + * @param value The keyPath to set. + */ + private void setKeyPath( + int index, java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + ensureKeyPathIsMutable(); + keyPath_.set(index, value); + } + /** + * repeated string key_path = 1 [json_name = "keyPath"]; + * @param value The keyPath to add. + */ + private void addKeyPath( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + ensureKeyPathIsMutable(); + keyPath_.add(value); + } + /** + * repeated string key_path = 1 [json_name = "keyPath"]; + * @param values The keyPath to add. + */ + private void addAllKeyPath( + java.lang.Iterable values) { + ensureKeyPathIsMutable(); + com.google.protobuf.AbstractMessageLite.addAll( + values, keyPath_); + } + /** + * repeated string key_path = 1 [json_name = "keyPath"]; + */ + private void clearKeyPath() { + keyPath_ = com.google.protobuf.GeneratedMessageLite.emptyProtobufList(); + } + /** + * repeated string key_path = 1 [json_name = "keyPath"]; + * @param value The bytes of the keyPath to add. + */ + private void addKeyPathBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + ensureKeyPathIsMutable(); + keyPath_.add(value.toStringUtf8()); + } + + public static com.ibc.core.commitment.v1.MerklePath parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.ibc.core.commitment.v1.MerklePath parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.ibc.core.commitment.v1.MerklePath parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.ibc.core.commitment.v1.MerklePath parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.ibc.core.commitment.v1.MerklePath parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.ibc.core.commitment.v1.MerklePath parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.ibc.core.commitment.v1.MerklePath parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.ibc.core.commitment.v1.MerklePath parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.ibc.core.commitment.v1.MerklePath parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.ibc.core.commitment.v1.MerklePath parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.ibc.core.commitment.v1.MerklePath parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.ibc.core.commitment.v1.MerklePath parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.ibc.core.commitment.v1.MerklePath prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+   * MerklePath is the path used to verify commitment proofs, which can be an
+   * arbitrary structured object (defined by a commitment type).
+   * MerklePath is represented from root-to-leaf
+   * 
+ * + * Protobuf type {@code ibc.core.commitment.v1.MerklePath} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.ibc.core.commitment.v1.MerklePath, Builder> implements + // @@protoc_insertion_point(builder_implements:ibc.core.commitment.v1.MerklePath) + com.ibc.core.commitment.v1.MerklePathOrBuilder { + // Construct using com.ibc.core.commitment.v1.MerklePath.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * repeated string key_path = 1 [json_name = "keyPath"]; + * @return A list containing the keyPath. + */ + @java.lang.Override + public java.util.List + getKeyPathList() { + return java.util.Collections.unmodifiableList( + instance.getKeyPathList()); + } + /** + * repeated string key_path = 1 [json_name = "keyPath"]; + * @return The count of keyPath. + */ + @java.lang.Override + public int getKeyPathCount() { + return instance.getKeyPathCount(); + } + /** + * repeated string key_path = 1 [json_name = "keyPath"]; + * @param index The index of the element to return. + * @return The keyPath at the given index. + */ + @java.lang.Override + public java.lang.String getKeyPath(int index) { + return instance.getKeyPath(index); + } + /** + * repeated string key_path = 1 [json_name = "keyPath"]; + * @param index The index of the value to return. + * @return The bytes of the keyPath at the given index. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getKeyPathBytes(int index) { + return instance.getKeyPathBytes(index); + } + /** + * repeated string key_path = 1 [json_name = "keyPath"]; + * @param index The index to set the value at. + * @param value The keyPath to set. + * @return This builder for chaining. + */ + public Builder setKeyPath( + int index, java.lang.String value) { + copyOnWrite(); + instance.setKeyPath(index, value); + return this; + } + /** + * repeated string key_path = 1 [json_name = "keyPath"]; + * @param value The keyPath to add. + * @return This builder for chaining. + */ + public Builder addKeyPath( + java.lang.String value) { + copyOnWrite(); + instance.addKeyPath(value); + return this; + } + /** + * repeated string key_path = 1 [json_name = "keyPath"]; + * @param values The keyPath to add. + * @return This builder for chaining. + */ + public Builder addAllKeyPath( + java.lang.Iterable values) { + copyOnWrite(); + instance.addAllKeyPath(values); + return this; + } + /** + * repeated string key_path = 1 [json_name = "keyPath"]; + * @return This builder for chaining. + */ + public Builder clearKeyPath() { + copyOnWrite(); + instance.clearKeyPath(); + return this; + } + /** + * repeated string key_path = 1 [json_name = "keyPath"]; + * @param value The bytes of the keyPath to add. + * @return This builder for chaining. + */ + public Builder addKeyPathBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.addKeyPathBytes(value); + return this; + } + + // @@protoc_insertion_point(builder_scope:ibc.core.commitment.v1.MerklePath) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.ibc.core.commitment.v1.MerklePath(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "keyPath_", + }; + java.lang.String info = + "\u0000\u0001\u0000\u0000\u0001\u0001\u0001\u0000\u0001\u0000\u0001\u021a"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.ibc.core.commitment.v1.MerklePath.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:ibc.core.commitment.v1.MerklePath) + private static final com.ibc.core.commitment.v1.MerklePath DEFAULT_INSTANCE; + static { + MerklePath defaultInstance = new MerklePath(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + MerklePath.class, defaultInstance); + } + + public static com.ibc.core.commitment.v1.MerklePath getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/commitment/v1/MerklePathOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/commitment/v1/MerklePathOrBuilder.java new file mode 100644 index 000000000..c2447ee02 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/commitment/v1/MerklePathOrBuilder.java @@ -0,0 +1,34 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: ibc/core/commitment/v1/commitment.proto + +package com.ibc.core.commitment.v1; + +public interface MerklePathOrBuilder extends + // @@protoc_insertion_point(interface_extends:ibc.core.commitment.v1.MerklePath) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * repeated string key_path = 1 [json_name = "keyPath"]; + * @return A list containing the keyPath. + */ + java.util.List + getKeyPathList(); + /** + * repeated string key_path = 1 [json_name = "keyPath"]; + * @return The count of keyPath. + */ + int getKeyPathCount(); + /** + * repeated string key_path = 1 [json_name = "keyPath"]; + * @param index The index of the element to return. + * @return The keyPath at the given index. + */ + java.lang.String getKeyPath(int index); + /** + * repeated string key_path = 1 [json_name = "keyPath"]; + * @param index The index of the element to return. + * @return The keyPath at the given index. + */ + com.google.protobuf.ByteString + getKeyPathBytes(int index); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/commitment/v1/MerklePrefix.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/commitment/v1/MerklePrefix.java new file mode 100644 index 000000000..31659034d --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/commitment/v1/MerklePrefix.java @@ -0,0 +1,252 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: ibc/core/commitment/v1/commitment.proto + +package com.ibc.core.commitment.v1; + +/** + *
+ * MerklePrefix is merkle path prefixed to the key.
+ * The constructed key from the Path and the key will be append(Path.KeyPath,
+ * append(Path.KeyPrefix, key...))
+ * 
+ * + * Protobuf type {@code ibc.core.commitment.v1.MerklePrefix} + */ +public final class MerklePrefix extends + com.google.protobuf.GeneratedMessageLite< + MerklePrefix, MerklePrefix.Builder> implements + // @@protoc_insertion_point(message_implements:ibc.core.commitment.v1.MerklePrefix) + MerklePrefixOrBuilder { + private MerklePrefix() { + keyPrefix_ = com.google.protobuf.ByteString.EMPTY; + } + public static final int KEY_PREFIX_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString keyPrefix_; + /** + * bytes key_prefix = 1 [json_name = "keyPrefix"]; + * @return The keyPrefix. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKeyPrefix() { + return keyPrefix_; + } + /** + * bytes key_prefix = 1 [json_name = "keyPrefix"]; + * @param value The keyPrefix to set. + */ + private void setKeyPrefix(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + keyPrefix_ = value; + } + /** + * bytes key_prefix = 1 [json_name = "keyPrefix"]; + */ + private void clearKeyPrefix() { + + keyPrefix_ = getDefaultInstance().getKeyPrefix(); + } + + public static com.ibc.core.commitment.v1.MerklePrefix parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.ibc.core.commitment.v1.MerklePrefix parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.ibc.core.commitment.v1.MerklePrefix parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.ibc.core.commitment.v1.MerklePrefix parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.ibc.core.commitment.v1.MerklePrefix parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.ibc.core.commitment.v1.MerklePrefix parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.ibc.core.commitment.v1.MerklePrefix parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.ibc.core.commitment.v1.MerklePrefix parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.ibc.core.commitment.v1.MerklePrefix parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.ibc.core.commitment.v1.MerklePrefix parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.ibc.core.commitment.v1.MerklePrefix parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.ibc.core.commitment.v1.MerklePrefix parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.ibc.core.commitment.v1.MerklePrefix prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+   * MerklePrefix is merkle path prefixed to the key.
+   * The constructed key from the Path and the key will be append(Path.KeyPath,
+   * append(Path.KeyPrefix, key...))
+   * 
+ * + * Protobuf type {@code ibc.core.commitment.v1.MerklePrefix} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.ibc.core.commitment.v1.MerklePrefix, Builder> implements + // @@protoc_insertion_point(builder_implements:ibc.core.commitment.v1.MerklePrefix) + com.ibc.core.commitment.v1.MerklePrefixOrBuilder { + // Construct using com.ibc.core.commitment.v1.MerklePrefix.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * bytes key_prefix = 1 [json_name = "keyPrefix"]; + * @return The keyPrefix. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKeyPrefix() { + return instance.getKeyPrefix(); + } + /** + * bytes key_prefix = 1 [json_name = "keyPrefix"]; + * @param value The keyPrefix to set. + * @return This builder for chaining. + */ + public Builder setKeyPrefix(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setKeyPrefix(value); + return this; + } + /** + * bytes key_prefix = 1 [json_name = "keyPrefix"]; + * @return This builder for chaining. + */ + public Builder clearKeyPrefix() { + copyOnWrite(); + instance.clearKeyPrefix(); + return this; + } + + // @@protoc_insertion_point(builder_scope:ibc.core.commitment.v1.MerklePrefix) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.ibc.core.commitment.v1.MerklePrefix(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "keyPrefix_", + }; + java.lang.String info = + "\u0000\u0001\u0000\u0000\u0001\u0001\u0001\u0000\u0000\u0000\u0001\n"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.ibc.core.commitment.v1.MerklePrefix.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:ibc.core.commitment.v1.MerklePrefix) + private static final com.ibc.core.commitment.v1.MerklePrefix DEFAULT_INSTANCE; + static { + MerklePrefix defaultInstance = new MerklePrefix(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + MerklePrefix.class, defaultInstance); + } + + public static com.ibc.core.commitment.v1.MerklePrefix getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/commitment/v1/MerklePrefixOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/commitment/v1/MerklePrefixOrBuilder.java new file mode 100644 index 000000000..3046f0a08 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/commitment/v1/MerklePrefixOrBuilder.java @@ -0,0 +1,15 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: ibc/core/commitment/v1/commitment.proto + +package com.ibc.core.commitment.v1; + +public interface MerklePrefixOrBuilder extends + // @@protoc_insertion_point(interface_extends:ibc.core.commitment.v1.MerklePrefix) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * bytes key_prefix = 1 [json_name = "keyPrefix"]; + * @return The keyPrefix. + */ + com.google.protobuf.ByteString getKeyPrefix(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/commitment/v1/MerkleProof.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/commitment/v1/MerkleProof.java new file mode 100644 index 000000000..f2480b876 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/commitment/v1/MerkleProof.java @@ -0,0 +1,398 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: ibc/core/commitment/v1/commitment.proto + +package com.ibc.core.commitment.v1; + +/** + *
+ * MerkleProof is a wrapper type over a chain of CommitmentProofs.
+ * It demonstrates membership or non-membership for an element or set of
+ * elements, verifiable in conjunction with a known commitment root. Proofs
+ * should be succinct.
+ * MerkleProofs are ordered from leaf-to-root
+ * 
+ * + * Protobuf type {@code ibc.core.commitment.v1.MerkleProof} + */ +public final class MerkleProof extends + com.google.protobuf.GeneratedMessageLite< + MerkleProof, MerkleProof.Builder> implements + // @@protoc_insertion_point(message_implements:ibc.core.commitment.v1.MerkleProof) + MerkleProofOrBuilder { + private MerkleProof() { + proofs_ = emptyProtobufList(); + } + public static final int PROOFS_FIELD_NUMBER = 1; + private com.google.protobuf.Internal.ProtobufList proofs_; + /** + * repeated .cosmos.ics23.v1.CommitmentProof proofs = 1 [json_name = "proofs"]; + */ + @java.lang.Override + public java.util.List getProofsList() { + return proofs_; + } + /** + * repeated .cosmos.ics23.v1.CommitmentProof proofs = 1 [json_name = "proofs"]; + */ + public java.util.List + getProofsOrBuilderList() { + return proofs_; + } + /** + * repeated .cosmos.ics23.v1.CommitmentProof proofs = 1 [json_name = "proofs"]; + */ + @java.lang.Override + public int getProofsCount() { + return proofs_.size(); + } + /** + * repeated .cosmos.ics23.v1.CommitmentProof proofs = 1 [json_name = "proofs"]; + */ + @java.lang.Override + public com.cosmos.ics23.v1.CommitmentProof getProofs(int index) { + return proofs_.get(index); + } + /** + * repeated .cosmos.ics23.v1.CommitmentProof proofs = 1 [json_name = "proofs"]; + */ + public com.cosmos.ics23.v1.CommitmentProofOrBuilder getProofsOrBuilder( + int index) { + return proofs_.get(index); + } + private void ensureProofsIsMutable() { + com.google.protobuf.Internal.ProtobufList tmp = proofs_; + if (!tmp.isModifiable()) { + proofs_ = + com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp); + } + } + + /** + * repeated .cosmos.ics23.v1.CommitmentProof proofs = 1 [json_name = "proofs"]; + */ + private void setProofs( + int index, com.cosmos.ics23.v1.CommitmentProof value) { + value.getClass(); + ensureProofsIsMutable(); + proofs_.set(index, value); + } + /** + * repeated .cosmos.ics23.v1.CommitmentProof proofs = 1 [json_name = "proofs"]; + */ + private void addProofs(com.cosmos.ics23.v1.CommitmentProof value) { + value.getClass(); + ensureProofsIsMutable(); + proofs_.add(value); + } + /** + * repeated .cosmos.ics23.v1.CommitmentProof proofs = 1 [json_name = "proofs"]; + */ + private void addProofs( + int index, com.cosmos.ics23.v1.CommitmentProof value) { + value.getClass(); + ensureProofsIsMutable(); + proofs_.add(index, value); + } + /** + * repeated .cosmos.ics23.v1.CommitmentProof proofs = 1 [json_name = "proofs"]; + */ + private void addAllProofs( + java.lang.Iterable values) { + ensureProofsIsMutable(); + com.google.protobuf.AbstractMessageLite.addAll( + values, proofs_); + } + /** + * repeated .cosmos.ics23.v1.CommitmentProof proofs = 1 [json_name = "proofs"]; + */ + private void clearProofs() { + proofs_ = emptyProtobufList(); + } + /** + * repeated .cosmos.ics23.v1.CommitmentProof proofs = 1 [json_name = "proofs"]; + */ + private void removeProofs(int index) { + ensureProofsIsMutable(); + proofs_.remove(index); + } + + public static com.ibc.core.commitment.v1.MerkleProof parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.ibc.core.commitment.v1.MerkleProof parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.ibc.core.commitment.v1.MerkleProof parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.ibc.core.commitment.v1.MerkleProof parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.ibc.core.commitment.v1.MerkleProof parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.ibc.core.commitment.v1.MerkleProof parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.ibc.core.commitment.v1.MerkleProof parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.ibc.core.commitment.v1.MerkleProof parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.ibc.core.commitment.v1.MerkleProof parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.ibc.core.commitment.v1.MerkleProof parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.ibc.core.commitment.v1.MerkleProof parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.ibc.core.commitment.v1.MerkleProof parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.ibc.core.commitment.v1.MerkleProof prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+   * MerkleProof is a wrapper type over a chain of CommitmentProofs.
+   * It demonstrates membership or non-membership for an element or set of
+   * elements, verifiable in conjunction with a known commitment root. Proofs
+   * should be succinct.
+   * MerkleProofs are ordered from leaf-to-root
+   * 
+ * + * Protobuf type {@code ibc.core.commitment.v1.MerkleProof} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.ibc.core.commitment.v1.MerkleProof, Builder> implements + // @@protoc_insertion_point(builder_implements:ibc.core.commitment.v1.MerkleProof) + com.ibc.core.commitment.v1.MerkleProofOrBuilder { + // Construct using com.ibc.core.commitment.v1.MerkleProof.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * repeated .cosmos.ics23.v1.CommitmentProof proofs = 1 [json_name = "proofs"]; + */ + @java.lang.Override + public java.util.List getProofsList() { + return java.util.Collections.unmodifiableList( + instance.getProofsList()); + } + /** + * repeated .cosmos.ics23.v1.CommitmentProof proofs = 1 [json_name = "proofs"]; + */ + @java.lang.Override + public int getProofsCount() { + return instance.getProofsCount(); + }/** + * repeated .cosmos.ics23.v1.CommitmentProof proofs = 1 [json_name = "proofs"]; + */ + @java.lang.Override + public com.cosmos.ics23.v1.CommitmentProof getProofs(int index) { + return instance.getProofs(index); + } + /** + * repeated .cosmos.ics23.v1.CommitmentProof proofs = 1 [json_name = "proofs"]; + */ + public Builder setProofs( + int index, com.cosmos.ics23.v1.CommitmentProof value) { + copyOnWrite(); + instance.setProofs(index, value); + return this; + } + /** + * repeated .cosmos.ics23.v1.CommitmentProof proofs = 1 [json_name = "proofs"]; + */ + public Builder setProofs( + int index, com.cosmos.ics23.v1.CommitmentProof.Builder builderForValue) { + copyOnWrite(); + instance.setProofs(index, + builderForValue.build()); + return this; + } + /** + * repeated .cosmos.ics23.v1.CommitmentProof proofs = 1 [json_name = "proofs"]; + */ + public Builder addProofs(com.cosmos.ics23.v1.CommitmentProof value) { + copyOnWrite(); + instance.addProofs(value); + return this; + } + /** + * repeated .cosmos.ics23.v1.CommitmentProof proofs = 1 [json_name = "proofs"]; + */ + public Builder addProofs( + int index, com.cosmos.ics23.v1.CommitmentProof value) { + copyOnWrite(); + instance.addProofs(index, value); + return this; + } + /** + * repeated .cosmos.ics23.v1.CommitmentProof proofs = 1 [json_name = "proofs"]; + */ + public Builder addProofs( + com.cosmos.ics23.v1.CommitmentProof.Builder builderForValue) { + copyOnWrite(); + instance.addProofs(builderForValue.build()); + return this; + } + /** + * repeated .cosmos.ics23.v1.CommitmentProof proofs = 1 [json_name = "proofs"]; + */ + public Builder addProofs( + int index, com.cosmos.ics23.v1.CommitmentProof.Builder builderForValue) { + copyOnWrite(); + instance.addProofs(index, + builderForValue.build()); + return this; + } + /** + * repeated .cosmos.ics23.v1.CommitmentProof proofs = 1 [json_name = "proofs"]; + */ + public Builder addAllProofs( + java.lang.Iterable values) { + copyOnWrite(); + instance.addAllProofs(values); + return this; + } + /** + * repeated .cosmos.ics23.v1.CommitmentProof proofs = 1 [json_name = "proofs"]; + */ + public Builder clearProofs() { + copyOnWrite(); + instance.clearProofs(); + return this; + } + /** + * repeated .cosmos.ics23.v1.CommitmentProof proofs = 1 [json_name = "proofs"]; + */ + public Builder removeProofs(int index) { + copyOnWrite(); + instance.removeProofs(index); + return this; + } + + // @@protoc_insertion_point(builder_scope:ibc.core.commitment.v1.MerkleProof) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.ibc.core.commitment.v1.MerkleProof(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "proofs_", + com.cosmos.ics23.v1.CommitmentProof.class, + }; + java.lang.String info = + "\u0000\u0001\u0000\u0000\u0001\u0001\u0001\u0000\u0001\u0000\u0001\u001b"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.ibc.core.commitment.v1.MerkleProof.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:ibc.core.commitment.v1.MerkleProof) + private static final com.ibc.core.commitment.v1.MerkleProof DEFAULT_INSTANCE; + static { + MerkleProof defaultInstance = new MerkleProof(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + MerkleProof.class, defaultInstance); + } + + public static com.ibc.core.commitment.v1.MerkleProof getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/commitment/v1/MerkleProofOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/commitment/v1/MerkleProofOrBuilder.java new file mode 100644 index 000000000..d457a90ed --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/commitment/v1/MerkleProofOrBuilder.java @@ -0,0 +1,23 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: ibc/core/commitment/v1/commitment.proto + +package com.ibc.core.commitment.v1; + +public interface MerkleProofOrBuilder extends + // @@protoc_insertion_point(interface_extends:ibc.core.commitment.v1.MerkleProof) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * repeated .cosmos.ics23.v1.CommitmentProof proofs = 1 [json_name = "proofs"]; + */ + java.util.List + getProofsList(); + /** + * repeated .cosmos.ics23.v1.CommitmentProof proofs = 1 [json_name = "proofs"]; + */ + com.cosmos.ics23.v1.CommitmentProof getProofs(int index); + /** + * repeated .cosmos.ics23.v1.CommitmentProof proofs = 1 [json_name = "proofs"]; + */ + int getProofsCount(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/commitment/v1/MerkleRoot.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/commitment/v1/MerkleRoot.java new file mode 100644 index 000000000..11f73658d --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/commitment/v1/MerkleRoot.java @@ -0,0 +1,250 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: ibc/core/commitment/v1/commitment.proto + +package com.ibc.core.commitment.v1; + +/** + *
+ * MerkleRoot defines a merkle root hash.
+ * In the Cosmos SDK, the AppHash of a block header becomes the root.
+ * 
+ * + * Protobuf type {@code ibc.core.commitment.v1.MerkleRoot} + */ +public final class MerkleRoot extends + com.google.protobuf.GeneratedMessageLite< + MerkleRoot, MerkleRoot.Builder> implements + // @@protoc_insertion_point(message_implements:ibc.core.commitment.v1.MerkleRoot) + MerkleRootOrBuilder { + private MerkleRoot() { + hash_ = com.google.protobuf.ByteString.EMPTY; + } + public static final int HASH_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString hash_; + /** + * bytes hash = 1 [json_name = "hash"]; + * @return The hash. + */ + @java.lang.Override + public com.google.protobuf.ByteString getHash() { + return hash_; + } + /** + * bytes hash = 1 [json_name = "hash"]; + * @param value The hash to set. + */ + private void setHash(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + hash_ = value; + } + /** + * bytes hash = 1 [json_name = "hash"]; + */ + private void clearHash() { + + hash_ = getDefaultInstance().getHash(); + } + + public static com.ibc.core.commitment.v1.MerkleRoot parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.ibc.core.commitment.v1.MerkleRoot parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.ibc.core.commitment.v1.MerkleRoot parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.ibc.core.commitment.v1.MerkleRoot parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.ibc.core.commitment.v1.MerkleRoot parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.ibc.core.commitment.v1.MerkleRoot parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.ibc.core.commitment.v1.MerkleRoot parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.ibc.core.commitment.v1.MerkleRoot parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.ibc.core.commitment.v1.MerkleRoot parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.ibc.core.commitment.v1.MerkleRoot parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.ibc.core.commitment.v1.MerkleRoot parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.ibc.core.commitment.v1.MerkleRoot parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.ibc.core.commitment.v1.MerkleRoot prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+   * MerkleRoot defines a merkle root hash.
+   * In the Cosmos SDK, the AppHash of a block header becomes the root.
+   * 
+ * + * Protobuf type {@code ibc.core.commitment.v1.MerkleRoot} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.ibc.core.commitment.v1.MerkleRoot, Builder> implements + // @@protoc_insertion_point(builder_implements:ibc.core.commitment.v1.MerkleRoot) + com.ibc.core.commitment.v1.MerkleRootOrBuilder { + // Construct using com.ibc.core.commitment.v1.MerkleRoot.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * bytes hash = 1 [json_name = "hash"]; + * @return The hash. + */ + @java.lang.Override + public com.google.protobuf.ByteString getHash() { + return instance.getHash(); + } + /** + * bytes hash = 1 [json_name = "hash"]; + * @param value The hash to set. + * @return This builder for chaining. + */ + public Builder setHash(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setHash(value); + return this; + } + /** + * bytes hash = 1 [json_name = "hash"]; + * @return This builder for chaining. + */ + public Builder clearHash() { + copyOnWrite(); + instance.clearHash(); + return this; + } + + // @@protoc_insertion_point(builder_scope:ibc.core.commitment.v1.MerkleRoot) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.ibc.core.commitment.v1.MerkleRoot(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "hash_", + }; + java.lang.String info = + "\u0000\u0001\u0000\u0000\u0001\u0001\u0001\u0000\u0000\u0000\u0001\n"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.ibc.core.commitment.v1.MerkleRoot.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:ibc.core.commitment.v1.MerkleRoot) + private static final com.ibc.core.commitment.v1.MerkleRoot DEFAULT_INSTANCE; + static { + MerkleRoot defaultInstance = new MerkleRoot(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + MerkleRoot.class, defaultInstance); + } + + public static com.ibc.core.commitment.v1.MerkleRoot getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/commitment/v1/MerkleRootOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/commitment/v1/MerkleRootOrBuilder.java new file mode 100644 index 000000000..ac3bf42b0 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/commitment/v1/MerkleRootOrBuilder.java @@ -0,0 +1,15 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: ibc/core/commitment/v1/commitment.proto + +package com.ibc.core.commitment.v1; + +public interface MerkleRootOrBuilder extends + // @@protoc_insertion_point(interface_extends:ibc.core.commitment.v1.MerkleRoot) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * bytes hash = 1 [json_name = "hash"]; + * @return The hash. + */ + com.google.protobuf.ByteString getHash(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/lightclients/tendermint/v1/ClientState.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/lightclients/tendermint/v1/ClientState.java new file mode 100644 index 000000000..ec96d69ec --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/lightclients/tendermint/v1/ClientState.java @@ -0,0 +1,1927 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: clients/tendermint/TendermintLight.proto + +package com.ibc.lightclients.tendermint.v1; + +/** + *
+ * ClientState from Tendermint tracks the current validator set, latest height,
+ * and a possible frozen height.
+ * 
+ * + * Protobuf type {@code ibc.lightclients.tendermint.v1.ClientState} + */ +public final class ClientState extends + com.google.protobuf.GeneratedMessageLite< + ClientState, ClientState.Builder> implements + // @@protoc_insertion_point(message_implements:ibc.lightclients.tendermint.v1.ClientState) + ClientStateOrBuilder { + private ClientState() { + chainId_ = ""; + proofSpecs_ = emptyProtobufList(); + upgradePath_ = com.google.protobuf.GeneratedMessageLite.emptyProtobufList(); + } + public static final int CHAIN_ID_FIELD_NUMBER = 1; + private java.lang.String chainId_; + /** + * string chain_id = 1 [json_name = "chainId"]; + * @return The chainId. + */ + @java.lang.Override + public java.lang.String getChainId() { + return chainId_; + } + /** + * string chain_id = 1 [json_name = "chainId"]; + * @return The bytes for chainId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getChainIdBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(chainId_); + } + /** + * string chain_id = 1 [json_name = "chainId"]; + * @param value The chainId to set. + */ + private void setChainId( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + chainId_ = value; + } + /** + * string chain_id = 1 [json_name = "chainId"]; + */ + private void clearChainId() { + + chainId_ = getDefaultInstance().getChainId(); + } + /** + * string chain_id = 1 [json_name = "chainId"]; + * @param value The bytes for chainId to set. + */ + private void setChainIdBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + chainId_ = value.toStringUtf8(); + + } + + public static final int TRUST_LEVEL_FIELD_NUMBER = 2; + private com.ibc.lightclients.tendermint.v1.Fraction trustLevel_; + /** + * .ibc.lightclients.tendermint.v1.Fraction trust_level = 2 [json_name = "trustLevel", (.gogoproto.nullable) = false]; + */ + @java.lang.Override + public boolean hasTrustLevel() { + return trustLevel_ != null; + } + /** + * .ibc.lightclients.tendermint.v1.Fraction trust_level = 2 [json_name = "trustLevel", (.gogoproto.nullable) = false]; + */ + @java.lang.Override + public com.ibc.lightclients.tendermint.v1.Fraction getTrustLevel() { + return trustLevel_ == null ? com.ibc.lightclients.tendermint.v1.Fraction.getDefaultInstance() : trustLevel_; + } + /** + * .ibc.lightclients.tendermint.v1.Fraction trust_level = 2 [json_name = "trustLevel", (.gogoproto.nullable) = false]; + */ + private void setTrustLevel(com.ibc.lightclients.tendermint.v1.Fraction value) { + value.getClass(); + trustLevel_ = value; + + } + /** + * .ibc.lightclients.tendermint.v1.Fraction trust_level = 2 [json_name = "trustLevel", (.gogoproto.nullable) = false]; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeTrustLevel(com.ibc.lightclients.tendermint.v1.Fraction value) { + value.getClass(); + if (trustLevel_ != null && + trustLevel_ != com.ibc.lightclients.tendermint.v1.Fraction.getDefaultInstance()) { + trustLevel_ = + com.ibc.lightclients.tendermint.v1.Fraction.newBuilder(trustLevel_).mergeFrom(value).buildPartial(); + } else { + trustLevel_ = value; + } + + } + /** + * .ibc.lightclients.tendermint.v1.Fraction trust_level = 2 [json_name = "trustLevel", (.gogoproto.nullable) = false]; + */ + private void clearTrustLevel() { trustLevel_ = null; + + } + + public static final int TRUSTING_PERIOD_FIELD_NUMBER = 3; + private com.google.protobuf.Duration trustingPeriod_; + /** + *
+   * duration of the period since the LastestTimestamp during which the
+   * submitted headers are valid for upgrade
+   * 
+ * + * .google.protobuf.Duration trusting_period = 3 [json_name = "trustingPeriod", (.gogoproto.nullable) = false, (.gogoproto.stdduration) = true]; + */ + @java.lang.Override + public boolean hasTrustingPeriod() { + return trustingPeriod_ != null; + } + /** + *
+   * duration of the period since the LastestTimestamp during which the
+   * submitted headers are valid for upgrade
+   * 
+ * + * .google.protobuf.Duration trusting_period = 3 [json_name = "trustingPeriod", (.gogoproto.nullable) = false, (.gogoproto.stdduration) = true]; + */ + @java.lang.Override + public com.google.protobuf.Duration getTrustingPeriod() { + return trustingPeriod_ == null ? com.google.protobuf.Duration.getDefaultInstance() : trustingPeriod_; + } + /** + *
+   * duration of the period since the LastestTimestamp during which the
+   * submitted headers are valid for upgrade
+   * 
+ * + * .google.protobuf.Duration trusting_period = 3 [json_name = "trustingPeriod", (.gogoproto.nullable) = false, (.gogoproto.stdduration) = true]; + */ + private void setTrustingPeriod(com.google.protobuf.Duration value) { + value.getClass(); + trustingPeriod_ = value; + + } + /** + *
+   * duration of the period since the LastestTimestamp during which the
+   * submitted headers are valid for upgrade
+   * 
+ * + * .google.protobuf.Duration trusting_period = 3 [json_name = "trustingPeriod", (.gogoproto.nullable) = false, (.gogoproto.stdduration) = true]; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeTrustingPeriod(com.google.protobuf.Duration value) { + value.getClass(); + if (trustingPeriod_ != null && + trustingPeriod_ != com.google.protobuf.Duration.getDefaultInstance()) { + trustingPeriod_ = + com.google.protobuf.Duration.newBuilder(trustingPeriod_).mergeFrom(value).buildPartial(); + } else { + trustingPeriod_ = value; + } + + } + /** + *
+   * duration of the period since the LastestTimestamp during which the
+   * submitted headers are valid for upgrade
+   * 
+ * + * .google.protobuf.Duration trusting_period = 3 [json_name = "trustingPeriod", (.gogoproto.nullable) = false, (.gogoproto.stdduration) = true]; + */ + private void clearTrustingPeriod() { trustingPeriod_ = null; + + } + + public static final int UNBONDING_PERIOD_FIELD_NUMBER = 4; + private com.google.protobuf.Duration unbondingPeriod_; + /** + *
+   * duration of the staking unbonding period
+   * 
+ * + * .google.protobuf.Duration unbonding_period = 4 [json_name = "unbondingPeriod", (.gogoproto.nullable) = false, (.gogoproto.stdduration) = true]; + */ + @java.lang.Override + public boolean hasUnbondingPeriod() { + return unbondingPeriod_ != null; + } + /** + *
+   * duration of the staking unbonding period
+   * 
+ * + * .google.protobuf.Duration unbonding_period = 4 [json_name = "unbondingPeriod", (.gogoproto.nullable) = false, (.gogoproto.stdduration) = true]; + */ + @java.lang.Override + public com.google.protobuf.Duration getUnbondingPeriod() { + return unbondingPeriod_ == null ? com.google.protobuf.Duration.getDefaultInstance() : unbondingPeriod_; + } + /** + *
+   * duration of the staking unbonding period
+   * 
+ * + * .google.protobuf.Duration unbonding_period = 4 [json_name = "unbondingPeriod", (.gogoproto.nullable) = false, (.gogoproto.stdduration) = true]; + */ + private void setUnbondingPeriod(com.google.protobuf.Duration value) { + value.getClass(); + unbondingPeriod_ = value; + + } + /** + *
+   * duration of the staking unbonding period
+   * 
+ * + * .google.protobuf.Duration unbonding_period = 4 [json_name = "unbondingPeriod", (.gogoproto.nullable) = false, (.gogoproto.stdduration) = true]; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeUnbondingPeriod(com.google.protobuf.Duration value) { + value.getClass(); + if (unbondingPeriod_ != null && + unbondingPeriod_ != com.google.protobuf.Duration.getDefaultInstance()) { + unbondingPeriod_ = + com.google.protobuf.Duration.newBuilder(unbondingPeriod_).mergeFrom(value).buildPartial(); + } else { + unbondingPeriod_ = value; + } + + } + /** + *
+   * duration of the staking unbonding period
+   * 
+ * + * .google.protobuf.Duration unbonding_period = 4 [json_name = "unbondingPeriod", (.gogoproto.nullable) = false, (.gogoproto.stdduration) = true]; + */ + private void clearUnbondingPeriod() { unbondingPeriod_ = null; + + } + + public static final int MAX_CLOCK_DRIFT_FIELD_NUMBER = 5; + private com.google.protobuf.Duration maxClockDrift_; + /** + *
+   * defines how much new (untrusted) header's Time can drift into the future.
+   * 
+ * + * .google.protobuf.Duration max_clock_drift = 5 [json_name = "maxClockDrift", (.gogoproto.nullable) = false, (.gogoproto.stdduration) = true]; + */ + @java.lang.Override + public boolean hasMaxClockDrift() { + return maxClockDrift_ != null; + } + /** + *
+   * defines how much new (untrusted) header's Time can drift into the future.
+   * 
+ * + * .google.protobuf.Duration max_clock_drift = 5 [json_name = "maxClockDrift", (.gogoproto.nullable) = false, (.gogoproto.stdduration) = true]; + */ + @java.lang.Override + public com.google.protobuf.Duration getMaxClockDrift() { + return maxClockDrift_ == null ? com.google.protobuf.Duration.getDefaultInstance() : maxClockDrift_; + } + /** + *
+   * defines how much new (untrusted) header's Time can drift into the future.
+   * 
+ * + * .google.protobuf.Duration max_clock_drift = 5 [json_name = "maxClockDrift", (.gogoproto.nullable) = false, (.gogoproto.stdduration) = true]; + */ + private void setMaxClockDrift(com.google.protobuf.Duration value) { + value.getClass(); + maxClockDrift_ = value; + + } + /** + *
+   * defines how much new (untrusted) header's Time can drift into the future.
+   * 
+ * + * .google.protobuf.Duration max_clock_drift = 5 [json_name = "maxClockDrift", (.gogoproto.nullable) = false, (.gogoproto.stdduration) = true]; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeMaxClockDrift(com.google.protobuf.Duration value) { + value.getClass(); + if (maxClockDrift_ != null && + maxClockDrift_ != com.google.protobuf.Duration.getDefaultInstance()) { + maxClockDrift_ = + com.google.protobuf.Duration.newBuilder(maxClockDrift_).mergeFrom(value).buildPartial(); + } else { + maxClockDrift_ = value; + } + + } + /** + *
+   * defines how much new (untrusted) header's Time can drift into the future.
+   * 
+ * + * .google.protobuf.Duration max_clock_drift = 5 [json_name = "maxClockDrift", (.gogoproto.nullable) = false, (.gogoproto.stdduration) = true]; + */ + private void clearMaxClockDrift() { maxClockDrift_ = null; + + } + + public static final int FROZEN_HEIGHT_FIELD_NUMBER = 6; + private com.ibc.core.client.v1.Height frozenHeight_; + /** + *
+   * Block height when the client was frozen due to a misbehaviour
+   * 
+ * + * .ibc.core.client.v1.Height frozen_height = 6 [json_name = "frozenHeight", (.gogoproto.nullable) = false]; + */ + @java.lang.Override + public boolean hasFrozenHeight() { + return frozenHeight_ != null; + } + /** + *
+   * Block height when the client was frozen due to a misbehaviour
+   * 
+ * + * .ibc.core.client.v1.Height frozen_height = 6 [json_name = "frozenHeight", (.gogoproto.nullable) = false]; + */ + @java.lang.Override + public com.ibc.core.client.v1.Height getFrozenHeight() { + return frozenHeight_ == null ? com.ibc.core.client.v1.Height.getDefaultInstance() : frozenHeight_; + } + /** + *
+   * Block height when the client was frozen due to a misbehaviour
+   * 
+ * + * .ibc.core.client.v1.Height frozen_height = 6 [json_name = "frozenHeight", (.gogoproto.nullable) = false]; + */ + private void setFrozenHeight(com.ibc.core.client.v1.Height value) { + value.getClass(); + frozenHeight_ = value; + + } + /** + *
+   * Block height when the client was frozen due to a misbehaviour
+   * 
+ * + * .ibc.core.client.v1.Height frozen_height = 6 [json_name = "frozenHeight", (.gogoproto.nullable) = false]; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeFrozenHeight(com.ibc.core.client.v1.Height value) { + value.getClass(); + if (frozenHeight_ != null && + frozenHeight_ != com.ibc.core.client.v1.Height.getDefaultInstance()) { + frozenHeight_ = + com.ibc.core.client.v1.Height.newBuilder(frozenHeight_).mergeFrom(value).buildPartial(); + } else { + frozenHeight_ = value; + } + + } + /** + *
+   * Block height when the client was frozen due to a misbehaviour
+   * 
+ * + * .ibc.core.client.v1.Height frozen_height = 6 [json_name = "frozenHeight", (.gogoproto.nullable) = false]; + */ + private void clearFrozenHeight() { frozenHeight_ = null; + + } + + public static final int LATEST_HEIGHT_FIELD_NUMBER = 7; + private com.ibc.core.client.v1.Height latestHeight_; + /** + *
+   * Latest height the client was updated to
+   * 
+ * + * .ibc.core.client.v1.Height latest_height = 7 [json_name = "latestHeight", (.gogoproto.nullable) = false]; + */ + @java.lang.Override + public boolean hasLatestHeight() { + return latestHeight_ != null; + } + /** + *
+   * Latest height the client was updated to
+   * 
+ * + * .ibc.core.client.v1.Height latest_height = 7 [json_name = "latestHeight", (.gogoproto.nullable) = false]; + */ + @java.lang.Override + public com.ibc.core.client.v1.Height getLatestHeight() { + return latestHeight_ == null ? com.ibc.core.client.v1.Height.getDefaultInstance() : latestHeight_; + } + /** + *
+   * Latest height the client was updated to
+   * 
+ * + * .ibc.core.client.v1.Height latest_height = 7 [json_name = "latestHeight", (.gogoproto.nullable) = false]; + */ + private void setLatestHeight(com.ibc.core.client.v1.Height value) { + value.getClass(); + latestHeight_ = value; + + } + /** + *
+   * Latest height the client was updated to
+   * 
+ * + * .ibc.core.client.v1.Height latest_height = 7 [json_name = "latestHeight", (.gogoproto.nullable) = false]; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeLatestHeight(com.ibc.core.client.v1.Height value) { + value.getClass(); + if (latestHeight_ != null && + latestHeight_ != com.ibc.core.client.v1.Height.getDefaultInstance()) { + latestHeight_ = + com.ibc.core.client.v1.Height.newBuilder(latestHeight_).mergeFrom(value).buildPartial(); + } else { + latestHeight_ = value; + } + + } + /** + *
+   * Latest height the client was updated to
+   * 
+ * + * .ibc.core.client.v1.Height latest_height = 7 [json_name = "latestHeight", (.gogoproto.nullable) = false]; + */ + private void clearLatestHeight() { latestHeight_ = null; + + } + + public static final int PROOF_SPECS_FIELD_NUMBER = 8; + private com.google.protobuf.Internal.ProtobufList proofSpecs_; + /** + *
+   * Proof specifications used in verifying counterparty state
+   * 
+ * + * repeated .cosmos.ics23.v1.ProofSpec proof_specs = 8 [json_name = "proofSpecs"]; + */ + @java.lang.Override + public java.util.List getProofSpecsList() { + return proofSpecs_; + } + /** + *
+   * Proof specifications used in verifying counterparty state
+   * 
+ * + * repeated .cosmos.ics23.v1.ProofSpec proof_specs = 8 [json_name = "proofSpecs"]; + */ + public java.util.List + getProofSpecsOrBuilderList() { + return proofSpecs_; + } + /** + *
+   * Proof specifications used in verifying counterparty state
+   * 
+ * + * repeated .cosmos.ics23.v1.ProofSpec proof_specs = 8 [json_name = "proofSpecs"]; + */ + @java.lang.Override + public int getProofSpecsCount() { + return proofSpecs_.size(); + } + /** + *
+   * Proof specifications used in verifying counterparty state
+   * 
+ * + * repeated .cosmos.ics23.v1.ProofSpec proof_specs = 8 [json_name = "proofSpecs"]; + */ + @java.lang.Override + public com.cosmos.ics23.v1.ProofSpec getProofSpecs(int index) { + return proofSpecs_.get(index); + } + /** + *
+   * Proof specifications used in verifying counterparty state
+   * 
+ * + * repeated .cosmos.ics23.v1.ProofSpec proof_specs = 8 [json_name = "proofSpecs"]; + */ + public com.cosmos.ics23.v1.ProofSpecOrBuilder getProofSpecsOrBuilder( + int index) { + return proofSpecs_.get(index); + } + private void ensureProofSpecsIsMutable() { + com.google.protobuf.Internal.ProtobufList tmp = proofSpecs_; + if (!tmp.isModifiable()) { + proofSpecs_ = + com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp); + } + } + + /** + *
+   * Proof specifications used in verifying counterparty state
+   * 
+ * + * repeated .cosmos.ics23.v1.ProofSpec proof_specs = 8 [json_name = "proofSpecs"]; + */ + private void setProofSpecs( + int index, com.cosmos.ics23.v1.ProofSpec value) { + value.getClass(); + ensureProofSpecsIsMutable(); + proofSpecs_.set(index, value); + } + /** + *
+   * Proof specifications used in verifying counterparty state
+   * 
+ * + * repeated .cosmos.ics23.v1.ProofSpec proof_specs = 8 [json_name = "proofSpecs"]; + */ + private void addProofSpecs(com.cosmos.ics23.v1.ProofSpec value) { + value.getClass(); + ensureProofSpecsIsMutable(); + proofSpecs_.add(value); + } + /** + *
+   * Proof specifications used in verifying counterparty state
+   * 
+ * + * repeated .cosmos.ics23.v1.ProofSpec proof_specs = 8 [json_name = "proofSpecs"]; + */ + private void addProofSpecs( + int index, com.cosmos.ics23.v1.ProofSpec value) { + value.getClass(); + ensureProofSpecsIsMutable(); + proofSpecs_.add(index, value); + } + /** + *
+   * Proof specifications used in verifying counterparty state
+   * 
+ * + * repeated .cosmos.ics23.v1.ProofSpec proof_specs = 8 [json_name = "proofSpecs"]; + */ + private void addAllProofSpecs( + java.lang.Iterable values) { + ensureProofSpecsIsMutable(); + com.google.protobuf.AbstractMessageLite.addAll( + values, proofSpecs_); + } + /** + *
+   * Proof specifications used in verifying counterparty state
+   * 
+ * + * repeated .cosmos.ics23.v1.ProofSpec proof_specs = 8 [json_name = "proofSpecs"]; + */ + private void clearProofSpecs() { + proofSpecs_ = emptyProtobufList(); + } + /** + *
+   * Proof specifications used in verifying counterparty state
+   * 
+ * + * repeated .cosmos.ics23.v1.ProofSpec proof_specs = 8 [json_name = "proofSpecs"]; + */ + private void removeProofSpecs(int index) { + ensureProofSpecsIsMutable(); + proofSpecs_.remove(index); + } + + public static final int UPGRADE_PATH_FIELD_NUMBER = 9; + private com.google.protobuf.Internal.ProtobufList upgradePath_; + /** + *
+   * Path at which next upgraded client will be committed.
+   * Each element corresponds to the key for a single CommitmentProof in the
+   * chained proof. NOTE: ClientState must stored under
+   * `{upgradePath}/{upgradeHeight}/clientState` ConsensusState must be stored
+   * under `{upgradepath}/{upgradeHeight}/consensusState` For SDK chains using
+   * the default upgrade module, upgrade_path should be []string{"upgrade",
+   * "upgradedIBCState"}`
+   * 
+ * + * repeated string upgrade_path = 9 [json_name = "upgradePath"]; + * @return A list containing the upgradePath. + */ + @java.lang.Override + public java.util.List getUpgradePathList() { + return upgradePath_; + } + /** + *
+   * Path at which next upgraded client will be committed.
+   * Each element corresponds to the key for a single CommitmentProof in the
+   * chained proof. NOTE: ClientState must stored under
+   * `{upgradePath}/{upgradeHeight}/clientState` ConsensusState must be stored
+   * under `{upgradepath}/{upgradeHeight}/consensusState` For SDK chains using
+   * the default upgrade module, upgrade_path should be []string{"upgrade",
+   * "upgradedIBCState"}`
+   * 
+ * + * repeated string upgrade_path = 9 [json_name = "upgradePath"]; + * @return The count of upgradePath. + */ + @java.lang.Override + public int getUpgradePathCount() { + return upgradePath_.size(); + } + /** + *
+   * Path at which next upgraded client will be committed.
+   * Each element corresponds to the key for a single CommitmentProof in the
+   * chained proof. NOTE: ClientState must stored under
+   * `{upgradePath}/{upgradeHeight}/clientState` ConsensusState must be stored
+   * under `{upgradepath}/{upgradeHeight}/consensusState` For SDK chains using
+   * the default upgrade module, upgrade_path should be []string{"upgrade",
+   * "upgradedIBCState"}`
+   * 
+ * + * repeated string upgrade_path = 9 [json_name = "upgradePath"]; + * @param index The index of the element to return. + * @return The upgradePath at the given index. + */ + @java.lang.Override + public java.lang.String getUpgradePath(int index) { + return upgradePath_.get(index); + } + /** + *
+   * Path at which next upgraded client will be committed.
+   * Each element corresponds to the key for a single CommitmentProof in the
+   * chained proof. NOTE: ClientState must stored under
+   * `{upgradePath}/{upgradeHeight}/clientState` ConsensusState must be stored
+   * under `{upgradepath}/{upgradeHeight}/consensusState` For SDK chains using
+   * the default upgrade module, upgrade_path should be []string{"upgrade",
+   * "upgradedIBCState"}`
+   * 
+ * + * repeated string upgrade_path = 9 [json_name = "upgradePath"]; + * @param index The index of the value to return. + * @return The bytes of the upgradePath at the given index. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getUpgradePathBytes(int index) { + return com.google.protobuf.ByteString.copyFromUtf8( + upgradePath_.get(index)); + } + private void ensureUpgradePathIsMutable() { + com.google.protobuf.Internal.ProtobufList tmp = + upgradePath_; if (!tmp.isModifiable()) { + upgradePath_ = + com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp); + } + } + /** + *
+   * Path at which next upgraded client will be committed.
+   * Each element corresponds to the key for a single CommitmentProof in the
+   * chained proof. NOTE: ClientState must stored under
+   * `{upgradePath}/{upgradeHeight}/clientState` ConsensusState must be stored
+   * under `{upgradepath}/{upgradeHeight}/consensusState` For SDK chains using
+   * the default upgrade module, upgrade_path should be []string{"upgrade",
+   * "upgradedIBCState"}`
+   * 
+ * + * repeated string upgrade_path = 9 [json_name = "upgradePath"]; + * @param index The index to set the value at. + * @param value The upgradePath to set. + */ + private void setUpgradePath( + int index, java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + ensureUpgradePathIsMutable(); + upgradePath_.set(index, value); + } + /** + *
+   * Path at which next upgraded client will be committed.
+   * Each element corresponds to the key for a single CommitmentProof in the
+   * chained proof. NOTE: ClientState must stored under
+   * `{upgradePath}/{upgradeHeight}/clientState` ConsensusState must be stored
+   * under `{upgradepath}/{upgradeHeight}/consensusState` For SDK chains using
+   * the default upgrade module, upgrade_path should be []string{"upgrade",
+   * "upgradedIBCState"}`
+   * 
+ * + * repeated string upgrade_path = 9 [json_name = "upgradePath"]; + * @param value The upgradePath to add. + */ + private void addUpgradePath( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + ensureUpgradePathIsMutable(); + upgradePath_.add(value); + } + /** + *
+   * Path at which next upgraded client will be committed.
+   * Each element corresponds to the key for a single CommitmentProof in the
+   * chained proof. NOTE: ClientState must stored under
+   * `{upgradePath}/{upgradeHeight}/clientState` ConsensusState must be stored
+   * under `{upgradepath}/{upgradeHeight}/consensusState` For SDK chains using
+   * the default upgrade module, upgrade_path should be []string{"upgrade",
+   * "upgradedIBCState"}`
+   * 
+ * + * repeated string upgrade_path = 9 [json_name = "upgradePath"]; + * @param values The upgradePath to add. + */ + private void addAllUpgradePath( + java.lang.Iterable values) { + ensureUpgradePathIsMutable(); + com.google.protobuf.AbstractMessageLite.addAll( + values, upgradePath_); + } + /** + *
+   * Path at which next upgraded client will be committed.
+   * Each element corresponds to the key for a single CommitmentProof in the
+   * chained proof. NOTE: ClientState must stored under
+   * `{upgradePath}/{upgradeHeight}/clientState` ConsensusState must be stored
+   * under `{upgradepath}/{upgradeHeight}/consensusState` For SDK chains using
+   * the default upgrade module, upgrade_path should be []string{"upgrade",
+   * "upgradedIBCState"}`
+   * 
+ * + * repeated string upgrade_path = 9 [json_name = "upgradePath"]; + */ + private void clearUpgradePath() { + upgradePath_ = com.google.protobuf.GeneratedMessageLite.emptyProtobufList(); + } + /** + *
+   * Path at which next upgraded client will be committed.
+   * Each element corresponds to the key for a single CommitmentProof in the
+   * chained proof. NOTE: ClientState must stored under
+   * `{upgradePath}/{upgradeHeight}/clientState` ConsensusState must be stored
+   * under `{upgradepath}/{upgradeHeight}/consensusState` For SDK chains using
+   * the default upgrade module, upgrade_path should be []string{"upgrade",
+   * "upgradedIBCState"}`
+   * 
+ * + * repeated string upgrade_path = 9 [json_name = "upgradePath"]; + * @param value The bytes of the upgradePath to add. + */ + private void addUpgradePathBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + ensureUpgradePathIsMutable(); + upgradePath_.add(value.toStringUtf8()); + } + + public static final int ALLOW_UPDATE_AFTER_EXPIRY_FIELD_NUMBER = 10; + private boolean allowUpdateAfterExpiry_; + /** + *
+   * allow_update_after_expiry is deprecated
+   * 
+ * + * bool allow_update_after_expiry = 10 [json_name = "allowUpdateAfterExpiry", deprecated = true]; + * @deprecated ibc.lightclients.tendermint.v1.ClientState.allow_update_after_expiry is deprecated. + * See clients/tendermint/TendermintLight.proto;l=47 + * @return The allowUpdateAfterExpiry. + */ + @java.lang.Override + @java.lang.Deprecated public boolean getAllowUpdateAfterExpiry() { + return allowUpdateAfterExpiry_; + } + /** + *
+   * allow_update_after_expiry is deprecated
+   * 
+ * + * bool allow_update_after_expiry = 10 [json_name = "allowUpdateAfterExpiry", deprecated = true]; + * @deprecated ibc.lightclients.tendermint.v1.ClientState.allow_update_after_expiry is deprecated. + * See clients/tendermint/TendermintLight.proto;l=47 + * @param value The allowUpdateAfterExpiry to set. + */ + private void setAllowUpdateAfterExpiry(boolean value) { + + allowUpdateAfterExpiry_ = value; + } + /** + *
+   * allow_update_after_expiry is deprecated
+   * 
+ * + * bool allow_update_after_expiry = 10 [json_name = "allowUpdateAfterExpiry", deprecated = true]; + * @deprecated ibc.lightclients.tendermint.v1.ClientState.allow_update_after_expiry is deprecated. + * See clients/tendermint/TendermintLight.proto;l=47 + */ + private void clearAllowUpdateAfterExpiry() { + + allowUpdateAfterExpiry_ = false; + } + + public static final int ALLOW_UPDATE_AFTER_MISBEHAVIOUR_FIELD_NUMBER = 11; + private boolean allowUpdateAfterMisbehaviour_; + /** + *
+   * allow_update_after_misbehaviour is deprecated
+   * 
+ * + * bool allow_update_after_misbehaviour = 11 [json_name = "allowUpdateAfterMisbehaviour", deprecated = true]; + * @deprecated ibc.lightclients.tendermint.v1.ClientState.allow_update_after_misbehaviour is deprecated. + * See clients/tendermint/TendermintLight.proto;l=49 + * @return The allowUpdateAfterMisbehaviour. + */ + @java.lang.Override + @java.lang.Deprecated public boolean getAllowUpdateAfterMisbehaviour() { + return allowUpdateAfterMisbehaviour_; + } + /** + *
+   * allow_update_after_misbehaviour is deprecated
+   * 
+ * + * bool allow_update_after_misbehaviour = 11 [json_name = "allowUpdateAfterMisbehaviour", deprecated = true]; + * @deprecated ibc.lightclients.tendermint.v1.ClientState.allow_update_after_misbehaviour is deprecated. + * See clients/tendermint/TendermintLight.proto;l=49 + * @param value The allowUpdateAfterMisbehaviour to set. + */ + private void setAllowUpdateAfterMisbehaviour(boolean value) { + + allowUpdateAfterMisbehaviour_ = value; + } + /** + *
+   * allow_update_after_misbehaviour is deprecated
+   * 
+ * + * bool allow_update_after_misbehaviour = 11 [json_name = "allowUpdateAfterMisbehaviour", deprecated = true]; + * @deprecated ibc.lightclients.tendermint.v1.ClientState.allow_update_after_misbehaviour is deprecated. + * See clients/tendermint/TendermintLight.proto;l=49 + */ + private void clearAllowUpdateAfterMisbehaviour() { + + allowUpdateAfterMisbehaviour_ = false; + } + + public static com.ibc.lightclients.tendermint.v1.ClientState parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.ibc.lightclients.tendermint.v1.ClientState parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.ibc.lightclients.tendermint.v1.ClientState parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.ibc.lightclients.tendermint.v1.ClientState parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.ibc.lightclients.tendermint.v1.ClientState parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.ibc.lightclients.tendermint.v1.ClientState parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.ibc.lightclients.tendermint.v1.ClientState parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.ibc.lightclients.tendermint.v1.ClientState parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.ibc.lightclients.tendermint.v1.ClientState parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.ibc.lightclients.tendermint.v1.ClientState parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.ibc.lightclients.tendermint.v1.ClientState parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.ibc.lightclients.tendermint.v1.ClientState parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.ibc.lightclients.tendermint.v1.ClientState prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+   * ClientState from Tendermint tracks the current validator set, latest height,
+   * and a possible frozen height.
+   * 
+ * + * Protobuf type {@code ibc.lightclients.tendermint.v1.ClientState} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.ibc.lightclients.tendermint.v1.ClientState, Builder> implements + // @@protoc_insertion_point(builder_implements:ibc.lightclients.tendermint.v1.ClientState) + com.ibc.lightclients.tendermint.v1.ClientStateOrBuilder { + // Construct using com.ibc.lightclients.tendermint.v1.ClientState.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * string chain_id = 1 [json_name = "chainId"]; + * @return The chainId. + */ + @java.lang.Override + public java.lang.String getChainId() { + return instance.getChainId(); + } + /** + * string chain_id = 1 [json_name = "chainId"]; + * @return The bytes for chainId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getChainIdBytes() { + return instance.getChainIdBytes(); + } + /** + * string chain_id = 1 [json_name = "chainId"]; + * @param value The chainId to set. + * @return This builder for chaining. + */ + public Builder setChainId( + java.lang.String value) { + copyOnWrite(); + instance.setChainId(value); + return this; + } + /** + * string chain_id = 1 [json_name = "chainId"]; + * @return This builder for chaining. + */ + public Builder clearChainId() { + copyOnWrite(); + instance.clearChainId(); + return this; + } + /** + * string chain_id = 1 [json_name = "chainId"]; + * @param value The bytes for chainId to set. + * @return This builder for chaining. + */ + public Builder setChainIdBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setChainIdBytes(value); + return this; + } + + /** + * .ibc.lightclients.tendermint.v1.Fraction trust_level = 2 [json_name = "trustLevel", (.gogoproto.nullable) = false]; + */ + @java.lang.Override + public boolean hasTrustLevel() { + return instance.hasTrustLevel(); + } + /** + * .ibc.lightclients.tendermint.v1.Fraction trust_level = 2 [json_name = "trustLevel", (.gogoproto.nullable) = false]; + */ + @java.lang.Override + public com.ibc.lightclients.tendermint.v1.Fraction getTrustLevel() { + return instance.getTrustLevel(); + } + /** + * .ibc.lightclients.tendermint.v1.Fraction trust_level = 2 [json_name = "trustLevel", (.gogoproto.nullable) = false]; + */ + public Builder setTrustLevel(com.ibc.lightclients.tendermint.v1.Fraction value) { + copyOnWrite(); + instance.setTrustLevel(value); + return this; + } + /** + * .ibc.lightclients.tendermint.v1.Fraction trust_level = 2 [json_name = "trustLevel", (.gogoproto.nullable) = false]; + */ + public Builder setTrustLevel( + com.ibc.lightclients.tendermint.v1.Fraction.Builder builderForValue) { + copyOnWrite(); + instance.setTrustLevel(builderForValue.build()); + return this; + } + /** + * .ibc.lightclients.tendermint.v1.Fraction trust_level = 2 [json_name = "trustLevel", (.gogoproto.nullable) = false]; + */ + public Builder mergeTrustLevel(com.ibc.lightclients.tendermint.v1.Fraction value) { + copyOnWrite(); + instance.mergeTrustLevel(value); + return this; + } + /** + * .ibc.lightclients.tendermint.v1.Fraction trust_level = 2 [json_name = "trustLevel", (.gogoproto.nullable) = false]; + */ + public Builder clearTrustLevel() { copyOnWrite(); + instance.clearTrustLevel(); + return this; + } + + /** + *
+     * duration of the period since the LastestTimestamp during which the
+     * submitted headers are valid for upgrade
+     * 
+ * + * .google.protobuf.Duration trusting_period = 3 [json_name = "trustingPeriod", (.gogoproto.nullable) = false, (.gogoproto.stdduration) = true]; + */ + @java.lang.Override + public boolean hasTrustingPeriod() { + return instance.hasTrustingPeriod(); + } + /** + *
+     * duration of the period since the LastestTimestamp during which the
+     * submitted headers are valid for upgrade
+     * 
+ * + * .google.protobuf.Duration trusting_period = 3 [json_name = "trustingPeriod", (.gogoproto.nullable) = false, (.gogoproto.stdduration) = true]; + */ + @java.lang.Override + public com.google.protobuf.Duration getTrustingPeriod() { + return instance.getTrustingPeriod(); + } + /** + *
+     * duration of the period since the LastestTimestamp during which the
+     * submitted headers are valid for upgrade
+     * 
+ * + * .google.protobuf.Duration trusting_period = 3 [json_name = "trustingPeriod", (.gogoproto.nullable) = false, (.gogoproto.stdduration) = true]; + */ + public Builder setTrustingPeriod(com.google.protobuf.Duration value) { + copyOnWrite(); + instance.setTrustingPeriod(value); + return this; + } + /** + *
+     * duration of the period since the LastestTimestamp during which the
+     * submitted headers are valid for upgrade
+     * 
+ * + * .google.protobuf.Duration trusting_period = 3 [json_name = "trustingPeriod", (.gogoproto.nullable) = false, (.gogoproto.stdduration) = true]; + */ + public Builder setTrustingPeriod( + com.google.protobuf.Duration.Builder builderForValue) { + copyOnWrite(); + instance.setTrustingPeriod(builderForValue.build()); + return this; + } + /** + *
+     * duration of the period since the LastestTimestamp during which the
+     * submitted headers are valid for upgrade
+     * 
+ * + * .google.protobuf.Duration trusting_period = 3 [json_name = "trustingPeriod", (.gogoproto.nullable) = false, (.gogoproto.stdduration) = true]; + */ + public Builder mergeTrustingPeriod(com.google.protobuf.Duration value) { + copyOnWrite(); + instance.mergeTrustingPeriod(value); + return this; + } + /** + *
+     * duration of the period since the LastestTimestamp during which the
+     * submitted headers are valid for upgrade
+     * 
+ * + * .google.protobuf.Duration trusting_period = 3 [json_name = "trustingPeriod", (.gogoproto.nullable) = false, (.gogoproto.stdduration) = true]; + */ + public Builder clearTrustingPeriod() { copyOnWrite(); + instance.clearTrustingPeriod(); + return this; + } + + /** + *
+     * duration of the staking unbonding period
+     * 
+ * + * .google.protobuf.Duration unbonding_period = 4 [json_name = "unbondingPeriod", (.gogoproto.nullable) = false, (.gogoproto.stdduration) = true]; + */ + @java.lang.Override + public boolean hasUnbondingPeriod() { + return instance.hasUnbondingPeriod(); + } + /** + *
+     * duration of the staking unbonding period
+     * 
+ * + * .google.protobuf.Duration unbonding_period = 4 [json_name = "unbondingPeriod", (.gogoproto.nullable) = false, (.gogoproto.stdduration) = true]; + */ + @java.lang.Override + public com.google.protobuf.Duration getUnbondingPeriod() { + return instance.getUnbondingPeriod(); + } + /** + *
+     * duration of the staking unbonding period
+     * 
+ * + * .google.protobuf.Duration unbonding_period = 4 [json_name = "unbondingPeriod", (.gogoproto.nullable) = false, (.gogoproto.stdduration) = true]; + */ + public Builder setUnbondingPeriod(com.google.protobuf.Duration value) { + copyOnWrite(); + instance.setUnbondingPeriod(value); + return this; + } + /** + *
+     * duration of the staking unbonding period
+     * 
+ * + * .google.protobuf.Duration unbonding_period = 4 [json_name = "unbondingPeriod", (.gogoproto.nullable) = false, (.gogoproto.stdduration) = true]; + */ + public Builder setUnbondingPeriod( + com.google.protobuf.Duration.Builder builderForValue) { + copyOnWrite(); + instance.setUnbondingPeriod(builderForValue.build()); + return this; + } + /** + *
+     * duration of the staking unbonding period
+     * 
+ * + * .google.protobuf.Duration unbonding_period = 4 [json_name = "unbondingPeriod", (.gogoproto.nullable) = false, (.gogoproto.stdduration) = true]; + */ + public Builder mergeUnbondingPeriod(com.google.protobuf.Duration value) { + copyOnWrite(); + instance.mergeUnbondingPeriod(value); + return this; + } + /** + *
+     * duration of the staking unbonding period
+     * 
+ * + * .google.protobuf.Duration unbonding_period = 4 [json_name = "unbondingPeriod", (.gogoproto.nullable) = false, (.gogoproto.stdduration) = true]; + */ + public Builder clearUnbondingPeriod() { copyOnWrite(); + instance.clearUnbondingPeriod(); + return this; + } + + /** + *
+     * defines how much new (untrusted) header's Time can drift into the future.
+     * 
+ * + * .google.protobuf.Duration max_clock_drift = 5 [json_name = "maxClockDrift", (.gogoproto.nullable) = false, (.gogoproto.stdduration) = true]; + */ + @java.lang.Override + public boolean hasMaxClockDrift() { + return instance.hasMaxClockDrift(); + } + /** + *
+     * defines how much new (untrusted) header's Time can drift into the future.
+     * 
+ * + * .google.protobuf.Duration max_clock_drift = 5 [json_name = "maxClockDrift", (.gogoproto.nullable) = false, (.gogoproto.stdduration) = true]; + */ + @java.lang.Override + public com.google.protobuf.Duration getMaxClockDrift() { + return instance.getMaxClockDrift(); + } + /** + *
+     * defines how much new (untrusted) header's Time can drift into the future.
+     * 
+ * + * .google.protobuf.Duration max_clock_drift = 5 [json_name = "maxClockDrift", (.gogoproto.nullable) = false, (.gogoproto.stdduration) = true]; + */ + public Builder setMaxClockDrift(com.google.protobuf.Duration value) { + copyOnWrite(); + instance.setMaxClockDrift(value); + return this; + } + /** + *
+     * defines how much new (untrusted) header's Time can drift into the future.
+     * 
+ * + * .google.protobuf.Duration max_clock_drift = 5 [json_name = "maxClockDrift", (.gogoproto.nullable) = false, (.gogoproto.stdduration) = true]; + */ + public Builder setMaxClockDrift( + com.google.protobuf.Duration.Builder builderForValue) { + copyOnWrite(); + instance.setMaxClockDrift(builderForValue.build()); + return this; + } + /** + *
+     * defines how much new (untrusted) header's Time can drift into the future.
+     * 
+ * + * .google.protobuf.Duration max_clock_drift = 5 [json_name = "maxClockDrift", (.gogoproto.nullable) = false, (.gogoproto.stdduration) = true]; + */ + public Builder mergeMaxClockDrift(com.google.protobuf.Duration value) { + copyOnWrite(); + instance.mergeMaxClockDrift(value); + return this; + } + /** + *
+     * defines how much new (untrusted) header's Time can drift into the future.
+     * 
+ * + * .google.protobuf.Duration max_clock_drift = 5 [json_name = "maxClockDrift", (.gogoproto.nullable) = false, (.gogoproto.stdduration) = true]; + */ + public Builder clearMaxClockDrift() { copyOnWrite(); + instance.clearMaxClockDrift(); + return this; + } + + /** + *
+     * Block height when the client was frozen due to a misbehaviour
+     * 
+ * + * .ibc.core.client.v1.Height frozen_height = 6 [json_name = "frozenHeight", (.gogoproto.nullable) = false]; + */ + @java.lang.Override + public boolean hasFrozenHeight() { + return instance.hasFrozenHeight(); + } + /** + *
+     * Block height when the client was frozen due to a misbehaviour
+     * 
+ * + * .ibc.core.client.v1.Height frozen_height = 6 [json_name = "frozenHeight", (.gogoproto.nullable) = false]; + */ + @java.lang.Override + public com.ibc.core.client.v1.Height getFrozenHeight() { + return instance.getFrozenHeight(); + } + /** + *
+     * Block height when the client was frozen due to a misbehaviour
+     * 
+ * + * .ibc.core.client.v1.Height frozen_height = 6 [json_name = "frozenHeight", (.gogoproto.nullable) = false]; + */ + public Builder setFrozenHeight(com.ibc.core.client.v1.Height value) { + copyOnWrite(); + instance.setFrozenHeight(value); + return this; + } + /** + *
+     * Block height when the client was frozen due to a misbehaviour
+     * 
+ * + * .ibc.core.client.v1.Height frozen_height = 6 [json_name = "frozenHeight", (.gogoproto.nullable) = false]; + */ + public Builder setFrozenHeight( + com.ibc.core.client.v1.Height.Builder builderForValue) { + copyOnWrite(); + instance.setFrozenHeight(builderForValue.build()); + return this; + } + /** + *
+     * Block height when the client was frozen due to a misbehaviour
+     * 
+ * + * .ibc.core.client.v1.Height frozen_height = 6 [json_name = "frozenHeight", (.gogoproto.nullable) = false]; + */ + public Builder mergeFrozenHeight(com.ibc.core.client.v1.Height value) { + copyOnWrite(); + instance.mergeFrozenHeight(value); + return this; + } + /** + *
+     * Block height when the client was frozen due to a misbehaviour
+     * 
+ * + * .ibc.core.client.v1.Height frozen_height = 6 [json_name = "frozenHeight", (.gogoproto.nullable) = false]; + */ + public Builder clearFrozenHeight() { copyOnWrite(); + instance.clearFrozenHeight(); + return this; + } + + /** + *
+     * Latest height the client was updated to
+     * 
+ * + * .ibc.core.client.v1.Height latest_height = 7 [json_name = "latestHeight", (.gogoproto.nullable) = false]; + */ + @java.lang.Override + public boolean hasLatestHeight() { + return instance.hasLatestHeight(); + } + /** + *
+     * Latest height the client was updated to
+     * 
+ * + * .ibc.core.client.v1.Height latest_height = 7 [json_name = "latestHeight", (.gogoproto.nullable) = false]; + */ + @java.lang.Override + public com.ibc.core.client.v1.Height getLatestHeight() { + return instance.getLatestHeight(); + } + /** + *
+     * Latest height the client was updated to
+     * 
+ * + * .ibc.core.client.v1.Height latest_height = 7 [json_name = "latestHeight", (.gogoproto.nullable) = false]; + */ + public Builder setLatestHeight(com.ibc.core.client.v1.Height value) { + copyOnWrite(); + instance.setLatestHeight(value); + return this; + } + /** + *
+     * Latest height the client was updated to
+     * 
+ * + * .ibc.core.client.v1.Height latest_height = 7 [json_name = "latestHeight", (.gogoproto.nullable) = false]; + */ + public Builder setLatestHeight( + com.ibc.core.client.v1.Height.Builder builderForValue) { + copyOnWrite(); + instance.setLatestHeight(builderForValue.build()); + return this; + } + /** + *
+     * Latest height the client was updated to
+     * 
+ * + * .ibc.core.client.v1.Height latest_height = 7 [json_name = "latestHeight", (.gogoproto.nullable) = false]; + */ + public Builder mergeLatestHeight(com.ibc.core.client.v1.Height value) { + copyOnWrite(); + instance.mergeLatestHeight(value); + return this; + } + /** + *
+     * Latest height the client was updated to
+     * 
+ * + * .ibc.core.client.v1.Height latest_height = 7 [json_name = "latestHeight", (.gogoproto.nullable) = false]; + */ + public Builder clearLatestHeight() { copyOnWrite(); + instance.clearLatestHeight(); + return this; + } + + /** + *
+     * Proof specifications used in verifying counterparty state
+     * 
+ * + * repeated .cosmos.ics23.v1.ProofSpec proof_specs = 8 [json_name = "proofSpecs"]; + */ + @java.lang.Override + public java.util.List getProofSpecsList() { + return java.util.Collections.unmodifiableList( + instance.getProofSpecsList()); + } + /** + *
+     * Proof specifications used in verifying counterparty state
+     * 
+ * + * repeated .cosmos.ics23.v1.ProofSpec proof_specs = 8 [json_name = "proofSpecs"]; + */ + @java.lang.Override + public int getProofSpecsCount() { + return instance.getProofSpecsCount(); + }/** + *
+     * Proof specifications used in verifying counterparty state
+     * 
+ * + * repeated .cosmos.ics23.v1.ProofSpec proof_specs = 8 [json_name = "proofSpecs"]; + */ + @java.lang.Override + public com.cosmos.ics23.v1.ProofSpec getProofSpecs(int index) { + return instance.getProofSpecs(index); + } + /** + *
+     * Proof specifications used in verifying counterparty state
+     * 
+ * + * repeated .cosmos.ics23.v1.ProofSpec proof_specs = 8 [json_name = "proofSpecs"]; + */ + public Builder setProofSpecs( + int index, com.cosmos.ics23.v1.ProofSpec value) { + copyOnWrite(); + instance.setProofSpecs(index, value); + return this; + } + /** + *
+     * Proof specifications used in verifying counterparty state
+     * 
+ * + * repeated .cosmos.ics23.v1.ProofSpec proof_specs = 8 [json_name = "proofSpecs"]; + */ + public Builder setProofSpecs( + int index, com.cosmos.ics23.v1.ProofSpec.Builder builderForValue) { + copyOnWrite(); + instance.setProofSpecs(index, + builderForValue.build()); + return this; + } + /** + *
+     * Proof specifications used in verifying counterparty state
+     * 
+ * + * repeated .cosmos.ics23.v1.ProofSpec proof_specs = 8 [json_name = "proofSpecs"]; + */ + public Builder addProofSpecs(com.cosmos.ics23.v1.ProofSpec value) { + copyOnWrite(); + instance.addProofSpecs(value); + return this; + } + /** + *
+     * Proof specifications used in verifying counterparty state
+     * 
+ * + * repeated .cosmos.ics23.v1.ProofSpec proof_specs = 8 [json_name = "proofSpecs"]; + */ + public Builder addProofSpecs( + int index, com.cosmos.ics23.v1.ProofSpec value) { + copyOnWrite(); + instance.addProofSpecs(index, value); + return this; + } + /** + *
+     * Proof specifications used in verifying counterparty state
+     * 
+ * + * repeated .cosmos.ics23.v1.ProofSpec proof_specs = 8 [json_name = "proofSpecs"]; + */ + public Builder addProofSpecs( + com.cosmos.ics23.v1.ProofSpec.Builder builderForValue) { + copyOnWrite(); + instance.addProofSpecs(builderForValue.build()); + return this; + } + /** + *
+     * Proof specifications used in verifying counterparty state
+     * 
+ * + * repeated .cosmos.ics23.v1.ProofSpec proof_specs = 8 [json_name = "proofSpecs"]; + */ + public Builder addProofSpecs( + int index, com.cosmos.ics23.v1.ProofSpec.Builder builderForValue) { + copyOnWrite(); + instance.addProofSpecs(index, + builderForValue.build()); + return this; + } + /** + *
+     * Proof specifications used in verifying counterparty state
+     * 
+ * + * repeated .cosmos.ics23.v1.ProofSpec proof_specs = 8 [json_name = "proofSpecs"]; + */ + public Builder addAllProofSpecs( + java.lang.Iterable values) { + copyOnWrite(); + instance.addAllProofSpecs(values); + return this; + } + /** + *
+     * Proof specifications used in verifying counterparty state
+     * 
+ * + * repeated .cosmos.ics23.v1.ProofSpec proof_specs = 8 [json_name = "proofSpecs"]; + */ + public Builder clearProofSpecs() { + copyOnWrite(); + instance.clearProofSpecs(); + return this; + } + /** + *
+     * Proof specifications used in verifying counterparty state
+     * 
+ * + * repeated .cosmos.ics23.v1.ProofSpec proof_specs = 8 [json_name = "proofSpecs"]; + */ + public Builder removeProofSpecs(int index) { + copyOnWrite(); + instance.removeProofSpecs(index); + return this; + } + + /** + *
+     * Path at which next upgraded client will be committed.
+     * Each element corresponds to the key for a single CommitmentProof in the
+     * chained proof. NOTE: ClientState must stored under
+     * `{upgradePath}/{upgradeHeight}/clientState` ConsensusState must be stored
+     * under `{upgradepath}/{upgradeHeight}/consensusState` For SDK chains using
+     * the default upgrade module, upgrade_path should be []string{"upgrade",
+     * "upgradedIBCState"}`
+     * 
+ * + * repeated string upgrade_path = 9 [json_name = "upgradePath"]; + * @return A list containing the upgradePath. + */ + @java.lang.Override + public java.util.List + getUpgradePathList() { + return java.util.Collections.unmodifiableList( + instance.getUpgradePathList()); + } + /** + *
+     * Path at which next upgraded client will be committed.
+     * Each element corresponds to the key for a single CommitmentProof in the
+     * chained proof. NOTE: ClientState must stored under
+     * `{upgradePath}/{upgradeHeight}/clientState` ConsensusState must be stored
+     * under `{upgradepath}/{upgradeHeight}/consensusState` For SDK chains using
+     * the default upgrade module, upgrade_path should be []string{"upgrade",
+     * "upgradedIBCState"}`
+     * 
+ * + * repeated string upgrade_path = 9 [json_name = "upgradePath"]; + * @return The count of upgradePath. + */ + @java.lang.Override + public int getUpgradePathCount() { + return instance.getUpgradePathCount(); + } + /** + *
+     * Path at which next upgraded client will be committed.
+     * Each element corresponds to the key for a single CommitmentProof in the
+     * chained proof. NOTE: ClientState must stored under
+     * `{upgradePath}/{upgradeHeight}/clientState` ConsensusState must be stored
+     * under `{upgradepath}/{upgradeHeight}/consensusState` For SDK chains using
+     * the default upgrade module, upgrade_path should be []string{"upgrade",
+     * "upgradedIBCState"}`
+     * 
+ * + * repeated string upgrade_path = 9 [json_name = "upgradePath"]; + * @param index The index of the element to return. + * @return The upgradePath at the given index. + */ + @java.lang.Override + public java.lang.String getUpgradePath(int index) { + return instance.getUpgradePath(index); + } + /** + *
+     * Path at which next upgraded client will be committed.
+     * Each element corresponds to the key for a single CommitmentProof in the
+     * chained proof. NOTE: ClientState must stored under
+     * `{upgradePath}/{upgradeHeight}/clientState` ConsensusState must be stored
+     * under `{upgradepath}/{upgradeHeight}/consensusState` For SDK chains using
+     * the default upgrade module, upgrade_path should be []string{"upgrade",
+     * "upgradedIBCState"}`
+     * 
+ * + * repeated string upgrade_path = 9 [json_name = "upgradePath"]; + * @param index The index of the value to return. + * @return The bytes of the upgradePath at the given index. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getUpgradePathBytes(int index) { + return instance.getUpgradePathBytes(index); + } + /** + *
+     * Path at which next upgraded client will be committed.
+     * Each element corresponds to the key for a single CommitmentProof in the
+     * chained proof. NOTE: ClientState must stored under
+     * `{upgradePath}/{upgradeHeight}/clientState` ConsensusState must be stored
+     * under `{upgradepath}/{upgradeHeight}/consensusState` For SDK chains using
+     * the default upgrade module, upgrade_path should be []string{"upgrade",
+     * "upgradedIBCState"}`
+     * 
+ * + * repeated string upgrade_path = 9 [json_name = "upgradePath"]; + * @param index The index to set the value at. + * @param value The upgradePath to set. + * @return This builder for chaining. + */ + public Builder setUpgradePath( + int index, java.lang.String value) { + copyOnWrite(); + instance.setUpgradePath(index, value); + return this; + } + /** + *
+     * Path at which next upgraded client will be committed.
+     * Each element corresponds to the key for a single CommitmentProof in the
+     * chained proof. NOTE: ClientState must stored under
+     * `{upgradePath}/{upgradeHeight}/clientState` ConsensusState must be stored
+     * under `{upgradepath}/{upgradeHeight}/consensusState` For SDK chains using
+     * the default upgrade module, upgrade_path should be []string{"upgrade",
+     * "upgradedIBCState"}`
+     * 
+ * + * repeated string upgrade_path = 9 [json_name = "upgradePath"]; + * @param value The upgradePath to add. + * @return This builder for chaining. + */ + public Builder addUpgradePath( + java.lang.String value) { + copyOnWrite(); + instance.addUpgradePath(value); + return this; + } + /** + *
+     * Path at which next upgraded client will be committed.
+     * Each element corresponds to the key for a single CommitmentProof in the
+     * chained proof. NOTE: ClientState must stored under
+     * `{upgradePath}/{upgradeHeight}/clientState` ConsensusState must be stored
+     * under `{upgradepath}/{upgradeHeight}/consensusState` For SDK chains using
+     * the default upgrade module, upgrade_path should be []string{"upgrade",
+     * "upgradedIBCState"}`
+     * 
+ * + * repeated string upgrade_path = 9 [json_name = "upgradePath"]; + * @param values The upgradePath to add. + * @return This builder for chaining. + */ + public Builder addAllUpgradePath( + java.lang.Iterable values) { + copyOnWrite(); + instance.addAllUpgradePath(values); + return this; + } + /** + *
+     * Path at which next upgraded client will be committed.
+     * Each element corresponds to the key for a single CommitmentProof in the
+     * chained proof. NOTE: ClientState must stored under
+     * `{upgradePath}/{upgradeHeight}/clientState` ConsensusState must be stored
+     * under `{upgradepath}/{upgradeHeight}/consensusState` For SDK chains using
+     * the default upgrade module, upgrade_path should be []string{"upgrade",
+     * "upgradedIBCState"}`
+     * 
+ * + * repeated string upgrade_path = 9 [json_name = "upgradePath"]; + * @return This builder for chaining. + */ + public Builder clearUpgradePath() { + copyOnWrite(); + instance.clearUpgradePath(); + return this; + } + /** + *
+     * Path at which next upgraded client will be committed.
+     * Each element corresponds to the key for a single CommitmentProof in the
+     * chained proof. NOTE: ClientState must stored under
+     * `{upgradePath}/{upgradeHeight}/clientState` ConsensusState must be stored
+     * under `{upgradepath}/{upgradeHeight}/consensusState` For SDK chains using
+     * the default upgrade module, upgrade_path should be []string{"upgrade",
+     * "upgradedIBCState"}`
+     * 
+ * + * repeated string upgrade_path = 9 [json_name = "upgradePath"]; + * @param value The bytes of the upgradePath to add. + * @return This builder for chaining. + */ + public Builder addUpgradePathBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.addUpgradePathBytes(value); + return this; + } + + /** + *
+     * allow_update_after_expiry is deprecated
+     * 
+ * + * bool allow_update_after_expiry = 10 [json_name = "allowUpdateAfterExpiry", deprecated = true]; + * @deprecated ibc.lightclients.tendermint.v1.ClientState.allow_update_after_expiry is deprecated. + * See clients/tendermint/TendermintLight.proto;l=47 + * @return The allowUpdateAfterExpiry. + */ + @java.lang.Override + @java.lang.Deprecated public boolean getAllowUpdateAfterExpiry() { + return instance.getAllowUpdateAfterExpiry(); + } + /** + *
+     * allow_update_after_expiry is deprecated
+     * 
+ * + * bool allow_update_after_expiry = 10 [json_name = "allowUpdateAfterExpiry", deprecated = true]; + * @deprecated ibc.lightclients.tendermint.v1.ClientState.allow_update_after_expiry is deprecated. + * See clients/tendermint/TendermintLight.proto;l=47 + * @param value The allowUpdateAfterExpiry to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated public Builder setAllowUpdateAfterExpiry(boolean value) { + copyOnWrite(); + instance.setAllowUpdateAfterExpiry(value); + return this; + } + /** + *
+     * allow_update_after_expiry is deprecated
+     * 
+ * + * bool allow_update_after_expiry = 10 [json_name = "allowUpdateAfterExpiry", deprecated = true]; + * @deprecated ibc.lightclients.tendermint.v1.ClientState.allow_update_after_expiry is deprecated. + * See clients/tendermint/TendermintLight.proto;l=47 + * @return This builder for chaining. + */ + @java.lang.Deprecated public Builder clearAllowUpdateAfterExpiry() { + copyOnWrite(); + instance.clearAllowUpdateAfterExpiry(); + return this; + } + + /** + *
+     * allow_update_after_misbehaviour is deprecated
+     * 
+ * + * bool allow_update_after_misbehaviour = 11 [json_name = "allowUpdateAfterMisbehaviour", deprecated = true]; + * @deprecated ibc.lightclients.tendermint.v1.ClientState.allow_update_after_misbehaviour is deprecated. + * See clients/tendermint/TendermintLight.proto;l=49 + * @return The allowUpdateAfterMisbehaviour. + */ + @java.lang.Override + @java.lang.Deprecated public boolean getAllowUpdateAfterMisbehaviour() { + return instance.getAllowUpdateAfterMisbehaviour(); + } + /** + *
+     * allow_update_after_misbehaviour is deprecated
+     * 
+ * + * bool allow_update_after_misbehaviour = 11 [json_name = "allowUpdateAfterMisbehaviour", deprecated = true]; + * @deprecated ibc.lightclients.tendermint.v1.ClientState.allow_update_after_misbehaviour is deprecated. + * See clients/tendermint/TendermintLight.proto;l=49 + * @param value The allowUpdateAfterMisbehaviour to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated public Builder setAllowUpdateAfterMisbehaviour(boolean value) { + copyOnWrite(); + instance.setAllowUpdateAfterMisbehaviour(value); + return this; + } + /** + *
+     * allow_update_after_misbehaviour is deprecated
+     * 
+ * + * bool allow_update_after_misbehaviour = 11 [json_name = "allowUpdateAfterMisbehaviour", deprecated = true]; + * @deprecated ibc.lightclients.tendermint.v1.ClientState.allow_update_after_misbehaviour is deprecated. + * See clients/tendermint/TendermintLight.proto;l=49 + * @return This builder for chaining. + */ + @java.lang.Deprecated public Builder clearAllowUpdateAfterMisbehaviour() { + copyOnWrite(); + instance.clearAllowUpdateAfterMisbehaviour(); + return this; + } + + // @@protoc_insertion_point(builder_scope:ibc.lightclients.tendermint.v1.ClientState) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.ibc.lightclients.tendermint.v1.ClientState(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "chainId_", + "trustLevel_", + "trustingPeriod_", + "unbondingPeriod_", + "maxClockDrift_", + "frozenHeight_", + "latestHeight_", + "proofSpecs_", + com.cosmos.ics23.v1.ProofSpec.class, + "upgradePath_", + "allowUpdateAfterExpiry_", + "allowUpdateAfterMisbehaviour_", + }; + java.lang.String info = + "\u0000\u000b\u0000\u0000\u0001\u000b\u000b\u0000\u0002\u0000\u0001\u0208\u0002\t" + + "\u0003\t\u0004\t\u0005\t\u0006\t\u0007\t\b\u001b\t\u021a\n\u0007\u000b\u0007"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.ibc.lightclients.tendermint.v1.ClientState.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:ibc.lightclients.tendermint.v1.ClientState) + private static final com.ibc.lightclients.tendermint.v1.ClientState DEFAULT_INSTANCE; + static { + ClientState defaultInstance = new ClientState(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + ClientState.class, defaultInstance); + } + + public static com.ibc.lightclients.tendermint.v1.ClientState getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/lightclients/tendermint/v1/ClientStateOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/lightclients/tendermint/v1/ClientStateOrBuilder.java new file mode 100644 index 000000000..c0b655b51 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/lightclients/tendermint/v1/ClientStateOrBuilder.java @@ -0,0 +1,244 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: clients/tendermint/TendermintLight.proto + +package com.ibc.lightclients.tendermint.v1; + +public interface ClientStateOrBuilder extends + // @@protoc_insertion_point(interface_extends:ibc.lightclients.tendermint.v1.ClientState) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * string chain_id = 1 [json_name = "chainId"]; + * @return The chainId. + */ + java.lang.String getChainId(); + /** + * string chain_id = 1 [json_name = "chainId"]; + * @return The bytes for chainId. + */ + com.google.protobuf.ByteString + getChainIdBytes(); + + /** + * .ibc.lightclients.tendermint.v1.Fraction trust_level = 2 [json_name = "trustLevel", (.gogoproto.nullable) = false]; + * @return Whether the trustLevel field is set. + */ + boolean hasTrustLevel(); + /** + * .ibc.lightclients.tendermint.v1.Fraction trust_level = 2 [json_name = "trustLevel", (.gogoproto.nullable) = false]; + * @return The trustLevel. + */ + com.ibc.lightclients.tendermint.v1.Fraction getTrustLevel(); + + /** + *
+   * duration of the period since the LastestTimestamp during which the
+   * submitted headers are valid for upgrade
+   * 
+ * + * .google.protobuf.Duration trusting_period = 3 [json_name = "trustingPeriod", (.gogoproto.nullable) = false, (.gogoproto.stdduration) = true]; + * @return Whether the trustingPeriod field is set. + */ + boolean hasTrustingPeriod(); + /** + *
+   * duration of the period since the LastestTimestamp during which the
+   * submitted headers are valid for upgrade
+   * 
+ * + * .google.protobuf.Duration trusting_period = 3 [json_name = "trustingPeriod", (.gogoproto.nullable) = false, (.gogoproto.stdduration) = true]; + * @return The trustingPeriod. + */ + com.google.protobuf.Duration getTrustingPeriod(); + + /** + *
+   * duration of the staking unbonding period
+   * 
+ * + * .google.protobuf.Duration unbonding_period = 4 [json_name = "unbondingPeriod", (.gogoproto.nullable) = false, (.gogoproto.stdduration) = true]; + * @return Whether the unbondingPeriod field is set. + */ + boolean hasUnbondingPeriod(); + /** + *
+   * duration of the staking unbonding period
+   * 
+ * + * .google.protobuf.Duration unbonding_period = 4 [json_name = "unbondingPeriod", (.gogoproto.nullable) = false, (.gogoproto.stdduration) = true]; + * @return The unbondingPeriod. + */ + com.google.protobuf.Duration getUnbondingPeriod(); + + /** + *
+   * defines how much new (untrusted) header's Time can drift into the future.
+   * 
+ * + * .google.protobuf.Duration max_clock_drift = 5 [json_name = "maxClockDrift", (.gogoproto.nullable) = false, (.gogoproto.stdduration) = true]; + * @return Whether the maxClockDrift field is set. + */ + boolean hasMaxClockDrift(); + /** + *
+   * defines how much new (untrusted) header's Time can drift into the future.
+   * 
+ * + * .google.protobuf.Duration max_clock_drift = 5 [json_name = "maxClockDrift", (.gogoproto.nullable) = false, (.gogoproto.stdduration) = true]; + * @return The maxClockDrift. + */ + com.google.protobuf.Duration getMaxClockDrift(); + + /** + *
+   * Block height when the client was frozen due to a misbehaviour
+   * 
+ * + * .ibc.core.client.v1.Height frozen_height = 6 [json_name = "frozenHeight", (.gogoproto.nullable) = false]; + * @return Whether the frozenHeight field is set. + */ + boolean hasFrozenHeight(); + /** + *
+   * Block height when the client was frozen due to a misbehaviour
+   * 
+ * + * .ibc.core.client.v1.Height frozen_height = 6 [json_name = "frozenHeight", (.gogoproto.nullable) = false]; + * @return The frozenHeight. + */ + com.ibc.core.client.v1.Height getFrozenHeight(); + + /** + *
+   * Latest height the client was updated to
+   * 
+ * + * .ibc.core.client.v1.Height latest_height = 7 [json_name = "latestHeight", (.gogoproto.nullable) = false]; + * @return Whether the latestHeight field is set. + */ + boolean hasLatestHeight(); + /** + *
+   * Latest height the client was updated to
+   * 
+ * + * .ibc.core.client.v1.Height latest_height = 7 [json_name = "latestHeight", (.gogoproto.nullable) = false]; + * @return The latestHeight. + */ + com.ibc.core.client.v1.Height getLatestHeight(); + + /** + *
+   * Proof specifications used in verifying counterparty state
+   * 
+ * + * repeated .cosmos.ics23.v1.ProofSpec proof_specs = 8 [json_name = "proofSpecs"]; + */ + java.util.List + getProofSpecsList(); + /** + *
+   * Proof specifications used in verifying counterparty state
+   * 
+ * + * repeated .cosmos.ics23.v1.ProofSpec proof_specs = 8 [json_name = "proofSpecs"]; + */ + com.cosmos.ics23.v1.ProofSpec getProofSpecs(int index); + /** + *
+   * Proof specifications used in verifying counterparty state
+   * 
+ * + * repeated .cosmos.ics23.v1.ProofSpec proof_specs = 8 [json_name = "proofSpecs"]; + */ + int getProofSpecsCount(); + + /** + *
+   * Path at which next upgraded client will be committed.
+   * Each element corresponds to the key for a single CommitmentProof in the
+   * chained proof. NOTE: ClientState must stored under
+   * `{upgradePath}/{upgradeHeight}/clientState` ConsensusState must be stored
+   * under `{upgradepath}/{upgradeHeight}/consensusState` For SDK chains using
+   * the default upgrade module, upgrade_path should be []string{"upgrade",
+   * "upgradedIBCState"}`
+   * 
+ * + * repeated string upgrade_path = 9 [json_name = "upgradePath"]; + * @return A list containing the upgradePath. + */ + java.util.List + getUpgradePathList(); + /** + *
+   * Path at which next upgraded client will be committed.
+   * Each element corresponds to the key for a single CommitmentProof in the
+   * chained proof. NOTE: ClientState must stored under
+   * `{upgradePath}/{upgradeHeight}/clientState` ConsensusState must be stored
+   * under `{upgradepath}/{upgradeHeight}/consensusState` For SDK chains using
+   * the default upgrade module, upgrade_path should be []string{"upgrade",
+   * "upgradedIBCState"}`
+   * 
+ * + * repeated string upgrade_path = 9 [json_name = "upgradePath"]; + * @return The count of upgradePath. + */ + int getUpgradePathCount(); + /** + *
+   * Path at which next upgraded client will be committed.
+   * Each element corresponds to the key for a single CommitmentProof in the
+   * chained proof. NOTE: ClientState must stored under
+   * `{upgradePath}/{upgradeHeight}/clientState` ConsensusState must be stored
+   * under `{upgradepath}/{upgradeHeight}/consensusState` For SDK chains using
+   * the default upgrade module, upgrade_path should be []string{"upgrade",
+   * "upgradedIBCState"}`
+   * 
+ * + * repeated string upgrade_path = 9 [json_name = "upgradePath"]; + * @param index The index of the element to return. + * @return The upgradePath at the given index. + */ + java.lang.String getUpgradePath(int index); + /** + *
+   * Path at which next upgraded client will be committed.
+   * Each element corresponds to the key for a single CommitmentProof in the
+   * chained proof. NOTE: ClientState must stored under
+   * `{upgradePath}/{upgradeHeight}/clientState` ConsensusState must be stored
+   * under `{upgradepath}/{upgradeHeight}/consensusState` For SDK chains using
+   * the default upgrade module, upgrade_path should be []string{"upgrade",
+   * "upgradedIBCState"}`
+   * 
+ * + * repeated string upgrade_path = 9 [json_name = "upgradePath"]; + * @param index The index of the element to return. + * @return The upgradePath at the given index. + */ + com.google.protobuf.ByteString + getUpgradePathBytes(int index); + + /** + *
+   * allow_update_after_expiry is deprecated
+   * 
+ * + * bool allow_update_after_expiry = 10 [json_name = "allowUpdateAfterExpiry", deprecated = true]; + * @deprecated ibc.lightclients.tendermint.v1.ClientState.allow_update_after_expiry is deprecated. + * See clients/tendermint/TendermintLight.proto;l=47 + * @return The allowUpdateAfterExpiry. + */ + @java.lang.Deprecated boolean getAllowUpdateAfterExpiry(); + + /** + *
+   * allow_update_after_misbehaviour is deprecated
+   * 
+ * + * bool allow_update_after_misbehaviour = 11 [json_name = "allowUpdateAfterMisbehaviour", deprecated = true]; + * @deprecated ibc.lightclients.tendermint.v1.ClientState.allow_update_after_misbehaviour is deprecated. + * See clients/tendermint/TendermintLight.proto;l=49 + * @return The allowUpdateAfterMisbehaviour. + */ + @java.lang.Deprecated boolean getAllowUpdateAfterMisbehaviour(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/lightclients/tendermint/v1/ConsensusState.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/lightclients/tendermint/v1/ConsensusState.java new file mode 100644 index 000000000..90393a79b --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/lightclients/tendermint/v1/ConsensusState.java @@ -0,0 +1,536 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: clients/tendermint/TendermintLight.proto + +package com.ibc.lightclients.tendermint.v1; + +/** + *
+ * ConsensusState defines the consensus state from Tendermint.
+ * 
+ * + * Protobuf type {@code ibc.lightclients.tendermint.v1.ConsensusState} + */ +public final class ConsensusState extends + com.google.protobuf.GeneratedMessageLite< + ConsensusState, ConsensusState.Builder> implements + // @@protoc_insertion_point(message_implements:ibc.lightclients.tendermint.v1.ConsensusState) + ConsensusStateOrBuilder { + private ConsensusState() { + nextValidatorsHash_ = com.google.protobuf.ByteString.EMPTY; + } + public static final int TIMESTAMP_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp timestamp_; + /** + *
+   * timestamp that corresponds to the block height in which the ConsensusState
+   * was stored.
+   * 
+ * + * .google.protobuf.Timestamp timestamp = 1 [json_name = "timestamp", (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true]; + */ + @java.lang.Override + public boolean hasTimestamp() { + return timestamp_ != null; + } + /** + *
+   * timestamp that corresponds to the block height in which the ConsensusState
+   * was stored.
+   * 
+ * + * .google.protobuf.Timestamp timestamp = 1 [json_name = "timestamp", (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true]; + */ + @java.lang.Override + public com.google.protobuf.Timestamp getTimestamp() { + return timestamp_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : timestamp_; + } + /** + *
+   * timestamp that corresponds to the block height in which the ConsensusState
+   * was stored.
+   * 
+ * + * .google.protobuf.Timestamp timestamp = 1 [json_name = "timestamp", (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true]; + */ + private void setTimestamp(com.google.protobuf.Timestamp value) { + value.getClass(); + timestamp_ = value; + + } + /** + *
+   * timestamp that corresponds to the block height in which the ConsensusState
+   * was stored.
+   * 
+ * + * .google.protobuf.Timestamp timestamp = 1 [json_name = "timestamp", (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true]; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeTimestamp(com.google.protobuf.Timestamp value) { + value.getClass(); + if (timestamp_ != null && + timestamp_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + timestamp_ = + com.google.protobuf.Timestamp.newBuilder(timestamp_).mergeFrom(value).buildPartial(); + } else { + timestamp_ = value; + } + + } + /** + *
+   * timestamp that corresponds to the block height in which the ConsensusState
+   * was stored.
+   * 
+ * + * .google.protobuf.Timestamp timestamp = 1 [json_name = "timestamp", (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true]; + */ + private void clearTimestamp() { timestamp_ = null; + + } + + public static final int ROOT_FIELD_NUMBER = 2; + private com.ibc.core.commitment.v1.MerkleRoot root_; + /** + *
+   * commitment root (i.e app hash)
+   * 
+ * + * .ibc.core.commitment.v1.MerkleRoot root = 2 [json_name = "root", (.gogoproto.nullable) = false]; + */ + @java.lang.Override + public boolean hasRoot() { + return root_ != null; + } + /** + *
+   * commitment root (i.e app hash)
+   * 
+ * + * .ibc.core.commitment.v1.MerkleRoot root = 2 [json_name = "root", (.gogoproto.nullable) = false]; + */ + @java.lang.Override + public com.ibc.core.commitment.v1.MerkleRoot getRoot() { + return root_ == null ? com.ibc.core.commitment.v1.MerkleRoot.getDefaultInstance() : root_; + } + /** + *
+   * commitment root (i.e app hash)
+   * 
+ * + * .ibc.core.commitment.v1.MerkleRoot root = 2 [json_name = "root", (.gogoproto.nullable) = false]; + */ + private void setRoot(com.ibc.core.commitment.v1.MerkleRoot value) { + value.getClass(); + root_ = value; + + } + /** + *
+   * commitment root (i.e app hash)
+   * 
+ * + * .ibc.core.commitment.v1.MerkleRoot root = 2 [json_name = "root", (.gogoproto.nullable) = false]; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeRoot(com.ibc.core.commitment.v1.MerkleRoot value) { + value.getClass(); + if (root_ != null && + root_ != com.ibc.core.commitment.v1.MerkleRoot.getDefaultInstance()) { + root_ = + com.ibc.core.commitment.v1.MerkleRoot.newBuilder(root_).mergeFrom(value).buildPartial(); + } else { + root_ = value; + } + + } + /** + *
+   * commitment root (i.e app hash)
+   * 
+ * + * .ibc.core.commitment.v1.MerkleRoot root = 2 [json_name = "root", (.gogoproto.nullable) = false]; + */ + private void clearRoot() { root_ = null; + + } + + public static final int NEXT_VALIDATORS_HASH_FIELD_NUMBER = 3; + private com.google.protobuf.ByteString nextValidatorsHash_; + /** + * bytes next_validators_hash = 3 [json_name = "nextValidatorsHash", (.gogoproto.casttype) = "github.com/cometbft/cometbft/libs/bytes.HexBytes"]; + * @return The nextValidatorsHash. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextValidatorsHash() { + return nextValidatorsHash_; + } + /** + * bytes next_validators_hash = 3 [json_name = "nextValidatorsHash", (.gogoproto.casttype) = "github.com/cometbft/cometbft/libs/bytes.HexBytes"]; + * @param value The nextValidatorsHash to set. + */ + private void setNextValidatorsHash(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + nextValidatorsHash_ = value; + } + /** + * bytes next_validators_hash = 3 [json_name = "nextValidatorsHash", (.gogoproto.casttype) = "github.com/cometbft/cometbft/libs/bytes.HexBytes"]; + */ + private void clearNextValidatorsHash() { + + nextValidatorsHash_ = getDefaultInstance().getNextValidatorsHash(); + } + + public static com.ibc.lightclients.tendermint.v1.ConsensusState parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.ibc.lightclients.tendermint.v1.ConsensusState parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.ibc.lightclients.tendermint.v1.ConsensusState parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.ibc.lightclients.tendermint.v1.ConsensusState parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.ibc.lightclients.tendermint.v1.ConsensusState parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.ibc.lightclients.tendermint.v1.ConsensusState parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.ibc.lightclients.tendermint.v1.ConsensusState parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.ibc.lightclients.tendermint.v1.ConsensusState parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.ibc.lightclients.tendermint.v1.ConsensusState parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.ibc.lightclients.tendermint.v1.ConsensusState parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.ibc.lightclients.tendermint.v1.ConsensusState parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.ibc.lightclients.tendermint.v1.ConsensusState parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.ibc.lightclients.tendermint.v1.ConsensusState prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+   * ConsensusState defines the consensus state from Tendermint.
+   * 
+ * + * Protobuf type {@code ibc.lightclients.tendermint.v1.ConsensusState} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.ibc.lightclients.tendermint.v1.ConsensusState, Builder> implements + // @@protoc_insertion_point(builder_implements:ibc.lightclients.tendermint.v1.ConsensusState) + com.ibc.lightclients.tendermint.v1.ConsensusStateOrBuilder { + // Construct using com.ibc.lightclients.tendermint.v1.ConsensusState.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + *
+     * timestamp that corresponds to the block height in which the ConsensusState
+     * was stored.
+     * 
+ * + * .google.protobuf.Timestamp timestamp = 1 [json_name = "timestamp", (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true]; + */ + @java.lang.Override + public boolean hasTimestamp() { + return instance.hasTimestamp(); + } + /** + *
+     * timestamp that corresponds to the block height in which the ConsensusState
+     * was stored.
+     * 
+ * + * .google.protobuf.Timestamp timestamp = 1 [json_name = "timestamp", (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true]; + */ + @java.lang.Override + public com.google.protobuf.Timestamp getTimestamp() { + return instance.getTimestamp(); + } + /** + *
+     * timestamp that corresponds to the block height in which the ConsensusState
+     * was stored.
+     * 
+ * + * .google.protobuf.Timestamp timestamp = 1 [json_name = "timestamp", (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true]; + */ + public Builder setTimestamp(com.google.protobuf.Timestamp value) { + copyOnWrite(); + instance.setTimestamp(value); + return this; + } + /** + *
+     * timestamp that corresponds to the block height in which the ConsensusState
+     * was stored.
+     * 
+ * + * .google.protobuf.Timestamp timestamp = 1 [json_name = "timestamp", (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true]; + */ + public Builder setTimestamp( + com.google.protobuf.Timestamp.Builder builderForValue) { + copyOnWrite(); + instance.setTimestamp(builderForValue.build()); + return this; + } + /** + *
+     * timestamp that corresponds to the block height in which the ConsensusState
+     * was stored.
+     * 
+ * + * .google.protobuf.Timestamp timestamp = 1 [json_name = "timestamp", (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true]; + */ + public Builder mergeTimestamp(com.google.protobuf.Timestamp value) { + copyOnWrite(); + instance.mergeTimestamp(value); + return this; + } + /** + *
+     * timestamp that corresponds to the block height in which the ConsensusState
+     * was stored.
+     * 
+ * + * .google.protobuf.Timestamp timestamp = 1 [json_name = "timestamp", (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true]; + */ + public Builder clearTimestamp() { copyOnWrite(); + instance.clearTimestamp(); + return this; + } + + /** + *
+     * commitment root (i.e app hash)
+     * 
+ * + * .ibc.core.commitment.v1.MerkleRoot root = 2 [json_name = "root", (.gogoproto.nullable) = false]; + */ + @java.lang.Override + public boolean hasRoot() { + return instance.hasRoot(); + } + /** + *
+     * commitment root (i.e app hash)
+     * 
+ * + * .ibc.core.commitment.v1.MerkleRoot root = 2 [json_name = "root", (.gogoproto.nullable) = false]; + */ + @java.lang.Override + public com.ibc.core.commitment.v1.MerkleRoot getRoot() { + return instance.getRoot(); + } + /** + *
+     * commitment root (i.e app hash)
+     * 
+ * + * .ibc.core.commitment.v1.MerkleRoot root = 2 [json_name = "root", (.gogoproto.nullable) = false]; + */ + public Builder setRoot(com.ibc.core.commitment.v1.MerkleRoot value) { + copyOnWrite(); + instance.setRoot(value); + return this; + } + /** + *
+     * commitment root (i.e app hash)
+     * 
+ * + * .ibc.core.commitment.v1.MerkleRoot root = 2 [json_name = "root", (.gogoproto.nullable) = false]; + */ + public Builder setRoot( + com.ibc.core.commitment.v1.MerkleRoot.Builder builderForValue) { + copyOnWrite(); + instance.setRoot(builderForValue.build()); + return this; + } + /** + *
+     * commitment root (i.e app hash)
+     * 
+ * + * .ibc.core.commitment.v1.MerkleRoot root = 2 [json_name = "root", (.gogoproto.nullable) = false]; + */ + public Builder mergeRoot(com.ibc.core.commitment.v1.MerkleRoot value) { + copyOnWrite(); + instance.mergeRoot(value); + return this; + } + /** + *
+     * commitment root (i.e app hash)
+     * 
+ * + * .ibc.core.commitment.v1.MerkleRoot root = 2 [json_name = "root", (.gogoproto.nullable) = false]; + */ + public Builder clearRoot() { copyOnWrite(); + instance.clearRoot(); + return this; + } + + /** + * bytes next_validators_hash = 3 [json_name = "nextValidatorsHash", (.gogoproto.casttype) = "github.com/cometbft/cometbft/libs/bytes.HexBytes"]; + * @return The nextValidatorsHash. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextValidatorsHash() { + return instance.getNextValidatorsHash(); + } + /** + * bytes next_validators_hash = 3 [json_name = "nextValidatorsHash", (.gogoproto.casttype) = "github.com/cometbft/cometbft/libs/bytes.HexBytes"]; + * @param value The nextValidatorsHash to set. + * @return This builder for chaining. + */ + public Builder setNextValidatorsHash(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setNextValidatorsHash(value); + return this; + } + /** + * bytes next_validators_hash = 3 [json_name = "nextValidatorsHash", (.gogoproto.casttype) = "github.com/cometbft/cometbft/libs/bytes.HexBytes"]; + * @return This builder for chaining. + */ + public Builder clearNextValidatorsHash() { + copyOnWrite(); + instance.clearNextValidatorsHash(); + return this; + } + + // @@protoc_insertion_point(builder_scope:ibc.lightclients.tendermint.v1.ConsensusState) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.ibc.lightclients.tendermint.v1.ConsensusState(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "timestamp_", + "root_", + "nextValidatorsHash_", + }; + java.lang.String info = + "\u0000\u0003\u0000\u0000\u0001\u0003\u0003\u0000\u0000\u0000\u0001\t\u0002\t\u0003" + + "\n"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.ibc.lightclients.tendermint.v1.ConsensusState.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:ibc.lightclients.tendermint.v1.ConsensusState) + private static final com.ibc.lightclients.tendermint.v1.ConsensusState DEFAULT_INSTANCE; + static { + ConsensusState defaultInstance = new ConsensusState(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + ConsensusState.class, defaultInstance); + } + + public static com.ibc.lightclients.tendermint.v1.ConsensusState getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/lightclients/tendermint/v1/ConsensusStateOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/lightclients/tendermint/v1/ConsensusStateOrBuilder.java new file mode 100644 index 000000000..5e2a28b8d --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/lightclients/tendermint/v1/ConsensusStateOrBuilder.java @@ -0,0 +1,55 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: clients/tendermint/TendermintLight.proto + +package com.ibc.lightclients.tendermint.v1; + +public interface ConsensusStateOrBuilder extends + // @@protoc_insertion_point(interface_extends:ibc.lightclients.tendermint.v1.ConsensusState) + com.google.protobuf.MessageLiteOrBuilder { + + /** + *
+   * timestamp that corresponds to the block height in which the ConsensusState
+   * was stored.
+   * 
+ * + * .google.protobuf.Timestamp timestamp = 1 [json_name = "timestamp", (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true]; + * @return Whether the timestamp field is set. + */ + boolean hasTimestamp(); + /** + *
+   * timestamp that corresponds to the block height in which the ConsensusState
+   * was stored.
+   * 
+ * + * .google.protobuf.Timestamp timestamp = 1 [json_name = "timestamp", (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true]; + * @return The timestamp. + */ + com.google.protobuf.Timestamp getTimestamp(); + + /** + *
+   * commitment root (i.e app hash)
+   * 
+ * + * .ibc.core.commitment.v1.MerkleRoot root = 2 [json_name = "root", (.gogoproto.nullable) = false]; + * @return Whether the root field is set. + */ + boolean hasRoot(); + /** + *
+   * commitment root (i.e app hash)
+   * 
+ * + * .ibc.core.commitment.v1.MerkleRoot root = 2 [json_name = "root", (.gogoproto.nullable) = false]; + * @return The root. + */ + com.ibc.core.commitment.v1.MerkleRoot getRoot(); + + /** + * bytes next_validators_hash = 3 [json_name = "nextValidatorsHash", (.gogoproto.casttype) = "github.com/cometbft/cometbft/libs/bytes.HexBytes"]; + * @return The nextValidatorsHash. + */ + com.google.protobuf.ByteString getNextValidatorsHash(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/lightclients/tendermint/v1/Fraction.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/lightclients/tendermint/v1/Fraction.java new file mode 100644 index 000000000..23f421469 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/lightclients/tendermint/v1/Fraction.java @@ -0,0 +1,304 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: clients/tendermint/TendermintLight.proto + +package com.ibc.lightclients.tendermint.v1; + +/** + *
+ * Fraction defines the protobuf message type for tmmath.Fraction that only
+ * supports positive values.
+ * 
+ * + * Protobuf type {@code ibc.lightclients.tendermint.v1.Fraction} + */ +public final class Fraction extends + com.google.protobuf.GeneratedMessageLite< + Fraction, Fraction.Builder> implements + // @@protoc_insertion_point(message_implements:ibc.lightclients.tendermint.v1.Fraction) + FractionOrBuilder { + private Fraction() { + } + public static final int NUMERATOR_FIELD_NUMBER = 1; + private long numerator_; + /** + * uint64 numerator = 1 [json_name = "numerator"]; + * @return The numerator. + */ + @java.lang.Override + public long getNumerator() { + return numerator_; + } + /** + * uint64 numerator = 1 [json_name = "numerator"]; + * @param value The numerator to set. + */ + private void setNumerator(long value) { + + numerator_ = value; + } + /** + * uint64 numerator = 1 [json_name = "numerator"]; + */ + private void clearNumerator() { + + numerator_ = 0L; + } + + public static final int DENOMINATOR_FIELD_NUMBER = 2; + private long denominator_; + /** + * uint64 denominator = 2 [json_name = "denominator"]; + * @return The denominator. + */ + @java.lang.Override + public long getDenominator() { + return denominator_; + } + /** + * uint64 denominator = 2 [json_name = "denominator"]; + * @param value The denominator to set. + */ + private void setDenominator(long value) { + + denominator_ = value; + } + /** + * uint64 denominator = 2 [json_name = "denominator"]; + */ + private void clearDenominator() { + + denominator_ = 0L; + } + + public static com.ibc.lightclients.tendermint.v1.Fraction parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.ibc.lightclients.tendermint.v1.Fraction parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.ibc.lightclients.tendermint.v1.Fraction parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.ibc.lightclients.tendermint.v1.Fraction parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.ibc.lightclients.tendermint.v1.Fraction parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.ibc.lightclients.tendermint.v1.Fraction parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.ibc.lightclients.tendermint.v1.Fraction parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.ibc.lightclients.tendermint.v1.Fraction parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.ibc.lightclients.tendermint.v1.Fraction parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.ibc.lightclients.tendermint.v1.Fraction parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.ibc.lightclients.tendermint.v1.Fraction parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.ibc.lightclients.tendermint.v1.Fraction parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.ibc.lightclients.tendermint.v1.Fraction prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+   * Fraction defines the protobuf message type for tmmath.Fraction that only
+   * supports positive values.
+   * 
+ * + * Protobuf type {@code ibc.lightclients.tendermint.v1.Fraction} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.ibc.lightclients.tendermint.v1.Fraction, Builder> implements + // @@protoc_insertion_point(builder_implements:ibc.lightclients.tendermint.v1.Fraction) + com.ibc.lightclients.tendermint.v1.FractionOrBuilder { + // Construct using com.ibc.lightclients.tendermint.v1.Fraction.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * uint64 numerator = 1 [json_name = "numerator"]; + * @return The numerator. + */ + @java.lang.Override + public long getNumerator() { + return instance.getNumerator(); + } + /** + * uint64 numerator = 1 [json_name = "numerator"]; + * @param value The numerator to set. + * @return This builder for chaining. + */ + public Builder setNumerator(long value) { + copyOnWrite(); + instance.setNumerator(value); + return this; + } + /** + * uint64 numerator = 1 [json_name = "numerator"]; + * @return This builder for chaining. + */ + public Builder clearNumerator() { + copyOnWrite(); + instance.clearNumerator(); + return this; + } + + /** + * uint64 denominator = 2 [json_name = "denominator"]; + * @return The denominator. + */ + @java.lang.Override + public long getDenominator() { + return instance.getDenominator(); + } + /** + * uint64 denominator = 2 [json_name = "denominator"]; + * @param value The denominator to set. + * @return This builder for chaining. + */ + public Builder setDenominator(long value) { + copyOnWrite(); + instance.setDenominator(value); + return this; + } + /** + * uint64 denominator = 2 [json_name = "denominator"]; + * @return This builder for chaining. + */ + public Builder clearDenominator() { + copyOnWrite(); + instance.clearDenominator(); + return this; + } + + // @@protoc_insertion_point(builder_scope:ibc.lightclients.tendermint.v1.Fraction) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.ibc.lightclients.tendermint.v1.Fraction(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "numerator_", + "denominator_", + }; + java.lang.String info = + "\u0000\u0002\u0000\u0000\u0001\u0002\u0002\u0000\u0000\u0000\u0001\u0003\u0002\u0003" + + ""; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.ibc.lightclients.tendermint.v1.Fraction.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:ibc.lightclients.tendermint.v1.Fraction) + private static final com.ibc.lightclients.tendermint.v1.Fraction DEFAULT_INSTANCE; + static { + Fraction defaultInstance = new Fraction(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + Fraction.class, defaultInstance); + } + + public static com.ibc.lightclients.tendermint.v1.Fraction getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/lightclients/tendermint/v1/FractionOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/lightclients/tendermint/v1/FractionOrBuilder.java new file mode 100644 index 000000000..cb3f30b0c --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/lightclients/tendermint/v1/FractionOrBuilder.java @@ -0,0 +1,21 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: clients/tendermint/TendermintLight.proto + +package com.ibc.lightclients.tendermint.v1; + +public interface FractionOrBuilder extends + // @@protoc_insertion_point(interface_extends:ibc.lightclients.tendermint.v1.Fraction) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * uint64 numerator = 1 [json_name = "numerator"]; + * @return The numerator. + */ + long getNumerator(); + + /** + * uint64 denominator = 2 [json_name = "denominator"]; + * @return The denominator. + */ + long getDenominator(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/lightclients/tendermint/v1/Header.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/lightclients/tendermint/v1/Header.java new file mode 100644 index 000000000..5d6d0d682 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/lightclients/tendermint/v1/Header.java @@ -0,0 +1,590 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: clients/tendermint/TendermintLight.proto + +package com.ibc.lightclients.tendermint.v1; + +/** + *
+ * Header defines the Tendermint client consensus Header.
+ * It encapsulates all the information necessary to update from a trusted
+ * Tendermint ConsensusState. The inclusion of TrustedHeight and
+ * TrustedValidators allows this update to process correctly, so long as the
+ * ConsensusState for the TrustedHeight exists, this removes race conditions
+ * among relayers The SignedHeader and ValidatorSet are the new untrusted update
+ * fields for the client. The TrustedHeight is the height of a stored
+ * ConsensusState on the client that will be used to verify the new untrusted
+ * header. The Trusted ConsensusState must be within the unbonding period of
+ * current time in order to correctly verify, and the TrustedValidators must
+ * hash to TrustedConsensusState.NextValidatorsHash since that is the last
+ * trusted validator set at the TrustedHeight.
+ * 
+ * + * Protobuf type {@code ibc.lightclients.tendermint.v1.Header} + */ +public final class Header extends + com.google.protobuf.GeneratedMessageLite< + Header, Header.Builder> implements + // @@protoc_insertion_point(message_implements:ibc.lightclients.tendermint.v1.Header) + HeaderOrBuilder { + private Header() { + } + public static final int SIGNED_HEADER_FIELD_NUMBER = 1; + private com.tendermint.types.SignedHeader signedHeader_; + /** + * .tendermint.types.SignedHeader signed_header = 1 [json_name = "signedHeader", (.gogoproto.embed) = true]; + */ + @java.lang.Override + public boolean hasSignedHeader() { + return signedHeader_ != null; + } + /** + * .tendermint.types.SignedHeader signed_header = 1 [json_name = "signedHeader", (.gogoproto.embed) = true]; + */ + @java.lang.Override + public com.tendermint.types.SignedHeader getSignedHeader() { + return signedHeader_ == null ? com.tendermint.types.SignedHeader.getDefaultInstance() : signedHeader_; + } + /** + * .tendermint.types.SignedHeader signed_header = 1 [json_name = "signedHeader", (.gogoproto.embed) = true]; + */ + private void setSignedHeader(com.tendermint.types.SignedHeader value) { + value.getClass(); + signedHeader_ = value; + + } + /** + * .tendermint.types.SignedHeader signed_header = 1 [json_name = "signedHeader", (.gogoproto.embed) = true]; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeSignedHeader(com.tendermint.types.SignedHeader value) { + value.getClass(); + if (signedHeader_ != null && + signedHeader_ != com.tendermint.types.SignedHeader.getDefaultInstance()) { + signedHeader_ = + com.tendermint.types.SignedHeader.newBuilder(signedHeader_).mergeFrom(value).buildPartial(); + } else { + signedHeader_ = value; + } + + } + /** + * .tendermint.types.SignedHeader signed_header = 1 [json_name = "signedHeader", (.gogoproto.embed) = true]; + */ + private void clearSignedHeader() { signedHeader_ = null; + + } + + public static final int VALIDATOR_SET_FIELD_NUMBER = 2; + private com.tendermint.types.ValidatorSet validatorSet_; + /** + * .tendermint.types.ValidatorSet validator_set = 2 [json_name = "validatorSet"]; + */ + @java.lang.Override + public boolean hasValidatorSet() { + return validatorSet_ != null; + } + /** + * .tendermint.types.ValidatorSet validator_set = 2 [json_name = "validatorSet"]; + */ + @java.lang.Override + public com.tendermint.types.ValidatorSet getValidatorSet() { + return validatorSet_ == null ? com.tendermint.types.ValidatorSet.getDefaultInstance() : validatorSet_; + } + /** + * .tendermint.types.ValidatorSet validator_set = 2 [json_name = "validatorSet"]; + */ + private void setValidatorSet(com.tendermint.types.ValidatorSet value) { + value.getClass(); + validatorSet_ = value; + + } + /** + * .tendermint.types.ValidatorSet validator_set = 2 [json_name = "validatorSet"]; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeValidatorSet(com.tendermint.types.ValidatorSet value) { + value.getClass(); + if (validatorSet_ != null && + validatorSet_ != com.tendermint.types.ValidatorSet.getDefaultInstance()) { + validatorSet_ = + com.tendermint.types.ValidatorSet.newBuilder(validatorSet_).mergeFrom(value).buildPartial(); + } else { + validatorSet_ = value; + } + + } + /** + * .tendermint.types.ValidatorSet validator_set = 2 [json_name = "validatorSet"]; + */ + private void clearValidatorSet() { validatorSet_ = null; + + } + + public static final int TRUSTED_HEIGHT_FIELD_NUMBER = 3; + private com.ibc.core.client.v1.Height trustedHeight_; + /** + * .ibc.core.client.v1.Height trusted_height = 3 [json_name = "trustedHeight", (.gogoproto.nullable) = false]; + */ + @java.lang.Override + public boolean hasTrustedHeight() { + return trustedHeight_ != null; + } + /** + * .ibc.core.client.v1.Height trusted_height = 3 [json_name = "trustedHeight", (.gogoproto.nullable) = false]; + */ + @java.lang.Override + public com.ibc.core.client.v1.Height getTrustedHeight() { + return trustedHeight_ == null ? com.ibc.core.client.v1.Height.getDefaultInstance() : trustedHeight_; + } + /** + * .ibc.core.client.v1.Height trusted_height = 3 [json_name = "trustedHeight", (.gogoproto.nullable) = false]; + */ + private void setTrustedHeight(com.ibc.core.client.v1.Height value) { + value.getClass(); + trustedHeight_ = value; + + } + /** + * .ibc.core.client.v1.Height trusted_height = 3 [json_name = "trustedHeight", (.gogoproto.nullable) = false]; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeTrustedHeight(com.ibc.core.client.v1.Height value) { + value.getClass(); + if (trustedHeight_ != null && + trustedHeight_ != com.ibc.core.client.v1.Height.getDefaultInstance()) { + trustedHeight_ = + com.ibc.core.client.v1.Height.newBuilder(trustedHeight_).mergeFrom(value).buildPartial(); + } else { + trustedHeight_ = value; + } + + } + /** + * .ibc.core.client.v1.Height trusted_height = 3 [json_name = "trustedHeight", (.gogoproto.nullable) = false]; + */ + private void clearTrustedHeight() { trustedHeight_ = null; + + } + + public static final int TRUSTED_VALIDATORS_FIELD_NUMBER = 4; + private com.tendermint.types.ValidatorSet trustedValidators_; + /** + * .tendermint.types.ValidatorSet trusted_validators = 4 [json_name = "trustedValidators"]; + */ + @java.lang.Override + public boolean hasTrustedValidators() { + return trustedValidators_ != null; + } + /** + * .tendermint.types.ValidatorSet trusted_validators = 4 [json_name = "trustedValidators"]; + */ + @java.lang.Override + public com.tendermint.types.ValidatorSet getTrustedValidators() { + return trustedValidators_ == null ? com.tendermint.types.ValidatorSet.getDefaultInstance() : trustedValidators_; + } + /** + * .tendermint.types.ValidatorSet trusted_validators = 4 [json_name = "trustedValidators"]; + */ + private void setTrustedValidators(com.tendermint.types.ValidatorSet value) { + value.getClass(); + trustedValidators_ = value; + + } + /** + * .tendermint.types.ValidatorSet trusted_validators = 4 [json_name = "trustedValidators"]; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeTrustedValidators(com.tendermint.types.ValidatorSet value) { + value.getClass(); + if (trustedValidators_ != null && + trustedValidators_ != com.tendermint.types.ValidatorSet.getDefaultInstance()) { + trustedValidators_ = + com.tendermint.types.ValidatorSet.newBuilder(trustedValidators_).mergeFrom(value).buildPartial(); + } else { + trustedValidators_ = value; + } + + } + /** + * .tendermint.types.ValidatorSet trusted_validators = 4 [json_name = "trustedValidators"]; + */ + private void clearTrustedValidators() { trustedValidators_ = null; + + } + + public static com.ibc.lightclients.tendermint.v1.Header parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.ibc.lightclients.tendermint.v1.Header parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.ibc.lightclients.tendermint.v1.Header parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.ibc.lightclients.tendermint.v1.Header parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.ibc.lightclients.tendermint.v1.Header parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.ibc.lightclients.tendermint.v1.Header parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.ibc.lightclients.tendermint.v1.Header parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.ibc.lightclients.tendermint.v1.Header parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.ibc.lightclients.tendermint.v1.Header parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.ibc.lightclients.tendermint.v1.Header parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.ibc.lightclients.tendermint.v1.Header parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.ibc.lightclients.tendermint.v1.Header parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.ibc.lightclients.tendermint.v1.Header prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+   * Header defines the Tendermint client consensus Header.
+   * It encapsulates all the information necessary to update from a trusted
+   * Tendermint ConsensusState. The inclusion of TrustedHeight and
+   * TrustedValidators allows this update to process correctly, so long as the
+   * ConsensusState for the TrustedHeight exists, this removes race conditions
+   * among relayers The SignedHeader and ValidatorSet are the new untrusted update
+   * fields for the client. The TrustedHeight is the height of a stored
+   * ConsensusState on the client that will be used to verify the new untrusted
+   * header. The Trusted ConsensusState must be within the unbonding period of
+   * current time in order to correctly verify, and the TrustedValidators must
+   * hash to TrustedConsensusState.NextValidatorsHash since that is the last
+   * trusted validator set at the TrustedHeight.
+   * 
+ * + * Protobuf type {@code ibc.lightclients.tendermint.v1.Header} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.ibc.lightclients.tendermint.v1.Header, Builder> implements + // @@protoc_insertion_point(builder_implements:ibc.lightclients.tendermint.v1.Header) + com.ibc.lightclients.tendermint.v1.HeaderOrBuilder { + // Construct using com.ibc.lightclients.tendermint.v1.Header.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * .tendermint.types.SignedHeader signed_header = 1 [json_name = "signedHeader", (.gogoproto.embed) = true]; + */ + @java.lang.Override + public boolean hasSignedHeader() { + return instance.hasSignedHeader(); + } + /** + * .tendermint.types.SignedHeader signed_header = 1 [json_name = "signedHeader", (.gogoproto.embed) = true]; + */ + @java.lang.Override + public com.tendermint.types.SignedHeader getSignedHeader() { + return instance.getSignedHeader(); + } + /** + * .tendermint.types.SignedHeader signed_header = 1 [json_name = "signedHeader", (.gogoproto.embed) = true]; + */ + public Builder setSignedHeader(com.tendermint.types.SignedHeader value) { + copyOnWrite(); + instance.setSignedHeader(value); + return this; + } + /** + * .tendermint.types.SignedHeader signed_header = 1 [json_name = "signedHeader", (.gogoproto.embed) = true]; + */ + public Builder setSignedHeader( + com.tendermint.types.SignedHeader.Builder builderForValue) { + copyOnWrite(); + instance.setSignedHeader(builderForValue.build()); + return this; + } + /** + * .tendermint.types.SignedHeader signed_header = 1 [json_name = "signedHeader", (.gogoproto.embed) = true]; + */ + public Builder mergeSignedHeader(com.tendermint.types.SignedHeader value) { + copyOnWrite(); + instance.mergeSignedHeader(value); + return this; + } + /** + * .tendermint.types.SignedHeader signed_header = 1 [json_name = "signedHeader", (.gogoproto.embed) = true]; + */ + public Builder clearSignedHeader() { copyOnWrite(); + instance.clearSignedHeader(); + return this; + } + + /** + * .tendermint.types.ValidatorSet validator_set = 2 [json_name = "validatorSet"]; + */ + @java.lang.Override + public boolean hasValidatorSet() { + return instance.hasValidatorSet(); + } + /** + * .tendermint.types.ValidatorSet validator_set = 2 [json_name = "validatorSet"]; + */ + @java.lang.Override + public com.tendermint.types.ValidatorSet getValidatorSet() { + return instance.getValidatorSet(); + } + /** + * .tendermint.types.ValidatorSet validator_set = 2 [json_name = "validatorSet"]; + */ + public Builder setValidatorSet(com.tendermint.types.ValidatorSet value) { + copyOnWrite(); + instance.setValidatorSet(value); + return this; + } + /** + * .tendermint.types.ValidatorSet validator_set = 2 [json_name = "validatorSet"]; + */ + public Builder setValidatorSet( + com.tendermint.types.ValidatorSet.Builder builderForValue) { + copyOnWrite(); + instance.setValidatorSet(builderForValue.build()); + return this; + } + /** + * .tendermint.types.ValidatorSet validator_set = 2 [json_name = "validatorSet"]; + */ + public Builder mergeValidatorSet(com.tendermint.types.ValidatorSet value) { + copyOnWrite(); + instance.mergeValidatorSet(value); + return this; + } + /** + * .tendermint.types.ValidatorSet validator_set = 2 [json_name = "validatorSet"]; + */ + public Builder clearValidatorSet() { copyOnWrite(); + instance.clearValidatorSet(); + return this; + } + + /** + * .ibc.core.client.v1.Height trusted_height = 3 [json_name = "trustedHeight", (.gogoproto.nullable) = false]; + */ + @java.lang.Override + public boolean hasTrustedHeight() { + return instance.hasTrustedHeight(); + } + /** + * .ibc.core.client.v1.Height trusted_height = 3 [json_name = "trustedHeight", (.gogoproto.nullable) = false]; + */ + @java.lang.Override + public com.ibc.core.client.v1.Height getTrustedHeight() { + return instance.getTrustedHeight(); + } + /** + * .ibc.core.client.v1.Height trusted_height = 3 [json_name = "trustedHeight", (.gogoproto.nullable) = false]; + */ + public Builder setTrustedHeight(com.ibc.core.client.v1.Height value) { + copyOnWrite(); + instance.setTrustedHeight(value); + return this; + } + /** + * .ibc.core.client.v1.Height trusted_height = 3 [json_name = "trustedHeight", (.gogoproto.nullable) = false]; + */ + public Builder setTrustedHeight( + com.ibc.core.client.v1.Height.Builder builderForValue) { + copyOnWrite(); + instance.setTrustedHeight(builderForValue.build()); + return this; + } + /** + * .ibc.core.client.v1.Height trusted_height = 3 [json_name = "trustedHeight", (.gogoproto.nullable) = false]; + */ + public Builder mergeTrustedHeight(com.ibc.core.client.v1.Height value) { + copyOnWrite(); + instance.mergeTrustedHeight(value); + return this; + } + /** + * .ibc.core.client.v1.Height trusted_height = 3 [json_name = "trustedHeight", (.gogoproto.nullable) = false]; + */ + public Builder clearTrustedHeight() { copyOnWrite(); + instance.clearTrustedHeight(); + return this; + } + + /** + * .tendermint.types.ValidatorSet trusted_validators = 4 [json_name = "trustedValidators"]; + */ + @java.lang.Override + public boolean hasTrustedValidators() { + return instance.hasTrustedValidators(); + } + /** + * .tendermint.types.ValidatorSet trusted_validators = 4 [json_name = "trustedValidators"]; + */ + @java.lang.Override + public com.tendermint.types.ValidatorSet getTrustedValidators() { + return instance.getTrustedValidators(); + } + /** + * .tendermint.types.ValidatorSet trusted_validators = 4 [json_name = "trustedValidators"]; + */ + public Builder setTrustedValidators(com.tendermint.types.ValidatorSet value) { + copyOnWrite(); + instance.setTrustedValidators(value); + return this; + } + /** + * .tendermint.types.ValidatorSet trusted_validators = 4 [json_name = "trustedValidators"]; + */ + public Builder setTrustedValidators( + com.tendermint.types.ValidatorSet.Builder builderForValue) { + copyOnWrite(); + instance.setTrustedValidators(builderForValue.build()); + return this; + } + /** + * .tendermint.types.ValidatorSet trusted_validators = 4 [json_name = "trustedValidators"]; + */ + public Builder mergeTrustedValidators(com.tendermint.types.ValidatorSet value) { + copyOnWrite(); + instance.mergeTrustedValidators(value); + return this; + } + /** + * .tendermint.types.ValidatorSet trusted_validators = 4 [json_name = "trustedValidators"]; + */ + public Builder clearTrustedValidators() { copyOnWrite(); + instance.clearTrustedValidators(); + return this; + } + + // @@protoc_insertion_point(builder_scope:ibc.lightclients.tendermint.v1.Header) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.ibc.lightclients.tendermint.v1.Header(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "signedHeader_", + "validatorSet_", + "trustedHeight_", + "trustedValidators_", + }; + java.lang.String info = + "\u0000\u0004\u0000\u0000\u0001\u0004\u0004\u0000\u0000\u0000\u0001\t\u0002\t\u0003" + + "\t\u0004\t"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.ibc.lightclients.tendermint.v1.Header.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:ibc.lightclients.tendermint.v1.Header) + private static final com.ibc.lightclients.tendermint.v1.Header DEFAULT_INSTANCE; + static { + Header defaultInstance = new Header(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + Header.class, defaultInstance); + } + + public static com.ibc.lightclients.tendermint.v1.Header getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser
PARSER; + + public static com.google.protobuf.Parser
parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/lightclients/tendermint/v1/HeaderOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/lightclients/tendermint/v1/HeaderOrBuilder.java new file mode 100644 index 000000000..84e0e0276 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/lightclients/tendermint/v1/HeaderOrBuilder.java @@ -0,0 +1,53 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: clients/tendermint/TendermintLight.proto + +package com.ibc.lightclients.tendermint.v1; + +public interface HeaderOrBuilder extends + // @@protoc_insertion_point(interface_extends:ibc.lightclients.tendermint.v1.Header) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * .tendermint.types.SignedHeader signed_header = 1 [json_name = "signedHeader", (.gogoproto.embed) = true]; + * @return Whether the signedHeader field is set. + */ + boolean hasSignedHeader(); + /** + * .tendermint.types.SignedHeader signed_header = 1 [json_name = "signedHeader", (.gogoproto.embed) = true]; + * @return The signedHeader. + */ + com.tendermint.types.SignedHeader getSignedHeader(); + + /** + * .tendermint.types.ValidatorSet validator_set = 2 [json_name = "validatorSet"]; + * @return Whether the validatorSet field is set. + */ + boolean hasValidatorSet(); + /** + * .tendermint.types.ValidatorSet validator_set = 2 [json_name = "validatorSet"]; + * @return The validatorSet. + */ + com.tendermint.types.ValidatorSet getValidatorSet(); + + /** + * .ibc.core.client.v1.Height trusted_height = 3 [json_name = "trustedHeight", (.gogoproto.nullable) = false]; + * @return Whether the trustedHeight field is set. + */ + boolean hasTrustedHeight(); + /** + * .ibc.core.client.v1.Height trusted_height = 3 [json_name = "trustedHeight", (.gogoproto.nullable) = false]; + * @return The trustedHeight. + */ + com.ibc.core.client.v1.Height getTrustedHeight(); + + /** + * .tendermint.types.ValidatorSet trusted_validators = 4 [json_name = "trustedValidators"]; + * @return Whether the trustedValidators field is set. + */ + boolean hasTrustedValidators(); + /** + * .tendermint.types.ValidatorSet trusted_validators = 4 [json_name = "trustedValidators"]; + * @return The trustedValidators. + */ + com.tendermint.types.ValidatorSet getTrustedValidators(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/lightclients/tendermint/v1/Misbehaviour.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/lightclients/tendermint/v1/Misbehaviour.java new file mode 100644 index 000000000..d4bf1ba1e --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/lightclients/tendermint/v1/Misbehaviour.java @@ -0,0 +1,540 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: clients/tendermint/TendermintLight.proto + +package com.ibc.lightclients.tendermint.v1; + +/** + *
+ * Misbehaviour is a wrapper over two conflicting Headers
+ * that implements Misbehaviour interface expected by ICS-02
+ * 
+ * + * Protobuf type {@code ibc.lightclients.tendermint.v1.Misbehaviour} + */ +public final class Misbehaviour extends + com.google.protobuf.GeneratedMessageLite< + Misbehaviour, Misbehaviour.Builder> implements + // @@protoc_insertion_point(message_implements:ibc.lightclients.tendermint.v1.Misbehaviour) + MisbehaviourOrBuilder { + private Misbehaviour() { + clientId_ = ""; + } + public static final int CLIENT_ID_FIELD_NUMBER = 1; + private java.lang.String clientId_; + /** + *
+   * ClientID is deprecated
+   * 
+ * + * string client_id = 1 [json_name = "clientId", deprecated = true]; + * @deprecated ibc.lightclients.tendermint.v1.Misbehaviour.client_id is deprecated. + * See clients/tendermint/TendermintLight.proto;l=70 + * @return The clientId. + */ + @java.lang.Override + @java.lang.Deprecated public java.lang.String getClientId() { + return clientId_; + } + /** + *
+   * ClientID is deprecated
+   * 
+ * + * string client_id = 1 [json_name = "clientId", deprecated = true]; + * @deprecated ibc.lightclients.tendermint.v1.Misbehaviour.client_id is deprecated. + * See clients/tendermint/TendermintLight.proto;l=70 + * @return The bytes for clientId. + */ + @java.lang.Override + @java.lang.Deprecated public com.google.protobuf.ByteString + getClientIdBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(clientId_); + } + /** + *
+   * ClientID is deprecated
+   * 
+ * + * string client_id = 1 [json_name = "clientId", deprecated = true]; + * @deprecated ibc.lightclients.tendermint.v1.Misbehaviour.client_id is deprecated. + * See clients/tendermint/TendermintLight.proto;l=70 + * @param value The clientId to set. + */ + private void setClientId( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + clientId_ = value; + } + /** + *
+   * ClientID is deprecated
+   * 
+ * + * string client_id = 1 [json_name = "clientId", deprecated = true]; + * @deprecated ibc.lightclients.tendermint.v1.Misbehaviour.client_id is deprecated. + * See clients/tendermint/TendermintLight.proto;l=70 + */ + private void clearClientId() { + + clientId_ = getDefaultInstance().getClientId(); + } + /** + *
+   * ClientID is deprecated
+   * 
+ * + * string client_id = 1 [json_name = "clientId", deprecated = true]; + * @deprecated ibc.lightclients.tendermint.v1.Misbehaviour.client_id is deprecated. + * See clients/tendermint/TendermintLight.proto;l=70 + * @param value The bytes for clientId to set. + */ + private void setClientIdBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + clientId_ = value.toStringUtf8(); + + } + + public static final int HEADER_1_FIELD_NUMBER = 2; + private com.ibc.lightclients.tendermint.v1.Header header1_; + /** + * .ibc.lightclients.tendermint.v1.Header header_1 = 2 [json_name = "header1", (.gogoproto.customname) = "Header1"]; + */ + @java.lang.Override + public boolean hasHeader1() { + return header1_ != null; + } + /** + * .ibc.lightclients.tendermint.v1.Header header_1 = 2 [json_name = "header1", (.gogoproto.customname) = "Header1"]; + */ + @java.lang.Override + public com.ibc.lightclients.tendermint.v1.Header getHeader1() { + return header1_ == null ? com.ibc.lightclients.tendermint.v1.Header.getDefaultInstance() : header1_; + } + /** + * .ibc.lightclients.tendermint.v1.Header header_1 = 2 [json_name = "header1", (.gogoproto.customname) = "Header1"]; + */ + private void setHeader1(com.ibc.lightclients.tendermint.v1.Header value) { + value.getClass(); + header1_ = value; + + } + /** + * .ibc.lightclients.tendermint.v1.Header header_1 = 2 [json_name = "header1", (.gogoproto.customname) = "Header1"]; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeHeader1(com.ibc.lightclients.tendermint.v1.Header value) { + value.getClass(); + if (header1_ != null && + header1_ != com.ibc.lightclients.tendermint.v1.Header.getDefaultInstance()) { + header1_ = + com.ibc.lightclients.tendermint.v1.Header.newBuilder(header1_).mergeFrom(value).buildPartial(); + } else { + header1_ = value; + } + + } + /** + * .ibc.lightclients.tendermint.v1.Header header_1 = 2 [json_name = "header1", (.gogoproto.customname) = "Header1"]; + */ + private void clearHeader1() { header1_ = null; + + } + + public static final int HEADER_2_FIELD_NUMBER = 3; + private com.ibc.lightclients.tendermint.v1.Header header2_; + /** + * .ibc.lightclients.tendermint.v1.Header header_2 = 3 [json_name = "header2", (.gogoproto.customname) = "Header2"]; + */ + @java.lang.Override + public boolean hasHeader2() { + return header2_ != null; + } + /** + * .ibc.lightclients.tendermint.v1.Header header_2 = 3 [json_name = "header2", (.gogoproto.customname) = "Header2"]; + */ + @java.lang.Override + public com.ibc.lightclients.tendermint.v1.Header getHeader2() { + return header2_ == null ? com.ibc.lightclients.tendermint.v1.Header.getDefaultInstance() : header2_; + } + /** + * .ibc.lightclients.tendermint.v1.Header header_2 = 3 [json_name = "header2", (.gogoproto.customname) = "Header2"]; + */ + private void setHeader2(com.ibc.lightclients.tendermint.v1.Header value) { + value.getClass(); + header2_ = value; + + } + /** + * .ibc.lightclients.tendermint.v1.Header header_2 = 3 [json_name = "header2", (.gogoproto.customname) = "Header2"]; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeHeader2(com.ibc.lightclients.tendermint.v1.Header value) { + value.getClass(); + if (header2_ != null && + header2_ != com.ibc.lightclients.tendermint.v1.Header.getDefaultInstance()) { + header2_ = + com.ibc.lightclients.tendermint.v1.Header.newBuilder(header2_).mergeFrom(value).buildPartial(); + } else { + header2_ = value; + } + + } + /** + * .ibc.lightclients.tendermint.v1.Header header_2 = 3 [json_name = "header2", (.gogoproto.customname) = "Header2"]; + */ + private void clearHeader2() { header2_ = null; + + } + + public static com.ibc.lightclients.tendermint.v1.Misbehaviour parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.ibc.lightclients.tendermint.v1.Misbehaviour parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.ibc.lightclients.tendermint.v1.Misbehaviour parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.ibc.lightclients.tendermint.v1.Misbehaviour parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.ibc.lightclients.tendermint.v1.Misbehaviour parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.ibc.lightclients.tendermint.v1.Misbehaviour parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.ibc.lightclients.tendermint.v1.Misbehaviour parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.ibc.lightclients.tendermint.v1.Misbehaviour parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.ibc.lightclients.tendermint.v1.Misbehaviour parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.ibc.lightclients.tendermint.v1.Misbehaviour parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.ibc.lightclients.tendermint.v1.Misbehaviour parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.ibc.lightclients.tendermint.v1.Misbehaviour parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.ibc.lightclients.tendermint.v1.Misbehaviour prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+   * Misbehaviour is a wrapper over two conflicting Headers
+   * that implements Misbehaviour interface expected by ICS-02
+   * 
+ * + * Protobuf type {@code ibc.lightclients.tendermint.v1.Misbehaviour} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.ibc.lightclients.tendermint.v1.Misbehaviour, Builder> implements + // @@protoc_insertion_point(builder_implements:ibc.lightclients.tendermint.v1.Misbehaviour) + com.ibc.lightclients.tendermint.v1.MisbehaviourOrBuilder { + // Construct using com.ibc.lightclients.tendermint.v1.Misbehaviour.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + *
+     * ClientID is deprecated
+     * 
+ * + * string client_id = 1 [json_name = "clientId", deprecated = true]; + * @deprecated ibc.lightclients.tendermint.v1.Misbehaviour.client_id is deprecated. + * See clients/tendermint/TendermintLight.proto;l=70 + * @return The clientId. + */ + @java.lang.Override + @java.lang.Deprecated public java.lang.String getClientId() { + return instance.getClientId(); + } + /** + *
+     * ClientID is deprecated
+     * 
+ * + * string client_id = 1 [json_name = "clientId", deprecated = true]; + * @deprecated ibc.lightclients.tendermint.v1.Misbehaviour.client_id is deprecated. + * See clients/tendermint/TendermintLight.proto;l=70 + * @return The bytes for clientId. + */ + @java.lang.Override + @java.lang.Deprecated public com.google.protobuf.ByteString + getClientIdBytes() { + return instance.getClientIdBytes(); + } + /** + *
+     * ClientID is deprecated
+     * 
+ * + * string client_id = 1 [json_name = "clientId", deprecated = true]; + * @deprecated ibc.lightclients.tendermint.v1.Misbehaviour.client_id is deprecated. + * See clients/tendermint/TendermintLight.proto;l=70 + * @param value The clientId to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated public Builder setClientId( + java.lang.String value) { + copyOnWrite(); + instance.setClientId(value); + return this; + } + /** + *
+     * ClientID is deprecated
+     * 
+ * + * string client_id = 1 [json_name = "clientId", deprecated = true]; + * @deprecated ibc.lightclients.tendermint.v1.Misbehaviour.client_id is deprecated. + * See clients/tendermint/TendermintLight.proto;l=70 + * @return This builder for chaining. + */ + @java.lang.Deprecated public Builder clearClientId() { + copyOnWrite(); + instance.clearClientId(); + return this; + } + /** + *
+     * ClientID is deprecated
+     * 
+ * + * string client_id = 1 [json_name = "clientId", deprecated = true]; + * @deprecated ibc.lightclients.tendermint.v1.Misbehaviour.client_id is deprecated. + * See clients/tendermint/TendermintLight.proto;l=70 + * @param value The bytes for clientId to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated public Builder setClientIdBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setClientIdBytes(value); + return this; + } + + /** + * .ibc.lightclients.tendermint.v1.Header header_1 = 2 [json_name = "header1", (.gogoproto.customname) = "Header1"]; + */ + @java.lang.Override + public boolean hasHeader1() { + return instance.hasHeader1(); + } + /** + * .ibc.lightclients.tendermint.v1.Header header_1 = 2 [json_name = "header1", (.gogoproto.customname) = "Header1"]; + */ + @java.lang.Override + public com.ibc.lightclients.tendermint.v1.Header getHeader1() { + return instance.getHeader1(); + } + /** + * .ibc.lightclients.tendermint.v1.Header header_1 = 2 [json_name = "header1", (.gogoproto.customname) = "Header1"]; + */ + public Builder setHeader1(com.ibc.lightclients.tendermint.v1.Header value) { + copyOnWrite(); + instance.setHeader1(value); + return this; + } + /** + * .ibc.lightclients.tendermint.v1.Header header_1 = 2 [json_name = "header1", (.gogoproto.customname) = "Header1"]; + */ + public Builder setHeader1( + com.ibc.lightclients.tendermint.v1.Header.Builder builderForValue) { + copyOnWrite(); + instance.setHeader1(builderForValue.build()); + return this; + } + /** + * .ibc.lightclients.tendermint.v1.Header header_1 = 2 [json_name = "header1", (.gogoproto.customname) = "Header1"]; + */ + public Builder mergeHeader1(com.ibc.lightclients.tendermint.v1.Header value) { + copyOnWrite(); + instance.mergeHeader1(value); + return this; + } + /** + * .ibc.lightclients.tendermint.v1.Header header_1 = 2 [json_name = "header1", (.gogoproto.customname) = "Header1"]; + */ + public Builder clearHeader1() { copyOnWrite(); + instance.clearHeader1(); + return this; + } + + /** + * .ibc.lightclients.tendermint.v1.Header header_2 = 3 [json_name = "header2", (.gogoproto.customname) = "Header2"]; + */ + @java.lang.Override + public boolean hasHeader2() { + return instance.hasHeader2(); + } + /** + * .ibc.lightclients.tendermint.v1.Header header_2 = 3 [json_name = "header2", (.gogoproto.customname) = "Header2"]; + */ + @java.lang.Override + public com.ibc.lightclients.tendermint.v1.Header getHeader2() { + return instance.getHeader2(); + } + /** + * .ibc.lightclients.tendermint.v1.Header header_2 = 3 [json_name = "header2", (.gogoproto.customname) = "Header2"]; + */ + public Builder setHeader2(com.ibc.lightclients.tendermint.v1.Header value) { + copyOnWrite(); + instance.setHeader2(value); + return this; + } + /** + * .ibc.lightclients.tendermint.v1.Header header_2 = 3 [json_name = "header2", (.gogoproto.customname) = "Header2"]; + */ + public Builder setHeader2( + com.ibc.lightclients.tendermint.v1.Header.Builder builderForValue) { + copyOnWrite(); + instance.setHeader2(builderForValue.build()); + return this; + } + /** + * .ibc.lightclients.tendermint.v1.Header header_2 = 3 [json_name = "header2", (.gogoproto.customname) = "Header2"]; + */ + public Builder mergeHeader2(com.ibc.lightclients.tendermint.v1.Header value) { + copyOnWrite(); + instance.mergeHeader2(value); + return this; + } + /** + * .ibc.lightclients.tendermint.v1.Header header_2 = 3 [json_name = "header2", (.gogoproto.customname) = "Header2"]; + */ + public Builder clearHeader2() { copyOnWrite(); + instance.clearHeader2(); + return this; + } + + // @@protoc_insertion_point(builder_scope:ibc.lightclients.tendermint.v1.Misbehaviour) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.ibc.lightclients.tendermint.v1.Misbehaviour(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "clientId_", + "header1_", + "header2_", + }; + java.lang.String info = + "\u0000\u0003\u0000\u0000\u0001\u0003\u0003\u0000\u0000\u0000\u0001\u0208\u0002\t" + + "\u0003\t"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.ibc.lightclients.tendermint.v1.Misbehaviour.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:ibc.lightclients.tendermint.v1.Misbehaviour) + private static final com.ibc.lightclients.tendermint.v1.Misbehaviour DEFAULT_INSTANCE; + static { + Misbehaviour defaultInstance = new Misbehaviour(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + Misbehaviour.class, defaultInstance); + } + + public static com.ibc.lightclients.tendermint.v1.Misbehaviour getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/lightclients/tendermint/v1/MisbehaviourOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/lightclients/tendermint/v1/MisbehaviourOrBuilder.java new file mode 100644 index 000000000..d1c64b556 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/lightclients/tendermint/v1/MisbehaviourOrBuilder.java @@ -0,0 +1,55 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: clients/tendermint/TendermintLight.proto + +package com.ibc.lightclients.tendermint.v1; + +public interface MisbehaviourOrBuilder extends + // @@protoc_insertion_point(interface_extends:ibc.lightclients.tendermint.v1.Misbehaviour) + com.google.protobuf.MessageLiteOrBuilder { + + /** + *
+   * ClientID is deprecated
+   * 
+ * + * string client_id = 1 [json_name = "clientId", deprecated = true]; + * @deprecated ibc.lightclients.tendermint.v1.Misbehaviour.client_id is deprecated. + * See clients/tendermint/TendermintLight.proto;l=70 + * @return The clientId. + */ + @java.lang.Deprecated java.lang.String getClientId(); + /** + *
+   * ClientID is deprecated
+   * 
+ * + * string client_id = 1 [json_name = "clientId", deprecated = true]; + * @deprecated ibc.lightclients.tendermint.v1.Misbehaviour.client_id is deprecated. + * See clients/tendermint/TendermintLight.proto;l=70 + * @return The bytes for clientId. + */ + @java.lang.Deprecated com.google.protobuf.ByteString + getClientIdBytes(); + + /** + * .ibc.lightclients.tendermint.v1.Header header_1 = 2 [json_name = "header1", (.gogoproto.customname) = "Header1"]; + * @return Whether the header1 field is set. + */ + boolean hasHeader1(); + /** + * .ibc.lightclients.tendermint.v1.Header header_1 = 2 [json_name = "header1", (.gogoproto.customname) = "Header1"]; + * @return The header1. + */ + com.ibc.lightclients.tendermint.v1.Header getHeader1(); + + /** + * .ibc.lightclients.tendermint.v1.Header header_2 = 3 [json_name = "header2", (.gogoproto.customname) = "Header2"]; + * @return Whether the header2 field is set. + */ + boolean hasHeader2(); + /** + * .ibc.lightclients.tendermint.v1.Header header_2 = 3 [json_name = "header2", (.gogoproto.customname) = "Header2"]; + * @return The header2. + */ + com.ibc.lightclients.tendermint.v1.Header getHeader2(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/lightclients/tendermint/v1/TendermintLightProto.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/lightclients/tendermint/v1/TendermintLightProto.java new file mode 100644 index 000000000..67f6eafe9 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/lightclients/tendermint/v1/TendermintLightProto.java @@ -0,0 +1,16 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: clients/tendermint/TendermintLight.proto + +package com.ibc.lightclients.tendermint.v1; + +public final class TendermintLightProto { + private TendermintLightProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + static { + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/lightclient/v1/BlockUpdate.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/lightclient/v1/BlockUpdate.java new file mode 100644 index 000000000..12cacd022 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/lightclient/v1/BlockUpdate.java @@ -0,0 +1,277 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: icon/lightclient/v1/light.proto + +package com.icon.lightclient.v1; + +/** + * Protobuf type {@code icon.lightclient.v1.BlockUpdate} + */ +public final class BlockUpdate extends + com.google.protobuf.GeneratedMessageLite< + BlockUpdate, BlockUpdate.Builder> implements + // @@protoc_insertion_point(message_implements:icon.lightclient.v1.BlockUpdate) + BlockUpdateOrBuilder { + private BlockUpdate() { + } + public static final int HEADER_FIELD_NUMBER = 1; + private com.icon.types.v1.SignedHeader header_; + /** + * .icon.types.v1.SignedHeader header = 1 [json_name = "header"]; + */ + @java.lang.Override + public boolean hasHeader() { + return header_ != null; + } + /** + * .icon.types.v1.SignedHeader header = 1 [json_name = "header"]; + */ + @java.lang.Override + public com.icon.types.v1.SignedHeader getHeader() { + return header_ == null ? com.icon.types.v1.SignedHeader.getDefaultInstance() : header_; + } + /** + * .icon.types.v1.SignedHeader header = 1 [json_name = "header"]; + */ + private void setHeader(com.icon.types.v1.SignedHeader value) { + value.getClass(); + header_ = value; + + } + /** + * .icon.types.v1.SignedHeader header = 1 [json_name = "header"]; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeHeader(com.icon.types.v1.SignedHeader value) { + value.getClass(); + if (header_ != null && + header_ != com.icon.types.v1.SignedHeader.getDefaultInstance()) { + header_ = + com.icon.types.v1.SignedHeader.newBuilder(header_).mergeFrom(value).buildPartial(); + } else { + header_ = value; + } + + } + /** + * .icon.types.v1.SignedHeader header = 1 [json_name = "header"]; + */ + private void clearHeader() { header_ = null; + + } + + public static com.icon.lightclient.v1.BlockUpdate parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.lightclient.v1.BlockUpdate parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.lightclient.v1.BlockUpdate parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.lightclient.v1.BlockUpdate parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.lightclient.v1.BlockUpdate parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.lightclient.v1.BlockUpdate parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.lightclient.v1.BlockUpdate parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.icon.lightclient.v1.BlockUpdate parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.icon.lightclient.v1.BlockUpdate parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.icon.lightclient.v1.BlockUpdate parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.icon.lightclient.v1.BlockUpdate parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.icon.lightclient.v1.BlockUpdate parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.icon.lightclient.v1.BlockUpdate prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + * Protobuf type {@code icon.lightclient.v1.BlockUpdate} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.icon.lightclient.v1.BlockUpdate, Builder> implements + // @@protoc_insertion_point(builder_implements:icon.lightclient.v1.BlockUpdate) + com.icon.lightclient.v1.BlockUpdateOrBuilder { + // Construct using com.icon.lightclient.v1.BlockUpdate.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * .icon.types.v1.SignedHeader header = 1 [json_name = "header"]; + */ + @java.lang.Override + public boolean hasHeader() { + return instance.hasHeader(); + } + /** + * .icon.types.v1.SignedHeader header = 1 [json_name = "header"]; + */ + @java.lang.Override + public com.icon.types.v1.SignedHeader getHeader() { + return instance.getHeader(); + } + /** + * .icon.types.v1.SignedHeader header = 1 [json_name = "header"]; + */ + public Builder setHeader(com.icon.types.v1.SignedHeader value) { + copyOnWrite(); + instance.setHeader(value); + return this; + } + /** + * .icon.types.v1.SignedHeader header = 1 [json_name = "header"]; + */ + public Builder setHeader( + com.icon.types.v1.SignedHeader.Builder builderForValue) { + copyOnWrite(); + instance.setHeader(builderForValue.build()); + return this; + } + /** + * .icon.types.v1.SignedHeader header = 1 [json_name = "header"]; + */ + public Builder mergeHeader(com.icon.types.v1.SignedHeader value) { + copyOnWrite(); + instance.mergeHeader(value); + return this; + } + /** + * .icon.types.v1.SignedHeader header = 1 [json_name = "header"]; + */ + public Builder clearHeader() { copyOnWrite(); + instance.clearHeader(); + return this; + } + + // @@protoc_insertion_point(builder_scope:icon.lightclient.v1.BlockUpdate) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.icon.lightclient.v1.BlockUpdate(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "header_", + }; + java.lang.String info = + "\u0000\u0001\u0000\u0000\u0001\u0001\u0001\u0000\u0000\u0000\u0001\t"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.icon.lightclient.v1.BlockUpdate.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:icon.lightclient.v1.BlockUpdate) + private static final com.icon.lightclient.v1.BlockUpdate DEFAULT_INSTANCE; + static { + BlockUpdate defaultInstance = new BlockUpdate(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + BlockUpdate.class, defaultInstance); + } + + public static com.icon.lightclient.v1.BlockUpdate getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/lightclient/v1/BlockUpdateOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/lightclient/v1/BlockUpdateOrBuilder.java new file mode 100644 index 000000000..aa1e9f992 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/lightclient/v1/BlockUpdateOrBuilder.java @@ -0,0 +1,20 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: icon/lightclient/v1/light.proto + +package com.icon.lightclient.v1; + +public interface BlockUpdateOrBuilder extends + // @@protoc_insertion_point(interface_extends:icon.lightclient.v1.BlockUpdate) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * .icon.types.v1.SignedHeader header = 1 [json_name = "header"]; + * @return Whether the header field is set. + */ + boolean hasHeader(); + /** + * .icon.types.v1.SignedHeader header = 1 [json_name = "header"]; + * @return The header. + */ + com.icon.types.v1.SignedHeader getHeader(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/lightclient/v1/ClientState.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/lightclient/v1/ClientState.java new file mode 100644 index 000000000..aebe3fbf6 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/lightclient/v1/ClientState.java @@ -0,0 +1,612 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: icon/lightclient/v1/light.proto + +package com.icon.lightclient.v1; + +/** + * Protobuf type {@code icon.lightclient.v1.ClientState} + */ +public final class ClientState extends + com.google.protobuf.GeneratedMessageLite< + ClientState, ClientState.Builder> implements + // @@protoc_insertion_point(message_implements:icon.lightclient.v1.ClientState) + ClientStateOrBuilder { + private ClientState() { + srcNetworkId_ = ""; + } + public static final int TRUSTING_PERIOD_FIELD_NUMBER = 1; + private long trustingPeriod_; + /** + * uint64 trusting_period = 1 [json_name = "trustingPeriod"]; + * @return The trustingPeriod. + */ + @java.lang.Override + public long getTrustingPeriod() { + return trustingPeriod_; + } + /** + * uint64 trusting_period = 1 [json_name = "trustingPeriod"]; + * @param value The trustingPeriod to set. + */ + private void setTrustingPeriod(long value) { + + trustingPeriod_ = value; + } + /** + * uint64 trusting_period = 1 [json_name = "trustingPeriod"]; + */ + private void clearTrustingPeriod() { + + trustingPeriod_ = 0L; + } + + public static final int FROZEN_HEIGHT_FIELD_NUMBER = 2; + private long frozenHeight_; + /** + * uint64 frozen_height = 2 [json_name = "frozenHeight"]; + * @return The frozenHeight. + */ + @java.lang.Override + public long getFrozenHeight() { + return frozenHeight_; + } + /** + * uint64 frozen_height = 2 [json_name = "frozenHeight"]; + * @param value The frozenHeight to set. + */ + private void setFrozenHeight(long value) { + + frozenHeight_ = value; + } + /** + * uint64 frozen_height = 2 [json_name = "frozenHeight"]; + */ + private void clearFrozenHeight() { + + frozenHeight_ = 0L; + } + + public static final int MAX_CLOCK_DRIFT_FIELD_NUMBER = 3; + private long maxClockDrift_; + /** + * uint64 max_clock_drift = 3 [json_name = "maxClockDrift"]; + * @return The maxClockDrift. + */ + @java.lang.Override + public long getMaxClockDrift() { + return maxClockDrift_; + } + /** + * uint64 max_clock_drift = 3 [json_name = "maxClockDrift"]; + * @param value The maxClockDrift to set. + */ + private void setMaxClockDrift(long value) { + + maxClockDrift_ = value; + } + /** + * uint64 max_clock_drift = 3 [json_name = "maxClockDrift"]; + */ + private void clearMaxClockDrift() { + + maxClockDrift_ = 0L; + } + + public static final int LATEST_HEIGHT_FIELD_NUMBER = 4; + private long latestHeight_; + /** + * uint64 latest_height = 4 [json_name = "latestHeight"]; + * @return The latestHeight. + */ + @java.lang.Override + public long getLatestHeight() { + return latestHeight_; + } + /** + * uint64 latest_height = 4 [json_name = "latestHeight"]; + * @param value The latestHeight to set. + */ + private void setLatestHeight(long value) { + + latestHeight_ = value; + } + /** + * uint64 latest_height = 4 [json_name = "latestHeight"]; + */ + private void clearLatestHeight() { + + latestHeight_ = 0L; + } + + public static final int SRC_NETWORK_ID_FIELD_NUMBER = 5; + private java.lang.String srcNetworkId_; + /** + * string src_network_id = 5 [json_name = "srcNetworkId"]; + * @return The srcNetworkId. + */ + @java.lang.Override + public java.lang.String getSrcNetworkId() { + return srcNetworkId_; + } + /** + * string src_network_id = 5 [json_name = "srcNetworkId"]; + * @return The bytes for srcNetworkId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getSrcNetworkIdBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(srcNetworkId_); + } + /** + * string src_network_id = 5 [json_name = "srcNetworkId"]; + * @param value The srcNetworkId to set. + */ + private void setSrcNetworkId( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + srcNetworkId_ = value; + } + /** + * string src_network_id = 5 [json_name = "srcNetworkId"]; + */ + private void clearSrcNetworkId() { + + srcNetworkId_ = getDefaultInstance().getSrcNetworkId(); + } + /** + * string src_network_id = 5 [json_name = "srcNetworkId"]; + * @param value The bytes for srcNetworkId to set. + */ + private void setSrcNetworkIdBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + srcNetworkId_ = value.toStringUtf8(); + + } + + public static final int NETWORK_ID_FIELD_NUMBER = 6; + private long networkId_; + /** + * uint64 network_id = 6 [json_name = "networkId"]; + * @return The networkId. + */ + @java.lang.Override + public long getNetworkId() { + return networkId_; + } + /** + * uint64 network_id = 6 [json_name = "networkId"]; + * @param value The networkId to set. + */ + private void setNetworkId(long value) { + + networkId_ = value; + } + /** + * uint64 network_id = 6 [json_name = "networkId"]; + */ + private void clearNetworkId() { + + networkId_ = 0L; + } + + public static final int NETWORK_TYPE_ID_FIELD_NUMBER = 7; + private long networkTypeId_; + /** + * uint64 network_type_id = 7 [json_name = "networkTypeId"]; + * @return The networkTypeId. + */ + @java.lang.Override + public long getNetworkTypeId() { + return networkTypeId_; + } + /** + * uint64 network_type_id = 7 [json_name = "networkTypeId"]; + * @param value The networkTypeId to set. + */ + private void setNetworkTypeId(long value) { + + networkTypeId_ = value; + } + /** + * uint64 network_type_id = 7 [json_name = "networkTypeId"]; + */ + private void clearNetworkTypeId() { + + networkTypeId_ = 0L; + } + + public static com.icon.lightclient.v1.ClientState parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.lightclient.v1.ClientState parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.lightclient.v1.ClientState parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.lightclient.v1.ClientState parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.lightclient.v1.ClientState parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.lightclient.v1.ClientState parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.lightclient.v1.ClientState parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.icon.lightclient.v1.ClientState parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.icon.lightclient.v1.ClientState parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.icon.lightclient.v1.ClientState parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.icon.lightclient.v1.ClientState parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.icon.lightclient.v1.ClientState parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.icon.lightclient.v1.ClientState prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + * Protobuf type {@code icon.lightclient.v1.ClientState} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.icon.lightclient.v1.ClientState, Builder> implements + // @@protoc_insertion_point(builder_implements:icon.lightclient.v1.ClientState) + com.icon.lightclient.v1.ClientStateOrBuilder { + // Construct using com.icon.lightclient.v1.ClientState.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * uint64 trusting_period = 1 [json_name = "trustingPeriod"]; + * @return The trustingPeriod. + */ + @java.lang.Override + public long getTrustingPeriod() { + return instance.getTrustingPeriod(); + } + /** + * uint64 trusting_period = 1 [json_name = "trustingPeriod"]; + * @param value The trustingPeriod to set. + * @return This builder for chaining. + */ + public Builder setTrustingPeriod(long value) { + copyOnWrite(); + instance.setTrustingPeriod(value); + return this; + } + /** + * uint64 trusting_period = 1 [json_name = "trustingPeriod"]; + * @return This builder for chaining. + */ + public Builder clearTrustingPeriod() { + copyOnWrite(); + instance.clearTrustingPeriod(); + return this; + } + + /** + * uint64 frozen_height = 2 [json_name = "frozenHeight"]; + * @return The frozenHeight. + */ + @java.lang.Override + public long getFrozenHeight() { + return instance.getFrozenHeight(); + } + /** + * uint64 frozen_height = 2 [json_name = "frozenHeight"]; + * @param value The frozenHeight to set. + * @return This builder for chaining. + */ + public Builder setFrozenHeight(long value) { + copyOnWrite(); + instance.setFrozenHeight(value); + return this; + } + /** + * uint64 frozen_height = 2 [json_name = "frozenHeight"]; + * @return This builder for chaining. + */ + public Builder clearFrozenHeight() { + copyOnWrite(); + instance.clearFrozenHeight(); + return this; + } + + /** + * uint64 max_clock_drift = 3 [json_name = "maxClockDrift"]; + * @return The maxClockDrift. + */ + @java.lang.Override + public long getMaxClockDrift() { + return instance.getMaxClockDrift(); + } + /** + * uint64 max_clock_drift = 3 [json_name = "maxClockDrift"]; + * @param value The maxClockDrift to set. + * @return This builder for chaining. + */ + public Builder setMaxClockDrift(long value) { + copyOnWrite(); + instance.setMaxClockDrift(value); + return this; + } + /** + * uint64 max_clock_drift = 3 [json_name = "maxClockDrift"]; + * @return This builder for chaining. + */ + public Builder clearMaxClockDrift() { + copyOnWrite(); + instance.clearMaxClockDrift(); + return this; + } + + /** + * uint64 latest_height = 4 [json_name = "latestHeight"]; + * @return The latestHeight. + */ + @java.lang.Override + public long getLatestHeight() { + return instance.getLatestHeight(); + } + /** + * uint64 latest_height = 4 [json_name = "latestHeight"]; + * @param value The latestHeight to set. + * @return This builder for chaining. + */ + public Builder setLatestHeight(long value) { + copyOnWrite(); + instance.setLatestHeight(value); + return this; + } + /** + * uint64 latest_height = 4 [json_name = "latestHeight"]; + * @return This builder for chaining. + */ + public Builder clearLatestHeight() { + copyOnWrite(); + instance.clearLatestHeight(); + return this; + } + + /** + * string src_network_id = 5 [json_name = "srcNetworkId"]; + * @return The srcNetworkId. + */ + @java.lang.Override + public java.lang.String getSrcNetworkId() { + return instance.getSrcNetworkId(); + } + /** + * string src_network_id = 5 [json_name = "srcNetworkId"]; + * @return The bytes for srcNetworkId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getSrcNetworkIdBytes() { + return instance.getSrcNetworkIdBytes(); + } + /** + * string src_network_id = 5 [json_name = "srcNetworkId"]; + * @param value The srcNetworkId to set. + * @return This builder for chaining. + */ + public Builder setSrcNetworkId( + java.lang.String value) { + copyOnWrite(); + instance.setSrcNetworkId(value); + return this; + } + /** + * string src_network_id = 5 [json_name = "srcNetworkId"]; + * @return This builder for chaining. + */ + public Builder clearSrcNetworkId() { + copyOnWrite(); + instance.clearSrcNetworkId(); + return this; + } + /** + * string src_network_id = 5 [json_name = "srcNetworkId"]; + * @param value The bytes for srcNetworkId to set. + * @return This builder for chaining. + */ + public Builder setSrcNetworkIdBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setSrcNetworkIdBytes(value); + return this; + } + + /** + * uint64 network_id = 6 [json_name = "networkId"]; + * @return The networkId. + */ + @java.lang.Override + public long getNetworkId() { + return instance.getNetworkId(); + } + /** + * uint64 network_id = 6 [json_name = "networkId"]; + * @param value The networkId to set. + * @return This builder for chaining. + */ + public Builder setNetworkId(long value) { + copyOnWrite(); + instance.setNetworkId(value); + return this; + } + /** + * uint64 network_id = 6 [json_name = "networkId"]; + * @return This builder for chaining. + */ + public Builder clearNetworkId() { + copyOnWrite(); + instance.clearNetworkId(); + return this; + } + + /** + * uint64 network_type_id = 7 [json_name = "networkTypeId"]; + * @return The networkTypeId. + */ + @java.lang.Override + public long getNetworkTypeId() { + return instance.getNetworkTypeId(); + } + /** + * uint64 network_type_id = 7 [json_name = "networkTypeId"]; + * @param value The networkTypeId to set. + * @return This builder for chaining. + */ + public Builder setNetworkTypeId(long value) { + copyOnWrite(); + instance.setNetworkTypeId(value); + return this; + } + /** + * uint64 network_type_id = 7 [json_name = "networkTypeId"]; + * @return This builder for chaining. + */ + public Builder clearNetworkTypeId() { + copyOnWrite(); + instance.clearNetworkTypeId(); + return this; + } + + // @@protoc_insertion_point(builder_scope:icon.lightclient.v1.ClientState) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.icon.lightclient.v1.ClientState(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "trustingPeriod_", + "frozenHeight_", + "maxClockDrift_", + "latestHeight_", + "srcNetworkId_", + "networkId_", + "networkTypeId_", + }; + java.lang.String info = + "\u0000\u0007\u0000\u0000\u0001\u0007\u0007\u0000\u0000\u0000\u0001\u0003\u0002\u0003" + + "\u0003\u0003\u0004\u0003\u0005\u0208\u0006\u0003\u0007\u0003"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.icon.lightclient.v1.ClientState.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:icon.lightclient.v1.ClientState) + private static final com.icon.lightclient.v1.ClientState DEFAULT_INSTANCE; + static { + ClientState defaultInstance = new ClientState(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + ClientState.class, defaultInstance); + } + + public static com.icon.lightclient.v1.ClientState getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/lightclient/v1/ClientStateOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/lightclient/v1/ClientStateOrBuilder.java new file mode 100644 index 000000000..9a9c75914 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/lightclient/v1/ClientStateOrBuilder.java @@ -0,0 +1,57 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: icon/lightclient/v1/light.proto + +package com.icon.lightclient.v1; + +public interface ClientStateOrBuilder extends + // @@protoc_insertion_point(interface_extends:icon.lightclient.v1.ClientState) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * uint64 trusting_period = 1 [json_name = "trustingPeriod"]; + * @return The trustingPeriod. + */ + long getTrustingPeriod(); + + /** + * uint64 frozen_height = 2 [json_name = "frozenHeight"]; + * @return The frozenHeight. + */ + long getFrozenHeight(); + + /** + * uint64 max_clock_drift = 3 [json_name = "maxClockDrift"]; + * @return The maxClockDrift. + */ + long getMaxClockDrift(); + + /** + * uint64 latest_height = 4 [json_name = "latestHeight"]; + * @return The latestHeight. + */ + long getLatestHeight(); + + /** + * string src_network_id = 5 [json_name = "srcNetworkId"]; + * @return The srcNetworkId. + */ + java.lang.String getSrcNetworkId(); + /** + * string src_network_id = 5 [json_name = "srcNetworkId"]; + * @return The bytes for srcNetworkId. + */ + com.google.protobuf.ByteString + getSrcNetworkIdBytes(); + + /** + * uint64 network_id = 6 [json_name = "networkId"]; + * @return The networkId. + */ + long getNetworkId(); + + /** + * uint64 network_type_id = 7 [json_name = "networkTypeId"]; + * @return The networkTypeId. + */ + long getNetworkTypeId(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/lightclient/v1/ConsensusState.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/lightclient/v1/ConsensusState.java new file mode 100644 index 000000000..ea842aa0e --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/lightclient/v1/ConsensusState.java @@ -0,0 +1,297 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: icon/lightclient/v1/light.proto + +package com.icon.lightclient.v1; + +/** + * Protobuf type {@code icon.lightclient.v1.ConsensusState} + */ +public final class ConsensusState extends + com.google.protobuf.GeneratedMessageLite< + ConsensusState, ConsensusState.Builder> implements + // @@protoc_insertion_point(message_implements:icon.lightclient.v1.ConsensusState) + ConsensusStateOrBuilder { + private ConsensusState() { + messageRoot_ = com.google.protobuf.ByteString.EMPTY; + nextProofContextHash_ = com.google.protobuf.ByteString.EMPTY; + } + public static final int MESSAGE_ROOT_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString messageRoot_; + /** + * bytes message_root = 1 [json_name = "messageRoot"]; + * @return The messageRoot. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMessageRoot() { + return messageRoot_; + } + /** + * bytes message_root = 1 [json_name = "messageRoot"]; + * @param value The messageRoot to set. + */ + private void setMessageRoot(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + messageRoot_ = value; + } + /** + * bytes message_root = 1 [json_name = "messageRoot"]; + */ + private void clearMessageRoot() { + + messageRoot_ = getDefaultInstance().getMessageRoot(); + } + + public static final int NEXT_PROOF_CONTEXT_HASH_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString nextProofContextHash_; + /** + * bytes next_proof_context_hash = 2 [json_name = "nextProofContextHash"]; + * @return The nextProofContextHash. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextProofContextHash() { + return nextProofContextHash_; + } + /** + * bytes next_proof_context_hash = 2 [json_name = "nextProofContextHash"]; + * @param value The nextProofContextHash to set. + */ + private void setNextProofContextHash(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + nextProofContextHash_ = value; + } + /** + * bytes next_proof_context_hash = 2 [json_name = "nextProofContextHash"]; + */ + private void clearNextProofContextHash() { + + nextProofContextHash_ = getDefaultInstance().getNextProofContextHash(); + } + + public static com.icon.lightclient.v1.ConsensusState parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.lightclient.v1.ConsensusState parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.lightclient.v1.ConsensusState parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.lightclient.v1.ConsensusState parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.lightclient.v1.ConsensusState parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.lightclient.v1.ConsensusState parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.lightclient.v1.ConsensusState parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.icon.lightclient.v1.ConsensusState parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.icon.lightclient.v1.ConsensusState parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.icon.lightclient.v1.ConsensusState parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.icon.lightclient.v1.ConsensusState parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.icon.lightclient.v1.ConsensusState parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.icon.lightclient.v1.ConsensusState prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + * Protobuf type {@code icon.lightclient.v1.ConsensusState} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.icon.lightclient.v1.ConsensusState, Builder> implements + // @@protoc_insertion_point(builder_implements:icon.lightclient.v1.ConsensusState) + com.icon.lightclient.v1.ConsensusStateOrBuilder { + // Construct using com.icon.lightclient.v1.ConsensusState.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * bytes message_root = 1 [json_name = "messageRoot"]; + * @return The messageRoot. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMessageRoot() { + return instance.getMessageRoot(); + } + /** + * bytes message_root = 1 [json_name = "messageRoot"]; + * @param value The messageRoot to set. + * @return This builder for chaining. + */ + public Builder setMessageRoot(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setMessageRoot(value); + return this; + } + /** + * bytes message_root = 1 [json_name = "messageRoot"]; + * @return This builder for chaining. + */ + public Builder clearMessageRoot() { + copyOnWrite(); + instance.clearMessageRoot(); + return this; + } + + /** + * bytes next_proof_context_hash = 2 [json_name = "nextProofContextHash"]; + * @return The nextProofContextHash. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextProofContextHash() { + return instance.getNextProofContextHash(); + } + /** + * bytes next_proof_context_hash = 2 [json_name = "nextProofContextHash"]; + * @param value The nextProofContextHash to set. + * @return This builder for chaining. + */ + public Builder setNextProofContextHash(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setNextProofContextHash(value); + return this; + } + /** + * bytes next_proof_context_hash = 2 [json_name = "nextProofContextHash"]; + * @return This builder for chaining. + */ + public Builder clearNextProofContextHash() { + copyOnWrite(); + instance.clearNextProofContextHash(); + return this; + } + + // @@protoc_insertion_point(builder_scope:icon.lightclient.v1.ConsensusState) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.icon.lightclient.v1.ConsensusState(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "messageRoot_", + "nextProofContextHash_", + }; + java.lang.String info = + "\u0000\u0002\u0000\u0000\u0001\u0002\u0002\u0000\u0000\u0000\u0001\n\u0002\n"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.icon.lightclient.v1.ConsensusState.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:icon.lightclient.v1.ConsensusState) + private static final com.icon.lightclient.v1.ConsensusState DEFAULT_INSTANCE; + static { + ConsensusState defaultInstance = new ConsensusState(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + ConsensusState.class, defaultInstance); + } + + public static com.icon.lightclient.v1.ConsensusState getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/lightclient/v1/ConsensusStateOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/lightclient/v1/ConsensusStateOrBuilder.java new file mode 100644 index 000000000..c9373974a --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/lightclient/v1/ConsensusStateOrBuilder.java @@ -0,0 +1,21 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: icon/lightclient/v1/light.proto + +package com.icon.lightclient.v1; + +public interface ConsensusStateOrBuilder extends + // @@protoc_insertion_point(interface_extends:icon.lightclient.v1.ConsensusState) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * bytes message_root = 1 [json_name = "messageRoot"]; + * @return The messageRoot. + */ + com.google.protobuf.ByteString getMessageRoot(); + + /** + * bytes next_proof_context_hash = 2 [json_name = "nextProofContextHash"]; + * @return The nextProofContextHash. + */ + com.google.protobuf.ByteString getNextProofContextHash(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/lightclient/v1/LightProto.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/lightclient/v1/LightProto.java new file mode 100644 index 000000000..83452e076 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/lightclient/v1/LightProto.java @@ -0,0 +1,16 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: icon/lightclient/v1/light.proto + +package com.icon.lightclient.v1; + +public final class LightProto { + private LightProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + static { + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/lightclient/v1/Misbehaviour.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/lightclient/v1/Misbehaviour.java new file mode 100644 index 000000000..89c5c3bb2 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/lightclient/v1/Misbehaviour.java @@ -0,0 +1,470 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: icon/lightclient/v1/light.proto + +package com.icon.lightclient.v1; + +/** + * Protobuf type {@code icon.lightclient.v1.Misbehaviour} + */ +public final class Misbehaviour extends + com.google.protobuf.GeneratedMessageLite< + Misbehaviour, Misbehaviour.Builder> implements + // @@protoc_insertion_point(message_implements:icon.lightclient.v1.Misbehaviour) + MisbehaviourOrBuilder { + private Misbehaviour() { + clientId_ = ""; + } + public static final int CLIENT_ID_FIELD_NUMBER = 1; + private java.lang.String clientId_; + /** + * string client_id = 1 [json_name = "clientId"]; + * @return The clientId. + */ + @java.lang.Override + public java.lang.String getClientId() { + return clientId_; + } + /** + * string client_id = 1 [json_name = "clientId"]; + * @return The bytes for clientId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getClientIdBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(clientId_); + } + /** + * string client_id = 1 [json_name = "clientId"]; + * @param value The clientId to set. + */ + private void setClientId( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + clientId_ = value; + } + /** + * string client_id = 1 [json_name = "clientId"]; + */ + private void clearClientId() { + + clientId_ = getDefaultInstance().getClientId(); + } + /** + * string client_id = 1 [json_name = "clientId"]; + * @param value The bytes for clientId to set. + */ + private void setClientIdBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + clientId_ = value.toStringUtf8(); + + } + + public static final int HEADER_1_FIELD_NUMBER = 2; + private com.icon.lightclient.v1.BlockUpdate header1_; + /** + * .icon.lightclient.v1.BlockUpdate header_1 = 2 [json_name = "header1"]; + */ + @java.lang.Override + public boolean hasHeader1() { + return header1_ != null; + } + /** + * .icon.lightclient.v1.BlockUpdate header_1 = 2 [json_name = "header1"]; + */ + @java.lang.Override + public com.icon.lightclient.v1.BlockUpdate getHeader1() { + return header1_ == null ? com.icon.lightclient.v1.BlockUpdate.getDefaultInstance() : header1_; + } + /** + * .icon.lightclient.v1.BlockUpdate header_1 = 2 [json_name = "header1"]; + */ + private void setHeader1(com.icon.lightclient.v1.BlockUpdate value) { + value.getClass(); + header1_ = value; + + } + /** + * .icon.lightclient.v1.BlockUpdate header_1 = 2 [json_name = "header1"]; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeHeader1(com.icon.lightclient.v1.BlockUpdate value) { + value.getClass(); + if (header1_ != null && + header1_ != com.icon.lightclient.v1.BlockUpdate.getDefaultInstance()) { + header1_ = + com.icon.lightclient.v1.BlockUpdate.newBuilder(header1_).mergeFrom(value).buildPartial(); + } else { + header1_ = value; + } + + } + /** + * .icon.lightclient.v1.BlockUpdate header_1 = 2 [json_name = "header1"]; + */ + private void clearHeader1() { header1_ = null; + + } + + public static final int HEADER_2_FIELD_NUMBER = 3; + private com.icon.lightclient.v1.BlockUpdate header2_; + /** + * .icon.lightclient.v1.BlockUpdate header_2 = 3 [json_name = "header2"]; + */ + @java.lang.Override + public boolean hasHeader2() { + return header2_ != null; + } + /** + * .icon.lightclient.v1.BlockUpdate header_2 = 3 [json_name = "header2"]; + */ + @java.lang.Override + public com.icon.lightclient.v1.BlockUpdate getHeader2() { + return header2_ == null ? com.icon.lightclient.v1.BlockUpdate.getDefaultInstance() : header2_; + } + /** + * .icon.lightclient.v1.BlockUpdate header_2 = 3 [json_name = "header2"]; + */ + private void setHeader2(com.icon.lightclient.v1.BlockUpdate value) { + value.getClass(); + header2_ = value; + + } + /** + * .icon.lightclient.v1.BlockUpdate header_2 = 3 [json_name = "header2"]; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeHeader2(com.icon.lightclient.v1.BlockUpdate value) { + value.getClass(); + if (header2_ != null && + header2_ != com.icon.lightclient.v1.BlockUpdate.getDefaultInstance()) { + header2_ = + com.icon.lightclient.v1.BlockUpdate.newBuilder(header2_).mergeFrom(value).buildPartial(); + } else { + header2_ = value; + } + + } + /** + * .icon.lightclient.v1.BlockUpdate header_2 = 3 [json_name = "header2"]; + */ + private void clearHeader2() { header2_ = null; + + } + + public static com.icon.lightclient.v1.Misbehaviour parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.lightclient.v1.Misbehaviour parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.lightclient.v1.Misbehaviour parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.lightclient.v1.Misbehaviour parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.lightclient.v1.Misbehaviour parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.lightclient.v1.Misbehaviour parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.lightclient.v1.Misbehaviour parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.icon.lightclient.v1.Misbehaviour parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.icon.lightclient.v1.Misbehaviour parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.icon.lightclient.v1.Misbehaviour parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.icon.lightclient.v1.Misbehaviour parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.icon.lightclient.v1.Misbehaviour parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.icon.lightclient.v1.Misbehaviour prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + * Protobuf type {@code icon.lightclient.v1.Misbehaviour} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.icon.lightclient.v1.Misbehaviour, Builder> implements + // @@protoc_insertion_point(builder_implements:icon.lightclient.v1.Misbehaviour) + com.icon.lightclient.v1.MisbehaviourOrBuilder { + // Construct using com.icon.lightclient.v1.Misbehaviour.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * string client_id = 1 [json_name = "clientId"]; + * @return The clientId. + */ + @java.lang.Override + public java.lang.String getClientId() { + return instance.getClientId(); + } + /** + * string client_id = 1 [json_name = "clientId"]; + * @return The bytes for clientId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getClientIdBytes() { + return instance.getClientIdBytes(); + } + /** + * string client_id = 1 [json_name = "clientId"]; + * @param value The clientId to set. + * @return This builder for chaining. + */ + public Builder setClientId( + java.lang.String value) { + copyOnWrite(); + instance.setClientId(value); + return this; + } + /** + * string client_id = 1 [json_name = "clientId"]; + * @return This builder for chaining. + */ + public Builder clearClientId() { + copyOnWrite(); + instance.clearClientId(); + return this; + } + /** + * string client_id = 1 [json_name = "clientId"]; + * @param value The bytes for clientId to set. + * @return This builder for chaining. + */ + public Builder setClientIdBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setClientIdBytes(value); + return this; + } + + /** + * .icon.lightclient.v1.BlockUpdate header_1 = 2 [json_name = "header1"]; + */ + @java.lang.Override + public boolean hasHeader1() { + return instance.hasHeader1(); + } + /** + * .icon.lightclient.v1.BlockUpdate header_1 = 2 [json_name = "header1"]; + */ + @java.lang.Override + public com.icon.lightclient.v1.BlockUpdate getHeader1() { + return instance.getHeader1(); + } + /** + * .icon.lightclient.v1.BlockUpdate header_1 = 2 [json_name = "header1"]; + */ + public Builder setHeader1(com.icon.lightclient.v1.BlockUpdate value) { + copyOnWrite(); + instance.setHeader1(value); + return this; + } + /** + * .icon.lightclient.v1.BlockUpdate header_1 = 2 [json_name = "header1"]; + */ + public Builder setHeader1( + com.icon.lightclient.v1.BlockUpdate.Builder builderForValue) { + copyOnWrite(); + instance.setHeader1(builderForValue.build()); + return this; + } + /** + * .icon.lightclient.v1.BlockUpdate header_1 = 2 [json_name = "header1"]; + */ + public Builder mergeHeader1(com.icon.lightclient.v1.BlockUpdate value) { + copyOnWrite(); + instance.mergeHeader1(value); + return this; + } + /** + * .icon.lightclient.v1.BlockUpdate header_1 = 2 [json_name = "header1"]; + */ + public Builder clearHeader1() { copyOnWrite(); + instance.clearHeader1(); + return this; + } + + /** + * .icon.lightclient.v1.BlockUpdate header_2 = 3 [json_name = "header2"]; + */ + @java.lang.Override + public boolean hasHeader2() { + return instance.hasHeader2(); + } + /** + * .icon.lightclient.v1.BlockUpdate header_2 = 3 [json_name = "header2"]; + */ + @java.lang.Override + public com.icon.lightclient.v1.BlockUpdate getHeader2() { + return instance.getHeader2(); + } + /** + * .icon.lightclient.v1.BlockUpdate header_2 = 3 [json_name = "header2"]; + */ + public Builder setHeader2(com.icon.lightclient.v1.BlockUpdate value) { + copyOnWrite(); + instance.setHeader2(value); + return this; + } + /** + * .icon.lightclient.v1.BlockUpdate header_2 = 3 [json_name = "header2"]; + */ + public Builder setHeader2( + com.icon.lightclient.v1.BlockUpdate.Builder builderForValue) { + copyOnWrite(); + instance.setHeader2(builderForValue.build()); + return this; + } + /** + * .icon.lightclient.v1.BlockUpdate header_2 = 3 [json_name = "header2"]; + */ + public Builder mergeHeader2(com.icon.lightclient.v1.BlockUpdate value) { + copyOnWrite(); + instance.mergeHeader2(value); + return this; + } + /** + * .icon.lightclient.v1.BlockUpdate header_2 = 3 [json_name = "header2"]; + */ + public Builder clearHeader2() { copyOnWrite(); + instance.clearHeader2(); + return this; + } + + // @@protoc_insertion_point(builder_scope:icon.lightclient.v1.Misbehaviour) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.icon.lightclient.v1.Misbehaviour(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "clientId_", + "header1_", + "header2_", + }; + java.lang.String info = + "\u0000\u0003\u0000\u0000\u0001\u0003\u0003\u0000\u0000\u0000\u0001\u0208\u0002\t" + + "\u0003\t"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.icon.lightclient.v1.Misbehaviour.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:icon.lightclient.v1.Misbehaviour) + private static final com.icon.lightclient.v1.Misbehaviour DEFAULT_INSTANCE; + static { + Misbehaviour defaultInstance = new Misbehaviour(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + Misbehaviour.class, defaultInstance); + } + + public static com.icon.lightclient.v1.Misbehaviour getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/lightclient/v1/MisbehaviourOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/lightclient/v1/MisbehaviourOrBuilder.java new file mode 100644 index 000000000..4ae2a0811 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/lightclient/v1/MisbehaviourOrBuilder.java @@ -0,0 +1,43 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: icon/lightclient/v1/light.proto + +package com.icon.lightclient.v1; + +public interface MisbehaviourOrBuilder extends + // @@protoc_insertion_point(interface_extends:icon.lightclient.v1.Misbehaviour) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * string client_id = 1 [json_name = "clientId"]; + * @return The clientId. + */ + java.lang.String getClientId(); + /** + * string client_id = 1 [json_name = "clientId"]; + * @return The bytes for clientId. + */ + com.google.protobuf.ByteString + getClientIdBytes(); + + /** + * .icon.lightclient.v1.BlockUpdate header_1 = 2 [json_name = "header1"]; + * @return Whether the header1 field is set. + */ + boolean hasHeader1(); + /** + * .icon.lightclient.v1.BlockUpdate header_1 = 2 [json_name = "header1"]; + * @return The header1. + */ + com.icon.lightclient.v1.BlockUpdate getHeader1(); + + /** + * .icon.lightclient.v1.BlockUpdate header_2 = 3 [json_name = "header2"]; + * @return Whether the header2 field is set. + */ + boolean hasHeader2(); + /** + * .icon.lightclient.v1.BlockUpdate header_2 = 3 [json_name = "header2"]; + * @return The header2. + */ + com.icon.lightclient.v1.BlockUpdate getHeader2(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/lightclient/v1/TrustLevel.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/lightclient/v1/TrustLevel.java new file mode 100644 index 000000000..f04dde697 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/lightclient/v1/TrustLevel.java @@ -0,0 +1,294 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: icon/lightclient/v1/light.proto + +package com.icon.lightclient.v1; + +/** + * Protobuf type {@code icon.lightclient.v1.TrustLevel} + */ +public final class TrustLevel extends + com.google.protobuf.GeneratedMessageLite< + TrustLevel, TrustLevel.Builder> implements + // @@protoc_insertion_point(message_implements:icon.lightclient.v1.TrustLevel) + TrustLevelOrBuilder { + private TrustLevel() { + } + public static final int NUMERATOR_FIELD_NUMBER = 1; + private long numerator_; + /** + * uint64 numerator = 1 [json_name = "numerator"]; + * @return The numerator. + */ + @java.lang.Override + public long getNumerator() { + return numerator_; + } + /** + * uint64 numerator = 1 [json_name = "numerator"]; + * @param value The numerator to set. + */ + private void setNumerator(long value) { + + numerator_ = value; + } + /** + * uint64 numerator = 1 [json_name = "numerator"]; + */ + private void clearNumerator() { + + numerator_ = 0L; + } + + public static final int DENOMINATOR_FIELD_NUMBER = 2; + private long denominator_; + /** + * uint64 denominator = 2 [json_name = "denominator"]; + * @return The denominator. + */ + @java.lang.Override + public long getDenominator() { + return denominator_; + } + /** + * uint64 denominator = 2 [json_name = "denominator"]; + * @param value The denominator to set. + */ + private void setDenominator(long value) { + + denominator_ = value; + } + /** + * uint64 denominator = 2 [json_name = "denominator"]; + */ + private void clearDenominator() { + + denominator_ = 0L; + } + + public static com.icon.lightclient.v1.TrustLevel parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.lightclient.v1.TrustLevel parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.lightclient.v1.TrustLevel parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.lightclient.v1.TrustLevel parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.lightclient.v1.TrustLevel parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.lightclient.v1.TrustLevel parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.lightclient.v1.TrustLevel parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.icon.lightclient.v1.TrustLevel parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.icon.lightclient.v1.TrustLevel parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.icon.lightclient.v1.TrustLevel parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.icon.lightclient.v1.TrustLevel parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.icon.lightclient.v1.TrustLevel parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.icon.lightclient.v1.TrustLevel prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + * Protobuf type {@code icon.lightclient.v1.TrustLevel} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.icon.lightclient.v1.TrustLevel, Builder> implements + // @@protoc_insertion_point(builder_implements:icon.lightclient.v1.TrustLevel) + com.icon.lightclient.v1.TrustLevelOrBuilder { + // Construct using com.icon.lightclient.v1.TrustLevel.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * uint64 numerator = 1 [json_name = "numerator"]; + * @return The numerator. + */ + @java.lang.Override + public long getNumerator() { + return instance.getNumerator(); + } + /** + * uint64 numerator = 1 [json_name = "numerator"]; + * @param value The numerator to set. + * @return This builder for chaining. + */ + public Builder setNumerator(long value) { + copyOnWrite(); + instance.setNumerator(value); + return this; + } + /** + * uint64 numerator = 1 [json_name = "numerator"]; + * @return This builder for chaining. + */ + public Builder clearNumerator() { + copyOnWrite(); + instance.clearNumerator(); + return this; + } + + /** + * uint64 denominator = 2 [json_name = "denominator"]; + * @return The denominator. + */ + @java.lang.Override + public long getDenominator() { + return instance.getDenominator(); + } + /** + * uint64 denominator = 2 [json_name = "denominator"]; + * @param value The denominator to set. + * @return This builder for chaining. + */ + public Builder setDenominator(long value) { + copyOnWrite(); + instance.setDenominator(value); + return this; + } + /** + * uint64 denominator = 2 [json_name = "denominator"]; + * @return This builder for chaining. + */ + public Builder clearDenominator() { + copyOnWrite(); + instance.clearDenominator(); + return this; + } + + // @@protoc_insertion_point(builder_scope:icon.lightclient.v1.TrustLevel) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.icon.lightclient.v1.TrustLevel(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "numerator_", + "denominator_", + }; + java.lang.String info = + "\u0000\u0002\u0000\u0000\u0001\u0002\u0002\u0000\u0000\u0000\u0001\u0003\u0002\u0003" + + ""; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.icon.lightclient.v1.TrustLevel.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:icon.lightclient.v1.TrustLevel) + private static final com.icon.lightclient.v1.TrustLevel DEFAULT_INSTANCE; + static { + TrustLevel defaultInstance = new TrustLevel(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + TrustLevel.class, defaultInstance); + } + + public static com.icon.lightclient.v1.TrustLevel getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/lightclient/v1/TrustLevelOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/lightclient/v1/TrustLevelOrBuilder.java new file mode 100644 index 000000000..ffcc7576d --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/lightclient/v1/TrustLevelOrBuilder.java @@ -0,0 +1,21 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: icon/lightclient/v1/light.proto + +package com.icon.lightclient.v1; + +public interface TrustLevelOrBuilder extends + // @@protoc_insertion_point(interface_extends:icon.lightclient.v1.TrustLevel) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * uint64 numerator = 1 [json_name = "numerator"]; + * @return The numerator. + */ + long getNumerator(); + + /** + * uint64 denominator = 2 [json_name = "denominator"]; + * @return The denominator. + */ + long getDenominator(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/channel/Channel.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/channel/Channel.java new file mode 100644 index 000000000..56db34aea --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/channel/Channel.java @@ -0,0 +1,3249 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: core/04-channel/Channel.proto + +package com.icon.proto.core.channel; + +/** + *
+ * Channel defines pipeline for exactly-once packet delivery between specific
+ * modules on separate blockchains, which has at least one end capable of
+ * sending packets and one end capable of receiving packets.
+ * 
+ * + * Protobuf type {@code icon.proto.core.channel.Channel} + */ +public final class Channel extends + com.google.protobuf.GeneratedMessageLite< + Channel, Channel.Builder> implements + // @@protoc_insertion_point(message_implements:icon.proto.core.channel.Channel) + ChannelOrBuilder { + private Channel() { + connectionHops_ = com.google.protobuf.GeneratedMessageLite.emptyProtobufList(); + version_ = ""; + } + /** + *
+   * State defines if a channel is in one of the following states:
+   * CLOSED, INIT, TRYOPEN, OPEN or UNINITIALIZED.
+   * 
+ * + * Protobuf enum {@code icon.proto.core.channel.Channel.State} + */ + public enum State + implements com.google.protobuf.Internal.EnumLite { + /** + *
+     * Default State
+     * 
+ * + * STATE_UNINITIALIZED_UNSPECIFIED = 0; + */ + STATE_UNINITIALIZED_UNSPECIFIED(0), + /** + *
+     * A channel has just started the opening handshake.
+     * 
+ * + * STATE_INIT = 1; + */ + STATE_INIT(1), + /** + *
+     * A channel has acknowledged the handshake step on the counterparty chain.
+     * 
+ * + * STATE_TRYOPEN = 2; + */ + STATE_TRYOPEN(2), + /** + *
+     * A channel has completed the handshake. Open channels are
+     * ready to send and receive packets.
+     * 
+ * + * STATE_OPEN = 3; + */ + STATE_OPEN(3), + /** + *
+     * A channel has been closed and can no longer be used to send or receive
+     * packets.
+     * 
+ * + * STATE_CLOSED = 4; + */ + STATE_CLOSED(4), + UNRECOGNIZED(-1), + ; + + /** + *
+     * Default State
+     * 
+ * + * STATE_UNINITIALIZED_UNSPECIFIED = 0; + */ + public static final int STATE_UNINITIALIZED_UNSPECIFIED_VALUE = 0; + /** + *
+     * A channel has just started the opening handshake.
+     * 
+ * + * STATE_INIT = 1; + */ + public static final int STATE_INIT_VALUE = 1; + /** + *
+     * A channel has acknowledged the handshake step on the counterparty chain.
+     * 
+ * + * STATE_TRYOPEN = 2; + */ + public static final int STATE_TRYOPEN_VALUE = 2; + /** + *
+     * A channel has completed the handshake. Open channels are
+     * ready to send and receive packets.
+     * 
+ * + * STATE_OPEN = 3; + */ + public static final int STATE_OPEN_VALUE = 3; + /** + *
+     * A channel has been closed and can no longer be used to send or receive
+     * packets.
+     * 
+ * + * STATE_CLOSED = 4; + */ + public static final int STATE_CLOSED_VALUE = 4; + + + @java.lang.Override + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static State valueOf(int value) { + return forNumber(value); + } + + public static State forNumber(int value) { + switch (value) { + case 0: return STATE_UNINITIALIZED_UNSPECIFIED; + case 1: return STATE_INIT; + case 2: return STATE_TRYOPEN; + case 3: return STATE_OPEN; + case 4: return STATE_CLOSED; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + State> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + @java.lang.Override + public State findValueByNumber(int number) { + return State.forNumber(number); + } + }; + + public static com.google.protobuf.Internal.EnumVerifier + internalGetVerifier() { + return StateVerifier.INSTANCE; + } + + private static final class StateVerifier implements + com.google.protobuf.Internal.EnumVerifier { + static final com.google.protobuf.Internal.EnumVerifier INSTANCE = new StateVerifier(); + @java.lang.Override + public boolean isInRange(int number) { + return State.forNumber(number) != null; + } + }; + + private final int value; + + private State(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:icon.proto.core.channel.Channel.State) + } + + /** + *
+   * Order defines if a channel is ORDERED or UNORDERED
+   * 
+ * + * Protobuf enum {@code icon.proto.core.channel.Channel.Order} + */ + public enum Order + implements com.google.protobuf.Internal.EnumLite { + /** + *
+     * zero-value for channel ordering
+     * 
+ * + * ORDER_NONE_UNSPECIFIED = 0; + */ + ORDER_NONE_UNSPECIFIED(0), + /** + *
+     * packets can be delivered in any order, which may differ from the order in
+     * which they were sent.
+     * 
+ * + * ORDER_UNORDERED = 1; + */ + ORDER_UNORDERED(1), + /** + *
+     * packets are delivered exactly in the order which they were sent
+     * 
+ * + * ORDER_ORDERED = 2; + */ + ORDER_ORDERED(2), + UNRECOGNIZED(-1), + ; + + /** + *
+     * zero-value for channel ordering
+     * 
+ * + * ORDER_NONE_UNSPECIFIED = 0; + */ + public static final int ORDER_NONE_UNSPECIFIED_VALUE = 0; + /** + *
+     * packets can be delivered in any order, which may differ from the order in
+     * which they were sent.
+     * 
+ * + * ORDER_UNORDERED = 1; + */ + public static final int ORDER_UNORDERED_VALUE = 1; + /** + *
+     * packets are delivered exactly in the order which they were sent
+     * 
+ * + * ORDER_ORDERED = 2; + */ + public static final int ORDER_ORDERED_VALUE = 2; + + + @java.lang.Override + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Order valueOf(int value) { + return forNumber(value); + } + + public static Order forNumber(int value) { + switch (value) { + case 0: return ORDER_NONE_UNSPECIFIED; + case 1: return ORDER_UNORDERED; + case 2: return ORDER_ORDERED; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + Order> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + @java.lang.Override + public Order findValueByNumber(int number) { + return Order.forNumber(number); + } + }; + + public static com.google.protobuf.Internal.EnumVerifier + internalGetVerifier() { + return OrderVerifier.INSTANCE; + } + + private static final class OrderVerifier implements + com.google.protobuf.Internal.EnumVerifier { + static final com.google.protobuf.Internal.EnumVerifier INSTANCE = new OrderVerifier(); + @java.lang.Override + public boolean isInRange(int number) { + return Order.forNumber(number) != null; + } + }; + + private final int value; + + private Order(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:icon.proto.core.channel.Channel.Order) + } + + public interface CounterpartyOrBuilder extends + // @@protoc_insertion_point(interface_extends:icon.proto.core.channel.Channel.Counterparty) + com.google.protobuf.MessageLiteOrBuilder { + + /** + *
+     * port on the counterparty chain which owns the other end of the channel.
+     * 
+ * + * string port_id = 1 [json_name = "portId"]; + * @return The portId. + */ + java.lang.String getPortId(); + /** + *
+     * port on the counterparty chain which owns the other end of the channel.
+     * 
+ * + * string port_id = 1 [json_name = "portId"]; + * @return The bytes for portId. + */ + com.google.protobuf.ByteString + getPortIdBytes(); + + /** + *
+     * channel end on the counterparty chain
+     * 
+ * + * string channel_id = 2 [json_name = "channelId"]; + * @return The channelId. + */ + java.lang.String getChannelId(); + /** + *
+     * channel end on the counterparty chain
+     * 
+ * + * string channel_id = 2 [json_name = "channelId"]; + * @return The bytes for channelId. + */ + com.google.protobuf.ByteString + getChannelIdBytes(); + } + /** + *
+   * Counterparty defines a channel end counterparty
+   * 
+ * + * Protobuf type {@code icon.proto.core.channel.Channel.Counterparty} + */ + public static final class Counterparty extends + com.google.protobuf.GeneratedMessageLite< + Counterparty, Counterparty.Builder> implements + // @@protoc_insertion_point(message_implements:icon.proto.core.channel.Channel.Counterparty) + CounterpartyOrBuilder { + private Counterparty() { + portId_ = ""; + channelId_ = ""; + } + public static final int PORT_ID_FIELD_NUMBER = 1; + private java.lang.String portId_; + /** + *
+     * port on the counterparty chain which owns the other end of the channel.
+     * 
+ * + * string port_id = 1 [json_name = "portId"]; + * @return The portId. + */ + @java.lang.Override + public java.lang.String getPortId() { + return portId_; + } + /** + *
+     * port on the counterparty chain which owns the other end of the channel.
+     * 
+ * + * string port_id = 1 [json_name = "portId"]; + * @return The bytes for portId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getPortIdBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(portId_); + } + /** + *
+     * port on the counterparty chain which owns the other end of the channel.
+     * 
+ * + * string port_id = 1 [json_name = "portId"]; + * @param value The portId to set. + */ + private void setPortId( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + portId_ = value; + } + /** + *
+     * port on the counterparty chain which owns the other end of the channel.
+     * 
+ * + * string port_id = 1 [json_name = "portId"]; + */ + private void clearPortId() { + + portId_ = getDefaultInstance().getPortId(); + } + /** + *
+     * port on the counterparty chain which owns the other end of the channel.
+     * 
+ * + * string port_id = 1 [json_name = "portId"]; + * @param value The bytes for portId to set. + */ + private void setPortIdBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + portId_ = value.toStringUtf8(); + + } + + public static final int CHANNEL_ID_FIELD_NUMBER = 2; + private java.lang.String channelId_; + /** + *
+     * channel end on the counterparty chain
+     * 
+ * + * string channel_id = 2 [json_name = "channelId"]; + * @return The channelId. + */ + @java.lang.Override + public java.lang.String getChannelId() { + return channelId_; + } + /** + *
+     * channel end on the counterparty chain
+     * 
+ * + * string channel_id = 2 [json_name = "channelId"]; + * @return The bytes for channelId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getChannelIdBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(channelId_); + } + /** + *
+     * channel end on the counterparty chain
+     * 
+ * + * string channel_id = 2 [json_name = "channelId"]; + * @param value The channelId to set. + */ + private void setChannelId( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + channelId_ = value; + } + /** + *
+     * channel end on the counterparty chain
+     * 
+ * + * string channel_id = 2 [json_name = "channelId"]; + */ + private void clearChannelId() { + + channelId_ = getDefaultInstance().getChannelId(); + } + /** + *
+     * channel end on the counterparty chain
+     * 
+ * + * string channel_id = 2 [json_name = "channelId"]; + * @param value The bytes for channelId to set. + */ + private void setChannelIdBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + channelId_ = value.toStringUtf8(); + + } + + public static com.icon.proto.core.channel.Channel.Counterparty parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.channel.Channel.Counterparty parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.channel.Channel.Counterparty parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.channel.Channel.Counterparty parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.channel.Channel.Counterparty parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.channel.Channel.Counterparty parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.channel.Channel.Counterparty parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.channel.Channel.Counterparty parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.icon.proto.core.channel.Channel.Counterparty parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.channel.Channel.Counterparty parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.icon.proto.core.channel.Channel.Counterparty parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.channel.Channel.Counterparty parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.icon.proto.core.channel.Channel.Counterparty prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+     * Counterparty defines a channel end counterparty
+     * 
+ * + * Protobuf type {@code icon.proto.core.channel.Channel.Counterparty} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.icon.proto.core.channel.Channel.Counterparty, Builder> implements + // @@protoc_insertion_point(builder_implements:icon.proto.core.channel.Channel.Counterparty) + com.icon.proto.core.channel.Channel.CounterpartyOrBuilder { + // Construct using com.icon.proto.core.channel.Channel.Counterparty.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + *
+       * port on the counterparty chain which owns the other end of the channel.
+       * 
+ * + * string port_id = 1 [json_name = "portId"]; + * @return The portId. + */ + @java.lang.Override + public java.lang.String getPortId() { + return instance.getPortId(); + } + /** + *
+       * port on the counterparty chain which owns the other end of the channel.
+       * 
+ * + * string port_id = 1 [json_name = "portId"]; + * @return The bytes for portId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getPortIdBytes() { + return instance.getPortIdBytes(); + } + /** + *
+       * port on the counterparty chain which owns the other end of the channel.
+       * 
+ * + * string port_id = 1 [json_name = "portId"]; + * @param value The portId to set. + * @return This builder for chaining. + */ + public Builder setPortId( + java.lang.String value) { + copyOnWrite(); + instance.setPortId(value); + return this; + } + /** + *
+       * port on the counterparty chain which owns the other end of the channel.
+       * 
+ * + * string port_id = 1 [json_name = "portId"]; + * @return This builder for chaining. + */ + public Builder clearPortId() { + copyOnWrite(); + instance.clearPortId(); + return this; + } + /** + *
+       * port on the counterparty chain which owns the other end of the channel.
+       * 
+ * + * string port_id = 1 [json_name = "portId"]; + * @param value The bytes for portId to set. + * @return This builder for chaining. + */ + public Builder setPortIdBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setPortIdBytes(value); + return this; + } + + /** + *
+       * channel end on the counterparty chain
+       * 
+ * + * string channel_id = 2 [json_name = "channelId"]; + * @return The channelId. + */ + @java.lang.Override + public java.lang.String getChannelId() { + return instance.getChannelId(); + } + /** + *
+       * channel end on the counterparty chain
+       * 
+ * + * string channel_id = 2 [json_name = "channelId"]; + * @return The bytes for channelId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getChannelIdBytes() { + return instance.getChannelIdBytes(); + } + /** + *
+       * channel end on the counterparty chain
+       * 
+ * + * string channel_id = 2 [json_name = "channelId"]; + * @param value The channelId to set. + * @return This builder for chaining. + */ + public Builder setChannelId( + java.lang.String value) { + copyOnWrite(); + instance.setChannelId(value); + return this; + } + /** + *
+       * channel end on the counterparty chain
+       * 
+ * + * string channel_id = 2 [json_name = "channelId"]; + * @return This builder for chaining. + */ + public Builder clearChannelId() { + copyOnWrite(); + instance.clearChannelId(); + return this; + } + /** + *
+       * channel end on the counterparty chain
+       * 
+ * + * string channel_id = 2 [json_name = "channelId"]; + * @param value The bytes for channelId to set. + * @return This builder for chaining. + */ + public Builder setChannelIdBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setChannelIdBytes(value); + return this; + } + + // @@protoc_insertion_point(builder_scope:icon.proto.core.channel.Channel.Counterparty) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.icon.proto.core.channel.Channel.Counterparty(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "portId_", + "channelId_", + }; + java.lang.String info = + "\u0000\u0002\u0000\u0000\u0001\u0002\u0002\u0000\u0000\u0000\u0001\u0208\u0002\u0208" + + ""; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.icon.proto.core.channel.Channel.Counterparty.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:icon.proto.core.channel.Channel.Counterparty) + private static final com.icon.proto.core.channel.Channel.Counterparty DEFAULT_INSTANCE; + static { + Counterparty defaultInstance = new Counterparty(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + Counterparty.class, defaultInstance); + } + + public static com.icon.proto.core.channel.Channel.Counterparty getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } + } + + public interface IdentifiedChannelOrBuilder extends + // @@protoc_insertion_point(interface_extends:icon.proto.core.channel.Channel.IdentifiedChannel) + com.google.protobuf.MessageLiteOrBuilder { + + /** + *
+     * current state of the channel end
+     * 
+ * + * .icon.proto.core.channel.Channel.State state = 1 [json_name = "state"]; + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + *
+     * current state of the channel end
+     * 
+ * + * .icon.proto.core.channel.Channel.State state = 1 [json_name = "state"]; + * @return The state. + */ + com.icon.proto.core.channel.Channel.State getState(); + + /** + *
+     * whether the channel is ordered or unordered
+     * 
+ * + * .icon.proto.core.channel.Channel.Order ordering = 2 [json_name = "ordering"]; + * @return The enum numeric value on the wire for ordering. + */ + int getOrderingValue(); + /** + *
+     * whether the channel is ordered or unordered
+     * 
+ * + * .icon.proto.core.channel.Channel.Order ordering = 2 [json_name = "ordering"]; + * @return The ordering. + */ + com.icon.proto.core.channel.Channel.Order getOrdering(); + + /** + *
+     * counterparty channel end
+     * 
+ * + * .icon.proto.core.channel.Channel.Counterparty counterparty = 3 [json_name = "counterparty"]; + * @return Whether the counterparty field is set. + */ + boolean hasCounterparty(); + /** + *
+     * counterparty channel end
+     * 
+ * + * .icon.proto.core.channel.Channel.Counterparty counterparty = 3 [json_name = "counterparty"]; + * @return The counterparty. + */ + com.icon.proto.core.channel.Channel.Counterparty getCounterparty(); + + /** + *
+     * list of connection identifiers, in order, along which packets sent on
+     * this channel will travel
+     * 
+ * + * repeated string connection_hops = 4 [json_name = "connectionHops"]; + * @return A list containing the connectionHops. + */ + java.util.List + getConnectionHopsList(); + /** + *
+     * list of connection identifiers, in order, along which packets sent on
+     * this channel will travel
+     * 
+ * + * repeated string connection_hops = 4 [json_name = "connectionHops"]; + * @return The count of connectionHops. + */ + int getConnectionHopsCount(); + /** + *
+     * list of connection identifiers, in order, along which packets sent on
+     * this channel will travel
+     * 
+ * + * repeated string connection_hops = 4 [json_name = "connectionHops"]; + * @param index The index of the element to return. + * @return The connectionHops at the given index. + */ + java.lang.String getConnectionHops(int index); + /** + *
+     * list of connection identifiers, in order, along which packets sent on
+     * this channel will travel
+     * 
+ * + * repeated string connection_hops = 4 [json_name = "connectionHops"]; + * @param index The index of the element to return. + * @return The connectionHops at the given index. + */ + com.google.protobuf.ByteString + getConnectionHopsBytes(int index); + + /** + *
+     * opaque channel version, which is agreed upon during the handshake
+     * 
+ * + * string version = 5 [json_name = "version"]; + * @return The version. + */ + java.lang.String getVersion(); + /** + *
+     * opaque channel version, which is agreed upon during the handshake
+     * 
+ * + * string version = 5 [json_name = "version"]; + * @return The bytes for version. + */ + com.google.protobuf.ByteString + getVersionBytes(); + + /** + *
+     * port identifier
+     * 
+ * + * string port_id = 6 [json_name = "portId"]; + * @return The portId. + */ + java.lang.String getPortId(); + /** + *
+     * port identifier
+     * 
+ * + * string port_id = 6 [json_name = "portId"]; + * @return The bytes for portId. + */ + com.google.protobuf.ByteString + getPortIdBytes(); + + /** + *
+     * channel identifier
+     * 
+ * + * string channel_id = 7 [json_name = "channelId"]; + * @return The channelId. + */ + java.lang.String getChannelId(); + /** + *
+     * channel identifier
+     * 
+ * + * string channel_id = 7 [json_name = "channelId"]; + * @return The bytes for channelId. + */ + com.google.protobuf.ByteString + getChannelIdBytes(); + } + /** + *
+   * IdentifiedChannel defines a channel with additional port and channel
+   * identifier fields.
+   * 
+ * + * Protobuf type {@code icon.proto.core.channel.Channel.IdentifiedChannel} + */ + public static final class IdentifiedChannel extends + com.google.protobuf.GeneratedMessageLite< + IdentifiedChannel, IdentifiedChannel.Builder> implements + // @@protoc_insertion_point(message_implements:icon.proto.core.channel.Channel.IdentifiedChannel) + IdentifiedChannelOrBuilder { + private IdentifiedChannel() { + connectionHops_ = com.google.protobuf.GeneratedMessageLite.emptyProtobufList(); + version_ = ""; + portId_ = ""; + channelId_ = ""; + } + public static final int STATE_FIELD_NUMBER = 1; + private int state_; + /** + *
+     * current state of the channel end
+     * 
+ * + * .icon.proto.core.channel.Channel.State state = 1 [json_name = "state"]; + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + *
+     * current state of the channel end
+     * 
+ * + * .icon.proto.core.channel.Channel.State state = 1 [json_name = "state"]; + * @return The state. + */ + @java.lang.Override + public com.icon.proto.core.channel.Channel.State getState() { + com.icon.proto.core.channel.Channel.State result = com.icon.proto.core.channel.Channel.State.forNumber(state_); + return result == null ? com.icon.proto.core.channel.Channel.State.UNRECOGNIZED : result; + } + /** + *
+     * current state of the channel end
+     * 
+ * + * .icon.proto.core.channel.Channel.State state = 1 [json_name = "state"]; + * @param value The enum numeric value on the wire for state to set. + */ + private void setStateValue(int value) { + state_ = value; + } + /** + *
+     * current state of the channel end
+     * 
+ * + * .icon.proto.core.channel.Channel.State state = 1 [json_name = "state"]; + * @param value The state to set. + */ + private void setState(com.icon.proto.core.channel.Channel.State value) { + state_ = value.getNumber(); + + } + /** + *
+     * current state of the channel end
+     * 
+ * + * .icon.proto.core.channel.Channel.State state = 1 [json_name = "state"]; + */ + private void clearState() { + + state_ = 0; + } + + public static final int ORDERING_FIELD_NUMBER = 2; + private int ordering_; + /** + *
+     * whether the channel is ordered or unordered
+     * 
+ * + * .icon.proto.core.channel.Channel.Order ordering = 2 [json_name = "ordering"]; + * @return The enum numeric value on the wire for ordering. + */ + @java.lang.Override + public int getOrderingValue() { + return ordering_; + } + /** + *
+     * whether the channel is ordered or unordered
+     * 
+ * + * .icon.proto.core.channel.Channel.Order ordering = 2 [json_name = "ordering"]; + * @return The ordering. + */ + @java.lang.Override + public com.icon.proto.core.channel.Channel.Order getOrdering() { + com.icon.proto.core.channel.Channel.Order result = com.icon.proto.core.channel.Channel.Order.forNumber(ordering_); + return result == null ? com.icon.proto.core.channel.Channel.Order.UNRECOGNIZED : result; + } + /** + *
+     * whether the channel is ordered or unordered
+     * 
+ * + * .icon.proto.core.channel.Channel.Order ordering = 2 [json_name = "ordering"]; + * @param value The enum numeric value on the wire for ordering to set. + */ + private void setOrderingValue(int value) { + ordering_ = value; + } + /** + *
+     * whether the channel is ordered or unordered
+     * 
+ * + * .icon.proto.core.channel.Channel.Order ordering = 2 [json_name = "ordering"]; + * @param value The ordering to set. + */ + private void setOrdering(com.icon.proto.core.channel.Channel.Order value) { + ordering_ = value.getNumber(); + + } + /** + *
+     * whether the channel is ordered or unordered
+     * 
+ * + * .icon.proto.core.channel.Channel.Order ordering = 2 [json_name = "ordering"]; + */ + private void clearOrdering() { + + ordering_ = 0; + } + + public static final int COUNTERPARTY_FIELD_NUMBER = 3; + private com.icon.proto.core.channel.Channel.Counterparty counterparty_; + /** + *
+     * counterparty channel end
+     * 
+ * + * .icon.proto.core.channel.Channel.Counterparty counterparty = 3 [json_name = "counterparty"]; + */ + @java.lang.Override + public boolean hasCounterparty() { + return counterparty_ != null; + } + /** + *
+     * counterparty channel end
+     * 
+ * + * .icon.proto.core.channel.Channel.Counterparty counterparty = 3 [json_name = "counterparty"]; + */ + @java.lang.Override + public com.icon.proto.core.channel.Channel.Counterparty getCounterparty() { + return counterparty_ == null ? com.icon.proto.core.channel.Channel.Counterparty.getDefaultInstance() : counterparty_; + } + /** + *
+     * counterparty channel end
+     * 
+ * + * .icon.proto.core.channel.Channel.Counterparty counterparty = 3 [json_name = "counterparty"]; + */ + private void setCounterparty(com.icon.proto.core.channel.Channel.Counterparty value) { + value.getClass(); + counterparty_ = value; + + } + /** + *
+     * counterparty channel end
+     * 
+ * + * .icon.proto.core.channel.Channel.Counterparty counterparty = 3 [json_name = "counterparty"]; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeCounterparty(com.icon.proto.core.channel.Channel.Counterparty value) { + value.getClass(); + if (counterparty_ != null && + counterparty_ != com.icon.proto.core.channel.Channel.Counterparty.getDefaultInstance()) { + counterparty_ = + com.icon.proto.core.channel.Channel.Counterparty.newBuilder(counterparty_).mergeFrom(value).buildPartial(); + } else { + counterparty_ = value; + } + + } + /** + *
+     * counterparty channel end
+     * 
+ * + * .icon.proto.core.channel.Channel.Counterparty counterparty = 3 [json_name = "counterparty"]; + */ + private void clearCounterparty() { counterparty_ = null; + + } + + public static final int CONNECTION_HOPS_FIELD_NUMBER = 4; + private com.google.protobuf.Internal.ProtobufList connectionHops_; + /** + *
+     * list of connection identifiers, in order, along which packets sent on
+     * this channel will travel
+     * 
+ * + * repeated string connection_hops = 4 [json_name = "connectionHops"]; + * @return A list containing the connectionHops. + */ + @java.lang.Override + public java.util.List getConnectionHopsList() { + return connectionHops_; + } + /** + *
+     * list of connection identifiers, in order, along which packets sent on
+     * this channel will travel
+     * 
+ * + * repeated string connection_hops = 4 [json_name = "connectionHops"]; + * @return The count of connectionHops. + */ + @java.lang.Override + public int getConnectionHopsCount() { + return connectionHops_.size(); + } + /** + *
+     * list of connection identifiers, in order, along which packets sent on
+     * this channel will travel
+     * 
+ * + * repeated string connection_hops = 4 [json_name = "connectionHops"]; + * @param index The index of the element to return. + * @return The connectionHops at the given index. + */ + @java.lang.Override + public java.lang.String getConnectionHops(int index) { + return connectionHops_.get(index); + } + /** + *
+     * list of connection identifiers, in order, along which packets sent on
+     * this channel will travel
+     * 
+ * + * repeated string connection_hops = 4 [json_name = "connectionHops"]; + * @param index The index of the value to return. + * @return The bytes of the connectionHops at the given index. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getConnectionHopsBytes(int index) { + return com.google.protobuf.ByteString.copyFromUtf8( + connectionHops_.get(index)); + } + private void ensureConnectionHopsIsMutable() { + com.google.protobuf.Internal.ProtobufList tmp = + connectionHops_; if (!tmp.isModifiable()) { + connectionHops_ = + com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp); + } + } + /** + *
+     * list of connection identifiers, in order, along which packets sent on
+     * this channel will travel
+     * 
+ * + * repeated string connection_hops = 4 [json_name = "connectionHops"]; + * @param index The index to set the value at. + * @param value The connectionHops to set. + */ + private void setConnectionHops( + int index, java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + ensureConnectionHopsIsMutable(); + connectionHops_.set(index, value); + } + /** + *
+     * list of connection identifiers, in order, along which packets sent on
+     * this channel will travel
+     * 
+ * + * repeated string connection_hops = 4 [json_name = "connectionHops"]; + * @param value The connectionHops to add. + */ + private void addConnectionHops( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + ensureConnectionHopsIsMutable(); + connectionHops_.add(value); + } + /** + *
+     * list of connection identifiers, in order, along which packets sent on
+     * this channel will travel
+     * 
+ * + * repeated string connection_hops = 4 [json_name = "connectionHops"]; + * @param values The connectionHops to add. + */ + private void addAllConnectionHops( + java.lang.Iterable values) { + ensureConnectionHopsIsMutable(); + com.google.protobuf.AbstractMessageLite.addAll( + values, connectionHops_); + } + /** + *
+     * list of connection identifiers, in order, along which packets sent on
+     * this channel will travel
+     * 
+ * + * repeated string connection_hops = 4 [json_name = "connectionHops"]; + */ + private void clearConnectionHops() { + connectionHops_ = com.google.protobuf.GeneratedMessageLite.emptyProtobufList(); + } + /** + *
+     * list of connection identifiers, in order, along which packets sent on
+     * this channel will travel
+     * 
+ * + * repeated string connection_hops = 4 [json_name = "connectionHops"]; + * @param value The bytes of the connectionHops to add. + */ + private void addConnectionHopsBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + ensureConnectionHopsIsMutable(); + connectionHops_.add(value.toStringUtf8()); + } + + public static final int VERSION_FIELD_NUMBER = 5; + private java.lang.String version_; + /** + *
+     * opaque channel version, which is agreed upon during the handshake
+     * 
+ * + * string version = 5 [json_name = "version"]; + * @return The version. + */ + @java.lang.Override + public java.lang.String getVersion() { + return version_; + } + /** + *
+     * opaque channel version, which is agreed upon during the handshake
+     * 
+ * + * string version = 5 [json_name = "version"]; + * @return The bytes for version. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getVersionBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(version_); + } + /** + *
+     * opaque channel version, which is agreed upon during the handshake
+     * 
+ * + * string version = 5 [json_name = "version"]; + * @param value The version to set. + */ + private void setVersion( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + version_ = value; + } + /** + *
+     * opaque channel version, which is agreed upon during the handshake
+     * 
+ * + * string version = 5 [json_name = "version"]; + */ + private void clearVersion() { + + version_ = getDefaultInstance().getVersion(); + } + /** + *
+     * opaque channel version, which is agreed upon during the handshake
+     * 
+ * + * string version = 5 [json_name = "version"]; + * @param value The bytes for version to set. + */ + private void setVersionBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + version_ = value.toStringUtf8(); + + } + + public static final int PORT_ID_FIELD_NUMBER = 6; + private java.lang.String portId_; + /** + *
+     * port identifier
+     * 
+ * + * string port_id = 6 [json_name = "portId"]; + * @return The portId. + */ + @java.lang.Override + public java.lang.String getPortId() { + return portId_; + } + /** + *
+     * port identifier
+     * 
+ * + * string port_id = 6 [json_name = "portId"]; + * @return The bytes for portId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getPortIdBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(portId_); + } + /** + *
+     * port identifier
+     * 
+ * + * string port_id = 6 [json_name = "portId"]; + * @param value The portId to set. + */ + private void setPortId( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + portId_ = value; + } + /** + *
+     * port identifier
+     * 
+ * + * string port_id = 6 [json_name = "portId"]; + */ + private void clearPortId() { + + portId_ = getDefaultInstance().getPortId(); + } + /** + *
+     * port identifier
+     * 
+ * + * string port_id = 6 [json_name = "portId"]; + * @param value The bytes for portId to set. + */ + private void setPortIdBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + portId_ = value.toStringUtf8(); + + } + + public static final int CHANNEL_ID_FIELD_NUMBER = 7; + private java.lang.String channelId_; + /** + *
+     * channel identifier
+     * 
+ * + * string channel_id = 7 [json_name = "channelId"]; + * @return The channelId. + */ + @java.lang.Override + public java.lang.String getChannelId() { + return channelId_; + } + /** + *
+     * channel identifier
+     * 
+ * + * string channel_id = 7 [json_name = "channelId"]; + * @return The bytes for channelId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getChannelIdBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(channelId_); + } + /** + *
+     * channel identifier
+     * 
+ * + * string channel_id = 7 [json_name = "channelId"]; + * @param value The channelId to set. + */ + private void setChannelId( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + channelId_ = value; + } + /** + *
+     * channel identifier
+     * 
+ * + * string channel_id = 7 [json_name = "channelId"]; + */ + private void clearChannelId() { + + channelId_ = getDefaultInstance().getChannelId(); + } + /** + *
+     * channel identifier
+     * 
+ * + * string channel_id = 7 [json_name = "channelId"]; + * @param value The bytes for channelId to set. + */ + private void setChannelIdBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + channelId_ = value.toStringUtf8(); + + } + + public static com.icon.proto.core.channel.Channel.IdentifiedChannel parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.channel.Channel.IdentifiedChannel parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.channel.Channel.IdentifiedChannel parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.channel.Channel.IdentifiedChannel parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.channel.Channel.IdentifiedChannel parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.channel.Channel.IdentifiedChannel parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.channel.Channel.IdentifiedChannel parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.channel.Channel.IdentifiedChannel parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.icon.proto.core.channel.Channel.IdentifiedChannel parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.channel.Channel.IdentifiedChannel parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.icon.proto.core.channel.Channel.IdentifiedChannel parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.channel.Channel.IdentifiedChannel parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.icon.proto.core.channel.Channel.IdentifiedChannel prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+     * IdentifiedChannel defines a channel with additional port and channel
+     * identifier fields.
+     * 
+ * + * Protobuf type {@code icon.proto.core.channel.Channel.IdentifiedChannel} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.icon.proto.core.channel.Channel.IdentifiedChannel, Builder> implements + // @@protoc_insertion_point(builder_implements:icon.proto.core.channel.Channel.IdentifiedChannel) + com.icon.proto.core.channel.Channel.IdentifiedChannelOrBuilder { + // Construct using com.icon.proto.core.channel.Channel.IdentifiedChannel.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + *
+       * current state of the channel end
+       * 
+ * + * .icon.proto.core.channel.Channel.State state = 1 [json_name = "state"]; + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return instance.getStateValue(); + } + /** + *
+       * current state of the channel end
+       * 
+ * + * .icon.proto.core.channel.Channel.State state = 1 [json_name = "state"]; + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setStateValue(int value) { + copyOnWrite(); + instance.setStateValue(value); + return this; + } + /** + *
+       * current state of the channel end
+       * 
+ * + * .icon.proto.core.channel.Channel.State state = 1 [json_name = "state"]; + * @return The state. + */ + @java.lang.Override + public com.icon.proto.core.channel.Channel.State getState() { + return instance.getState(); + } + /** + *
+       * current state of the channel end
+       * 
+ * + * .icon.proto.core.channel.Channel.State state = 1 [json_name = "state"]; + * @param value The enum numeric value on the wire for state to set. + * @return This builder for chaining. + */ + public Builder setState(com.icon.proto.core.channel.Channel.State value) { + copyOnWrite(); + instance.setState(value); + return this; + } + /** + *
+       * current state of the channel end
+       * 
+ * + * .icon.proto.core.channel.Channel.State state = 1 [json_name = "state"]; + * @return This builder for chaining. + */ + public Builder clearState() { + copyOnWrite(); + instance.clearState(); + return this; + } + + /** + *
+       * whether the channel is ordered or unordered
+       * 
+ * + * .icon.proto.core.channel.Channel.Order ordering = 2 [json_name = "ordering"]; + * @return The enum numeric value on the wire for ordering. + */ + @java.lang.Override + public int getOrderingValue() { + return instance.getOrderingValue(); + } + /** + *
+       * whether the channel is ordered or unordered
+       * 
+ * + * .icon.proto.core.channel.Channel.Order ordering = 2 [json_name = "ordering"]; + * @param value The ordering to set. + * @return This builder for chaining. + */ + public Builder setOrderingValue(int value) { + copyOnWrite(); + instance.setOrderingValue(value); + return this; + } + /** + *
+       * whether the channel is ordered or unordered
+       * 
+ * + * .icon.proto.core.channel.Channel.Order ordering = 2 [json_name = "ordering"]; + * @return The ordering. + */ + @java.lang.Override + public com.icon.proto.core.channel.Channel.Order getOrdering() { + return instance.getOrdering(); + } + /** + *
+       * whether the channel is ordered or unordered
+       * 
+ * + * .icon.proto.core.channel.Channel.Order ordering = 2 [json_name = "ordering"]; + * @param value The enum numeric value on the wire for ordering to set. + * @return This builder for chaining. + */ + public Builder setOrdering(com.icon.proto.core.channel.Channel.Order value) { + copyOnWrite(); + instance.setOrdering(value); + return this; + } + /** + *
+       * whether the channel is ordered or unordered
+       * 
+ * + * .icon.proto.core.channel.Channel.Order ordering = 2 [json_name = "ordering"]; + * @return This builder for chaining. + */ + public Builder clearOrdering() { + copyOnWrite(); + instance.clearOrdering(); + return this; + } + + /** + *
+       * counterparty channel end
+       * 
+ * + * .icon.proto.core.channel.Channel.Counterparty counterparty = 3 [json_name = "counterparty"]; + */ + @java.lang.Override + public boolean hasCounterparty() { + return instance.hasCounterparty(); + } + /** + *
+       * counterparty channel end
+       * 
+ * + * .icon.proto.core.channel.Channel.Counterparty counterparty = 3 [json_name = "counterparty"]; + */ + @java.lang.Override + public com.icon.proto.core.channel.Channel.Counterparty getCounterparty() { + return instance.getCounterparty(); + } + /** + *
+       * counterparty channel end
+       * 
+ * + * .icon.proto.core.channel.Channel.Counterparty counterparty = 3 [json_name = "counterparty"]; + */ + public Builder setCounterparty(com.icon.proto.core.channel.Channel.Counterparty value) { + copyOnWrite(); + instance.setCounterparty(value); + return this; + } + /** + *
+       * counterparty channel end
+       * 
+ * + * .icon.proto.core.channel.Channel.Counterparty counterparty = 3 [json_name = "counterparty"]; + */ + public Builder setCounterparty( + com.icon.proto.core.channel.Channel.Counterparty.Builder builderForValue) { + copyOnWrite(); + instance.setCounterparty(builderForValue.build()); + return this; + } + /** + *
+       * counterparty channel end
+       * 
+ * + * .icon.proto.core.channel.Channel.Counterparty counterparty = 3 [json_name = "counterparty"]; + */ + public Builder mergeCounterparty(com.icon.proto.core.channel.Channel.Counterparty value) { + copyOnWrite(); + instance.mergeCounterparty(value); + return this; + } + /** + *
+       * counterparty channel end
+       * 
+ * + * .icon.proto.core.channel.Channel.Counterparty counterparty = 3 [json_name = "counterparty"]; + */ + public Builder clearCounterparty() { copyOnWrite(); + instance.clearCounterparty(); + return this; + } + + /** + *
+       * list of connection identifiers, in order, along which packets sent on
+       * this channel will travel
+       * 
+ * + * repeated string connection_hops = 4 [json_name = "connectionHops"]; + * @return A list containing the connectionHops. + */ + @java.lang.Override + public java.util.List + getConnectionHopsList() { + return java.util.Collections.unmodifiableList( + instance.getConnectionHopsList()); + } + /** + *
+       * list of connection identifiers, in order, along which packets sent on
+       * this channel will travel
+       * 
+ * + * repeated string connection_hops = 4 [json_name = "connectionHops"]; + * @return The count of connectionHops. + */ + @java.lang.Override + public int getConnectionHopsCount() { + return instance.getConnectionHopsCount(); + } + /** + *
+       * list of connection identifiers, in order, along which packets sent on
+       * this channel will travel
+       * 
+ * + * repeated string connection_hops = 4 [json_name = "connectionHops"]; + * @param index The index of the element to return. + * @return The connectionHops at the given index. + */ + @java.lang.Override + public java.lang.String getConnectionHops(int index) { + return instance.getConnectionHops(index); + } + /** + *
+       * list of connection identifiers, in order, along which packets sent on
+       * this channel will travel
+       * 
+ * + * repeated string connection_hops = 4 [json_name = "connectionHops"]; + * @param index The index of the value to return. + * @return The bytes of the connectionHops at the given index. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getConnectionHopsBytes(int index) { + return instance.getConnectionHopsBytes(index); + } + /** + *
+       * list of connection identifiers, in order, along which packets sent on
+       * this channel will travel
+       * 
+ * + * repeated string connection_hops = 4 [json_name = "connectionHops"]; + * @param index The index to set the value at. + * @param value The connectionHops to set. + * @return This builder for chaining. + */ + public Builder setConnectionHops( + int index, java.lang.String value) { + copyOnWrite(); + instance.setConnectionHops(index, value); + return this; + } + /** + *
+       * list of connection identifiers, in order, along which packets sent on
+       * this channel will travel
+       * 
+ * + * repeated string connection_hops = 4 [json_name = "connectionHops"]; + * @param value The connectionHops to add. + * @return This builder for chaining. + */ + public Builder addConnectionHops( + java.lang.String value) { + copyOnWrite(); + instance.addConnectionHops(value); + return this; + } + /** + *
+       * list of connection identifiers, in order, along which packets sent on
+       * this channel will travel
+       * 
+ * + * repeated string connection_hops = 4 [json_name = "connectionHops"]; + * @param values The connectionHops to add. + * @return This builder for chaining. + */ + public Builder addAllConnectionHops( + java.lang.Iterable values) { + copyOnWrite(); + instance.addAllConnectionHops(values); + return this; + } + /** + *
+       * list of connection identifiers, in order, along which packets sent on
+       * this channel will travel
+       * 
+ * + * repeated string connection_hops = 4 [json_name = "connectionHops"]; + * @return This builder for chaining. + */ + public Builder clearConnectionHops() { + copyOnWrite(); + instance.clearConnectionHops(); + return this; + } + /** + *
+       * list of connection identifiers, in order, along which packets sent on
+       * this channel will travel
+       * 
+ * + * repeated string connection_hops = 4 [json_name = "connectionHops"]; + * @param value The bytes of the connectionHops to add. + * @return This builder for chaining. + */ + public Builder addConnectionHopsBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.addConnectionHopsBytes(value); + return this; + } + + /** + *
+       * opaque channel version, which is agreed upon during the handshake
+       * 
+ * + * string version = 5 [json_name = "version"]; + * @return The version. + */ + @java.lang.Override + public java.lang.String getVersion() { + return instance.getVersion(); + } + /** + *
+       * opaque channel version, which is agreed upon during the handshake
+       * 
+ * + * string version = 5 [json_name = "version"]; + * @return The bytes for version. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getVersionBytes() { + return instance.getVersionBytes(); + } + /** + *
+       * opaque channel version, which is agreed upon during the handshake
+       * 
+ * + * string version = 5 [json_name = "version"]; + * @param value The version to set. + * @return This builder for chaining. + */ + public Builder setVersion( + java.lang.String value) { + copyOnWrite(); + instance.setVersion(value); + return this; + } + /** + *
+       * opaque channel version, which is agreed upon during the handshake
+       * 
+ * + * string version = 5 [json_name = "version"]; + * @return This builder for chaining. + */ + public Builder clearVersion() { + copyOnWrite(); + instance.clearVersion(); + return this; + } + /** + *
+       * opaque channel version, which is agreed upon during the handshake
+       * 
+ * + * string version = 5 [json_name = "version"]; + * @param value The bytes for version to set. + * @return This builder for chaining. + */ + public Builder setVersionBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setVersionBytes(value); + return this; + } + + /** + *
+       * port identifier
+       * 
+ * + * string port_id = 6 [json_name = "portId"]; + * @return The portId. + */ + @java.lang.Override + public java.lang.String getPortId() { + return instance.getPortId(); + } + /** + *
+       * port identifier
+       * 
+ * + * string port_id = 6 [json_name = "portId"]; + * @return The bytes for portId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getPortIdBytes() { + return instance.getPortIdBytes(); + } + /** + *
+       * port identifier
+       * 
+ * + * string port_id = 6 [json_name = "portId"]; + * @param value The portId to set. + * @return This builder for chaining. + */ + public Builder setPortId( + java.lang.String value) { + copyOnWrite(); + instance.setPortId(value); + return this; + } + /** + *
+       * port identifier
+       * 
+ * + * string port_id = 6 [json_name = "portId"]; + * @return This builder for chaining. + */ + public Builder clearPortId() { + copyOnWrite(); + instance.clearPortId(); + return this; + } + /** + *
+       * port identifier
+       * 
+ * + * string port_id = 6 [json_name = "portId"]; + * @param value The bytes for portId to set. + * @return This builder for chaining. + */ + public Builder setPortIdBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setPortIdBytes(value); + return this; + } + + /** + *
+       * channel identifier
+       * 
+ * + * string channel_id = 7 [json_name = "channelId"]; + * @return The channelId. + */ + @java.lang.Override + public java.lang.String getChannelId() { + return instance.getChannelId(); + } + /** + *
+       * channel identifier
+       * 
+ * + * string channel_id = 7 [json_name = "channelId"]; + * @return The bytes for channelId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getChannelIdBytes() { + return instance.getChannelIdBytes(); + } + /** + *
+       * channel identifier
+       * 
+ * + * string channel_id = 7 [json_name = "channelId"]; + * @param value The channelId to set. + * @return This builder for chaining. + */ + public Builder setChannelId( + java.lang.String value) { + copyOnWrite(); + instance.setChannelId(value); + return this; + } + /** + *
+       * channel identifier
+       * 
+ * + * string channel_id = 7 [json_name = "channelId"]; + * @return This builder for chaining. + */ + public Builder clearChannelId() { + copyOnWrite(); + instance.clearChannelId(); + return this; + } + /** + *
+       * channel identifier
+       * 
+ * + * string channel_id = 7 [json_name = "channelId"]; + * @param value The bytes for channelId to set. + * @return This builder for chaining. + */ + public Builder setChannelIdBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setChannelIdBytes(value); + return this; + } + + // @@protoc_insertion_point(builder_scope:icon.proto.core.channel.Channel.IdentifiedChannel) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.icon.proto.core.channel.Channel.IdentifiedChannel(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "state_", + "ordering_", + "counterparty_", + "connectionHops_", + "version_", + "portId_", + "channelId_", + }; + java.lang.String info = + "\u0000\u0007\u0000\u0000\u0001\u0007\u0007\u0000\u0001\u0000\u0001\f\u0002\f\u0003" + + "\t\u0004\u021a\u0005\u0208\u0006\u0208\u0007\u0208"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.icon.proto.core.channel.Channel.IdentifiedChannel.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:icon.proto.core.channel.Channel.IdentifiedChannel) + private static final com.icon.proto.core.channel.Channel.IdentifiedChannel DEFAULT_INSTANCE; + static { + IdentifiedChannel defaultInstance = new IdentifiedChannel(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + IdentifiedChannel.class, defaultInstance); + } + + public static com.icon.proto.core.channel.Channel.IdentifiedChannel getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } + } + + public static final int STATE_FIELD_NUMBER = 1; + private int state_; + /** + *
+   * current state of the channel end
+   * 
+ * + * .icon.proto.core.channel.Channel.State state = 1 [json_name = "state"]; + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + *
+   * current state of the channel end
+   * 
+ * + * .icon.proto.core.channel.Channel.State state = 1 [json_name = "state"]; + * @return The state. + */ + @java.lang.Override + public com.icon.proto.core.channel.Channel.State getState() { + com.icon.proto.core.channel.Channel.State result = com.icon.proto.core.channel.Channel.State.forNumber(state_); + return result == null ? com.icon.proto.core.channel.Channel.State.UNRECOGNIZED : result; + } + /** + *
+   * current state of the channel end
+   * 
+ * + * .icon.proto.core.channel.Channel.State state = 1 [json_name = "state"]; + * @param value The enum numeric value on the wire for state to set. + */ + private void setStateValue(int value) { + state_ = value; + } + /** + *
+   * current state of the channel end
+   * 
+ * + * .icon.proto.core.channel.Channel.State state = 1 [json_name = "state"]; + * @param value The state to set. + */ + private void setState(com.icon.proto.core.channel.Channel.State value) { + state_ = value.getNumber(); + + } + /** + *
+   * current state of the channel end
+   * 
+ * + * .icon.proto.core.channel.Channel.State state = 1 [json_name = "state"]; + */ + private void clearState() { + + state_ = 0; + } + + public static final int ORDERING_FIELD_NUMBER = 2; + private int ordering_; + /** + *
+   * whether the channel is ordered or unordered
+   * 
+ * + * .icon.proto.core.channel.Channel.Order ordering = 2 [json_name = "ordering"]; + * @return The enum numeric value on the wire for ordering. + */ + @java.lang.Override + public int getOrderingValue() { + return ordering_; + } + /** + *
+   * whether the channel is ordered or unordered
+   * 
+ * + * .icon.proto.core.channel.Channel.Order ordering = 2 [json_name = "ordering"]; + * @return The ordering. + */ + @java.lang.Override + public com.icon.proto.core.channel.Channel.Order getOrdering() { + com.icon.proto.core.channel.Channel.Order result = com.icon.proto.core.channel.Channel.Order.forNumber(ordering_); + return result == null ? com.icon.proto.core.channel.Channel.Order.UNRECOGNIZED : result; + } + /** + *
+   * whether the channel is ordered or unordered
+   * 
+ * + * .icon.proto.core.channel.Channel.Order ordering = 2 [json_name = "ordering"]; + * @param value The enum numeric value on the wire for ordering to set. + */ + private void setOrderingValue(int value) { + ordering_ = value; + } + /** + *
+   * whether the channel is ordered or unordered
+   * 
+ * + * .icon.proto.core.channel.Channel.Order ordering = 2 [json_name = "ordering"]; + * @param value The ordering to set. + */ + private void setOrdering(com.icon.proto.core.channel.Channel.Order value) { + ordering_ = value.getNumber(); + + } + /** + *
+   * whether the channel is ordered or unordered
+   * 
+ * + * .icon.proto.core.channel.Channel.Order ordering = 2 [json_name = "ordering"]; + */ + private void clearOrdering() { + + ordering_ = 0; + } + + public static final int COUNTERPARTY_FIELD_NUMBER = 3; + private com.icon.proto.core.channel.Channel.Counterparty counterparty_; + /** + *
+   * counterparty channel end
+   * 
+ * + * .icon.proto.core.channel.Channel.Counterparty counterparty = 3 [json_name = "counterparty"]; + */ + @java.lang.Override + public boolean hasCounterparty() { + return counterparty_ != null; + } + /** + *
+   * counterparty channel end
+   * 
+ * + * .icon.proto.core.channel.Channel.Counterparty counterparty = 3 [json_name = "counterparty"]; + */ + @java.lang.Override + public com.icon.proto.core.channel.Channel.Counterparty getCounterparty() { + return counterparty_ == null ? com.icon.proto.core.channel.Channel.Counterparty.getDefaultInstance() : counterparty_; + } + /** + *
+   * counterparty channel end
+   * 
+ * + * .icon.proto.core.channel.Channel.Counterparty counterparty = 3 [json_name = "counterparty"]; + */ + private void setCounterparty(com.icon.proto.core.channel.Channel.Counterparty value) { + value.getClass(); + counterparty_ = value; + + } + /** + *
+   * counterparty channel end
+   * 
+ * + * .icon.proto.core.channel.Channel.Counterparty counterparty = 3 [json_name = "counterparty"]; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeCounterparty(com.icon.proto.core.channel.Channel.Counterparty value) { + value.getClass(); + if (counterparty_ != null && + counterparty_ != com.icon.proto.core.channel.Channel.Counterparty.getDefaultInstance()) { + counterparty_ = + com.icon.proto.core.channel.Channel.Counterparty.newBuilder(counterparty_).mergeFrom(value).buildPartial(); + } else { + counterparty_ = value; + } + + } + /** + *
+   * counterparty channel end
+   * 
+ * + * .icon.proto.core.channel.Channel.Counterparty counterparty = 3 [json_name = "counterparty"]; + */ + private void clearCounterparty() { counterparty_ = null; + + } + + public static final int CONNECTION_HOPS_FIELD_NUMBER = 4; + private com.google.protobuf.Internal.ProtobufList connectionHops_; + /** + *
+   * list of connection identifiers, in order, along which packets sent on
+   * this channel will travel
+   * 
+ * + * repeated string connection_hops = 4 [json_name = "connectionHops"]; + * @return A list containing the connectionHops. + */ + @java.lang.Override + public java.util.List getConnectionHopsList() { + return connectionHops_; + } + /** + *
+   * list of connection identifiers, in order, along which packets sent on
+   * this channel will travel
+   * 
+ * + * repeated string connection_hops = 4 [json_name = "connectionHops"]; + * @return The count of connectionHops. + */ + @java.lang.Override + public int getConnectionHopsCount() { + return connectionHops_.size(); + } + /** + *
+   * list of connection identifiers, in order, along which packets sent on
+   * this channel will travel
+   * 
+ * + * repeated string connection_hops = 4 [json_name = "connectionHops"]; + * @param index The index of the element to return. + * @return The connectionHops at the given index. + */ + @java.lang.Override + public java.lang.String getConnectionHops(int index) { + return connectionHops_.get(index); + } + /** + *
+   * list of connection identifiers, in order, along which packets sent on
+   * this channel will travel
+   * 
+ * + * repeated string connection_hops = 4 [json_name = "connectionHops"]; + * @param index The index of the value to return. + * @return The bytes of the connectionHops at the given index. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getConnectionHopsBytes(int index) { + return com.google.protobuf.ByteString.copyFromUtf8( + connectionHops_.get(index)); + } + private void ensureConnectionHopsIsMutable() { + com.google.protobuf.Internal.ProtobufList tmp = + connectionHops_; if (!tmp.isModifiable()) { + connectionHops_ = + com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp); + } + } + /** + *
+   * list of connection identifiers, in order, along which packets sent on
+   * this channel will travel
+   * 
+ * + * repeated string connection_hops = 4 [json_name = "connectionHops"]; + * @param index The index to set the value at. + * @param value The connectionHops to set. + */ + private void setConnectionHops( + int index, java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + ensureConnectionHopsIsMutable(); + connectionHops_.set(index, value); + } + /** + *
+   * list of connection identifiers, in order, along which packets sent on
+   * this channel will travel
+   * 
+ * + * repeated string connection_hops = 4 [json_name = "connectionHops"]; + * @param value The connectionHops to add. + */ + private void addConnectionHops( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + ensureConnectionHopsIsMutable(); + connectionHops_.add(value); + } + /** + *
+   * list of connection identifiers, in order, along which packets sent on
+   * this channel will travel
+   * 
+ * + * repeated string connection_hops = 4 [json_name = "connectionHops"]; + * @param values The connectionHops to add. + */ + private void addAllConnectionHops( + java.lang.Iterable values) { + ensureConnectionHopsIsMutable(); + com.google.protobuf.AbstractMessageLite.addAll( + values, connectionHops_); + } + /** + *
+   * list of connection identifiers, in order, along which packets sent on
+   * this channel will travel
+   * 
+ * + * repeated string connection_hops = 4 [json_name = "connectionHops"]; + */ + private void clearConnectionHops() { + connectionHops_ = com.google.protobuf.GeneratedMessageLite.emptyProtobufList(); + } + /** + *
+   * list of connection identifiers, in order, along which packets sent on
+   * this channel will travel
+   * 
+ * + * repeated string connection_hops = 4 [json_name = "connectionHops"]; + * @param value The bytes of the connectionHops to add. + */ + private void addConnectionHopsBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + ensureConnectionHopsIsMutable(); + connectionHops_.add(value.toStringUtf8()); + } + + public static final int VERSION_FIELD_NUMBER = 5; + private java.lang.String version_; + /** + *
+   * opaque channel version, which is agreed upon during the handshake
+   * 
+ * + * string version = 5 [json_name = "version"]; + * @return The version. + */ + @java.lang.Override + public java.lang.String getVersion() { + return version_; + } + /** + *
+   * opaque channel version, which is agreed upon during the handshake
+   * 
+ * + * string version = 5 [json_name = "version"]; + * @return The bytes for version. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getVersionBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(version_); + } + /** + *
+   * opaque channel version, which is agreed upon during the handshake
+   * 
+ * + * string version = 5 [json_name = "version"]; + * @param value The version to set. + */ + private void setVersion( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + version_ = value; + } + /** + *
+   * opaque channel version, which is agreed upon during the handshake
+   * 
+ * + * string version = 5 [json_name = "version"]; + */ + private void clearVersion() { + + version_ = getDefaultInstance().getVersion(); + } + /** + *
+   * opaque channel version, which is agreed upon during the handshake
+   * 
+ * + * string version = 5 [json_name = "version"]; + * @param value The bytes for version to set. + */ + private void setVersionBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + version_ = value.toStringUtf8(); + + } + + public static com.icon.proto.core.channel.Channel parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.channel.Channel parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.channel.Channel parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.channel.Channel parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.channel.Channel parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.channel.Channel parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.channel.Channel parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.channel.Channel parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.icon.proto.core.channel.Channel parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.channel.Channel parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.icon.proto.core.channel.Channel parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.channel.Channel parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.icon.proto.core.channel.Channel prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+   * Channel defines pipeline for exactly-once packet delivery between specific
+   * modules on separate blockchains, which has at least one end capable of
+   * sending packets and one end capable of receiving packets.
+   * 
+ * + * Protobuf type {@code icon.proto.core.channel.Channel} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.icon.proto.core.channel.Channel, Builder> implements + // @@protoc_insertion_point(builder_implements:icon.proto.core.channel.Channel) + com.icon.proto.core.channel.ChannelOrBuilder { + // Construct using com.icon.proto.core.channel.Channel.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + *
+     * current state of the channel end
+     * 
+ * + * .icon.proto.core.channel.Channel.State state = 1 [json_name = "state"]; + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return instance.getStateValue(); + } + /** + *
+     * current state of the channel end
+     * 
+ * + * .icon.proto.core.channel.Channel.State state = 1 [json_name = "state"]; + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setStateValue(int value) { + copyOnWrite(); + instance.setStateValue(value); + return this; + } + /** + *
+     * current state of the channel end
+     * 
+ * + * .icon.proto.core.channel.Channel.State state = 1 [json_name = "state"]; + * @return The state. + */ + @java.lang.Override + public com.icon.proto.core.channel.Channel.State getState() { + return instance.getState(); + } + /** + *
+     * current state of the channel end
+     * 
+ * + * .icon.proto.core.channel.Channel.State state = 1 [json_name = "state"]; + * @param value The enum numeric value on the wire for state to set. + * @return This builder for chaining. + */ + public Builder setState(com.icon.proto.core.channel.Channel.State value) { + copyOnWrite(); + instance.setState(value); + return this; + } + /** + *
+     * current state of the channel end
+     * 
+ * + * .icon.proto.core.channel.Channel.State state = 1 [json_name = "state"]; + * @return This builder for chaining. + */ + public Builder clearState() { + copyOnWrite(); + instance.clearState(); + return this; + } + + /** + *
+     * whether the channel is ordered or unordered
+     * 
+ * + * .icon.proto.core.channel.Channel.Order ordering = 2 [json_name = "ordering"]; + * @return The enum numeric value on the wire for ordering. + */ + @java.lang.Override + public int getOrderingValue() { + return instance.getOrderingValue(); + } + /** + *
+     * whether the channel is ordered or unordered
+     * 
+ * + * .icon.proto.core.channel.Channel.Order ordering = 2 [json_name = "ordering"]; + * @param value The ordering to set. + * @return This builder for chaining. + */ + public Builder setOrderingValue(int value) { + copyOnWrite(); + instance.setOrderingValue(value); + return this; + } + /** + *
+     * whether the channel is ordered or unordered
+     * 
+ * + * .icon.proto.core.channel.Channel.Order ordering = 2 [json_name = "ordering"]; + * @return The ordering. + */ + @java.lang.Override + public com.icon.proto.core.channel.Channel.Order getOrdering() { + return instance.getOrdering(); + } + /** + *
+     * whether the channel is ordered or unordered
+     * 
+ * + * .icon.proto.core.channel.Channel.Order ordering = 2 [json_name = "ordering"]; + * @param value The enum numeric value on the wire for ordering to set. + * @return This builder for chaining. + */ + public Builder setOrdering(com.icon.proto.core.channel.Channel.Order value) { + copyOnWrite(); + instance.setOrdering(value); + return this; + } + /** + *
+     * whether the channel is ordered or unordered
+     * 
+ * + * .icon.proto.core.channel.Channel.Order ordering = 2 [json_name = "ordering"]; + * @return This builder for chaining. + */ + public Builder clearOrdering() { + copyOnWrite(); + instance.clearOrdering(); + return this; + } + + /** + *
+     * counterparty channel end
+     * 
+ * + * .icon.proto.core.channel.Channel.Counterparty counterparty = 3 [json_name = "counterparty"]; + */ + @java.lang.Override + public boolean hasCounterparty() { + return instance.hasCounterparty(); + } + /** + *
+     * counterparty channel end
+     * 
+ * + * .icon.proto.core.channel.Channel.Counterparty counterparty = 3 [json_name = "counterparty"]; + */ + @java.lang.Override + public com.icon.proto.core.channel.Channel.Counterparty getCounterparty() { + return instance.getCounterparty(); + } + /** + *
+     * counterparty channel end
+     * 
+ * + * .icon.proto.core.channel.Channel.Counterparty counterparty = 3 [json_name = "counterparty"]; + */ + public Builder setCounterparty(com.icon.proto.core.channel.Channel.Counterparty value) { + copyOnWrite(); + instance.setCounterparty(value); + return this; + } + /** + *
+     * counterparty channel end
+     * 
+ * + * .icon.proto.core.channel.Channel.Counterparty counterparty = 3 [json_name = "counterparty"]; + */ + public Builder setCounterparty( + com.icon.proto.core.channel.Channel.Counterparty.Builder builderForValue) { + copyOnWrite(); + instance.setCounterparty(builderForValue.build()); + return this; + } + /** + *
+     * counterparty channel end
+     * 
+ * + * .icon.proto.core.channel.Channel.Counterparty counterparty = 3 [json_name = "counterparty"]; + */ + public Builder mergeCounterparty(com.icon.proto.core.channel.Channel.Counterparty value) { + copyOnWrite(); + instance.mergeCounterparty(value); + return this; + } + /** + *
+     * counterparty channel end
+     * 
+ * + * .icon.proto.core.channel.Channel.Counterparty counterparty = 3 [json_name = "counterparty"]; + */ + public Builder clearCounterparty() { copyOnWrite(); + instance.clearCounterparty(); + return this; + } + + /** + *
+     * list of connection identifiers, in order, along which packets sent on
+     * this channel will travel
+     * 
+ * + * repeated string connection_hops = 4 [json_name = "connectionHops"]; + * @return A list containing the connectionHops. + */ + @java.lang.Override + public java.util.List + getConnectionHopsList() { + return java.util.Collections.unmodifiableList( + instance.getConnectionHopsList()); + } + /** + *
+     * list of connection identifiers, in order, along which packets sent on
+     * this channel will travel
+     * 
+ * + * repeated string connection_hops = 4 [json_name = "connectionHops"]; + * @return The count of connectionHops. + */ + @java.lang.Override + public int getConnectionHopsCount() { + return instance.getConnectionHopsCount(); + } + /** + *
+     * list of connection identifiers, in order, along which packets sent on
+     * this channel will travel
+     * 
+ * + * repeated string connection_hops = 4 [json_name = "connectionHops"]; + * @param index The index of the element to return. + * @return The connectionHops at the given index. + */ + @java.lang.Override + public java.lang.String getConnectionHops(int index) { + return instance.getConnectionHops(index); + } + /** + *
+     * list of connection identifiers, in order, along which packets sent on
+     * this channel will travel
+     * 
+ * + * repeated string connection_hops = 4 [json_name = "connectionHops"]; + * @param index The index of the value to return. + * @return The bytes of the connectionHops at the given index. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getConnectionHopsBytes(int index) { + return instance.getConnectionHopsBytes(index); + } + /** + *
+     * list of connection identifiers, in order, along which packets sent on
+     * this channel will travel
+     * 
+ * + * repeated string connection_hops = 4 [json_name = "connectionHops"]; + * @param index The index to set the value at. + * @param value The connectionHops to set. + * @return This builder for chaining. + */ + public Builder setConnectionHops( + int index, java.lang.String value) { + copyOnWrite(); + instance.setConnectionHops(index, value); + return this; + } + /** + *
+     * list of connection identifiers, in order, along which packets sent on
+     * this channel will travel
+     * 
+ * + * repeated string connection_hops = 4 [json_name = "connectionHops"]; + * @param value The connectionHops to add. + * @return This builder for chaining. + */ + public Builder addConnectionHops( + java.lang.String value) { + copyOnWrite(); + instance.addConnectionHops(value); + return this; + } + /** + *
+     * list of connection identifiers, in order, along which packets sent on
+     * this channel will travel
+     * 
+ * + * repeated string connection_hops = 4 [json_name = "connectionHops"]; + * @param values The connectionHops to add. + * @return This builder for chaining. + */ + public Builder addAllConnectionHops( + java.lang.Iterable values) { + copyOnWrite(); + instance.addAllConnectionHops(values); + return this; + } + /** + *
+     * list of connection identifiers, in order, along which packets sent on
+     * this channel will travel
+     * 
+ * + * repeated string connection_hops = 4 [json_name = "connectionHops"]; + * @return This builder for chaining. + */ + public Builder clearConnectionHops() { + copyOnWrite(); + instance.clearConnectionHops(); + return this; + } + /** + *
+     * list of connection identifiers, in order, along which packets sent on
+     * this channel will travel
+     * 
+ * + * repeated string connection_hops = 4 [json_name = "connectionHops"]; + * @param value The bytes of the connectionHops to add. + * @return This builder for chaining. + */ + public Builder addConnectionHopsBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.addConnectionHopsBytes(value); + return this; + } + + /** + *
+     * opaque channel version, which is agreed upon during the handshake
+     * 
+ * + * string version = 5 [json_name = "version"]; + * @return The version. + */ + @java.lang.Override + public java.lang.String getVersion() { + return instance.getVersion(); + } + /** + *
+     * opaque channel version, which is agreed upon during the handshake
+     * 
+ * + * string version = 5 [json_name = "version"]; + * @return The bytes for version. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getVersionBytes() { + return instance.getVersionBytes(); + } + /** + *
+     * opaque channel version, which is agreed upon during the handshake
+     * 
+ * + * string version = 5 [json_name = "version"]; + * @param value The version to set. + * @return This builder for chaining. + */ + public Builder setVersion( + java.lang.String value) { + copyOnWrite(); + instance.setVersion(value); + return this; + } + /** + *
+     * opaque channel version, which is agreed upon during the handshake
+     * 
+ * + * string version = 5 [json_name = "version"]; + * @return This builder for chaining. + */ + public Builder clearVersion() { + copyOnWrite(); + instance.clearVersion(); + return this; + } + /** + *
+     * opaque channel version, which is agreed upon during the handshake
+     * 
+ * + * string version = 5 [json_name = "version"]; + * @param value The bytes for version to set. + * @return This builder for chaining. + */ + public Builder setVersionBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setVersionBytes(value); + return this; + } + + // @@protoc_insertion_point(builder_scope:icon.proto.core.channel.Channel) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.icon.proto.core.channel.Channel(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "state_", + "ordering_", + "counterparty_", + "connectionHops_", + "version_", + }; + java.lang.String info = + "\u0000\u0005\u0000\u0000\u0001\u0005\u0005\u0000\u0001\u0000\u0001\f\u0002\f\u0003" + + "\t\u0004\u021a\u0005\u0208"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.icon.proto.core.channel.Channel.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:icon.proto.core.channel.Channel) + private static final com.icon.proto.core.channel.Channel DEFAULT_INSTANCE; + static { + Channel defaultInstance = new Channel(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + Channel.class, defaultInstance); + } + + public static com.icon.proto.core.channel.Channel getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/channel/ChannelOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/channel/ChannelOrBuilder.java new file mode 100644 index 000000000..986c71a2d --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/channel/ChannelOrBuilder.java @@ -0,0 +1,131 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: core/04-channel/Channel.proto + +package com.icon.proto.core.channel; + +public interface ChannelOrBuilder extends + // @@protoc_insertion_point(interface_extends:icon.proto.core.channel.Channel) + com.google.protobuf.MessageLiteOrBuilder { + + /** + *
+   * current state of the channel end
+   * 
+ * + * .icon.proto.core.channel.Channel.State state = 1 [json_name = "state"]; + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + *
+   * current state of the channel end
+   * 
+ * + * .icon.proto.core.channel.Channel.State state = 1 [json_name = "state"]; + * @return The state. + */ + com.icon.proto.core.channel.Channel.State getState(); + + /** + *
+   * whether the channel is ordered or unordered
+   * 
+ * + * .icon.proto.core.channel.Channel.Order ordering = 2 [json_name = "ordering"]; + * @return The enum numeric value on the wire for ordering. + */ + int getOrderingValue(); + /** + *
+   * whether the channel is ordered or unordered
+   * 
+ * + * .icon.proto.core.channel.Channel.Order ordering = 2 [json_name = "ordering"]; + * @return The ordering. + */ + com.icon.proto.core.channel.Channel.Order getOrdering(); + + /** + *
+   * counterparty channel end
+   * 
+ * + * .icon.proto.core.channel.Channel.Counterparty counterparty = 3 [json_name = "counterparty"]; + * @return Whether the counterparty field is set. + */ + boolean hasCounterparty(); + /** + *
+   * counterparty channel end
+   * 
+ * + * .icon.proto.core.channel.Channel.Counterparty counterparty = 3 [json_name = "counterparty"]; + * @return The counterparty. + */ + com.icon.proto.core.channel.Channel.Counterparty getCounterparty(); + + /** + *
+   * list of connection identifiers, in order, along which packets sent on
+   * this channel will travel
+   * 
+ * + * repeated string connection_hops = 4 [json_name = "connectionHops"]; + * @return A list containing the connectionHops. + */ + java.util.List + getConnectionHopsList(); + /** + *
+   * list of connection identifiers, in order, along which packets sent on
+   * this channel will travel
+   * 
+ * + * repeated string connection_hops = 4 [json_name = "connectionHops"]; + * @return The count of connectionHops. + */ + int getConnectionHopsCount(); + /** + *
+   * list of connection identifiers, in order, along which packets sent on
+   * this channel will travel
+   * 
+ * + * repeated string connection_hops = 4 [json_name = "connectionHops"]; + * @param index The index of the element to return. + * @return The connectionHops at the given index. + */ + java.lang.String getConnectionHops(int index); + /** + *
+   * list of connection identifiers, in order, along which packets sent on
+   * this channel will travel
+   * 
+ * + * repeated string connection_hops = 4 [json_name = "connectionHops"]; + * @param index The index of the element to return. + * @return The connectionHops at the given index. + */ + com.google.protobuf.ByteString + getConnectionHopsBytes(int index); + + /** + *
+   * opaque channel version, which is agreed upon during the handshake
+   * 
+ * + * string version = 5 [json_name = "version"]; + * @return The version. + */ + java.lang.String getVersion(); + /** + *
+   * opaque channel version, which is agreed upon during the handshake
+   * 
+ * + * string version = 5 [json_name = "version"]; + * @return The bytes for version. + */ + com.google.protobuf.ByteString + getVersionBytes(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/channel/ChannelProto.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/channel/ChannelProto.java new file mode 100644 index 000000000..1b9e669f3 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/channel/ChannelProto.java @@ -0,0 +1,16 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: core/04-channel/Channel.proto + +package com.icon.proto.core.channel; + +public final class ChannelProto { + private ChannelProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + static { + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/channel/Packet.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/channel/Packet.java new file mode 100644 index 000000000..17d0872ef --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/channel/Packet.java @@ -0,0 +1,1133 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: core/04-channel/Channel.proto + +package com.icon.proto.core.channel; + +/** + *
+ * Packet defines a type that carries data across different chains through IBC
+ * 
+ * + * Protobuf type {@code icon.proto.core.channel.Packet} + */ +public final class Packet extends + com.google.protobuf.GeneratedMessageLite< + Packet, Packet.Builder> implements + // @@protoc_insertion_point(message_implements:icon.proto.core.channel.Packet) + PacketOrBuilder { + private Packet() { + sourcePort_ = ""; + sourceChannel_ = ""; + destinationPort_ = ""; + destinationChannel_ = ""; + data_ = com.google.protobuf.ByteString.EMPTY; + } + public static final int SEQUENCE_FIELD_NUMBER = 1; + private long sequence_; + /** + *
+   * number corresponds to the order of sends and receives, where a Packet
+   * with an earlier sequence number must be sent and received before a Packet
+   * with a later sequence number.
+   * 
+ * + * uint64 sequence = 1 [json_name = "sequence"]; + * @return The sequence. + */ + @java.lang.Override + public long getSequence() { + return sequence_; + } + /** + *
+   * number corresponds to the order of sends and receives, where a Packet
+   * with an earlier sequence number must be sent and received before a Packet
+   * with a later sequence number.
+   * 
+ * + * uint64 sequence = 1 [json_name = "sequence"]; + * @param value The sequence to set. + */ + private void setSequence(long value) { + + sequence_ = value; + } + /** + *
+   * number corresponds to the order of sends and receives, where a Packet
+   * with an earlier sequence number must be sent and received before a Packet
+   * with a later sequence number.
+   * 
+ * + * uint64 sequence = 1 [json_name = "sequence"]; + */ + private void clearSequence() { + + sequence_ = 0L; + } + + public static final int SOURCE_PORT_FIELD_NUMBER = 2; + private java.lang.String sourcePort_; + /** + *
+   * identifies the port on the sending chain.
+   * 
+ * + * string source_port = 2 [json_name = "sourcePort"]; + * @return The sourcePort. + */ + @java.lang.Override + public java.lang.String getSourcePort() { + return sourcePort_; + } + /** + *
+   * identifies the port on the sending chain.
+   * 
+ * + * string source_port = 2 [json_name = "sourcePort"]; + * @return The bytes for sourcePort. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getSourcePortBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(sourcePort_); + } + /** + *
+   * identifies the port on the sending chain.
+   * 
+ * + * string source_port = 2 [json_name = "sourcePort"]; + * @param value The sourcePort to set. + */ + private void setSourcePort( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + sourcePort_ = value; + } + /** + *
+   * identifies the port on the sending chain.
+   * 
+ * + * string source_port = 2 [json_name = "sourcePort"]; + */ + private void clearSourcePort() { + + sourcePort_ = getDefaultInstance().getSourcePort(); + } + /** + *
+   * identifies the port on the sending chain.
+   * 
+ * + * string source_port = 2 [json_name = "sourcePort"]; + * @param value The bytes for sourcePort to set. + */ + private void setSourcePortBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + sourcePort_ = value.toStringUtf8(); + + } + + public static final int SOURCE_CHANNEL_FIELD_NUMBER = 3; + private java.lang.String sourceChannel_; + /** + *
+   * identifies the channel end on the sending chain.
+   * 
+ * + * string source_channel = 3 [json_name = "sourceChannel"]; + * @return The sourceChannel. + */ + @java.lang.Override + public java.lang.String getSourceChannel() { + return sourceChannel_; + } + /** + *
+   * identifies the channel end on the sending chain.
+   * 
+ * + * string source_channel = 3 [json_name = "sourceChannel"]; + * @return The bytes for sourceChannel. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getSourceChannelBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(sourceChannel_); + } + /** + *
+   * identifies the channel end on the sending chain.
+   * 
+ * + * string source_channel = 3 [json_name = "sourceChannel"]; + * @param value The sourceChannel to set. + */ + private void setSourceChannel( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + sourceChannel_ = value; + } + /** + *
+   * identifies the channel end on the sending chain.
+   * 
+ * + * string source_channel = 3 [json_name = "sourceChannel"]; + */ + private void clearSourceChannel() { + + sourceChannel_ = getDefaultInstance().getSourceChannel(); + } + /** + *
+   * identifies the channel end on the sending chain.
+   * 
+ * + * string source_channel = 3 [json_name = "sourceChannel"]; + * @param value The bytes for sourceChannel to set. + */ + private void setSourceChannelBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + sourceChannel_ = value.toStringUtf8(); + + } + + public static final int DESTINATION_PORT_FIELD_NUMBER = 4; + private java.lang.String destinationPort_; + /** + *
+   * identifies the port on the receiving chain.
+   * 
+ * + * string destination_port = 4 [json_name = "destinationPort"]; + * @return The destinationPort. + */ + @java.lang.Override + public java.lang.String getDestinationPort() { + return destinationPort_; + } + /** + *
+   * identifies the port on the receiving chain.
+   * 
+ * + * string destination_port = 4 [json_name = "destinationPort"]; + * @return The bytes for destinationPort. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDestinationPortBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(destinationPort_); + } + /** + *
+   * identifies the port on the receiving chain.
+   * 
+ * + * string destination_port = 4 [json_name = "destinationPort"]; + * @param value The destinationPort to set. + */ + private void setDestinationPort( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + destinationPort_ = value; + } + /** + *
+   * identifies the port on the receiving chain.
+   * 
+ * + * string destination_port = 4 [json_name = "destinationPort"]; + */ + private void clearDestinationPort() { + + destinationPort_ = getDefaultInstance().getDestinationPort(); + } + /** + *
+   * identifies the port on the receiving chain.
+   * 
+ * + * string destination_port = 4 [json_name = "destinationPort"]; + * @param value The bytes for destinationPort to set. + */ + private void setDestinationPortBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + destinationPort_ = value.toStringUtf8(); + + } + + public static final int DESTINATION_CHANNEL_FIELD_NUMBER = 5; + private java.lang.String destinationChannel_; + /** + *
+   * identifies the channel end on the receiving chain.
+   * 
+ * + * string destination_channel = 5 [json_name = "destinationChannel"]; + * @return The destinationChannel. + */ + @java.lang.Override + public java.lang.String getDestinationChannel() { + return destinationChannel_; + } + /** + *
+   * identifies the channel end on the receiving chain.
+   * 
+ * + * string destination_channel = 5 [json_name = "destinationChannel"]; + * @return The bytes for destinationChannel. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDestinationChannelBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(destinationChannel_); + } + /** + *
+   * identifies the channel end on the receiving chain.
+   * 
+ * + * string destination_channel = 5 [json_name = "destinationChannel"]; + * @param value The destinationChannel to set. + */ + private void setDestinationChannel( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + destinationChannel_ = value; + } + /** + *
+   * identifies the channel end on the receiving chain.
+   * 
+ * + * string destination_channel = 5 [json_name = "destinationChannel"]; + */ + private void clearDestinationChannel() { + + destinationChannel_ = getDefaultInstance().getDestinationChannel(); + } + /** + *
+   * identifies the channel end on the receiving chain.
+   * 
+ * + * string destination_channel = 5 [json_name = "destinationChannel"]; + * @param value The bytes for destinationChannel to set. + */ + private void setDestinationChannelBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + destinationChannel_ = value.toStringUtf8(); + + } + + public static final int DATA_FIELD_NUMBER = 6; + private com.google.protobuf.ByteString data_; + /** + *
+   * actual opaque bytes transferred directly to the application module
+   * 
+ * + * bytes data = 6 [json_name = "data"]; + * @return The data. + */ + @java.lang.Override + public com.google.protobuf.ByteString getData() { + return data_; + } + /** + *
+   * actual opaque bytes transferred directly to the application module
+   * 
+ * + * bytes data = 6 [json_name = "data"]; + * @param value The data to set. + */ + private void setData(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + data_ = value; + } + /** + *
+   * actual opaque bytes transferred directly to the application module
+   * 
+ * + * bytes data = 6 [json_name = "data"]; + */ + private void clearData() { + + data_ = getDefaultInstance().getData(); + } + + public static final int TIMEOUT_HEIGHT_FIELD_NUMBER = 7; + private com.icon.proto.core.client.Height timeoutHeight_; + /** + *
+   * block height after which the packet times out
+   * 
+ * + * .icon.proto.core.client.Height timeout_height = 7 [json_name = "timeoutHeight"]; + */ + @java.lang.Override + public boolean hasTimeoutHeight() { + return timeoutHeight_ != null; + } + /** + *
+   * block height after which the packet times out
+   * 
+ * + * .icon.proto.core.client.Height timeout_height = 7 [json_name = "timeoutHeight"]; + */ + @java.lang.Override + public com.icon.proto.core.client.Height getTimeoutHeight() { + return timeoutHeight_ == null ? com.icon.proto.core.client.Height.getDefaultInstance() : timeoutHeight_; + } + /** + *
+   * block height after which the packet times out
+   * 
+ * + * .icon.proto.core.client.Height timeout_height = 7 [json_name = "timeoutHeight"]; + */ + private void setTimeoutHeight(com.icon.proto.core.client.Height value) { + value.getClass(); + timeoutHeight_ = value; + + } + /** + *
+   * block height after which the packet times out
+   * 
+ * + * .icon.proto.core.client.Height timeout_height = 7 [json_name = "timeoutHeight"]; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeTimeoutHeight(com.icon.proto.core.client.Height value) { + value.getClass(); + if (timeoutHeight_ != null && + timeoutHeight_ != com.icon.proto.core.client.Height.getDefaultInstance()) { + timeoutHeight_ = + com.icon.proto.core.client.Height.newBuilder(timeoutHeight_).mergeFrom(value).buildPartial(); + } else { + timeoutHeight_ = value; + } + + } + /** + *
+   * block height after which the packet times out
+   * 
+ * + * .icon.proto.core.client.Height timeout_height = 7 [json_name = "timeoutHeight"]; + */ + private void clearTimeoutHeight() { timeoutHeight_ = null; + + } + + public static final int TIMEOUT_TIMESTAMP_FIELD_NUMBER = 8; + private long timeoutTimestamp_; + /** + *
+   * block timestamp (in nanoseconds) after which the packet times out
+   * 
+ * + * uint64 timeout_timestamp = 8 [json_name = "timeoutTimestamp"]; + * @return The timeoutTimestamp. + */ + @java.lang.Override + public long getTimeoutTimestamp() { + return timeoutTimestamp_; + } + /** + *
+   * block timestamp (in nanoseconds) after which the packet times out
+   * 
+ * + * uint64 timeout_timestamp = 8 [json_name = "timeoutTimestamp"]; + * @param value The timeoutTimestamp to set. + */ + private void setTimeoutTimestamp(long value) { + + timeoutTimestamp_ = value; + } + /** + *
+   * block timestamp (in nanoseconds) after which the packet times out
+   * 
+ * + * uint64 timeout_timestamp = 8 [json_name = "timeoutTimestamp"]; + */ + private void clearTimeoutTimestamp() { + + timeoutTimestamp_ = 0L; + } + + public static com.icon.proto.core.channel.Packet parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.channel.Packet parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.channel.Packet parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.channel.Packet parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.channel.Packet parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.channel.Packet parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.channel.Packet parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.channel.Packet parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.icon.proto.core.channel.Packet parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.channel.Packet parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.icon.proto.core.channel.Packet parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.channel.Packet parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.icon.proto.core.channel.Packet prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+   * Packet defines a type that carries data across different chains through IBC
+   * 
+ * + * Protobuf type {@code icon.proto.core.channel.Packet} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.icon.proto.core.channel.Packet, Builder> implements + // @@protoc_insertion_point(builder_implements:icon.proto.core.channel.Packet) + com.icon.proto.core.channel.PacketOrBuilder { + // Construct using com.icon.proto.core.channel.Packet.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + *
+     * number corresponds to the order of sends and receives, where a Packet
+     * with an earlier sequence number must be sent and received before a Packet
+     * with a later sequence number.
+     * 
+ * + * uint64 sequence = 1 [json_name = "sequence"]; + * @return The sequence. + */ + @java.lang.Override + public long getSequence() { + return instance.getSequence(); + } + /** + *
+     * number corresponds to the order of sends and receives, where a Packet
+     * with an earlier sequence number must be sent and received before a Packet
+     * with a later sequence number.
+     * 
+ * + * uint64 sequence = 1 [json_name = "sequence"]; + * @param value The sequence to set. + * @return This builder for chaining. + */ + public Builder setSequence(long value) { + copyOnWrite(); + instance.setSequence(value); + return this; + } + /** + *
+     * number corresponds to the order of sends and receives, where a Packet
+     * with an earlier sequence number must be sent and received before a Packet
+     * with a later sequence number.
+     * 
+ * + * uint64 sequence = 1 [json_name = "sequence"]; + * @return This builder for chaining. + */ + public Builder clearSequence() { + copyOnWrite(); + instance.clearSequence(); + return this; + } + + /** + *
+     * identifies the port on the sending chain.
+     * 
+ * + * string source_port = 2 [json_name = "sourcePort"]; + * @return The sourcePort. + */ + @java.lang.Override + public java.lang.String getSourcePort() { + return instance.getSourcePort(); + } + /** + *
+     * identifies the port on the sending chain.
+     * 
+ * + * string source_port = 2 [json_name = "sourcePort"]; + * @return The bytes for sourcePort. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getSourcePortBytes() { + return instance.getSourcePortBytes(); + } + /** + *
+     * identifies the port on the sending chain.
+     * 
+ * + * string source_port = 2 [json_name = "sourcePort"]; + * @param value The sourcePort to set. + * @return This builder for chaining. + */ + public Builder setSourcePort( + java.lang.String value) { + copyOnWrite(); + instance.setSourcePort(value); + return this; + } + /** + *
+     * identifies the port on the sending chain.
+     * 
+ * + * string source_port = 2 [json_name = "sourcePort"]; + * @return This builder for chaining. + */ + public Builder clearSourcePort() { + copyOnWrite(); + instance.clearSourcePort(); + return this; + } + /** + *
+     * identifies the port on the sending chain.
+     * 
+ * + * string source_port = 2 [json_name = "sourcePort"]; + * @param value The bytes for sourcePort to set. + * @return This builder for chaining. + */ + public Builder setSourcePortBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setSourcePortBytes(value); + return this; + } + + /** + *
+     * identifies the channel end on the sending chain.
+     * 
+ * + * string source_channel = 3 [json_name = "sourceChannel"]; + * @return The sourceChannel. + */ + @java.lang.Override + public java.lang.String getSourceChannel() { + return instance.getSourceChannel(); + } + /** + *
+     * identifies the channel end on the sending chain.
+     * 
+ * + * string source_channel = 3 [json_name = "sourceChannel"]; + * @return The bytes for sourceChannel. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getSourceChannelBytes() { + return instance.getSourceChannelBytes(); + } + /** + *
+     * identifies the channel end on the sending chain.
+     * 
+ * + * string source_channel = 3 [json_name = "sourceChannel"]; + * @param value The sourceChannel to set. + * @return This builder for chaining. + */ + public Builder setSourceChannel( + java.lang.String value) { + copyOnWrite(); + instance.setSourceChannel(value); + return this; + } + /** + *
+     * identifies the channel end on the sending chain.
+     * 
+ * + * string source_channel = 3 [json_name = "sourceChannel"]; + * @return This builder for chaining. + */ + public Builder clearSourceChannel() { + copyOnWrite(); + instance.clearSourceChannel(); + return this; + } + /** + *
+     * identifies the channel end on the sending chain.
+     * 
+ * + * string source_channel = 3 [json_name = "sourceChannel"]; + * @param value The bytes for sourceChannel to set. + * @return This builder for chaining. + */ + public Builder setSourceChannelBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setSourceChannelBytes(value); + return this; + } + + /** + *
+     * identifies the port on the receiving chain.
+     * 
+ * + * string destination_port = 4 [json_name = "destinationPort"]; + * @return The destinationPort. + */ + @java.lang.Override + public java.lang.String getDestinationPort() { + return instance.getDestinationPort(); + } + /** + *
+     * identifies the port on the receiving chain.
+     * 
+ * + * string destination_port = 4 [json_name = "destinationPort"]; + * @return The bytes for destinationPort. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDestinationPortBytes() { + return instance.getDestinationPortBytes(); + } + /** + *
+     * identifies the port on the receiving chain.
+     * 
+ * + * string destination_port = 4 [json_name = "destinationPort"]; + * @param value The destinationPort to set. + * @return This builder for chaining. + */ + public Builder setDestinationPort( + java.lang.String value) { + copyOnWrite(); + instance.setDestinationPort(value); + return this; + } + /** + *
+     * identifies the port on the receiving chain.
+     * 
+ * + * string destination_port = 4 [json_name = "destinationPort"]; + * @return This builder for chaining. + */ + public Builder clearDestinationPort() { + copyOnWrite(); + instance.clearDestinationPort(); + return this; + } + /** + *
+     * identifies the port on the receiving chain.
+     * 
+ * + * string destination_port = 4 [json_name = "destinationPort"]; + * @param value The bytes for destinationPort to set. + * @return This builder for chaining. + */ + public Builder setDestinationPortBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setDestinationPortBytes(value); + return this; + } + + /** + *
+     * identifies the channel end on the receiving chain.
+     * 
+ * + * string destination_channel = 5 [json_name = "destinationChannel"]; + * @return The destinationChannel. + */ + @java.lang.Override + public java.lang.String getDestinationChannel() { + return instance.getDestinationChannel(); + } + /** + *
+     * identifies the channel end on the receiving chain.
+     * 
+ * + * string destination_channel = 5 [json_name = "destinationChannel"]; + * @return The bytes for destinationChannel. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDestinationChannelBytes() { + return instance.getDestinationChannelBytes(); + } + /** + *
+     * identifies the channel end on the receiving chain.
+     * 
+ * + * string destination_channel = 5 [json_name = "destinationChannel"]; + * @param value The destinationChannel to set. + * @return This builder for chaining. + */ + public Builder setDestinationChannel( + java.lang.String value) { + copyOnWrite(); + instance.setDestinationChannel(value); + return this; + } + /** + *
+     * identifies the channel end on the receiving chain.
+     * 
+ * + * string destination_channel = 5 [json_name = "destinationChannel"]; + * @return This builder for chaining. + */ + public Builder clearDestinationChannel() { + copyOnWrite(); + instance.clearDestinationChannel(); + return this; + } + /** + *
+     * identifies the channel end on the receiving chain.
+     * 
+ * + * string destination_channel = 5 [json_name = "destinationChannel"]; + * @param value The bytes for destinationChannel to set. + * @return This builder for chaining. + */ + public Builder setDestinationChannelBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setDestinationChannelBytes(value); + return this; + } + + /** + *
+     * actual opaque bytes transferred directly to the application module
+     * 
+ * + * bytes data = 6 [json_name = "data"]; + * @return The data. + */ + @java.lang.Override + public com.google.protobuf.ByteString getData() { + return instance.getData(); + } + /** + *
+     * actual opaque bytes transferred directly to the application module
+     * 
+ * + * bytes data = 6 [json_name = "data"]; + * @param value The data to set. + * @return This builder for chaining. + */ + public Builder setData(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setData(value); + return this; + } + /** + *
+     * actual opaque bytes transferred directly to the application module
+     * 
+ * + * bytes data = 6 [json_name = "data"]; + * @return This builder for chaining. + */ + public Builder clearData() { + copyOnWrite(); + instance.clearData(); + return this; + } + + /** + *
+     * block height after which the packet times out
+     * 
+ * + * .icon.proto.core.client.Height timeout_height = 7 [json_name = "timeoutHeight"]; + */ + @java.lang.Override + public boolean hasTimeoutHeight() { + return instance.hasTimeoutHeight(); + } + /** + *
+     * block height after which the packet times out
+     * 
+ * + * .icon.proto.core.client.Height timeout_height = 7 [json_name = "timeoutHeight"]; + */ + @java.lang.Override + public com.icon.proto.core.client.Height getTimeoutHeight() { + return instance.getTimeoutHeight(); + } + /** + *
+     * block height after which the packet times out
+     * 
+ * + * .icon.proto.core.client.Height timeout_height = 7 [json_name = "timeoutHeight"]; + */ + public Builder setTimeoutHeight(com.icon.proto.core.client.Height value) { + copyOnWrite(); + instance.setTimeoutHeight(value); + return this; + } + /** + *
+     * block height after which the packet times out
+     * 
+ * + * .icon.proto.core.client.Height timeout_height = 7 [json_name = "timeoutHeight"]; + */ + public Builder setTimeoutHeight( + com.icon.proto.core.client.Height.Builder builderForValue) { + copyOnWrite(); + instance.setTimeoutHeight(builderForValue.build()); + return this; + } + /** + *
+     * block height after which the packet times out
+     * 
+ * + * .icon.proto.core.client.Height timeout_height = 7 [json_name = "timeoutHeight"]; + */ + public Builder mergeTimeoutHeight(com.icon.proto.core.client.Height value) { + copyOnWrite(); + instance.mergeTimeoutHeight(value); + return this; + } + /** + *
+     * block height after which the packet times out
+     * 
+ * + * .icon.proto.core.client.Height timeout_height = 7 [json_name = "timeoutHeight"]; + */ + public Builder clearTimeoutHeight() { copyOnWrite(); + instance.clearTimeoutHeight(); + return this; + } + + /** + *
+     * block timestamp (in nanoseconds) after which the packet times out
+     * 
+ * + * uint64 timeout_timestamp = 8 [json_name = "timeoutTimestamp"]; + * @return The timeoutTimestamp. + */ + @java.lang.Override + public long getTimeoutTimestamp() { + return instance.getTimeoutTimestamp(); + } + /** + *
+     * block timestamp (in nanoseconds) after which the packet times out
+     * 
+ * + * uint64 timeout_timestamp = 8 [json_name = "timeoutTimestamp"]; + * @param value The timeoutTimestamp to set. + * @return This builder for chaining. + */ + public Builder setTimeoutTimestamp(long value) { + copyOnWrite(); + instance.setTimeoutTimestamp(value); + return this; + } + /** + *
+     * block timestamp (in nanoseconds) after which the packet times out
+     * 
+ * + * uint64 timeout_timestamp = 8 [json_name = "timeoutTimestamp"]; + * @return This builder for chaining. + */ + public Builder clearTimeoutTimestamp() { + copyOnWrite(); + instance.clearTimeoutTimestamp(); + return this; + } + + // @@protoc_insertion_point(builder_scope:icon.proto.core.channel.Packet) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.icon.proto.core.channel.Packet(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "sequence_", + "sourcePort_", + "sourceChannel_", + "destinationPort_", + "destinationChannel_", + "data_", + "timeoutHeight_", + "timeoutTimestamp_", + }; + java.lang.String info = + "\u0000\b\u0000\u0000\u0001\b\b\u0000\u0000\u0000\u0001\u0003\u0002\u0208\u0003\u0208" + + "\u0004\u0208\u0005\u0208\u0006\n\u0007\t\b\u0003"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.icon.proto.core.channel.Packet.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:icon.proto.core.channel.Packet) + private static final com.icon.proto.core.channel.Packet DEFAULT_INSTANCE; + static { + Packet defaultInstance = new Packet(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + Packet.class, defaultInstance); + } + + public static com.icon.proto.core.channel.Packet getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/channel/PacketOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/channel/PacketOrBuilder.java new file mode 100644 index 000000000..cfbc8e13c --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/channel/PacketOrBuilder.java @@ -0,0 +1,140 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: core/04-channel/Channel.proto + +package com.icon.proto.core.channel; + +public interface PacketOrBuilder extends + // @@protoc_insertion_point(interface_extends:icon.proto.core.channel.Packet) + com.google.protobuf.MessageLiteOrBuilder { + + /** + *
+   * number corresponds to the order of sends and receives, where a Packet
+   * with an earlier sequence number must be sent and received before a Packet
+   * with a later sequence number.
+   * 
+ * + * uint64 sequence = 1 [json_name = "sequence"]; + * @return The sequence. + */ + long getSequence(); + + /** + *
+   * identifies the port on the sending chain.
+   * 
+ * + * string source_port = 2 [json_name = "sourcePort"]; + * @return The sourcePort. + */ + java.lang.String getSourcePort(); + /** + *
+   * identifies the port on the sending chain.
+   * 
+ * + * string source_port = 2 [json_name = "sourcePort"]; + * @return The bytes for sourcePort. + */ + com.google.protobuf.ByteString + getSourcePortBytes(); + + /** + *
+   * identifies the channel end on the sending chain.
+   * 
+ * + * string source_channel = 3 [json_name = "sourceChannel"]; + * @return The sourceChannel. + */ + java.lang.String getSourceChannel(); + /** + *
+   * identifies the channel end on the sending chain.
+   * 
+ * + * string source_channel = 3 [json_name = "sourceChannel"]; + * @return The bytes for sourceChannel. + */ + com.google.protobuf.ByteString + getSourceChannelBytes(); + + /** + *
+   * identifies the port on the receiving chain.
+   * 
+ * + * string destination_port = 4 [json_name = "destinationPort"]; + * @return The destinationPort. + */ + java.lang.String getDestinationPort(); + /** + *
+   * identifies the port on the receiving chain.
+   * 
+ * + * string destination_port = 4 [json_name = "destinationPort"]; + * @return The bytes for destinationPort. + */ + com.google.protobuf.ByteString + getDestinationPortBytes(); + + /** + *
+   * identifies the channel end on the receiving chain.
+   * 
+ * + * string destination_channel = 5 [json_name = "destinationChannel"]; + * @return The destinationChannel. + */ + java.lang.String getDestinationChannel(); + /** + *
+   * identifies the channel end on the receiving chain.
+   * 
+ * + * string destination_channel = 5 [json_name = "destinationChannel"]; + * @return The bytes for destinationChannel. + */ + com.google.protobuf.ByteString + getDestinationChannelBytes(); + + /** + *
+   * actual opaque bytes transferred directly to the application module
+   * 
+ * + * bytes data = 6 [json_name = "data"]; + * @return The data. + */ + com.google.protobuf.ByteString getData(); + + /** + *
+   * block height after which the packet times out
+   * 
+ * + * .icon.proto.core.client.Height timeout_height = 7 [json_name = "timeoutHeight"]; + * @return Whether the timeoutHeight field is set. + */ + boolean hasTimeoutHeight(); + /** + *
+   * block height after which the packet times out
+   * 
+ * + * .icon.proto.core.client.Height timeout_height = 7 [json_name = "timeoutHeight"]; + * @return The timeoutHeight. + */ + com.icon.proto.core.client.Height getTimeoutHeight(); + + /** + *
+   * block timestamp (in nanoseconds) after which the packet times out
+   * 
+ * + * uint64 timeout_timestamp = 8 [json_name = "timeoutTimestamp"]; + * @return The timeoutTimestamp. + */ + long getTimeoutTimestamp(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/channel/PacketState.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/channel/PacketState.java new file mode 100644 index 000000000..f66526a6b --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/channel/PacketState.java @@ -0,0 +1,634 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: core/04-channel/Channel.proto + +package com.icon.proto.core.channel; + +/** + *
+ * PacketState defines the generic type necessary to retrieve and store
+ * packet commitments, acknowledgements, and receipts.
+ * Caller is responsible for knowing the context necessary to interpret this
+ * state as a commitment, acknowledgement, or a receipt.
+ * 
+ * + * Protobuf type {@code icon.proto.core.channel.PacketState} + */ +public final class PacketState extends + com.google.protobuf.GeneratedMessageLite< + PacketState, PacketState.Builder> implements + // @@protoc_insertion_point(message_implements:icon.proto.core.channel.PacketState) + PacketStateOrBuilder { + private PacketState() { + portId_ = ""; + channelId_ = ""; + data_ = com.google.protobuf.ByteString.EMPTY; + } + public static final int PORT_ID_FIELD_NUMBER = 1; + private java.lang.String portId_; + /** + *
+   * channel port identifier.
+   * 
+ * + * string port_id = 1 [json_name = "portId"]; + * @return The portId. + */ + @java.lang.Override + public java.lang.String getPortId() { + return portId_; + } + /** + *
+   * channel port identifier.
+   * 
+ * + * string port_id = 1 [json_name = "portId"]; + * @return The bytes for portId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getPortIdBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(portId_); + } + /** + *
+   * channel port identifier.
+   * 
+ * + * string port_id = 1 [json_name = "portId"]; + * @param value The portId to set. + */ + private void setPortId( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + portId_ = value; + } + /** + *
+   * channel port identifier.
+   * 
+ * + * string port_id = 1 [json_name = "portId"]; + */ + private void clearPortId() { + + portId_ = getDefaultInstance().getPortId(); + } + /** + *
+   * channel port identifier.
+   * 
+ * + * string port_id = 1 [json_name = "portId"]; + * @param value The bytes for portId to set. + */ + private void setPortIdBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + portId_ = value.toStringUtf8(); + + } + + public static final int CHANNEL_ID_FIELD_NUMBER = 2; + private java.lang.String channelId_; + /** + *
+   * channel unique identifier.
+   * 
+ * + * string channel_id = 2 [json_name = "channelId"]; + * @return The channelId. + */ + @java.lang.Override + public java.lang.String getChannelId() { + return channelId_; + } + /** + *
+   * channel unique identifier.
+   * 
+ * + * string channel_id = 2 [json_name = "channelId"]; + * @return The bytes for channelId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getChannelIdBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(channelId_); + } + /** + *
+   * channel unique identifier.
+   * 
+ * + * string channel_id = 2 [json_name = "channelId"]; + * @param value The channelId to set. + */ + private void setChannelId( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + channelId_ = value; + } + /** + *
+   * channel unique identifier.
+   * 
+ * + * string channel_id = 2 [json_name = "channelId"]; + */ + private void clearChannelId() { + + channelId_ = getDefaultInstance().getChannelId(); + } + /** + *
+   * channel unique identifier.
+   * 
+ * + * string channel_id = 2 [json_name = "channelId"]; + * @param value The bytes for channelId to set. + */ + private void setChannelIdBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + channelId_ = value.toStringUtf8(); + + } + + public static final int SEQUENCE_FIELD_NUMBER = 3; + private long sequence_; + /** + *
+   * packet sequence.
+   * 
+ * + * uint64 sequence = 3 [json_name = "sequence"]; + * @return The sequence. + */ + @java.lang.Override + public long getSequence() { + return sequence_; + } + /** + *
+   * packet sequence.
+   * 
+ * + * uint64 sequence = 3 [json_name = "sequence"]; + * @param value The sequence to set. + */ + private void setSequence(long value) { + + sequence_ = value; + } + /** + *
+   * packet sequence.
+   * 
+ * + * uint64 sequence = 3 [json_name = "sequence"]; + */ + private void clearSequence() { + + sequence_ = 0L; + } + + public static final int DATA_FIELD_NUMBER = 4; + private com.google.protobuf.ByteString data_; + /** + *
+   * embedded data that represents packet state.
+   * 
+ * + * bytes data = 4 [json_name = "data"]; + * @return The data. + */ + @java.lang.Override + public com.google.protobuf.ByteString getData() { + return data_; + } + /** + *
+   * embedded data that represents packet state.
+   * 
+ * + * bytes data = 4 [json_name = "data"]; + * @param value The data to set. + */ + private void setData(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + data_ = value; + } + /** + *
+   * embedded data that represents packet state.
+   * 
+ * + * bytes data = 4 [json_name = "data"]; + */ + private void clearData() { + + data_ = getDefaultInstance().getData(); + } + + public static com.icon.proto.core.channel.PacketState parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.channel.PacketState parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.channel.PacketState parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.channel.PacketState parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.channel.PacketState parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.channel.PacketState parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.channel.PacketState parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.channel.PacketState parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.icon.proto.core.channel.PacketState parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.channel.PacketState parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.icon.proto.core.channel.PacketState parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.channel.PacketState parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.icon.proto.core.channel.PacketState prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+   * PacketState defines the generic type necessary to retrieve and store
+   * packet commitments, acknowledgements, and receipts.
+   * Caller is responsible for knowing the context necessary to interpret this
+   * state as a commitment, acknowledgement, or a receipt.
+   * 
+ * + * Protobuf type {@code icon.proto.core.channel.PacketState} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.icon.proto.core.channel.PacketState, Builder> implements + // @@protoc_insertion_point(builder_implements:icon.proto.core.channel.PacketState) + com.icon.proto.core.channel.PacketStateOrBuilder { + // Construct using com.icon.proto.core.channel.PacketState.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + *
+     * channel port identifier.
+     * 
+ * + * string port_id = 1 [json_name = "portId"]; + * @return The portId. + */ + @java.lang.Override + public java.lang.String getPortId() { + return instance.getPortId(); + } + /** + *
+     * channel port identifier.
+     * 
+ * + * string port_id = 1 [json_name = "portId"]; + * @return The bytes for portId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getPortIdBytes() { + return instance.getPortIdBytes(); + } + /** + *
+     * channel port identifier.
+     * 
+ * + * string port_id = 1 [json_name = "portId"]; + * @param value The portId to set. + * @return This builder for chaining. + */ + public Builder setPortId( + java.lang.String value) { + copyOnWrite(); + instance.setPortId(value); + return this; + } + /** + *
+     * channel port identifier.
+     * 
+ * + * string port_id = 1 [json_name = "portId"]; + * @return This builder for chaining. + */ + public Builder clearPortId() { + copyOnWrite(); + instance.clearPortId(); + return this; + } + /** + *
+     * channel port identifier.
+     * 
+ * + * string port_id = 1 [json_name = "portId"]; + * @param value The bytes for portId to set. + * @return This builder for chaining. + */ + public Builder setPortIdBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setPortIdBytes(value); + return this; + } + + /** + *
+     * channel unique identifier.
+     * 
+ * + * string channel_id = 2 [json_name = "channelId"]; + * @return The channelId. + */ + @java.lang.Override + public java.lang.String getChannelId() { + return instance.getChannelId(); + } + /** + *
+     * channel unique identifier.
+     * 
+ * + * string channel_id = 2 [json_name = "channelId"]; + * @return The bytes for channelId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getChannelIdBytes() { + return instance.getChannelIdBytes(); + } + /** + *
+     * channel unique identifier.
+     * 
+ * + * string channel_id = 2 [json_name = "channelId"]; + * @param value The channelId to set. + * @return This builder for chaining. + */ + public Builder setChannelId( + java.lang.String value) { + copyOnWrite(); + instance.setChannelId(value); + return this; + } + /** + *
+     * channel unique identifier.
+     * 
+ * + * string channel_id = 2 [json_name = "channelId"]; + * @return This builder for chaining. + */ + public Builder clearChannelId() { + copyOnWrite(); + instance.clearChannelId(); + return this; + } + /** + *
+     * channel unique identifier.
+     * 
+ * + * string channel_id = 2 [json_name = "channelId"]; + * @param value The bytes for channelId to set. + * @return This builder for chaining. + */ + public Builder setChannelIdBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setChannelIdBytes(value); + return this; + } + + /** + *
+     * packet sequence.
+     * 
+ * + * uint64 sequence = 3 [json_name = "sequence"]; + * @return The sequence. + */ + @java.lang.Override + public long getSequence() { + return instance.getSequence(); + } + /** + *
+     * packet sequence.
+     * 
+ * + * uint64 sequence = 3 [json_name = "sequence"]; + * @param value The sequence to set. + * @return This builder for chaining. + */ + public Builder setSequence(long value) { + copyOnWrite(); + instance.setSequence(value); + return this; + } + /** + *
+     * packet sequence.
+     * 
+ * + * uint64 sequence = 3 [json_name = "sequence"]; + * @return This builder for chaining. + */ + public Builder clearSequence() { + copyOnWrite(); + instance.clearSequence(); + return this; + } + + /** + *
+     * embedded data that represents packet state.
+     * 
+ * + * bytes data = 4 [json_name = "data"]; + * @return The data. + */ + @java.lang.Override + public com.google.protobuf.ByteString getData() { + return instance.getData(); + } + /** + *
+     * embedded data that represents packet state.
+     * 
+ * + * bytes data = 4 [json_name = "data"]; + * @param value The data to set. + * @return This builder for chaining. + */ + public Builder setData(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setData(value); + return this; + } + /** + *
+     * embedded data that represents packet state.
+     * 
+ * + * bytes data = 4 [json_name = "data"]; + * @return This builder for chaining. + */ + public Builder clearData() { + copyOnWrite(); + instance.clearData(); + return this; + } + + // @@protoc_insertion_point(builder_scope:icon.proto.core.channel.PacketState) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.icon.proto.core.channel.PacketState(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "portId_", + "channelId_", + "sequence_", + "data_", + }; + java.lang.String info = + "\u0000\u0004\u0000\u0000\u0001\u0004\u0004\u0000\u0000\u0000\u0001\u0208\u0002\u0208" + + "\u0003\u0003\u0004\n"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.icon.proto.core.channel.PacketState.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:icon.proto.core.channel.PacketState) + private static final com.icon.proto.core.channel.PacketState DEFAULT_INSTANCE; + static { + PacketState defaultInstance = new PacketState(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + PacketState.class, defaultInstance); + } + + public static com.icon.proto.core.channel.PacketState getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/channel/PacketStateOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/channel/PacketStateOrBuilder.java new file mode 100644 index 000000000..443d7068f --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/channel/PacketStateOrBuilder.java @@ -0,0 +1,69 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: core/04-channel/Channel.proto + +package com.icon.proto.core.channel; + +public interface PacketStateOrBuilder extends + // @@protoc_insertion_point(interface_extends:icon.proto.core.channel.PacketState) + com.google.protobuf.MessageLiteOrBuilder { + + /** + *
+   * channel port identifier.
+   * 
+ * + * string port_id = 1 [json_name = "portId"]; + * @return The portId. + */ + java.lang.String getPortId(); + /** + *
+   * channel port identifier.
+   * 
+ * + * string port_id = 1 [json_name = "portId"]; + * @return The bytes for portId. + */ + com.google.protobuf.ByteString + getPortIdBytes(); + + /** + *
+   * channel unique identifier.
+   * 
+ * + * string channel_id = 2 [json_name = "channelId"]; + * @return The channelId. + */ + java.lang.String getChannelId(); + /** + *
+   * channel unique identifier.
+   * 
+ * + * string channel_id = 2 [json_name = "channelId"]; + * @return The bytes for channelId. + */ + com.google.protobuf.ByteString + getChannelIdBytes(); + + /** + *
+   * packet sequence.
+   * 
+ * + * uint64 sequence = 3 [json_name = "sequence"]; + * @return The sequence. + */ + long getSequence(); + + /** + *
+   * embedded data that represents packet state.
+   * 
+ * + * bytes data = 4 [json_name = "data"]; + * @return The data. + */ + com.google.protobuf.ByteString getData(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/client/ClientProto.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/client/ClientProto.java new file mode 100644 index 000000000..4cfa6b80f --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/client/ClientProto.java @@ -0,0 +1,16 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: core/02-client/Client.proto + +package com.icon.proto.core.client; + +public final class ClientProto { + private ClientProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + static { + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/client/Height.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/client/Height.java new file mode 100644 index 000000000..8b4c3e1a1 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/client/Height.java @@ -0,0 +1,364 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: core/02-client/Client.proto + +package com.icon.proto.core.client; + +/** + *
+ * Height is a monotonically increasing data type
+ * that can be compared against another Height for the purposes of updating and
+ * freezing clients
+ * Normally the RevisionHeight is incremented at each height while keeping RevisionNumber
+ * the same. However some consensus algorithms may choose to reset the
+ * height in certain conditions e.g. hard forks, state-machine breaking changes
+ * In these cases, the RevisionNumber is incremented so that height continues to
+ * be monitonically increasing even as the RevisionHeight gets reset
+ * 
+ * + * Protobuf type {@code icon.proto.core.client.Height} + */ +public final class Height extends + com.google.protobuf.GeneratedMessageLite< + Height, Height.Builder> implements + // @@protoc_insertion_point(message_implements:icon.proto.core.client.Height) + HeightOrBuilder { + private Height() { + } + public static final int REVISION_NUMBER_FIELD_NUMBER = 1; + private long revisionNumber_; + /** + *
+   * the revision that the client is currently on
+   * 
+ * + * uint64 revision_number = 1 [json_name = "revisionNumber"]; + * @return The revisionNumber. + */ + @java.lang.Override + public long getRevisionNumber() { + return revisionNumber_; + } + /** + *
+   * the revision that the client is currently on
+   * 
+ * + * uint64 revision_number = 1 [json_name = "revisionNumber"]; + * @param value The revisionNumber to set. + */ + private void setRevisionNumber(long value) { + + revisionNumber_ = value; + } + /** + *
+   * the revision that the client is currently on
+   * 
+ * + * uint64 revision_number = 1 [json_name = "revisionNumber"]; + */ + private void clearRevisionNumber() { + + revisionNumber_ = 0L; + } + + public static final int REVISION_HEIGHT_FIELD_NUMBER = 2; + private long revisionHeight_; + /** + *
+   * the height within the given revision
+   * 
+ * + * uint64 revision_height = 2 [json_name = "revisionHeight"]; + * @return The revisionHeight. + */ + @java.lang.Override + public long getRevisionHeight() { + return revisionHeight_; + } + /** + *
+   * the height within the given revision
+   * 
+ * + * uint64 revision_height = 2 [json_name = "revisionHeight"]; + * @param value The revisionHeight to set. + */ + private void setRevisionHeight(long value) { + + revisionHeight_ = value; + } + /** + *
+   * the height within the given revision
+   * 
+ * + * uint64 revision_height = 2 [json_name = "revisionHeight"]; + */ + private void clearRevisionHeight() { + + revisionHeight_ = 0L; + } + + public static com.icon.proto.core.client.Height parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.client.Height parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.client.Height parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.client.Height parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.client.Height parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.client.Height parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.client.Height parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.client.Height parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.icon.proto.core.client.Height parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.client.Height parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.icon.proto.core.client.Height parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.client.Height parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.icon.proto.core.client.Height prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+   * Height is a monotonically increasing data type
+   * that can be compared against another Height for the purposes of updating and
+   * freezing clients
+   * Normally the RevisionHeight is incremented at each height while keeping RevisionNumber
+   * the same. However some consensus algorithms may choose to reset the
+   * height in certain conditions e.g. hard forks, state-machine breaking changes
+   * In these cases, the RevisionNumber is incremented so that height continues to
+   * be monitonically increasing even as the RevisionHeight gets reset
+   * 
+ * + * Protobuf type {@code icon.proto.core.client.Height} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.icon.proto.core.client.Height, Builder> implements + // @@protoc_insertion_point(builder_implements:icon.proto.core.client.Height) + com.icon.proto.core.client.HeightOrBuilder { + // Construct using com.icon.proto.core.client.Height.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + *
+     * the revision that the client is currently on
+     * 
+ * + * uint64 revision_number = 1 [json_name = "revisionNumber"]; + * @return The revisionNumber. + */ + @java.lang.Override + public long getRevisionNumber() { + return instance.getRevisionNumber(); + } + /** + *
+     * the revision that the client is currently on
+     * 
+ * + * uint64 revision_number = 1 [json_name = "revisionNumber"]; + * @param value The revisionNumber to set. + * @return This builder for chaining. + */ + public Builder setRevisionNumber(long value) { + copyOnWrite(); + instance.setRevisionNumber(value); + return this; + } + /** + *
+     * the revision that the client is currently on
+     * 
+ * + * uint64 revision_number = 1 [json_name = "revisionNumber"]; + * @return This builder for chaining. + */ + public Builder clearRevisionNumber() { + copyOnWrite(); + instance.clearRevisionNumber(); + return this; + } + + /** + *
+     * the height within the given revision
+     * 
+ * + * uint64 revision_height = 2 [json_name = "revisionHeight"]; + * @return The revisionHeight. + */ + @java.lang.Override + public long getRevisionHeight() { + return instance.getRevisionHeight(); + } + /** + *
+     * the height within the given revision
+     * 
+ * + * uint64 revision_height = 2 [json_name = "revisionHeight"]; + * @param value The revisionHeight to set. + * @return This builder for chaining. + */ + public Builder setRevisionHeight(long value) { + copyOnWrite(); + instance.setRevisionHeight(value); + return this; + } + /** + *
+     * the height within the given revision
+     * 
+ * + * uint64 revision_height = 2 [json_name = "revisionHeight"]; + * @return This builder for chaining. + */ + public Builder clearRevisionHeight() { + copyOnWrite(); + instance.clearRevisionHeight(); + return this; + } + + // @@protoc_insertion_point(builder_scope:icon.proto.core.client.Height) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.icon.proto.core.client.Height(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "revisionNumber_", + "revisionHeight_", + }; + java.lang.String info = + "\u0000\u0002\u0000\u0000\u0001\u0002\u0002\u0000\u0000\u0000\u0001\u0003\u0002\u0003" + + ""; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.icon.proto.core.client.Height.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:icon.proto.core.client.Height) + private static final com.icon.proto.core.client.Height DEFAULT_INSTANCE; + static { + Height defaultInstance = new Height(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + Height.class, defaultInstance); + } + + public static com.icon.proto.core.client.Height getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/client/HeightOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/client/HeightOrBuilder.java new file mode 100644 index 000000000..5e1621801 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/client/HeightOrBuilder.java @@ -0,0 +1,29 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: core/02-client/Client.proto + +package com.icon.proto.core.client; + +public interface HeightOrBuilder extends + // @@protoc_insertion_point(interface_extends:icon.proto.core.client.Height) + com.google.protobuf.MessageLiteOrBuilder { + + /** + *
+   * the revision that the client is currently on
+   * 
+ * + * uint64 revision_number = 1 [json_name = "revisionNumber"]; + * @return The revisionNumber. + */ + long getRevisionNumber(); + + /** + *
+   * the height within the given revision
+   * 
+ * + * uint64 revision_height = 2 [json_name = "revisionHeight"]; + * @return The revisionHeight. + */ + long getRevisionHeight(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/BatchEntry.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/BatchEntry.java new file mode 100644 index 000000000..4184bab4c --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/BatchEntry.java @@ -0,0 +1,447 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: core/23-commitment/proofs.proto + +package com.icon.proto.core.commitment; + +/** + *
+ * Use BatchEntry not CommitmentProof, to avoid recursion
+ * 
+ * + * Protobuf type {@code icon.proto.core.commitment.BatchEntry} + */ +public final class BatchEntry extends + com.google.protobuf.GeneratedMessageLite< + BatchEntry, BatchEntry.Builder> implements + // @@protoc_insertion_point(message_implements:icon.proto.core.commitment.BatchEntry) + BatchEntryOrBuilder { + private BatchEntry() { + } + private int proofCase_ = 0; + private java.lang.Object proof_; + public enum ProofCase { + EXIST(1), + NONEXIST(2), + PROOF_NOT_SET(0); + private final int value; + private ProofCase(int value) { + this.value = value; + } + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ProofCase valueOf(int value) { + return forNumber(value); + } + + public static ProofCase forNumber(int value) { + switch (value) { + case 1: return EXIST; + case 2: return NONEXIST; + case 0: return PROOF_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + @java.lang.Override + public ProofCase + getProofCase() { + return ProofCase.forNumber( + proofCase_); + } + + private void clearProof() { + proofCase_ = 0; + proof_ = null; + } + + public static final int EXIST_FIELD_NUMBER = 1; + /** + * .icon.proto.core.commitment.ExistenceProof exist = 1 [json_name = "exist"]; + */ + @java.lang.Override + public boolean hasExist() { + return proofCase_ == 1; + } + /** + * .icon.proto.core.commitment.ExistenceProof exist = 1 [json_name = "exist"]; + */ + @java.lang.Override + public com.icon.proto.core.commitment.ExistenceProof getExist() { + if (proofCase_ == 1) { + return (com.icon.proto.core.commitment.ExistenceProof) proof_; + } + return com.icon.proto.core.commitment.ExistenceProof.getDefaultInstance(); + } + /** + * .icon.proto.core.commitment.ExistenceProof exist = 1 [json_name = "exist"]; + */ + private void setExist(com.icon.proto.core.commitment.ExistenceProof value) { + value.getClass(); + proof_ = value; + proofCase_ = 1; + } + /** + * .icon.proto.core.commitment.ExistenceProof exist = 1 [json_name = "exist"]; + */ + private void mergeExist(com.icon.proto.core.commitment.ExistenceProof value) { + value.getClass(); + if (proofCase_ == 1 && + proof_ != com.icon.proto.core.commitment.ExistenceProof.getDefaultInstance()) { + proof_ = com.icon.proto.core.commitment.ExistenceProof.newBuilder((com.icon.proto.core.commitment.ExistenceProof) proof_) + .mergeFrom(value).buildPartial(); + } else { + proof_ = value; + } + proofCase_ = 1; + } + /** + * .icon.proto.core.commitment.ExistenceProof exist = 1 [json_name = "exist"]; + */ + private void clearExist() { + if (proofCase_ == 1) { + proofCase_ = 0; + proof_ = null; + } + } + + public static final int NONEXIST_FIELD_NUMBER = 2; + /** + * .icon.proto.core.commitment.NonExistenceProof nonexist = 2 [json_name = "nonexist"]; + */ + @java.lang.Override + public boolean hasNonexist() { + return proofCase_ == 2; + } + /** + * .icon.proto.core.commitment.NonExistenceProof nonexist = 2 [json_name = "nonexist"]; + */ + @java.lang.Override + public com.icon.proto.core.commitment.NonExistenceProof getNonexist() { + if (proofCase_ == 2) { + return (com.icon.proto.core.commitment.NonExistenceProof) proof_; + } + return com.icon.proto.core.commitment.NonExistenceProof.getDefaultInstance(); + } + /** + * .icon.proto.core.commitment.NonExistenceProof nonexist = 2 [json_name = "nonexist"]; + */ + private void setNonexist(com.icon.proto.core.commitment.NonExistenceProof value) { + value.getClass(); + proof_ = value; + proofCase_ = 2; + } + /** + * .icon.proto.core.commitment.NonExistenceProof nonexist = 2 [json_name = "nonexist"]; + */ + private void mergeNonexist(com.icon.proto.core.commitment.NonExistenceProof value) { + value.getClass(); + if (proofCase_ == 2 && + proof_ != com.icon.proto.core.commitment.NonExistenceProof.getDefaultInstance()) { + proof_ = com.icon.proto.core.commitment.NonExistenceProof.newBuilder((com.icon.proto.core.commitment.NonExistenceProof) proof_) + .mergeFrom(value).buildPartial(); + } else { + proof_ = value; + } + proofCase_ = 2; + } + /** + * .icon.proto.core.commitment.NonExistenceProof nonexist = 2 [json_name = "nonexist"]; + */ + private void clearNonexist() { + if (proofCase_ == 2) { + proofCase_ = 0; + proof_ = null; + } + } + + public static com.icon.proto.core.commitment.BatchEntry parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.commitment.BatchEntry parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.commitment.BatchEntry parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.commitment.BatchEntry parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.commitment.BatchEntry parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.commitment.BatchEntry parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.commitment.BatchEntry parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.commitment.BatchEntry parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.icon.proto.core.commitment.BatchEntry parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.commitment.BatchEntry parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.icon.proto.core.commitment.BatchEntry parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.commitment.BatchEntry parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.icon.proto.core.commitment.BatchEntry prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+   * Use BatchEntry not CommitmentProof, to avoid recursion
+   * 
+ * + * Protobuf type {@code icon.proto.core.commitment.BatchEntry} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.icon.proto.core.commitment.BatchEntry, Builder> implements + // @@protoc_insertion_point(builder_implements:icon.proto.core.commitment.BatchEntry) + com.icon.proto.core.commitment.BatchEntryOrBuilder { + // Construct using com.icon.proto.core.commitment.BatchEntry.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + @java.lang.Override + public ProofCase + getProofCase() { + return instance.getProofCase(); + } + + public Builder clearProof() { + copyOnWrite(); + instance.clearProof(); + return this; + } + + + /** + * .icon.proto.core.commitment.ExistenceProof exist = 1 [json_name = "exist"]; + */ + @java.lang.Override + public boolean hasExist() { + return instance.hasExist(); + } + /** + * .icon.proto.core.commitment.ExistenceProof exist = 1 [json_name = "exist"]; + */ + @java.lang.Override + public com.icon.proto.core.commitment.ExistenceProof getExist() { + return instance.getExist(); + } + /** + * .icon.proto.core.commitment.ExistenceProof exist = 1 [json_name = "exist"]; + */ + public Builder setExist(com.icon.proto.core.commitment.ExistenceProof value) { + copyOnWrite(); + instance.setExist(value); + return this; + } + /** + * .icon.proto.core.commitment.ExistenceProof exist = 1 [json_name = "exist"]; + */ + public Builder setExist( + com.icon.proto.core.commitment.ExistenceProof.Builder builderForValue) { + copyOnWrite(); + instance.setExist(builderForValue.build()); + return this; + } + /** + * .icon.proto.core.commitment.ExistenceProof exist = 1 [json_name = "exist"]; + */ + public Builder mergeExist(com.icon.proto.core.commitment.ExistenceProof value) { + copyOnWrite(); + instance.mergeExist(value); + return this; + } + /** + * .icon.proto.core.commitment.ExistenceProof exist = 1 [json_name = "exist"]; + */ + public Builder clearExist() { + copyOnWrite(); + instance.clearExist(); + return this; + } + + /** + * .icon.proto.core.commitment.NonExistenceProof nonexist = 2 [json_name = "nonexist"]; + */ + @java.lang.Override + public boolean hasNonexist() { + return instance.hasNonexist(); + } + /** + * .icon.proto.core.commitment.NonExistenceProof nonexist = 2 [json_name = "nonexist"]; + */ + @java.lang.Override + public com.icon.proto.core.commitment.NonExistenceProof getNonexist() { + return instance.getNonexist(); + } + /** + * .icon.proto.core.commitment.NonExistenceProof nonexist = 2 [json_name = "nonexist"]; + */ + public Builder setNonexist(com.icon.proto.core.commitment.NonExistenceProof value) { + copyOnWrite(); + instance.setNonexist(value); + return this; + } + /** + * .icon.proto.core.commitment.NonExistenceProof nonexist = 2 [json_name = "nonexist"]; + */ + public Builder setNonexist( + com.icon.proto.core.commitment.NonExistenceProof.Builder builderForValue) { + copyOnWrite(); + instance.setNonexist(builderForValue.build()); + return this; + } + /** + * .icon.proto.core.commitment.NonExistenceProof nonexist = 2 [json_name = "nonexist"]; + */ + public Builder mergeNonexist(com.icon.proto.core.commitment.NonExistenceProof value) { + copyOnWrite(); + instance.mergeNonexist(value); + return this; + } + /** + * .icon.proto.core.commitment.NonExistenceProof nonexist = 2 [json_name = "nonexist"]; + */ + public Builder clearNonexist() { + copyOnWrite(); + instance.clearNonexist(); + return this; + } + + // @@protoc_insertion_point(builder_scope:icon.proto.core.commitment.BatchEntry) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.icon.proto.core.commitment.BatchEntry(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "proof_", + "proofCase_", + com.icon.proto.core.commitment.ExistenceProof.class, + com.icon.proto.core.commitment.NonExistenceProof.class, + }; + java.lang.String info = + "\u0000\u0002\u0001\u0000\u0001\u0002\u0002\u0000\u0000\u0000\u0001<\u0000\u0002<" + + "\u0000"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.icon.proto.core.commitment.BatchEntry.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:icon.proto.core.commitment.BatchEntry) + private static final com.icon.proto.core.commitment.BatchEntry DEFAULT_INSTANCE; + static { + BatchEntry defaultInstance = new BatchEntry(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + BatchEntry.class, defaultInstance); + } + + public static com.icon.proto.core.commitment.BatchEntry getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/BatchEntryOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/BatchEntryOrBuilder.java new file mode 100644 index 000000000..a6c1d81e7 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/BatchEntryOrBuilder.java @@ -0,0 +1,33 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: core/23-commitment/proofs.proto + +package com.icon.proto.core.commitment; + +public interface BatchEntryOrBuilder extends + // @@protoc_insertion_point(interface_extends:icon.proto.core.commitment.BatchEntry) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * .icon.proto.core.commitment.ExistenceProof exist = 1 [json_name = "exist"]; + * @return Whether the exist field is set. + */ + boolean hasExist(); + /** + * .icon.proto.core.commitment.ExistenceProof exist = 1 [json_name = "exist"]; + * @return The exist. + */ + com.icon.proto.core.commitment.ExistenceProof getExist(); + + /** + * .icon.proto.core.commitment.NonExistenceProof nonexist = 2 [json_name = "nonexist"]; + * @return Whether the nonexist field is set. + */ + boolean hasNonexist(); + /** + * .icon.proto.core.commitment.NonExistenceProof nonexist = 2 [json_name = "nonexist"]; + * @return The nonexist. + */ + com.icon.proto.core.commitment.NonExistenceProof getNonexist(); + + public com.icon.proto.core.commitment.BatchEntry.ProofCase getProofCase(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/BatchProof.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/BatchProof.java new file mode 100644 index 000000000..6f7f29c7e --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/BatchProof.java @@ -0,0 +1,390 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: core/23-commitment/proofs.proto + +package com.icon.proto.core.commitment; + +/** + *
+ *BatchProof is a group of multiple proof types than can be compressed
+ * 
+ * + * Protobuf type {@code icon.proto.core.commitment.BatchProof} + */ +public final class BatchProof extends + com.google.protobuf.GeneratedMessageLite< + BatchProof, BatchProof.Builder> implements + // @@protoc_insertion_point(message_implements:icon.proto.core.commitment.BatchProof) + BatchProofOrBuilder { + private BatchProof() { + entries_ = emptyProtobufList(); + } + public static final int ENTRIES_FIELD_NUMBER = 1; + private com.google.protobuf.Internal.ProtobufList entries_; + /** + * repeated .icon.proto.core.commitment.BatchEntry entries = 1 [json_name = "entries"]; + */ + @java.lang.Override + public java.util.List getEntriesList() { + return entries_; + } + /** + * repeated .icon.proto.core.commitment.BatchEntry entries = 1 [json_name = "entries"]; + */ + public java.util.List + getEntriesOrBuilderList() { + return entries_; + } + /** + * repeated .icon.proto.core.commitment.BatchEntry entries = 1 [json_name = "entries"]; + */ + @java.lang.Override + public int getEntriesCount() { + return entries_.size(); + } + /** + * repeated .icon.proto.core.commitment.BatchEntry entries = 1 [json_name = "entries"]; + */ + @java.lang.Override + public com.icon.proto.core.commitment.BatchEntry getEntries(int index) { + return entries_.get(index); + } + /** + * repeated .icon.proto.core.commitment.BatchEntry entries = 1 [json_name = "entries"]; + */ + public com.icon.proto.core.commitment.BatchEntryOrBuilder getEntriesOrBuilder( + int index) { + return entries_.get(index); + } + private void ensureEntriesIsMutable() { + com.google.protobuf.Internal.ProtobufList tmp = entries_; + if (!tmp.isModifiable()) { + entries_ = + com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp); + } + } + + /** + * repeated .icon.proto.core.commitment.BatchEntry entries = 1 [json_name = "entries"]; + */ + private void setEntries( + int index, com.icon.proto.core.commitment.BatchEntry value) { + value.getClass(); + ensureEntriesIsMutable(); + entries_.set(index, value); + } + /** + * repeated .icon.proto.core.commitment.BatchEntry entries = 1 [json_name = "entries"]; + */ + private void addEntries(com.icon.proto.core.commitment.BatchEntry value) { + value.getClass(); + ensureEntriesIsMutable(); + entries_.add(value); + } + /** + * repeated .icon.proto.core.commitment.BatchEntry entries = 1 [json_name = "entries"]; + */ + private void addEntries( + int index, com.icon.proto.core.commitment.BatchEntry value) { + value.getClass(); + ensureEntriesIsMutable(); + entries_.add(index, value); + } + /** + * repeated .icon.proto.core.commitment.BatchEntry entries = 1 [json_name = "entries"]; + */ + private void addAllEntries( + java.lang.Iterable values) { + ensureEntriesIsMutable(); + com.google.protobuf.AbstractMessageLite.addAll( + values, entries_); + } + /** + * repeated .icon.proto.core.commitment.BatchEntry entries = 1 [json_name = "entries"]; + */ + private void clearEntries() { + entries_ = emptyProtobufList(); + } + /** + * repeated .icon.proto.core.commitment.BatchEntry entries = 1 [json_name = "entries"]; + */ + private void removeEntries(int index) { + ensureEntriesIsMutable(); + entries_.remove(index); + } + + public static com.icon.proto.core.commitment.BatchProof parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.commitment.BatchProof parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.commitment.BatchProof parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.commitment.BatchProof parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.commitment.BatchProof parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.commitment.BatchProof parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.commitment.BatchProof parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.commitment.BatchProof parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.icon.proto.core.commitment.BatchProof parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.commitment.BatchProof parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.icon.proto.core.commitment.BatchProof parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.commitment.BatchProof parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.icon.proto.core.commitment.BatchProof prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+   *BatchProof is a group of multiple proof types than can be compressed
+   * 
+ * + * Protobuf type {@code icon.proto.core.commitment.BatchProof} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.icon.proto.core.commitment.BatchProof, Builder> implements + // @@protoc_insertion_point(builder_implements:icon.proto.core.commitment.BatchProof) + com.icon.proto.core.commitment.BatchProofOrBuilder { + // Construct using com.icon.proto.core.commitment.BatchProof.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * repeated .icon.proto.core.commitment.BatchEntry entries = 1 [json_name = "entries"]; + */ + @java.lang.Override + public java.util.List getEntriesList() { + return java.util.Collections.unmodifiableList( + instance.getEntriesList()); + } + /** + * repeated .icon.proto.core.commitment.BatchEntry entries = 1 [json_name = "entries"]; + */ + @java.lang.Override + public int getEntriesCount() { + return instance.getEntriesCount(); + }/** + * repeated .icon.proto.core.commitment.BatchEntry entries = 1 [json_name = "entries"]; + */ + @java.lang.Override + public com.icon.proto.core.commitment.BatchEntry getEntries(int index) { + return instance.getEntries(index); + } + /** + * repeated .icon.proto.core.commitment.BatchEntry entries = 1 [json_name = "entries"]; + */ + public Builder setEntries( + int index, com.icon.proto.core.commitment.BatchEntry value) { + copyOnWrite(); + instance.setEntries(index, value); + return this; + } + /** + * repeated .icon.proto.core.commitment.BatchEntry entries = 1 [json_name = "entries"]; + */ + public Builder setEntries( + int index, com.icon.proto.core.commitment.BatchEntry.Builder builderForValue) { + copyOnWrite(); + instance.setEntries(index, + builderForValue.build()); + return this; + } + /** + * repeated .icon.proto.core.commitment.BatchEntry entries = 1 [json_name = "entries"]; + */ + public Builder addEntries(com.icon.proto.core.commitment.BatchEntry value) { + copyOnWrite(); + instance.addEntries(value); + return this; + } + /** + * repeated .icon.proto.core.commitment.BatchEntry entries = 1 [json_name = "entries"]; + */ + public Builder addEntries( + int index, com.icon.proto.core.commitment.BatchEntry value) { + copyOnWrite(); + instance.addEntries(index, value); + return this; + } + /** + * repeated .icon.proto.core.commitment.BatchEntry entries = 1 [json_name = "entries"]; + */ + public Builder addEntries( + com.icon.proto.core.commitment.BatchEntry.Builder builderForValue) { + copyOnWrite(); + instance.addEntries(builderForValue.build()); + return this; + } + /** + * repeated .icon.proto.core.commitment.BatchEntry entries = 1 [json_name = "entries"]; + */ + public Builder addEntries( + int index, com.icon.proto.core.commitment.BatchEntry.Builder builderForValue) { + copyOnWrite(); + instance.addEntries(index, + builderForValue.build()); + return this; + } + /** + * repeated .icon.proto.core.commitment.BatchEntry entries = 1 [json_name = "entries"]; + */ + public Builder addAllEntries( + java.lang.Iterable values) { + copyOnWrite(); + instance.addAllEntries(values); + return this; + } + /** + * repeated .icon.proto.core.commitment.BatchEntry entries = 1 [json_name = "entries"]; + */ + public Builder clearEntries() { + copyOnWrite(); + instance.clearEntries(); + return this; + } + /** + * repeated .icon.proto.core.commitment.BatchEntry entries = 1 [json_name = "entries"]; + */ + public Builder removeEntries(int index) { + copyOnWrite(); + instance.removeEntries(index); + return this; + } + + // @@protoc_insertion_point(builder_scope:icon.proto.core.commitment.BatchProof) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.icon.proto.core.commitment.BatchProof(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "entries_", + com.icon.proto.core.commitment.BatchEntry.class, + }; + java.lang.String info = + "\u0000\u0001\u0000\u0000\u0001\u0001\u0001\u0000\u0001\u0000\u0001\u001b"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.icon.proto.core.commitment.BatchProof.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:icon.proto.core.commitment.BatchProof) + private static final com.icon.proto.core.commitment.BatchProof DEFAULT_INSTANCE; + static { + BatchProof defaultInstance = new BatchProof(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + BatchProof.class, defaultInstance); + } + + public static com.icon.proto.core.commitment.BatchProof getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/BatchProofOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/BatchProofOrBuilder.java new file mode 100644 index 000000000..7a7f4eb96 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/BatchProofOrBuilder.java @@ -0,0 +1,23 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: core/23-commitment/proofs.proto + +package com.icon.proto.core.commitment; + +public interface BatchProofOrBuilder extends + // @@protoc_insertion_point(interface_extends:icon.proto.core.commitment.BatchProof) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * repeated .icon.proto.core.commitment.BatchEntry entries = 1 [json_name = "entries"]; + */ + java.util.List + getEntriesList(); + /** + * repeated .icon.proto.core.commitment.BatchEntry entries = 1 [json_name = "entries"]; + */ + com.icon.proto.core.commitment.BatchEntry getEntries(int index); + /** + * repeated .icon.proto.core.commitment.BatchEntry entries = 1 [json_name = "entries"]; + */ + int getEntriesCount(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/CommitmentProof.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/CommitmentProof.java new file mode 100644 index 000000000..c16e16e37 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/CommitmentProof.java @@ -0,0 +1,649 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: core/23-commitment/proofs.proto + +package com.icon.proto.core.commitment; + +/** + *
+ *CommitmentProof is either an ExistenceProof or a NonExistenceProof, or a Batch of such messages
+ * 
+ * + * Protobuf type {@code icon.proto.core.commitment.CommitmentProof} + */ +public final class CommitmentProof extends + com.google.protobuf.GeneratedMessageLite< + CommitmentProof, CommitmentProof.Builder> implements + // @@protoc_insertion_point(message_implements:icon.proto.core.commitment.CommitmentProof) + CommitmentProofOrBuilder { + private CommitmentProof() { + } + private int proofCase_ = 0; + private java.lang.Object proof_; + public enum ProofCase { + EXIST(1), + NONEXIST(2), + BATCH(3), + COMPRESSED(4), + PROOF_NOT_SET(0); + private final int value; + private ProofCase(int value) { + this.value = value; + } + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ProofCase valueOf(int value) { + return forNumber(value); + } + + public static ProofCase forNumber(int value) { + switch (value) { + case 1: return EXIST; + case 2: return NONEXIST; + case 3: return BATCH; + case 4: return COMPRESSED; + case 0: return PROOF_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + @java.lang.Override + public ProofCase + getProofCase() { + return ProofCase.forNumber( + proofCase_); + } + + private void clearProof() { + proofCase_ = 0; + proof_ = null; + } + + public static final int EXIST_FIELD_NUMBER = 1; + /** + * .icon.proto.core.commitment.ExistenceProof exist = 1 [json_name = "exist"]; + */ + @java.lang.Override + public boolean hasExist() { + return proofCase_ == 1; + } + /** + * .icon.proto.core.commitment.ExistenceProof exist = 1 [json_name = "exist"]; + */ + @java.lang.Override + public com.icon.proto.core.commitment.ExistenceProof getExist() { + if (proofCase_ == 1) { + return (com.icon.proto.core.commitment.ExistenceProof) proof_; + } + return com.icon.proto.core.commitment.ExistenceProof.getDefaultInstance(); + } + /** + * .icon.proto.core.commitment.ExistenceProof exist = 1 [json_name = "exist"]; + */ + private void setExist(com.icon.proto.core.commitment.ExistenceProof value) { + value.getClass(); + proof_ = value; + proofCase_ = 1; + } + /** + * .icon.proto.core.commitment.ExistenceProof exist = 1 [json_name = "exist"]; + */ + private void mergeExist(com.icon.proto.core.commitment.ExistenceProof value) { + value.getClass(); + if (proofCase_ == 1 && + proof_ != com.icon.proto.core.commitment.ExistenceProof.getDefaultInstance()) { + proof_ = com.icon.proto.core.commitment.ExistenceProof.newBuilder((com.icon.proto.core.commitment.ExistenceProof) proof_) + .mergeFrom(value).buildPartial(); + } else { + proof_ = value; + } + proofCase_ = 1; + } + /** + * .icon.proto.core.commitment.ExistenceProof exist = 1 [json_name = "exist"]; + */ + private void clearExist() { + if (proofCase_ == 1) { + proofCase_ = 0; + proof_ = null; + } + } + + public static final int NONEXIST_FIELD_NUMBER = 2; + /** + * .icon.proto.core.commitment.NonExistenceProof nonexist = 2 [json_name = "nonexist"]; + */ + @java.lang.Override + public boolean hasNonexist() { + return proofCase_ == 2; + } + /** + * .icon.proto.core.commitment.NonExistenceProof nonexist = 2 [json_name = "nonexist"]; + */ + @java.lang.Override + public com.icon.proto.core.commitment.NonExistenceProof getNonexist() { + if (proofCase_ == 2) { + return (com.icon.proto.core.commitment.NonExistenceProof) proof_; + } + return com.icon.proto.core.commitment.NonExistenceProof.getDefaultInstance(); + } + /** + * .icon.proto.core.commitment.NonExistenceProof nonexist = 2 [json_name = "nonexist"]; + */ + private void setNonexist(com.icon.proto.core.commitment.NonExistenceProof value) { + value.getClass(); + proof_ = value; + proofCase_ = 2; + } + /** + * .icon.proto.core.commitment.NonExistenceProof nonexist = 2 [json_name = "nonexist"]; + */ + private void mergeNonexist(com.icon.proto.core.commitment.NonExistenceProof value) { + value.getClass(); + if (proofCase_ == 2 && + proof_ != com.icon.proto.core.commitment.NonExistenceProof.getDefaultInstance()) { + proof_ = com.icon.proto.core.commitment.NonExistenceProof.newBuilder((com.icon.proto.core.commitment.NonExistenceProof) proof_) + .mergeFrom(value).buildPartial(); + } else { + proof_ = value; + } + proofCase_ = 2; + } + /** + * .icon.proto.core.commitment.NonExistenceProof nonexist = 2 [json_name = "nonexist"]; + */ + private void clearNonexist() { + if (proofCase_ == 2) { + proofCase_ = 0; + proof_ = null; + } + } + + public static final int BATCH_FIELD_NUMBER = 3; + /** + * .icon.proto.core.commitment.BatchProof batch = 3 [json_name = "batch"]; + */ + @java.lang.Override + public boolean hasBatch() { + return proofCase_ == 3; + } + /** + * .icon.proto.core.commitment.BatchProof batch = 3 [json_name = "batch"]; + */ + @java.lang.Override + public com.icon.proto.core.commitment.BatchProof getBatch() { + if (proofCase_ == 3) { + return (com.icon.proto.core.commitment.BatchProof) proof_; + } + return com.icon.proto.core.commitment.BatchProof.getDefaultInstance(); + } + /** + * .icon.proto.core.commitment.BatchProof batch = 3 [json_name = "batch"]; + */ + private void setBatch(com.icon.proto.core.commitment.BatchProof value) { + value.getClass(); + proof_ = value; + proofCase_ = 3; + } + /** + * .icon.proto.core.commitment.BatchProof batch = 3 [json_name = "batch"]; + */ + private void mergeBatch(com.icon.proto.core.commitment.BatchProof value) { + value.getClass(); + if (proofCase_ == 3 && + proof_ != com.icon.proto.core.commitment.BatchProof.getDefaultInstance()) { + proof_ = com.icon.proto.core.commitment.BatchProof.newBuilder((com.icon.proto.core.commitment.BatchProof) proof_) + .mergeFrom(value).buildPartial(); + } else { + proof_ = value; + } + proofCase_ = 3; + } + /** + * .icon.proto.core.commitment.BatchProof batch = 3 [json_name = "batch"]; + */ + private void clearBatch() { + if (proofCase_ == 3) { + proofCase_ = 0; + proof_ = null; + } + } + + public static final int COMPRESSED_FIELD_NUMBER = 4; + /** + * .icon.proto.core.commitment.CompressedBatchProof compressed = 4 [json_name = "compressed"]; + */ + @java.lang.Override + public boolean hasCompressed() { + return proofCase_ == 4; + } + /** + * .icon.proto.core.commitment.CompressedBatchProof compressed = 4 [json_name = "compressed"]; + */ + @java.lang.Override + public com.icon.proto.core.commitment.CompressedBatchProof getCompressed() { + if (proofCase_ == 4) { + return (com.icon.proto.core.commitment.CompressedBatchProof) proof_; + } + return com.icon.proto.core.commitment.CompressedBatchProof.getDefaultInstance(); + } + /** + * .icon.proto.core.commitment.CompressedBatchProof compressed = 4 [json_name = "compressed"]; + */ + private void setCompressed(com.icon.proto.core.commitment.CompressedBatchProof value) { + value.getClass(); + proof_ = value; + proofCase_ = 4; + } + /** + * .icon.proto.core.commitment.CompressedBatchProof compressed = 4 [json_name = "compressed"]; + */ + private void mergeCompressed(com.icon.proto.core.commitment.CompressedBatchProof value) { + value.getClass(); + if (proofCase_ == 4 && + proof_ != com.icon.proto.core.commitment.CompressedBatchProof.getDefaultInstance()) { + proof_ = com.icon.proto.core.commitment.CompressedBatchProof.newBuilder((com.icon.proto.core.commitment.CompressedBatchProof) proof_) + .mergeFrom(value).buildPartial(); + } else { + proof_ = value; + } + proofCase_ = 4; + } + /** + * .icon.proto.core.commitment.CompressedBatchProof compressed = 4 [json_name = "compressed"]; + */ + private void clearCompressed() { + if (proofCase_ == 4) { + proofCase_ = 0; + proof_ = null; + } + } + + public static com.icon.proto.core.commitment.CommitmentProof parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.commitment.CommitmentProof parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.commitment.CommitmentProof parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.commitment.CommitmentProof parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.commitment.CommitmentProof parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.commitment.CommitmentProof parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.commitment.CommitmentProof parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.commitment.CommitmentProof parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.icon.proto.core.commitment.CommitmentProof parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.commitment.CommitmentProof parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.icon.proto.core.commitment.CommitmentProof parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.commitment.CommitmentProof parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.icon.proto.core.commitment.CommitmentProof prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+   *CommitmentProof is either an ExistenceProof or a NonExistenceProof, or a Batch of such messages
+   * 
+ * + * Protobuf type {@code icon.proto.core.commitment.CommitmentProof} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.icon.proto.core.commitment.CommitmentProof, Builder> implements + // @@protoc_insertion_point(builder_implements:icon.proto.core.commitment.CommitmentProof) + com.icon.proto.core.commitment.CommitmentProofOrBuilder { + // Construct using com.icon.proto.core.commitment.CommitmentProof.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + @java.lang.Override + public ProofCase + getProofCase() { + return instance.getProofCase(); + } + + public Builder clearProof() { + copyOnWrite(); + instance.clearProof(); + return this; + } + + + /** + * .icon.proto.core.commitment.ExistenceProof exist = 1 [json_name = "exist"]; + */ + @java.lang.Override + public boolean hasExist() { + return instance.hasExist(); + } + /** + * .icon.proto.core.commitment.ExistenceProof exist = 1 [json_name = "exist"]; + */ + @java.lang.Override + public com.icon.proto.core.commitment.ExistenceProof getExist() { + return instance.getExist(); + } + /** + * .icon.proto.core.commitment.ExistenceProof exist = 1 [json_name = "exist"]; + */ + public Builder setExist(com.icon.proto.core.commitment.ExistenceProof value) { + copyOnWrite(); + instance.setExist(value); + return this; + } + /** + * .icon.proto.core.commitment.ExistenceProof exist = 1 [json_name = "exist"]; + */ + public Builder setExist( + com.icon.proto.core.commitment.ExistenceProof.Builder builderForValue) { + copyOnWrite(); + instance.setExist(builderForValue.build()); + return this; + } + /** + * .icon.proto.core.commitment.ExistenceProof exist = 1 [json_name = "exist"]; + */ + public Builder mergeExist(com.icon.proto.core.commitment.ExistenceProof value) { + copyOnWrite(); + instance.mergeExist(value); + return this; + } + /** + * .icon.proto.core.commitment.ExistenceProof exist = 1 [json_name = "exist"]; + */ + public Builder clearExist() { + copyOnWrite(); + instance.clearExist(); + return this; + } + + /** + * .icon.proto.core.commitment.NonExistenceProof nonexist = 2 [json_name = "nonexist"]; + */ + @java.lang.Override + public boolean hasNonexist() { + return instance.hasNonexist(); + } + /** + * .icon.proto.core.commitment.NonExistenceProof nonexist = 2 [json_name = "nonexist"]; + */ + @java.lang.Override + public com.icon.proto.core.commitment.NonExistenceProof getNonexist() { + return instance.getNonexist(); + } + /** + * .icon.proto.core.commitment.NonExistenceProof nonexist = 2 [json_name = "nonexist"]; + */ + public Builder setNonexist(com.icon.proto.core.commitment.NonExistenceProof value) { + copyOnWrite(); + instance.setNonexist(value); + return this; + } + /** + * .icon.proto.core.commitment.NonExistenceProof nonexist = 2 [json_name = "nonexist"]; + */ + public Builder setNonexist( + com.icon.proto.core.commitment.NonExistenceProof.Builder builderForValue) { + copyOnWrite(); + instance.setNonexist(builderForValue.build()); + return this; + } + /** + * .icon.proto.core.commitment.NonExistenceProof nonexist = 2 [json_name = "nonexist"]; + */ + public Builder mergeNonexist(com.icon.proto.core.commitment.NonExistenceProof value) { + copyOnWrite(); + instance.mergeNonexist(value); + return this; + } + /** + * .icon.proto.core.commitment.NonExistenceProof nonexist = 2 [json_name = "nonexist"]; + */ + public Builder clearNonexist() { + copyOnWrite(); + instance.clearNonexist(); + return this; + } + + /** + * .icon.proto.core.commitment.BatchProof batch = 3 [json_name = "batch"]; + */ + @java.lang.Override + public boolean hasBatch() { + return instance.hasBatch(); + } + /** + * .icon.proto.core.commitment.BatchProof batch = 3 [json_name = "batch"]; + */ + @java.lang.Override + public com.icon.proto.core.commitment.BatchProof getBatch() { + return instance.getBatch(); + } + /** + * .icon.proto.core.commitment.BatchProof batch = 3 [json_name = "batch"]; + */ + public Builder setBatch(com.icon.proto.core.commitment.BatchProof value) { + copyOnWrite(); + instance.setBatch(value); + return this; + } + /** + * .icon.proto.core.commitment.BatchProof batch = 3 [json_name = "batch"]; + */ + public Builder setBatch( + com.icon.proto.core.commitment.BatchProof.Builder builderForValue) { + copyOnWrite(); + instance.setBatch(builderForValue.build()); + return this; + } + /** + * .icon.proto.core.commitment.BatchProof batch = 3 [json_name = "batch"]; + */ + public Builder mergeBatch(com.icon.proto.core.commitment.BatchProof value) { + copyOnWrite(); + instance.mergeBatch(value); + return this; + } + /** + * .icon.proto.core.commitment.BatchProof batch = 3 [json_name = "batch"]; + */ + public Builder clearBatch() { + copyOnWrite(); + instance.clearBatch(); + return this; + } + + /** + * .icon.proto.core.commitment.CompressedBatchProof compressed = 4 [json_name = "compressed"]; + */ + @java.lang.Override + public boolean hasCompressed() { + return instance.hasCompressed(); + } + /** + * .icon.proto.core.commitment.CompressedBatchProof compressed = 4 [json_name = "compressed"]; + */ + @java.lang.Override + public com.icon.proto.core.commitment.CompressedBatchProof getCompressed() { + return instance.getCompressed(); + } + /** + * .icon.proto.core.commitment.CompressedBatchProof compressed = 4 [json_name = "compressed"]; + */ + public Builder setCompressed(com.icon.proto.core.commitment.CompressedBatchProof value) { + copyOnWrite(); + instance.setCompressed(value); + return this; + } + /** + * .icon.proto.core.commitment.CompressedBatchProof compressed = 4 [json_name = "compressed"]; + */ + public Builder setCompressed( + com.icon.proto.core.commitment.CompressedBatchProof.Builder builderForValue) { + copyOnWrite(); + instance.setCompressed(builderForValue.build()); + return this; + } + /** + * .icon.proto.core.commitment.CompressedBatchProof compressed = 4 [json_name = "compressed"]; + */ + public Builder mergeCompressed(com.icon.proto.core.commitment.CompressedBatchProof value) { + copyOnWrite(); + instance.mergeCompressed(value); + return this; + } + /** + * .icon.proto.core.commitment.CompressedBatchProof compressed = 4 [json_name = "compressed"]; + */ + public Builder clearCompressed() { + copyOnWrite(); + instance.clearCompressed(); + return this; + } + + // @@protoc_insertion_point(builder_scope:icon.proto.core.commitment.CommitmentProof) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.icon.proto.core.commitment.CommitmentProof(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "proof_", + "proofCase_", + com.icon.proto.core.commitment.ExistenceProof.class, + com.icon.proto.core.commitment.NonExistenceProof.class, + com.icon.proto.core.commitment.BatchProof.class, + com.icon.proto.core.commitment.CompressedBatchProof.class, + }; + java.lang.String info = + "\u0000\u0004\u0001\u0000\u0001\u0004\u0004\u0000\u0000\u0000\u0001<\u0000\u0002<" + + "\u0000\u0003<\u0000\u0004<\u0000"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.icon.proto.core.commitment.CommitmentProof.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:icon.proto.core.commitment.CommitmentProof) + private static final com.icon.proto.core.commitment.CommitmentProof DEFAULT_INSTANCE; + static { + CommitmentProof defaultInstance = new CommitmentProof(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + CommitmentProof.class, defaultInstance); + } + + public static com.icon.proto.core.commitment.CommitmentProof getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/CommitmentProofOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/CommitmentProofOrBuilder.java new file mode 100644 index 000000000..e992feafa --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/CommitmentProofOrBuilder.java @@ -0,0 +1,55 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: core/23-commitment/proofs.proto + +package com.icon.proto.core.commitment; + +public interface CommitmentProofOrBuilder extends + // @@protoc_insertion_point(interface_extends:icon.proto.core.commitment.CommitmentProof) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * .icon.proto.core.commitment.ExistenceProof exist = 1 [json_name = "exist"]; + * @return Whether the exist field is set. + */ + boolean hasExist(); + /** + * .icon.proto.core.commitment.ExistenceProof exist = 1 [json_name = "exist"]; + * @return The exist. + */ + com.icon.proto.core.commitment.ExistenceProof getExist(); + + /** + * .icon.proto.core.commitment.NonExistenceProof nonexist = 2 [json_name = "nonexist"]; + * @return Whether the nonexist field is set. + */ + boolean hasNonexist(); + /** + * .icon.proto.core.commitment.NonExistenceProof nonexist = 2 [json_name = "nonexist"]; + * @return The nonexist. + */ + com.icon.proto.core.commitment.NonExistenceProof getNonexist(); + + /** + * .icon.proto.core.commitment.BatchProof batch = 3 [json_name = "batch"]; + * @return Whether the batch field is set. + */ + boolean hasBatch(); + /** + * .icon.proto.core.commitment.BatchProof batch = 3 [json_name = "batch"]; + * @return The batch. + */ + com.icon.proto.core.commitment.BatchProof getBatch(); + + /** + * .icon.proto.core.commitment.CompressedBatchProof compressed = 4 [json_name = "compressed"]; + * @return Whether the compressed field is set. + */ + boolean hasCompressed(); + /** + * .icon.proto.core.commitment.CompressedBatchProof compressed = 4 [json_name = "compressed"]; + * @return The compressed. + */ + com.icon.proto.core.commitment.CompressedBatchProof getCompressed(); + + public com.icon.proto.core.commitment.CommitmentProof.ProofCase getProofCase(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/CommitmentProto.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/CommitmentProto.java new file mode 100644 index 000000000..927f424b3 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/CommitmentProto.java @@ -0,0 +1,16 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: core/23-commitment/commitment.proto + +package com.icon.proto.core.commitment; + +public final class CommitmentProto { + private CommitmentProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + static { + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/CompressedBatchEntry.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/CompressedBatchEntry.java new file mode 100644 index 000000000..3d968f4bf --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/CompressedBatchEntry.java @@ -0,0 +1,447 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: core/23-commitment/proofs.proto + +package com.icon.proto.core.commitment; + +/** + *
+ * Use BatchEntry not CommitmentProof, to avoid recursion
+ * 
+ * + * Protobuf type {@code icon.proto.core.commitment.CompressedBatchEntry} + */ +public final class CompressedBatchEntry extends + com.google.protobuf.GeneratedMessageLite< + CompressedBatchEntry, CompressedBatchEntry.Builder> implements + // @@protoc_insertion_point(message_implements:icon.proto.core.commitment.CompressedBatchEntry) + CompressedBatchEntryOrBuilder { + private CompressedBatchEntry() { + } + private int proofCase_ = 0; + private java.lang.Object proof_; + public enum ProofCase { + EXIST(1), + NONEXIST(2), + PROOF_NOT_SET(0); + private final int value; + private ProofCase(int value) { + this.value = value; + } + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ProofCase valueOf(int value) { + return forNumber(value); + } + + public static ProofCase forNumber(int value) { + switch (value) { + case 1: return EXIST; + case 2: return NONEXIST; + case 0: return PROOF_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + @java.lang.Override + public ProofCase + getProofCase() { + return ProofCase.forNumber( + proofCase_); + } + + private void clearProof() { + proofCase_ = 0; + proof_ = null; + } + + public static final int EXIST_FIELD_NUMBER = 1; + /** + * .icon.proto.core.commitment.CompressedExistenceProof exist = 1 [json_name = "exist"]; + */ + @java.lang.Override + public boolean hasExist() { + return proofCase_ == 1; + } + /** + * .icon.proto.core.commitment.CompressedExistenceProof exist = 1 [json_name = "exist"]; + */ + @java.lang.Override + public com.icon.proto.core.commitment.CompressedExistenceProof getExist() { + if (proofCase_ == 1) { + return (com.icon.proto.core.commitment.CompressedExistenceProof) proof_; + } + return com.icon.proto.core.commitment.CompressedExistenceProof.getDefaultInstance(); + } + /** + * .icon.proto.core.commitment.CompressedExistenceProof exist = 1 [json_name = "exist"]; + */ + private void setExist(com.icon.proto.core.commitment.CompressedExistenceProof value) { + value.getClass(); + proof_ = value; + proofCase_ = 1; + } + /** + * .icon.proto.core.commitment.CompressedExistenceProof exist = 1 [json_name = "exist"]; + */ + private void mergeExist(com.icon.proto.core.commitment.CompressedExistenceProof value) { + value.getClass(); + if (proofCase_ == 1 && + proof_ != com.icon.proto.core.commitment.CompressedExistenceProof.getDefaultInstance()) { + proof_ = com.icon.proto.core.commitment.CompressedExistenceProof.newBuilder((com.icon.proto.core.commitment.CompressedExistenceProof) proof_) + .mergeFrom(value).buildPartial(); + } else { + proof_ = value; + } + proofCase_ = 1; + } + /** + * .icon.proto.core.commitment.CompressedExistenceProof exist = 1 [json_name = "exist"]; + */ + private void clearExist() { + if (proofCase_ == 1) { + proofCase_ = 0; + proof_ = null; + } + } + + public static final int NONEXIST_FIELD_NUMBER = 2; + /** + * .icon.proto.core.commitment.CompressedNonExistenceProof nonexist = 2 [json_name = "nonexist"]; + */ + @java.lang.Override + public boolean hasNonexist() { + return proofCase_ == 2; + } + /** + * .icon.proto.core.commitment.CompressedNonExistenceProof nonexist = 2 [json_name = "nonexist"]; + */ + @java.lang.Override + public com.icon.proto.core.commitment.CompressedNonExistenceProof getNonexist() { + if (proofCase_ == 2) { + return (com.icon.proto.core.commitment.CompressedNonExistenceProof) proof_; + } + return com.icon.proto.core.commitment.CompressedNonExistenceProof.getDefaultInstance(); + } + /** + * .icon.proto.core.commitment.CompressedNonExistenceProof nonexist = 2 [json_name = "nonexist"]; + */ + private void setNonexist(com.icon.proto.core.commitment.CompressedNonExistenceProof value) { + value.getClass(); + proof_ = value; + proofCase_ = 2; + } + /** + * .icon.proto.core.commitment.CompressedNonExistenceProof nonexist = 2 [json_name = "nonexist"]; + */ + private void mergeNonexist(com.icon.proto.core.commitment.CompressedNonExistenceProof value) { + value.getClass(); + if (proofCase_ == 2 && + proof_ != com.icon.proto.core.commitment.CompressedNonExistenceProof.getDefaultInstance()) { + proof_ = com.icon.proto.core.commitment.CompressedNonExistenceProof.newBuilder((com.icon.proto.core.commitment.CompressedNonExistenceProof) proof_) + .mergeFrom(value).buildPartial(); + } else { + proof_ = value; + } + proofCase_ = 2; + } + /** + * .icon.proto.core.commitment.CompressedNonExistenceProof nonexist = 2 [json_name = "nonexist"]; + */ + private void clearNonexist() { + if (proofCase_ == 2) { + proofCase_ = 0; + proof_ = null; + } + } + + public static com.icon.proto.core.commitment.CompressedBatchEntry parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.commitment.CompressedBatchEntry parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.commitment.CompressedBatchEntry parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.commitment.CompressedBatchEntry parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.commitment.CompressedBatchEntry parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.commitment.CompressedBatchEntry parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.commitment.CompressedBatchEntry parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.commitment.CompressedBatchEntry parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.icon.proto.core.commitment.CompressedBatchEntry parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.commitment.CompressedBatchEntry parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.icon.proto.core.commitment.CompressedBatchEntry parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.commitment.CompressedBatchEntry parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.icon.proto.core.commitment.CompressedBatchEntry prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+   * Use BatchEntry not CommitmentProof, to avoid recursion
+   * 
+ * + * Protobuf type {@code icon.proto.core.commitment.CompressedBatchEntry} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.icon.proto.core.commitment.CompressedBatchEntry, Builder> implements + // @@protoc_insertion_point(builder_implements:icon.proto.core.commitment.CompressedBatchEntry) + com.icon.proto.core.commitment.CompressedBatchEntryOrBuilder { + // Construct using com.icon.proto.core.commitment.CompressedBatchEntry.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + @java.lang.Override + public ProofCase + getProofCase() { + return instance.getProofCase(); + } + + public Builder clearProof() { + copyOnWrite(); + instance.clearProof(); + return this; + } + + + /** + * .icon.proto.core.commitment.CompressedExistenceProof exist = 1 [json_name = "exist"]; + */ + @java.lang.Override + public boolean hasExist() { + return instance.hasExist(); + } + /** + * .icon.proto.core.commitment.CompressedExistenceProof exist = 1 [json_name = "exist"]; + */ + @java.lang.Override + public com.icon.proto.core.commitment.CompressedExistenceProof getExist() { + return instance.getExist(); + } + /** + * .icon.proto.core.commitment.CompressedExistenceProof exist = 1 [json_name = "exist"]; + */ + public Builder setExist(com.icon.proto.core.commitment.CompressedExistenceProof value) { + copyOnWrite(); + instance.setExist(value); + return this; + } + /** + * .icon.proto.core.commitment.CompressedExistenceProof exist = 1 [json_name = "exist"]; + */ + public Builder setExist( + com.icon.proto.core.commitment.CompressedExistenceProof.Builder builderForValue) { + copyOnWrite(); + instance.setExist(builderForValue.build()); + return this; + } + /** + * .icon.proto.core.commitment.CompressedExistenceProof exist = 1 [json_name = "exist"]; + */ + public Builder mergeExist(com.icon.proto.core.commitment.CompressedExistenceProof value) { + copyOnWrite(); + instance.mergeExist(value); + return this; + } + /** + * .icon.proto.core.commitment.CompressedExistenceProof exist = 1 [json_name = "exist"]; + */ + public Builder clearExist() { + copyOnWrite(); + instance.clearExist(); + return this; + } + + /** + * .icon.proto.core.commitment.CompressedNonExistenceProof nonexist = 2 [json_name = "nonexist"]; + */ + @java.lang.Override + public boolean hasNonexist() { + return instance.hasNonexist(); + } + /** + * .icon.proto.core.commitment.CompressedNonExistenceProof nonexist = 2 [json_name = "nonexist"]; + */ + @java.lang.Override + public com.icon.proto.core.commitment.CompressedNonExistenceProof getNonexist() { + return instance.getNonexist(); + } + /** + * .icon.proto.core.commitment.CompressedNonExistenceProof nonexist = 2 [json_name = "nonexist"]; + */ + public Builder setNonexist(com.icon.proto.core.commitment.CompressedNonExistenceProof value) { + copyOnWrite(); + instance.setNonexist(value); + return this; + } + /** + * .icon.proto.core.commitment.CompressedNonExistenceProof nonexist = 2 [json_name = "nonexist"]; + */ + public Builder setNonexist( + com.icon.proto.core.commitment.CompressedNonExistenceProof.Builder builderForValue) { + copyOnWrite(); + instance.setNonexist(builderForValue.build()); + return this; + } + /** + * .icon.proto.core.commitment.CompressedNonExistenceProof nonexist = 2 [json_name = "nonexist"]; + */ + public Builder mergeNonexist(com.icon.proto.core.commitment.CompressedNonExistenceProof value) { + copyOnWrite(); + instance.mergeNonexist(value); + return this; + } + /** + * .icon.proto.core.commitment.CompressedNonExistenceProof nonexist = 2 [json_name = "nonexist"]; + */ + public Builder clearNonexist() { + copyOnWrite(); + instance.clearNonexist(); + return this; + } + + // @@protoc_insertion_point(builder_scope:icon.proto.core.commitment.CompressedBatchEntry) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.icon.proto.core.commitment.CompressedBatchEntry(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "proof_", + "proofCase_", + com.icon.proto.core.commitment.CompressedExistenceProof.class, + com.icon.proto.core.commitment.CompressedNonExistenceProof.class, + }; + java.lang.String info = + "\u0000\u0002\u0001\u0000\u0001\u0002\u0002\u0000\u0000\u0000\u0001<\u0000\u0002<" + + "\u0000"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.icon.proto.core.commitment.CompressedBatchEntry.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:icon.proto.core.commitment.CompressedBatchEntry) + private static final com.icon.proto.core.commitment.CompressedBatchEntry DEFAULT_INSTANCE; + static { + CompressedBatchEntry defaultInstance = new CompressedBatchEntry(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + CompressedBatchEntry.class, defaultInstance); + } + + public static com.icon.proto.core.commitment.CompressedBatchEntry getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/CompressedBatchEntryOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/CompressedBatchEntryOrBuilder.java new file mode 100644 index 000000000..46081a76d --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/CompressedBatchEntryOrBuilder.java @@ -0,0 +1,33 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: core/23-commitment/proofs.proto + +package com.icon.proto.core.commitment; + +public interface CompressedBatchEntryOrBuilder extends + // @@protoc_insertion_point(interface_extends:icon.proto.core.commitment.CompressedBatchEntry) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * .icon.proto.core.commitment.CompressedExistenceProof exist = 1 [json_name = "exist"]; + * @return Whether the exist field is set. + */ + boolean hasExist(); + /** + * .icon.proto.core.commitment.CompressedExistenceProof exist = 1 [json_name = "exist"]; + * @return The exist. + */ + com.icon.proto.core.commitment.CompressedExistenceProof getExist(); + + /** + * .icon.proto.core.commitment.CompressedNonExistenceProof nonexist = 2 [json_name = "nonexist"]; + * @return Whether the nonexist field is set. + */ + boolean hasNonexist(); + /** + * .icon.proto.core.commitment.CompressedNonExistenceProof nonexist = 2 [json_name = "nonexist"]; + * @return The nonexist. + */ + com.icon.proto.core.commitment.CompressedNonExistenceProof getNonexist(); + + public com.icon.proto.core.commitment.CompressedBatchEntry.ProofCase getProofCase(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/CompressedBatchProof.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/CompressedBatchProof.java new file mode 100644 index 000000000..905b94ed6 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/CompressedBatchProof.java @@ -0,0 +1,582 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: core/23-commitment/proofs.proto + +package com.icon.proto.core.commitment; + +/** + * Protobuf type {@code icon.proto.core.commitment.CompressedBatchProof} + */ +public final class CompressedBatchProof extends + com.google.protobuf.GeneratedMessageLite< + CompressedBatchProof, CompressedBatchProof.Builder> implements + // @@protoc_insertion_point(message_implements:icon.proto.core.commitment.CompressedBatchProof) + CompressedBatchProofOrBuilder { + private CompressedBatchProof() { + entries_ = emptyProtobufList(); + lookupInners_ = emptyProtobufList(); + } + public static final int ENTRIES_FIELD_NUMBER = 1; + private com.google.protobuf.Internal.ProtobufList entries_; + /** + * repeated .icon.proto.core.commitment.CompressedBatchEntry entries = 1 [json_name = "entries"]; + */ + @java.lang.Override + public java.util.List getEntriesList() { + return entries_; + } + /** + * repeated .icon.proto.core.commitment.CompressedBatchEntry entries = 1 [json_name = "entries"]; + */ + public java.util.List + getEntriesOrBuilderList() { + return entries_; + } + /** + * repeated .icon.proto.core.commitment.CompressedBatchEntry entries = 1 [json_name = "entries"]; + */ + @java.lang.Override + public int getEntriesCount() { + return entries_.size(); + } + /** + * repeated .icon.proto.core.commitment.CompressedBatchEntry entries = 1 [json_name = "entries"]; + */ + @java.lang.Override + public com.icon.proto.core.commitment.CompressedBatchEntry getEntries(int index) { + return entries_.get(index); + } + /** + * repeated .icon.proto.core.commitment.CompressedBatchEntry entries = 1 [json_name = "entries"]; + */ + public com.icon.proto.core.commitment.CompressedBatchEntryOrBuilder getEntriesOrBuilder( + int index) { + return entries_.get(index); + } + private void ensureEntriesIsMutable() { + com.google.protobuf.Internal.ProtobufList tmp = entries_; + if (!tmp.isModifiable()) { + entries_ = + com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp); + } + } + + /** + * repeated .icon.proto.core.commitment.CompressedBatchEntry entries = 1 [json_name = "entries"]; + */ + private void setEntries( + int index, com.icon.proto.core.commitment.CompressedBatchEntry value) { + value.getClass(); + ensureEntriesIsMutable(); + entries_.set(index, value); + } + /** + * repeated .icon.proto.core.commitment.CompressedBatchEntry entries = 1 [json_name = "entries"]; + */ + private void addEntries(com.icon.proto.core.commitment.CompressedBatchEntry value) { + value.getClass(); + ensureEntriesIsMutable(); + entries_.add(value); + } + /** + * repeated .icon.proto.core.commitment.CompressedBatchEntry entries = 1 [json_name = "entries"]; + */ + private void addEntries( + int index, com.icon.proto.core.commitment.CompressedBatchEntry value) { + value.getClass(); + ensureEntriesIsMutable(); + entries_.add(index, value); + } + /** + * repeated .icon.proto.core.commitment.CompressedBatchEntry entries = 1 [json_name = "entries"]; + */ + private void addAllEntries( + java.lang.Iterable values) { + ensureEntriesIsMutable(); + com.google.protobuf.AbstractMessageLite.addAll( + values, entries_); + } + /** + * repeated .icon.proto.core.commitment.CompressedBatchEntry entries = 1 [json_name = "entries"]; + */ + private void clearEntries() { + entries_ = emptyProtobufList(); + } + /** + * repeated .icon.proto.core.commitment.CompressedBatchEntry entries = 1 [json_name = "entries"]; + */ + private void removeEntries(int index) { + ensureEntriesIsMutable(); + entries_.remove(index); + } + + public static final int LOOKUP_INNERS_FIELD_NUMBER = 2; + private com.google.protobuf.Internal.ProtobufList lookupInners_; + /** + * repeated .icon.proto.core.commitment.InnerOp lookup_inners = 2 [json_name = "lookupInners"]; + */ + @java.lang.Override + public java.util.List getLookupInnersList() { + return lookupInners_; + } + /** + * repeated .icon.proto.core.commitment.InnerOp lookup_inners = 2 [json_name = "lookupInners"]; + */ + public java.util.List + getLookupInnersOrBuilderList() { + return lookupInners_; + } + /** + * repeated .icon.proto.core.commitment.InnerOp lookup_inners = 2 [json_name = "lookupInners"]; + */ + @java.lang.Override + public int getLookupInnersCount() { + return lookupInners_.size(); + } + /** + * repeated .icon.proto.core.commitment.InnerOp lookup_inners = 2 [json_name = "lookupInners"]; + */ + @java.lang.Override + public com.icon.proto.core.commitment.InnerOp getLookupInners(int index) { + return lookupInners_.get(index); + } + /** + * repeated .icon.proto.core.commitment.InnerOp lookup_inners = 2 [json_name = "lookupInners"]; + */ + public com.icon.proto.core.commitment.InnerOpOrBuilder getLookupInnersOrBuilder( + int index) { + return lookupInners_.get(index); + } + private void ensureLookupInnersIsMutable() { + com.google.protobuf.Internal.ProtobufList tmp = lookupInners_; + if (!tmp.isModifiable()) { + lookupInners_ = + com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp); + } + } + + /** + * repeated .icon.proto.core.commitment.InnerOp lookup_inners = 2 [json_name = "lookupInners"]; + */ + private void setLookupInners( + int index, com.icon.proto.core.commitment.InnerOp value) { + value.getClass(); + ensureLookupInnersIsMutable(); + lookupInners_.set(index, value); + } + /** + * repeated .icon.proto.core.commitment.InnerOp lookup_inners = 2 [json_name = "lookupInners"]; + */ + private void addLookupInners(com.icon.proto.core.commitment.InnerOp value) { + value.getClass(); + ensureLookupInnersIsMutable(); + lookupInners_.add(value); + } + /** + * repeated .icon.proto.core.commitment.InnerOp lookup_inners = 2 [json_name = "lookupInners"]; + */ + private void addLookupInners( + int index, com.icon.proto.core.commitment.InnerOp value) { + value.getClass(); + ensureLookupInnersIsMutable(); + lookupInners_.add(index, value); + } + /** + * repeated .icon.proto.core.commitment.InnerOp lookup_inners = 2 [json_name = "lookupInners"]; + */ + private void addAllLookupInners( + java.lang.Iterable values) { + ensureLookupInnersIsMutable(); + com.google.protobuf.AbstractMessageLite.addAll( + values, lookupInners_); + } + /** + * repeated .icon.proto.core.commitment.InnerOp lookup_inners = 2 [json_name = "lookupInners"]; + */ + private void clearLookupInners() { + lookupInners_ = emptyProtobufList(); + } + /** + * repeated .icon.proto.core.commitment.InnerOp lookup_inners = 2 [json_name = "lookupInners"]; + */ + private void removeLookupInners(int index) { + ensureLookupInnersIsMutable(); + lookupInners_.remove(index); + } + + public static com.icon.proto.core.commitment.CompressedBatchProof parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.commitment.CompressedBatchProof parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.commitment.CompressedBatchProof parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.commitment.CompressedBatchProof parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.commitment.CompressedBatchProof parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.commitment.CompressedBatchProof parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.commitment.CompressedBatchProof parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.commitment.CompressedBatchProof parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.icon.proto.core.commitment.CompressedBatchProof parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.commitment.CompressedBatchProof parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.icon.proto.core.commitment.CompressedBatchProof parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.commitment.CompressedBatchProof parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.icon.proto.core.commitment.CompressedBatchProof prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + * Protobuf type {@code icon.proto.core.commitment.CompressedBatchProof} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.icon.proto.core.commitment.CompressedBatchProof, Builder> implements + // @@protoc_insertion_point(builder_implements:icon.proto.core.commitment.CompressedBatchProof) + com.icon.proto.core.commitment.CompressedBatchProofOrBuilder { + // Construct using com.icon.proto.core.commitment.CompressedBatchProof.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * repeated .icon.proto.core.commitment.CompressedBatchEntry entries = 1 [json_name = "entries"]; + */ + @java.lang.Override + public java.util.List getEntriesList() { + return java.util.Collections.unmodifiableList( + instance.getEntriesList()); + } + /** + * repeated .icon.proto.core.commitment.CompressedBatchEntry entries = 1 [json_name = "entries"]; + */ + @java.lang.Override + public int getEntriesCount() { + return instance.getEntriesCount(); + }/** + * repeated .icon.proto.core.commitment.CompressedBatchEntry entries = 1 [json_name = "entries"]; + */ + @java.lang.Override + public com.icon.proto.core.commitment.CompressedBatchEntry getEntries(int index) { + return instance.getEntries(index); + } + /** + * repeated .icon.proto.core.commitment.CompressedBatchEntry entries = 1 [json_name = "entries"]; + */ + public Builder setEntries( + int index, com.icon.proto.core.commitment.CompressedBatchEntry value) { + copyOnWrite(); + instance.setEntries(index, value); + return this; + } + /** + * repeated .icon.proto.core.commitment.CompressedBatchEntry entries = 1 [json_name = "entries"]; + */ + public Builder setEntries( + int index, com.icon.proto.core.commitment.CompressedBatchEntry.Builder builderForValue) { + copyOnWrite(); + instance.setEntries(index, + builderForValue.build()); + return this; + } + /** + * repeated .icon.proto.core.commitment.CompressedBatchEntry entries = 1 [json_name = "entries"]; + */ + public Builder addEntries(com.icon.proto.core.commitment.CompressedBatchEntry value) { + copyOnWrite(); + instance.addEntries(value); + return this; + } + /** + * repeated .icon.proto.core.commitment.CompressedBatchEntry entries = 1 [json_name = "entries"]; + */ + public Builder addEntries( + int index, com.icon.proto.core.commitment.CompressedBatchEntry value) { + copyOnWrite(); + instance.addEntries(index, value); + return this; + } + /** + * repeated .icon.proto.core.commitment.CompressedBatchEntry entries = 1 [json_name = "entries"]; + */ + public Builder addEntries( + com.icon.proto.core.commitment.CompressedBatchEntry.Builder builderForValue) { + copyOnWrite(); + instance.addEntries(builderForValue.build()); + return this; + } + /** + * repeated .icon.proto.core.commitment.CompressedBatchEntry entries = 1 [json_name = "entries"]; + */ + public Builder addEntries( + int index, com.icon.proto.core.commitment.CompressedBatchEntry.Builder builderForValue) { + copyOnWrite(); + instance.addEntries(index, + builderForValue.build()); + return this; + } + /** + * repeated .icon.proto.core.commitment.CompressedBatchEntry entries = 1 [json_name = "entries"]; + */ + public Builder addAllEntries( + java.lang.Iterable values) { + copyOnWrite(); + instance.addAllEntries(values); + return this; + } + /** + * repeated .icon.proto.core.commitment.CompressedBatchEntry entries = 1 [json_name = "entries"]; + */ + public Builder clearEntries() { + copyOnWrite(); + instance.clearEntries(); + return this; + } + /** + * repeated .icon.proto.core.commitment.CompressedBatchEntry entries = 1 [json_name = "entries"]; + */ + public Builder removeEntries(int index) { + copyOnWrite(); + instance.removeEntries(index); + return this; + } + + /** + * repeated .icon.proto.core.commitment.InnerOp lookup_inners = 2 [json_name = "lookupInners"]; + */ + @java.lang.Override + public java.util.List getLookupInnersList() { + return java.util.Collections.unmodifiableList( + instance.getLookupInnersList()); + } + /** + * repeated .icon.proto.core.commitment.InnerOp lookup_inners = 2 [json_name = "lookupInners"]; + */ + @java.lang.Override + public int getLookupInnersCount() { + return instance.getLookupInnersCount(); + }/** + * repeated .icon.proto.core.commitment.InnerOp lookup_inners = 2 [json_name = "lookupInners"]; + */ + @java.lang.Override + public com.icon.proto.core.commitment.InnerOp getLookupInners(int index) { + return instance.getLookupInners(index); + } + /** + * repeated .icon.proto.core.commitment.InnerOp lookup_inners = 2 [json_name = "lookupInners"]; + */ + public Builder setLookupInners( + int index, com.icon.proto.core.commitment.InnerOp value) { + copyOnWrite(); + instance.setLookupInners(index, value); + return this; + } + /** + * repeated .icon.proto.core.commitment.InnerOp lookup_inners = 2 [json_name = "lookupInners"]; + */ + public Builder setLookupInners( + int index, com.icon.proto.core.commitment.InnerOp.Builder builderForValue) { + copyOnWrite(); + instance.setLookupInners(index, + builderForValue.build()); + return this; + } + /** + * repeated .icon.proto.core.commitment.InnerOp lookup_inners = 2 [json_name = "lookupInners"]; + */ + public Builder addLookupInners(com.icon.proto.core.commitment.InnerOp value) { + copyOnWrite(); + instance.addLookupInners(value); + return this; + } + /** + * repeated .icon.proto.core.commitment.InnerOp lookup_inners = 2 [json_name = "lookupInners"]; + */ + public Builder addLookupInners( + int index, com.icon.proto.core.commitment.InnerOp value) { + copyOnWrite(); + instance.addLookupInners(index, value); + return this; + } + /** + * repeated .icon.proto.core.commitment.InnerOp lookup_inners = 2 [json_name = "lookupInners"]; + */ + public Builder addLookupInners( + com.icon.proto.core.commitment.InnerOp.Builder builderForValue) { + copyOnWrite(); + instance.addLookupInners(builderForValue.build()); + return this; + } + /** + * repeated .icon.proto.core.commitment.InnerOp lookup_inners = 2 [json_name = "lookupInners"]; + */ + public Builder addLookupInners( + int index, com.icon.proto.core.commitment.InnerOp.Builder builderForValue) { + copyOnWrite(); + instance.addLookupInners(index, + builderForValue.build()); + return this; + } + /** + * repeated .icon.proto.core.commitment.InnerOp lookup_inners = 2 [json_name = "lookupInners"]; + */ + public Builder addAllLookupInners( + java.lang.Iterable values) { + copyOnWrite(); + instance.addAllLookupInners(values); + return this; + } + /** + * repeated .icon.proto.core.commitment.InnerOp lookup_inners = 2 [json_name = "lookupInners"]; + */ + public Builder clearLookupInners() { + copyOnWrite(); + instance.clearLookupInners(); + return this; + } + /** + * repeated .icon.proto.core.commitment.InnerOp lookup_inners = 2 [json_name = "lookupInners"]; + */ + public Builder removeLookupInners(int index) { + copyOnWrite(); + instance.removeLookupInners(index); + return this; + } + + // @@protoc_insertion_point(builder_scope:icon.proto.core.commitment.CompressedBatchProof) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.icon.proto.core.commitment.CompressedBatchProof(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "entries_", + com.icon.proto.core.commitment.CompressedBatchEntry.class, + "lookupInners_", + com.icon.proto.core.commitment.InnerOp.class, + }; + java.lang.String info = + "\u0000\u0002\u0000\u0000\u0001\u0002\u0002\u0000\u0002\u0000\u0001\u001b\u0002\u001b" + + ""; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.icon.proto.core.commitment.CompressedBatchProof.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:icon.proto.core.commitment.CompressedBatchProof) + private static final com.icon.proto.core.commitment.CompressedBatchProof DEFAULT_INSTANCE; + static { + CompressedBatchProof defaultInstance = new CompressedBatchProof(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + CompressedBatchProof.class, defaultInstance); + } + + public static com.icon.proto.core.commitment.CompressedBatchProof getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/CompressedBatchProofOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/CompressedBatchProofOrBuilder.java new file mode 100644 index 000000000..ff5f7274d --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/CompressedBatchProofOrBuilder.java @@ -0,0 +1,37 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: core/23-commitment/proofs.proto + +package com.icon.proto.core.commitment; + +public interface CompressedBatchProofOrBuilder extends + // @@protoc_insertion_point(interface_extends:icon.proto.core.commitment.CompressedBatchProof) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * repeated .icon.proto.core.commitment.CompressedBatchEntry entries = 1 [json_name = "entries"]; + */ + java.util.List + getEntriesList(); + /** + * repeated .icon.proto.core.commitment.CompressedBatchEntry entries = 1 [json_name = "entries"]; + */ + com.icon.proto.core.commitment.CompressedBatchEntry getEntries(int index); + /** + * repeated .icon.proto.core.commitment.CompressedBatchEntry entries = 1 [json_name = "entries"]; + */ + int getEntriesCount(); + + /** + * repeated .icon.proto.core.commitment.InnerOp lookup_inners = 2 [json_name = "lookupInners"]; + */ + java.util.List + getLookupInnersList(); + /** + * repeated .icon.proto.core.commitment.InnerOp lookup_inners = 2 [json_name = "lookupInners"]; + */ + com.icon.proto.core.commitment.InnerOp getLookupInners(int index); + /** + * repeated .icon.proto.core.commitment.InnerOp lookup_inners = 2 [json_name = "lookupInners"]; + */ + int getLookupInnersCount(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/CompressedExistenceProof.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/CompressedExistenceProof.java new file mode 100644 index 000000000..012401abf --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/CompressedExistenceProof.java @@ -0,0 +1,590 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: core/23-commitment/proofs.proto + +package com.icon.proto.core.commitment; + +/** + * Protobuf type {@code icon.proto.core.commitment.CompressedExistenceProof} + */ +public final class CompressedExistenceProof extends + com.google.protobuf.GeneratedMessageLite< + CompressedExistenceProof, CompressedExistenceProof.Builder> implements + // @@protoc_insertion_point(message_implements:icon.proto.core.commitment.CompressedExistenceProof) + CompressedExistenceProofOrBuilder { + private CompressedExistenceProof() { + key_ = com.google.protobuf.ByteString.EMPTY; + value_ = com.google.protobuf.ByteString.EMPTY; + path_ = emptyIntList(); + } + public static final int KEY_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString key_; + /** + * bytes key = 1 [json_name = "key"]; + * @return The key. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKey() { + return key_; + } + /** + * bytes key = 1 [json_name = "key"]; + * @param value The key to set. + */ + private void setKey(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + key_ = value; + } + /** + * bytes key = 1 [json_name = "key"]; + */ + private void clearKey() { + + key_ = getDefaultInstance().getKey(); + } + + public static final int VALUE_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString value_; + /** + * bytes value = 2 [json_name = "value"]; + * @return The value. + */ + @java.lang.Override + public com.google.protobuf.ByteString getValue() { + return value_; + } + /** + * bytes value = 2 [json_name = "value"]; + * @param value The value to set. + */ + private void setValue(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + value_ = value; + } + /** + * bytes value = 2 [json_name = "value"]; + */ + private void clearValue() { + + value_ = getDefaultInstance().getValue(); + } + + public static final int LEAF_FIELD_NUMBER = 3; + private com.icon.proto.core.commitment.LeafOp leaf_; + /** + * .icon.proto.core.commitment.LeafOp leaf = 3 [json_name = "leaf"]; + */ + @java.lang.Override + public boolean hasLeaf() { + return leaf_ != null; + } + /** + * .icon.proto.core.commitment.LeafOp leaf = 3 [json_name = "leaf"]; + */ + @java.lang.Override + public com.icon.proto.core.commitment.LeafOp getLeaf() { + return leaf_ == null ? com.icon.proto.core.commitment.LeafOp.getDefaultInstance() : leaf_; + } + /** + * .icon.proto.core.commitment.LeafOp leaf = 3 [json_name = "leaf"]; + */ + private void setLeaf(com.icon.proto.core.commitment.LeafOp value) { + value.getClass(); + leaf_ = value; + + } + /** + * .icon.proto.core.commitment.LeafOp leaf = 3 [json_name = "leaf"]; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeLeaf(com.icon.proto.core.commitment.LeafOp value) { + value.getClass(); + if (leaf_ != null && + leaf_ != com.icon.proto.core.commitment.LeafOp.getDefaultInstance()) { + leaf_ = + com.icon.proto.core.commitment.LeafOp.newBuilder(leaf_).mergeFrom(value).buildPartial(); + } else { + leaf_ = value; + } + + } + /** + * .icon.proto.core.commitment.LeafOp leaf = 3 [json_name = "leaf"]; + */ + private void clearLeaf() { leaf_ = null; + + } + + public static final int PATH_FIELD_NUMBER = 4; + private com.google.protobuf.Internal.IntList path_; + /** + *
+   * these are indexes into the lookup_inners table in CompressedBatchProof
+   * 
+ * + * repeated int32 path = 4 [json_name = "path"]; + * @return A list containing the path. + */ + @java.lang.Override + public java.util.List + getPathList() { + return path_; + } + /** + *
+   * these are indexes into the lookup_inners table in CompressedBatchProof
+   * 
+ * + * repeated int32 path = 4 [json_name = "path"]; + * @return The count of path. + */ + @java.lang.Override + public int getPathCount() { + return path_.size(); + } + /** + *
+   * these are indexes into the lookup_inners table in CompressedBatchProof
+   * 
+ * + * repeated int32 path = 4 [json_name = "path"]; + * @param index The index of the element to return. + * @return The path at the given index. + */ + @java.lang.Override + public int getPath(int index) { + return path_.getInt(index); + } + private int pathMemoizedSerializedSize = -1; + private void ensurePathIsMutable() { + com.google.protobuf.Internal.IntList tmp = path_; + if (!tmp.isModifiable()) { + path_ = + com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp); + } + } + /** + *
+   * these are indexes into the lookup_inners table in CompressedBatchProof
+   * 
+ * + * repeated int32 path = 4 [json_name = "path"]; + * @param index The index to set the value at. + * @param value The path to set. + */ + private void setPath( + int index, int value) { + ensurePathIsMutable(); + path_.setInt(index, value); + } + /** + *
+   * these are indexes into the lookup_inners table in CompressedBatchProof
+   * 
+ * + * repeated int32 path = 4 [json_name = "path"]; + * @param value The path to add. + */ + private void addPath(int value) { + ensurePathIsMutable(); + path_.addInt(value); + } + /** + *
+   * these are indexes into the lookup_inners table in CompressedBatchProof
+   * 
+ * + * repeated int32 path = 4 [json_name = "path"]; + * @param values The path to add. + */ + private void addAllPath( + java.lang.Iterable values) { + ensurePathIsMutable(); + com.google.protobuf.AbstractMessageLite.addAll( + values, path_); + } + /** + *
+   * these are indexes into the lookup_inners table in CompressedBatchProof
+   * 
+ * + * repeated int32 path = 4 [json_name = "path"]; + */ + private void clearPath() { + path_ = emptyIntList(); + } + + public static com.icon.proto.core.commitment.CompressedExistenceProof parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.commitment.CompressedExistenceProof parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.commitment.CompressedExistenceProof parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.commitment.CompressedExistenceProof parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.commitment.CompressedExistenceProof parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.commitment.CompressedExistenceProof parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.commitment.CompressedExistenceProof parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.commitment.CompressedExistenceProof parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.icon.proto.core.commitment.CompressedExistenceProof parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.commitment.CompressedExistenceProof parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.icon.proto.core.commitment.CompressedExistenceProof parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.commitment.CompressedExistenceProof parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.icon.proto.core.commitment.CompressedExistenceProof prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + * Protobuf type {@code icon.proto.core.commitment.CompressedExistenceProof} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.icon.proto.core.commitment.CompressedExistenceProof, Builder> implements + // @@protoc_insertion_point(builder_implements:icon.proto.core.commitment.CompressedExistenceProof) + com.icon.proto.core.commitment.CompressedExistenceProofOrBuilder { + // Construct using com.icon.proto.core.commitment.CompressedExistenceProof.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * bytes key = 1 [json_name = "key"]; + * @return The key. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKey() { + return instance.getKey(); + } + /** + * bytes key = 1 [json_name = "key"]; + * @param value The key to set. + * @return This builder for chaining. + */ + public Builder setKey(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setKey(value); + return this; + } + /** + * bytes key = 1 [json_name = "key"]; + * @return This builder for chaining. + */ + public Builder clearKey() { + copyOnWrite(); + instance.clearKey(); + return this; + } + + /** + * bytes value = 2 [json_name = "value"]; + * @return The value. + */ + @java.lang.Override + public com.google.protobuf.ByteString getValue() { + return instance.getValue(); + } + /** + * bytes value = 2 [json_name = "value"]; + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setValue(value); + return this; + } + /** + * bytes value = 2 [json_name = "value"]; + * @return This builder for chaining. + */ + public Builder clearValue() { + copyOnWrite(); + instance.clearValue(); + return this; + } + + /** + * .icon.proto.core.commitment.LeafOp leaf = 3 [json_name = "leaf"]; + */ + @java.lang.Override + public boolean hasLeaf() { + return instance.hasLeaf(); + } + /** + * .icon.proto.core.commitment.LeafOp leaf = 3 [json_name = "leaf"]; + */ + @java.lang.Override + public com.icon.proto.core.commitment.LeafOp getLeaf() { + return instance.getLeaf(); + } + /** + * .icon.proto.core.commitment.LeafOp leaf = 3 [json_name = "leaf"]; + */ + public Builder setLeaf(com.icon.proto.core.commitment.LeafOp value) { + copyOnWrite(); + instance.setLeaf(value); + return this; + } + /** + * .icon.proto.core.commitment.LeafOp leaf = 3 [json_name = "leaf"]; + */ + public Builder setLeaf( + com.icon.proto.core.commitment.LeafOp.Builder builderForValue) { + copyOnWrite(); + instance.setLeaf(builderForValue.build()); + return this; + } + /** + * .icon.proto.core.commitment.LeafOp leaf = 3 [json_name = "leaf"]; + */ + public Builder mergeLeaf(com.icon.proto.core.commitment.LeafOp value) { + copyOnWrite(); + instance.mergeLeaf(value); + return this; + } + /** + * .icon.proto.core.commitment.LeafOp leaf = 3 [json_name = "leaf"]; + */ + public Builder clearLeaf() { copyOnWrite(); + instance.clearLeaf(); + return this; + } + + /** + *
+     * these are indexes into the lookup_inners table in CompressedBatchProof
+     * 
+ * + * repeated int32 path = 4 [json_name = "path"]; + * @return A list containing the path. + */ + @java.lang.Override + public java.util.List + getPathList() { + return java.util.Collections.unmodifiableList( + instance.getPathList()); + } + /** + *
+     * these are indexes into the lookup_inners table in CompressedBatchProof
+     * 
+ * + * repeated int32 path = 4 [json_name = "path"]; + * @return The count of path. + */ + @java.lang.Override + public int getPathCount() { + return instance.getPathCount(); + } + /** + *
+     * these are indexes into the lookup_inners table in CompressedBatchProof
+     * 
+ * + * repeated int32 path = 4 [json_name = "path"]; + * @param index The index of the element to return. + * @return The path at the given index. + */ + @java.lang.Override + public int getPath(int index) { + return instance.getPath(index); + } + /** + *
+     * these are indexes into the lookup_inners table in CompressedBatchProof
+     * 
+ * + * repeated int32 path = 4 [json_name = "path"]; + * @param value The path to set. + * @return This builder for chaining. + */ + public Builder setPath( + int index, int value) { + copyOnWrite(); + instance.setPath(index, value); + return this; + } + /** + *
+     * these are indexes into the lookup_inners table in CompressedBatchProof
+     * 
+ * + * repeated int32 path = 4 [json_name = "path"]; + * @param value The path to add. + * @return This builder for chaining. + */ + public Builder addPath(int value) { + copyOnWrite(); + instance.addPath(value); + return this; + } + /** + *
+     * these are indexes into the lookup_inners table in CompressedBatchProof
+     * 
+ * + * repeated int32 path = 4 [json_name = "path"]; + * @param values The path to add. + * @return This builder for chaining. + */ + public Builder addAllPath( + java.lang.Iterable values) { + copyOnWrite(); + instance.addAllPath(values); + return this; + } + /** + *
+     * these are indexes into the lookup_inners table in CompressedBatchProof
+     * 
+ * + * repeated int32 path = 4 [json_name = "path"]; + * @return This builder for chaining. + */ + public Builder clearPath() { + copyOnWrite(); + instance.clearPath(); + return this; + } + + // @@protoc_insertion_point(builder_scope:icon.proto.core.commitment.CompressedExistenceProof) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.icon.proto.core.commitment.CompressedExistenceProof(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "key_", + "value_", + "leaf_", + "path_", + }; + java.lang.String info = + "\u0000\u0004\u0000\u0000\u0001\u0004\u0004\u0000\u0001\u0000\u0001\n\u0002\n\u0003" + + "\t\u0004\'"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.icon.proto.core.commitment.CompressedExistenceProof.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:icon.proto.core.commitment.CompressedExistenceProof) + private static final com.icon.proto.core.commitment.CompressedExistenceProof DEFAULT_INSTANCE; + static { + CompressedExistenceProof defaultInstance = new CompressedExistenceProof(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + CompressedExistenceProof.class, defaultInstance); + } + + public static com.icon.proto.core.commitment.CompressedExistenceProof getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/CompressedExistenceProofOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/CompressedExistenceProofOrBuilder.java new file mode 100644 index 000000000..f248a7098 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/CompressedExistenceProofOrBuilder.java @@ -0,0 +1,61 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: core/23-commitment/proofs.proto + +package com.icon.proto.core.commitment; + +public interface CompressedExistenceProofOrBuilder extends + // @@protoc_insertion_point(interface_extends:icon.proto.core.commitment.CompressedExistenceProof) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * bytes key = 1 [json_name = "key"]; + * @return The key. + */ + com.google.protobuf.ByteString getKey(); + + /** + * bytes value = 2 [json_name = "value"]; + * @return The value. + */ + com.google.protobuf.ByteString getValue(); + + /** + * .icon.proto.core.commitment.LeafOp leaf = 3 [json_name = "leaf"]; + * @return Whether the leaf field is set. + */ + boolean hasLeaf(); + /** + * .icon.proto.core.commitment.LeafOp leaf = 3 [json_name = "leaf"]; + * @return The leaf. + */ + com.icon.proto.core.commitment.LeafOp getLeaf(); + + /** + *
+   * these are indexes into the lookup_inners table in CompressedBatchProof
+   * 
+ * + * repeated int32 path = 4 [json_name = "path"]; + * @return A list containing the path. + */ + java.util.List getPathList(); + /** + *
+   * these are indexes into the lookup_inners table in CompressedBatchProof
+   * 
+ * + * repeated int32 path = 4 [json_name = "path"]; + * @return The count of path. + */ + int getPathCount(); + /** + *
+   * these are indexes into the lookup_inners table in CompressedBatchProof
+   * 
+ * + * repeated int32 path = 4 [json_name = "path"]; + * @param index The index of the element to return. + * @return The path at the given index. + */ + int getPath(int index); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/CompressedNonExistenceProof.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/CompressedNonExistenceProof.java new file mode 100644 index 000000000..e0859a384 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/CompressedNonExistenceProof.java @@ -0,0 +1,453 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: core/23-commitment/proofs.proto + +package com.icon.proto.core.commitment; + +/** + * Protobuf type {@code icon.proto.core.commitment.CompressedNonExistenceProof} + */ +public final class CompressedNonExistenceProof extends + com.google.protobuf.GeneratedMessageLite< + CompressedNonExistenceProof, CompressedNonExistenceProof.Builder> implements + // @@protoc_insertion_point(message_implements:icon.proto.core.commitment.CompressedNonExistenceProof) + CompressedNonExistenceProofOrBuilder { + private CompressedNonExistenceProof() { + key_ = com.google.protobuf.ByteString.EMPTY; + } + public static final int KEY_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString key_; + /** + *
+   * TODO: remove this as unnecessary??? we prove a range
+   * 
+ * + * bytes key = 1 [json_name = "key"]; + * @return The key. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKey() { + return key_; + } + /** + *
+   * TODO: remove this as unnecessary??? we prove a range
+   * 
+ * + * bytes key = 1 [json_name = "key"]; + * @param value The key to set. + */ + private void setKey(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + key_ = value; + } + /** + *
+   * TODO: remove this as unnecessary??? we prove a range
+   * 
+ * + * bytes key = 1 [json_name = "key"]; + */ + private void clearKey() { + + key_ = getDefaultInstance().getKey(); + } + + public static final int LEFT_FIELD_NUMBER = 2; + private com.icon.proto.core.commitment.CompressedExistenceProof left_; + /** + * .icon.proto.core.commitment.CompressedExistenceProof left = 2 [json_name = "left"]; + */ + @java.lang.Override + public boolean hasLeft() { + return left_ != null; + } + /** + * .icon.proto.core.commitment.CompressedExistenceProof left = 2 [json_name = "left"]; + */ + @java.lang.Override + public com.icon.proto.core.commitment.CompressedExistenceProof getLeft() { + return left_ == null ? com.icon.proto.core.commitment.CompressedExistenceProof.getDefaultInstance() : left_; + } + /** + * .icon.proto.core.commitment.CompressedExistenceProof left = 2 [json_name = "left"]; + */ + private void setLeft(com.icon.proto.core.commitment.CompressedExistenceProof value) { + value.getClass(); + left_ = value; + + } + /** + * .icon.proto.core.commitment.CompressedExistenceProof left = 2 [json_name = "left"]; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeLeft(com.icon.proto.core.commitment.CompressedExistenceProof value) { + value.getClass(); + if (left_ != null && + left_ != com.icon.proto.core.commitment.CompressedExistenceProof.getDefaultInstance()) { + left_ = + com.icon.proto.core.commitment.CompressedExistenceProof.newBuilder(left_).mergeFrom(value).buildPartial(); + } else { + left_ = value; + } + + } + /** + * .icon.proto.core.commitment.CompressedExistenceProof left = 2 [json_name = "left"]; + */ + private void clearLeft() { left_ = null; + + } + + public static final int RIGHT_FIELD_NUMBER = 3; + private com.icon.proto.core.commitment.CompressedExistenceProof right_; + /** + * .icon.proto.core.commitment.CompressedExistenceProof right = 3 [json_name = "right"]; + */ + @java.lang.Override + public boolean hasRight() { + return right_ != null; + } + /** + * .icon.proto.core.commitment.CompressedExistenceProof right = 3 [json_name = "right"]; + */ + @java.lang.Override + public com.icon.proto.core.commitment.CompressedExistenceProof getRight() { + return right_ == null ? com.icon.proto.core.commitment.CompressedExistenceProof.getDefaultInstance() : right_; + } + /** + * .icon.proto.core.commitment.CompressedExistenceProof right = 3 [json_name = "right"]; + */ + private void setRight(com.icon.proto.core.commitment.CompressedExistenceProof value) { + value.getClass(); + right_ = value; + + } + /** + * .icon.proto.core.commitment.CompressedExistenceProof right = 3 [json_name = "right"]; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeRight(com.icon.proto.core.commitment.CompressedExistenceProof value) { + value.getClass(); + if (right_ != null && + right_ != com.icon.proto.core.commitment.CompressedExistenceProof.getDefaultInstance()) { + right_ = + com.icon.proto.core.commitment.CompressedExistenceProof.newBuilder(right_).mergeFrom(value).buildPartial(); + } else { + right_ = value; + } + + } + /** + * .icon.proto.core.commitment.CompressedExistenceProof right = 3 [json_name = "right"]; + */ + private void clearRight() { right_ = null; + + } + + public static com.icon.proto.core.commitment.CompressedNonExistenceProof parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.commitment.CompressedNonExistenceProof parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.commitment.CompressedNonExistenceProof parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.commitment.CompressedNonExistenceProof parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.commitment.CompressedNonExistenceProof parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.commitment.CompressedNonExistenceProof parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.commitment.CompressedNonExistenceProof parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.commitment.CompressedNonExistenceProof parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.icon.proto.core.commitment.CompressedNonExistenceProof parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.commitment.CompressedNonExistenceProof parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.icon.proto.core.commitment.CompressedNonExistenceProof parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.commitment.CompressedNonExistenceProof parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.icon.proto.core.commitment.CompressedNonExistenceProof prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + * Protobuf type {@code icon.proto.core.commitment.CompressedNonExistenceProof} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.icon.proto.core.commitment.CompressedNonExistenceProof, Builder> implements + // @@protoc_insertion_point(builder_implements:icon.proto.core.commitment.CompressedNonExistenceProof) + com.icon.proto.core.commitment.CompressedNonExistenceProofOrBuilder { + // Construct using com.icon.proto.core.commitment.CompressedNonExistenceProof.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + *
+     * TODO: remove this as unnecessary??? we prove a range
+     * 
+ * + * bytes key = 1 [json_name = "key"]; + * @return The key. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKey() { + return instance.getKey(); + } + /** + *
+     * TODO: remove this as unnecessary??? we prove a range
+     * 
+ * + * bytes key = 1 [json_name = "key"]; + * @param value The key to set. + * @return This builder for chaining. + */ + public Builder setKey(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setKey(value); + return this; + } + /** + *
+     * TODO: remove this as unnecessary??? we prove a range
+     * 
+ * + * bytes key = 1 [json_name = "key"]; + * @return This builder for chaining. + */ + public Builder clearKey() { + copyOnWrite(); + instance.clearKey(); + return this; + } + + /** + * .icon.proto.core.commitment.CompressedExistenceProof left = 2 [json_name = "left"]; + */ + @java.lang.Override + public boolean hasLeft() { + return instance.hasLeft(); + } + /** + * .icon.proto.core.commitment.CompressedExistenceProof left = 2 [json_name = "left"]; + */ + @java.lang.Override + public com.icon.proto.core.commitment.CompressedExistenceProof getLeft() { + return instance.getLeft(); + } + /** + * .icon.proto.core.commitment.CompressedExistenceProof left = 2 [json_name = "left"]; + */ + public Builder setLeft(com.icon.proto.core.commitment.CompressedExistenceProof value) { + copyOnWrite(); + instance.setLeft(value); + return this; + } + /** + * .icon.proto.core.commitment.CompressedExistenceProof left = 2 [json_name = "left"]; + */ + public Builder setLeft( + com.icon.proto.core.commitment.CompressedExistenceProof.Builder builderForValue) { + copyOnWrite(); + instance.setLeft(builderForValue.build()); + return this; + } + /** + * .icon.proto.core.commitment.CompressedExistenceProof left = 2 [json_name = "left"]; + */ + public Builder mergeLeft(com.icon.proto.core.commitment.CompressedExistenceProof value) { + copyOnWrite(); + instance.mergeLeft(value); + return this; + } + /** + * .icon.proto.core.commitment.CompressedExistenceProof left = 2 [json_name = "left"]; + */ + public Builder clearLeft() { copyOnWrite(); + instance.clearLeft(); + return this; + } + + /** + * .icon.proto.core.commitment.CompressedExistenceProof right = 3 [json_name = "right"]; + */ + @java.lang.Override + public boolean hasRight() { + return instance.hasRight(); + } + /** + * .icon.proto.core.commitment.CompressedExistenceProof right = 3 [json_name = "right"]; + */ + @java.lang.Override + public com.icon.proto.core.commitment.CompressedExistenceProof getRight() { + return instance.getRight(); + } + /** + * .icon.proto.core.commitment.CompressedExistenceProof right = 3 [json_name = "right"]; + */ + public Builder setRight(com.icon.proto.core.commitment.CompressedExistenceProof value) { + copyOnWrite(); + instance.setRight(value); + return this; + } + /** + * .icon.proto.core.commitment.CompressedExistenceProof right = 3 [json_name = "right"]; + */ + public Builder setRight( + com.icon.proto.core.commitment.CompressedExistenceProof.Builder builderForValue) { + copyOnWrite(); + instance.setRight(builderForValue.build()); + return this; + } + /** + * .icon.proto.core.commitment.CompressedExistenceProof right = 3 [json_name = "right"]; + */ + public Builder mergeRight(com.icon.proto.core.commitment.CompressedExistenceProof value) { + copyOnWrite(); + instance.mergeRight(value); + return this; + } + /** + * .icon.proto.core.commitment.CompressedExistenceProof right = 3 [json_name = "right"]; + */ + public Builder clearRight() { copyOnWrite(); + instance.clearRight(); + return this; + } + + // @@protoc_insertion_point(builder_scope:icon.proto.core.commitment.CompressedNonExistenceProof) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.icon.proto.core.commitment.CompressedNonExistenceProof(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "key_", + "left_", + "right_", + }; + java.lang.String info = + "\u0000\u0003\u0000\u0000\u0001\u0003\u0003\u0000\u0000\u0000\u0001\n\u0002\t\u0003" + + "\t"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.icon.proto.core.commitment.CompressedNonExistenceProof.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:icon.proto.core.commitment.CompressedNonExistenceProof) + private static final com.icon.proto.core.commitment.CompressedNonExistenceProof DEFAULT_INSTANCE; + static { + CompressedNonExistenceProof defaultInstance = new CompressedNonExistenceProof(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + CompressedNonExistenceProof.class, defaultInstance); + } + + public static com.icon.proto.core.commitment.CompressedNonExistenceProof getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/CompressedNonExistenceProofOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/CompressedNonExistenceProofOrBuilder.java new file mode 100644 index 000000000..2fd2e2ec7 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/CompressedNonExistenceProofOrBuilder.java @@ -0,0 +1,41 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: core/23-commitment/proofs.proto + +package com.icon.proto.core.commitment; + +public interface CompressedNonExistenceProofOrBuilder extends + // @@protoc_insertion_point(interface_extends:icon.proto.core.commitment.CompressedNonExistenceProof) + com.google.protobuf.MessageLiteOrBuilder { + + /** + *
+   * TODO: remove this as unnecessary??? we prove a range
+   * 
+ * + * bytes key = 1 [json_name = "key"]; + * @return The key. + */ + com.google.protobuf.ByteString getKey(); + + /** + * .icon.proto.core.commitment.CompressedExistenceProof left = 2 [json_name = "left"]; + * @return Whether the left field is set. + */ + boolean hasLeft(); + /** + * .icon.proto.core.commitment.CompressedExistenceProof left = 2 [json_name = "left"]; + * @return The left. + */ + com.icon.proto.core.commitment.CompressedExistenceProof getLeft(); + + /** + * .icon.proto.core.commitment.CompressedExistenceProof right = 3 [json_name = "right"]; + * @return Whether the right field is set. + */ + boolean hasRight(); + /** + * .icon.proto.core.commitment.CompressedExistenceProof right = 3 [json_name = "right"]; + * @return The right. + */ + com.icon.proto.core.commitment.CompressedExistenceProof getRight(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/ExistenceProof.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/ExistenceProof.java new file mode 100644 index 000000000..17a064955 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/ExistenceProof.java @@ -0,0 +1,631 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: core/23-commitment/proofs.proto + +package com.icon.proto.core.commitment; + +/** + *
+ **
+ *ExistenceProof takes a key and a value and a set of steps to perform on it.
+ *The result of peforming all these steps will provide a "root hash", which can
+ *be compared to the value in a header.
+ *Since it is computationally infeasible to produce a hash collission for any of the used
+ *cryptographic hash functions, if someone can provide a series of operations to transform
+ *a given key and value into a root hash that matches some trusted root, these key and values
+ *must be in the referenced merkle tree.
+ *The only possible issue is maliablity in LeafOp, such as providing extra prefix data,
+ *which should be controlled by a spec. Eg. with lengthOp as NONE,
+ *prefix = FOO, key = BAR, value = CHOICE
+ *and
+ *prefix = F, key = OOBAR, value = CHOICE
+ *would produce the same value.
+ *With LengthOp this is tricker but not impossible. Which is why the "leafPrefixEqual" field
+ *in the ProofSpec is valuable to prevent this mutability. And why all trees should
+ *length-prefix the data before hashing it.
+ * 
+ * + * Protobuf type {@code icon.proto.core.commitment.ExistenceProof} + */ +public final class ExistenceProof extends + com.google.protobuf.GeneratedMessageLite< + ExistenceProof, ExistenceProof.Builder> implements + // @@protoc_insertion_point(message_implements:icon.proto.core.commitment.ExistenceProof) + ExistenceProofOrBuilder { + private ExistenceProof() { + key_ = com.google.protobuf.ByteString.EMPTY; + value_ = com.google.protobuf.ByteString.EMPTY; + path_ = emptyProtobufList(); + } + public static final int KEY_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString key_; + /** + * bytes key = 1 [json_name = "key"]; + * @return The key. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKey() { + return key_; + } + /** + * bytes key = 1 [json_name = "key"]; + * @param value The key to set. + */ + private void setKey(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + key_ = value; + } + /** + * bytes key = 1 [json_name = "key"]; + */ + private void clearKey() { + + key_ = getDefaultInstance().getKey(); + } + + public static final int VALUE_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString value_; + /** + * bytes value = 2 [json_name = "value"]; + * @return The value. + */ + @java.lang.Override + public com.google.protobuf.ByteString getValue() { + return value_; + } + /** + * bytes value = 2 [json_name = "value"]; + * @param value The value to set. + */ + private void setValue(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + value_ = value; + } + /** + * bytes value = 2 [json_name = "value"]; + */ + private void clearValue() { + + value_ = getDefaultInstance().getValue(); + } + + public static final int LEAF_FIELD_NUMBER = 3; + private com.icon.proto.core.commitment.LeafOp leaf_; + /** + * .icon.proto.core.commitment.LeafOp leaf = 3 [json_name = "leaf"]; + */ + @java.lang.Override + public boolean hasLeaf() { + return leaf_ != null; + } + /** + * .icon.proto.core.commitment.LeafOp leaf = 3 [json_name = "leaf"]; + */ + @java.lang.Override + public com.icon.proto.core.commitment.LeafOp getLeaf() { + return leaf_ == null ? com.icon.proto.core.commitment.LeafOp.getDefaultInstance() : leaf_; + } + /** + * .icon.proto.core.commitment.LeafOp leaf = 3 [json_name = "leaf"]; + */ + private void setLeaf(com.icon.proto.core.commitment.LeafOp value) { + value.getClass(); + leaf_ = value; + + } + /** + * .icon.proto.core.commitment.LeafOp leaf = 3 [json_name = "leaf"]; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeLeaf(com.icon.proto.core.commitment.LeafOp value) { + value.getClass(); + if (leaf_ != null && + leaf_ != com.icon.proto.core.commitment.LeafOp.getDefaultInstance()) { + leaf_ = + com.icon.proto.core.commitment.LeafOp.newBuilder(leaf_).mergeFrom(value).buildPartial(); + } else { + leaf_ = value; + } + + } + /** + * .icon.proto.core.commitment.LeafOp leaf = 3 [json_name = "leaf"]; + */ + private void clearLeaf() { leaf_ = null; + + } + + public static final int PATH_FIELD_NUMBER = 4; + private com.google.protobuf.Internal.ProtobufList path_; + /** + * repeated .icon.proto.core.commitment.InnerOp path = 4 [json_name = "path"]; + */ + @java.lang.Override + public java.util.List getPathList() { + return path_; + } + /** + * repeated .icon.proto.core.commitment.InnerOp path = 4 [json_name = "path"]; + */ + public java.util.List + getPathOrBuilderList() { + return path_; + } + /** + * repeated .icon.proto.core.commitment.InnerOp path = 4 [json_name = "path"]; + */ + @java.lang.Override + public int getPathCount() { + return path_.size(); + } + /** + * repeated .icon.proto.core.commitment.InnerOp path = 4 [json_name = "path"]; + */ + @java.lang.Override + public com.icon.proto.core.commitment.InnerOp getPath(int index) { + return path_.get(index); + } + /** + * repeated .icon.proto.core.commitment.InnerOp path = 4 [json_name = "path"]; + */ + public com.icon.proto.core.commitment.InnerOpOrBuilder getPathOrBuilder( + int index) { + return path_.get(index); + } + private void ensurePathIsMutable() { + com.google.protobuf.Internal.ProtobufList tmp = path_; + if (!tmp.isModifiable()) { + path_ = + com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp); + } + } + + /** + * repeated .icon.proto.core.commitment.InnerOp path = 4 [json_name = "path"]; + */ + private void setPath( + int index, com.icon.proto.core.commitment.InnerOp value) { + value.getClass(); + ensurePathIsMutable(); + path_.set(index, value); + } + /** + * repeated .icon.proto.core.commitment.InnerOp path = 4 [json_name = "path"]; + */ + private void addPath(com.icon.proto.core.commitment.InnerOp value) { + value.getClass(); + ensurePathIsMutable(); + path_.add(value); + } + /** + * repeated .icon.proto.core.commitment.InnerOp path = 4 [json_name = "path"]; + */ + private void addPath( + int index, com.icon.proto.core.commitment.InnerOp value) { + value.getClass(); + ensurePathIsMutable(); + path_.add(index, value); + } + /** + * repeated .icon.proto.core.commitment.InnerOp path = 4 [json_name = "path"]; + */ + private void addAllPath( + java.lang.Iterable values) { + ensurePathIsMutable(); + com.google.protobuf.AbstractMessageLite.addAll( + values, path_); + } + /** + * repeated .icon.proto.core.commitment.InnerOp path = 4 [json_name = "path"]; + */ + private void clearPath() { + path_ = emptyProtobufList(); + } + /** + * repeated .icon.proto.core.commitment.InnerOp path = 4 [json_name = "path"]; + */ + private void removePath(int index) { + ensurePathIsMutable(); + path_.remove(index); + } + + public static com.icon.proto.core.commitment.ExistenceProof parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.commitment.ExistenceProof parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.commitment.ExistenceProof parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.commitment.ExistenceProof parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.commitment.ExistenceProof parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.commitment.ExistenceProof parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.commitment.ExistenceProof parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.commitment.ExistenceProof parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.icon.proto.core.commitment.ExistenceProof parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.commitment.ExistenceProof parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.icon.proto.core.commitment.ExistenceProof parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.commitment.ExistenceProof parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.icon.proto.core.commitment.ExistenceProof prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+   **
+   *ExistenceProof takes a key and a value and a set of steps to perform on it.
+   *The result of peforming all these steps will provide a "root hash", which can
+   *be compared to the value in a header.
+   *Since it is computationally infeasible to produce a hash collission for any of the used
+   *cryptographic hash functions, if someone can provide a series of operations to transform
+   *a given key and value into a root hash that matches some trusted root, these key and values
+   *must be in the referenced merkle tree.
+   *The only possible issue is maliablity in LeafOp, such as providing extra prefix data,
+   *which should be controlled by a spec. Eg. with lengthOp as NONE,
+   *prefix = FOO, key = BAR, value = CHOICE
+   *and
+   *prefix = F, key = OOBAR, value = CHOICE
+   *would produce the same value.
+   *With LengthOp this is tricker but not impossible. Which is why the "leafPrefixEqual" field
+   *in the ProofSpec is valuable to prevent this mutability. And why all trees should
+   *length-prefix the data before hashing it.
+   * 
+ * + * Protobuf type {@code icon.proto.core.commitment.ExistenceProof} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.icon.proto.core.commitment.ExistenceProof, Builder> implements + // @@protoc_insertion_point(builder_implements:icon.proto.core.commitment.ExistenceProof) + com.icon.proto.core.commitment.ExistenceProofOrBuilder { + // Construct using com.icon.proto.core.commitment.ExistenceProof.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * bytes key = 1 [json_name = "key"]; + * @return The key. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKey() { + return instance.getKey(); + } + /** + * bytes key = 1 [json_name = "key"]; + * @param value The key to set. + * @return This builder for chaining. + */ + public Builder setKey(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setKey(value); + return this; + } + /** + * bytes key = 1 [json_name = "key"]; + * @return This builder for chaining. + */ + public Builder clearKey() { + copyOnWrite(); + instance.clearKey(); + return this; + } + + /** + * bytes value = 2 [json_name = "value"]; + * @return The value. + */ + @java.lang.Override + public com.google.protobuf.ByteString getValue() { + return instance.getValue(); + } + /** + * bytes value = 2 [json_name = "value"]; + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setValue(value); + return this; + } + /** + * bytes value = 2 [json_name = "value"]; + * @return This builder for chaining. + */ + public Builder clearValue() { + copyOnWrite(); + instance.clearValue(); + return this; + } + + /** + * .icon.proto.core.commitment.LeafOp leaf = 3 [json_name = "leaf"]; + */ + @java.lang.Override + public boolean hasLeaf() { + return instance.hasLeaf(); + } + /** + * .icon.proto.core.commitment.LeafOp leaf = 3 [json_name = "leaf"]; + */ + @java.lang.Override + public com.icon.proto.core.commitment.LeafOp getLeaf() { + return instance.getLeaf(); + } + /** + * .icon.proto.core.commitment.LeafOp leaf = 3 [json_name = "leaf"]; + */ + public Builder setLeaf(com.icon.proto.core.commitment.LeafOp value) { + copyOnWrite(); + instance.setLeaf(value); + return this; + } + /** + * .icon.proto.core.commitment.LeafOp leaf = 3 [json_name = "leaf"]; + */ + public Builder setLeaf( + com.icon.proto.core.commitment.LeafOp.Builder builderForValue) { + copyOnWrite(); + instance.setLeaf(builderForValue.build()); + return this; + } + /** + * .icon.proto.core.commitment.LeafOp leaf = 3 [json_name = "leaf"]; + */ + public Builder mergeLeaf(com.icon.proto.core.commitment.LeafOp value) { + copyOnWrite(); + instance.mergeLeaf(value); + return this; + } + /** + * .icon.proto.core.commitment.LeafOp leaf = 3 [json_name = "leaf"]; + */ + public Builder clearLeaf() { copyOnWrite(); + instance.clearLeaf(); + return this; + } + + /** + * repeated .icon.proto.core.commitment.InnerOp path = 4 [json_name = "path"]; + */ + @java.lang.Override + public java.util.List getPathList() { + return java.util.Collections.unmodifiableList( + instance.getPathList()); + } + /** + * repeated .icon.proto.core.commitment.InnerOp path = 4 [json_name = "path"]; + */ + @java.lang.Override + public int getPathCount() { + return instance.getPathCount(); + }/** + * repeated .icon.proto.core.commitment.InnerOp path = 4 [json_name = "path"]; + */ + @java.lang.Override + public com.icon.proto.core.commitment.InnerOp getPath(int index) { + return instance.getPath(index); + } + /** + * repeated .icon.proto.core.commitment.InnerOp path = 4 [json_name = "path"]; + */ + public Builder setPath( + int index, com.icon.proto.core.commitment.InnerOp value) { + copyOnWrite(); + instance.setPath(index, value); + return this; + } + /** + * repeated .icon.proto.core.commitment.InnerOp path = 4 [json_name = "path"]; + */ + public Builder setPath( + int index, com.icon.proto.core.commitment.InnerOp.Builder builderForValue) { + copyOnWrite(); + instance.setPath(index, + builderForValue.build()); + return this; + } + /** + * repeated .icon.proto.core.commitment.InnerOp path = 4 [json_name = "path"]; + */ + public Builder addPath(com.icon.proto.core.commitment.InnerOp value) { + copyOnWrite(); + instance.addPath(value); + return this; + } + /** + * repeated .icon.proto.core.commitment.InnerOp path = 4 [json_name = "path"]; + */ + public Builder addPath( + int index, com.icon.proto.core.commitment.InnerOp value) { + copyOnWrite(); + instance.addPath(index, value); + return this; + } + /** + * repeated .icon.proto.core.commitment.InnerOp path = 4 [json_name = "path"]; + */ + public Builder addPath( + com.icon.proto.core.commitment.InnerOp.Builder builderForValue) { + copyOnWrite(); + instance.addPath(builderForValue.build()); + return this; + } + /** + * repeated .icon.proto.core.commitment.InnerOp path = 4 [json_name = "path"]; + */ + public Builder addPath( + int index, com.icon.proto.core.commitment.InnerOp.Builder builderForValue) { + copyOnWrite(); + instance.addPath(index, + builderForValue.build()); + return this; + } + /** + * repeated .icon.proto.core.commitment.InnerOp path = 4 [json_name = "path"]; + */ + public Builder addAllPath( + java.lang.Iterable values) { + copyOnWrite(); + instance.addAllPath(values); + return this; + } + /** + * repeated .icon.proto.core.commitment.InnerOp path = 4 [json_name = "path"]; + */ + public Builder clearPath() { + copyOnWrite(); + instance.clearPath(); + return this; + } + /** + * repeated .icon.proto.core.commitment.InnerOp path = 4 [json_name = "path"]; + */ + public Builder removePath(int index) { + copyOnWrite(); + instance.removePath(index); + return this; + } + + // @@protoc_insertion_point(builder_scope:icon.proto.core.commitment.ExistenceProof) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.icon.proto.core.commitment.ExistenceProof(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "key_", + "value_", + "leaf_", + "path_", + com.icon.proto.core.commitment.InnerOp.class, + }; + java.lang.String info = + "\u0000\u0004\u0000\u0000\u0001\u0004\u0004\u0000\u0001\u0000\u0001\n\u0002\n\u0003" + + "\t\u0004\u001b"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.icon.proto.core.commitment.ExistenceProof.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:icon.proto.core.commitment.ExistenceProof) + private static final com.icon.proto.core.commitment.ExistenceProof DEFAULT_INSTANCE; + static { + ExistenceProof defaultInstance = new ExistenceProof(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + ExistenceProof.class, defaultInstance); + } + + public static com.icon.proto.core.commitment.ExistenceProof getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/ExistenceProofOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/ExistenceProofOrBuilder.java new file mode 100644 index 000000000..c77df0301 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/ExistenceProofOrBuilder.java @@ -0,0 +1,46 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: core/23-commitment/proofs.proto + +package com.icon.proto.core.commitment; + +public interface ExistenceProofOrBuilder extends + // @@protoc_insertion_point(interface_extends:icon.proto.core.commitment.ExistenceProof) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * bytes key = 1 [json_name = "key"]; + * @return The key. + */ + com.google.protobuf.ByteString getKey(); + + /** + * bytes value = 2 [json_name = "value"]; + * @return The value. + */ + com.google.protobuf.ByteString getValue(); + + /** + * .icon.proto.core.commitment.LeafOp leaf = 3 [json_name = "leaf"]; + * @return Whether the leaf field is set. + */ + boolean hasLeaf(); + /** + * .icon.proto.core.commitment.LeafOp leaf = 3 [json_name = "leaf"]; + * @return The leaf. + */ + com.icon.proto.core.commitment.LeafOp getLeaf(); + + /** + * repeated .icon.proto.core.commitment.InnerOp path = 4 [json_name = "path"]; + */ + java.util.List + getPathList(); + /** + * repeated .icon.proto.core.commitment.InnerOp path = 4 [json_name = "path"]; + */ + com.icon.proto.core.commitment.InnerOp getPath(int index); + /** + * repeated .icon.proto.core.commitment.InnerOp path = 4 [json_name = "path"]; + */ + int getPathCount(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/HashOp.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/HashOp.java new file mode 100644 index 000000000..1f1d4f7a5 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/HashOp.java @@ -0,0 +1,155 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: core/23-commitment/proofs.proto + +package com.icon.proto.core.commitment; + +/** + * Protobuf enum {@code icon.proto.core.commitment.HashOp} + */ +public enum HashOp + implements com.google.protobuf.Internal.EnumLite { + /** + *
+   * NO_HASH is the default if no data passed. Note this is an illegal argument some places.
+   * 
+ * + * NO_HASH = 0; + */ + NO_HASH(0), + /** + * SHA256 = 1; + */ + SHA256(1), + /** + * SHA512 = 2; + */ + SHA512(2), + /** + * KECCAK = 3; + */ + KECCAK(3), + /** + * RIPEMD160 = 4; + */ + RIPEMD160(4), + /** + *
+   * ripemd160(sha256(x))
+   * 
+ * + * BITCOIN = 5; + */ + BITCOIN(5), + /** + * SHA512_256 = 6; + */ + SHA512_256(6), + UNRECOGNIZED(-1), + ; + + /** + *
+   * NO_HASH is the default if no data passed. Note this is an illegal argument some places.
+   * 
+ * + * NO_HASH = 0; + */ + public static final int NO_HASH_VALUE = 0; + /** + * SHA256 = 1; + */ + public static final int SHA256_VALUE = 1; + /** + * SHA512 = 2; + */ + public static final int SHA512_VALUE = 2; + /** + * KECCAK = 3; + */ + public static final int KECCAK_VALUE = 3; + /** + * RIPEMD160 = 4; + */ + public static final int RIPEMD160_VALUE = 4; + /** + *
+   * ripemd160(sha256(x))
+   * 
+ * + * BITCOIN = 5; + */ + public static final int BITCOIN_VALUE = 5; + /** + * SHA512_256 = 6; + */ + public static final int SHA512_256_VALUE = 6; + + + @java.lang.Override + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static HashOp valueOf(int value) { + return forNumber(value); + } + + public static HashOp forNumber(int value) { + switch (value) { + case 0: return NO_HASH; + case 1: return SHA256; + case 2: return SHA512; + case 3: return KECCAK; + case 4: return RIPEMD160; + case 5: return BITCOIN; + case 6: return SHA512_256; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + HashOp> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + @java.lang.Override + public HashOp findValueByNumber(int number) { + return HashOp.forNumber(number); + } + }; + + public static com.google.protobuf.Internal.EnumVerifier + internalGetVerifier() { + return HashOpVerifier.INSTANCE; + } + + private static final class HashOpVerifier implements + com.google.protobuf.Internal.EnumVerifier { + static final com.google.protobuf.Internal.EnumVerifier INSTANCE = new HashOpVerifier(); + @java.lang.Override + public boolean isInRange(int number) { + return HashOp.forNumber(number) != null; + } + }; + + private final int value; + + private HashOp(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:icon.proto.core.commitment.HashOp) +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/InnerOp.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/InnerOp.java new file mode 100644 index 000000000..7ff519335 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/InnerOp.java @@ -0,0 +1,417 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: core/23-commitment/proofs.proto + +package com.icon.proto.core.commitment; + +/** + *
+ **
+ *InnerOp represents a merkle-proof step that is not a leaf.
+ *It represents concatenating two children and hashing them to provide the next result.
+ *The result of the previous step is passed in, so the signature of this op is:
+ *innerOp(child) -> output
+ *The result of applying InnerOp should be:
+ *output = op.hash(op.prefix || child || op.suffix)
+ *where the || operator is concatenation of binary data,
+ *and child is the result of hashing all the tree below this step.
+ *Any special data, like prepending child with the length, or prepending the entire operation with
+ *some value to differentiate from leaf nodes, should be included in prefix and suffix.
+ *If either of prefix or suffix is empty, we just treat it as an empty string
+ * 
+ * + * Protobuf type {@code icon.proto.core.commitment.InnerOp} + */ +public final class InnerOp extends + com.google.protobuf.GeneratedMessageLite< + InnerOp, InnerOp.Builder> implements + // @@protoc_insertion_point(message_implements:icon.proto.core.commitment.InnerOp) + InnerOpOrBuilder { + private InnerOp() { + prefix_ = com.google.protobuf.ByteString.EMPTY; + suffix_ = com.google.protobuf.ByteString.EMPTY; + } + public static final int HASH_FIELD_NUMBER = 1; + private int hash_; + /** + * .icon.proto.core.commitment.HashOp hash = 1 [json_name = "hash"]; + * @return The enum numeric value on the wire for hash. + */ + @java.lang.Override + public int getHashValue() { + return hash_; + } + /** + * .icon.proto.core.commitment.HashOp hash = 1 [json_name = "hash"]; + * @return The hash. + */ + @java.lang.Override + public com.icon.proto.core.commitment.HashOp getHash() { + com.icon.proto.core.commitment.HashOp result = com.icon.proto.core.commitment.HashOp.forNumber(hash_); + return result == null ? com.icon.proto.core.commitment.HashOp.UNRECOGNIZED : result; + } + /** + * .icon.proto.core.commitment.HashOp hash = 1 [json_name = "hash"]; + * @param value The enum numeric value on the wire for hash to set. + */ + private void setHashValue(int value) { + hash_ = value; + } + /** + * .icon.proto.core.commitment.HashOp hash = 1 [json_name = "hash"]; + * @param value The hash to set. + */ + private void setHash(com.icon.proto.core.commitment.HashOp value) { + hash_ = value.getNumber(); + + } + /** + * .icon.proto.core.commitment.HashOp hash = 1 [json_name = "hash"]; + */ + private void clearHash() { + + hash_ = 0; + } + + public static final int PREFIX_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString prefix_; + /** + * bytes prefix = 2 [json_name = "prefix"]; + * @return The prefix. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPrefix() { + return prefix_; + } + /** + * bytes prefix = 2 [json_name = "prefix"]; + * @param value The prefix to set. + */ + private void setPrefix(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + prefix_ = value; + } + /** + * bytes prefix = 2 [json_name = "prefix"]; + */ + private void clearPrefix() { + + prefix_ = getDefaultInstance().getPrefix(); + } + + public static final int SUFFIX_FIELD_NUMBER = 3; + private com.google.protobuf.ByteString suffix_; + /** + * bytes suffix = 3 [json_name = "suffix"]; + * @return The suffix. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSuffix() { + return suffix_; + } + /** + * bytes suffix = 3 [json_name = "suffix"]; + * @param value The suffix to set. + */ + private void setSuffix(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + suffix_ = value; + } + /** + * bytes suffix = 3 [json_name = "suffix"]; + */ + private void clearSuffix() { + + suffix_ = getDefaultInstance().getSuffix(); + } + + public static com.icon.proto.core.commitment.InnerOp parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.commitment.InnerOp parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.commitment.InnerOp parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.commitment.InnerOp parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.commitment.InnerOp parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.commitment.InnerOp parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.commitment.InnerOp parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.commitment.InnerOp parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.icon.proto.core.commitment.InnerOp parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.commitment.InnerOp parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.icon.proto.core.commitment.InnerOp parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.commitment.InnerOp parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.icon.proto.core.commitment.InnerOp prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+   **
+   *InnerOp represents a merkle-proof step that is not a leaf.
+   *It represents concatenating two children and hashing them to provide the next result.
+   *The result of the previous step is passed in, so the signature of this op is:
+   *innerOp(child) -> output
+   *The result of applying InnerOp should be:
+   *output = op.hash(op.prefix || child || op.suffix)
+   *where the || operator is concatenation of binary data,
+   *and child is the result of hashing all the tree below this step.
+   *Any special data, like prepending child with the length, or prepending the entire operation with
+   *some value to differentiate from leaf nodes, should be included in prefix and suffix.
+   *If either of prefix or suffix is empty, we just treat it as an empty string
+   * 
+ * + * Protobuf type {@code icon.proto.core.commitment.InnerOp} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.icon.proto.core.commitment.InnerOp, Builder> implements + // @@protoc_insertion_point(builder_implements:icon.proto.core.commitment.InnerOp) + com.icon.proto.core.commitment.InnerOpOrBuilder { + // Construct using com.icon.proto.core.commitment.InnerOp.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * .icon.proto.core.commitment.HashOp hash = 1 [json_name = "hash"]; + * @return The enum numeric value on the wire for hash. + */ + @java.lang.Override + public int getHashValue() { + return instance.getHashValue(); + } + /** + * .icon.proto.core.commitment.HashOp hash = 1 [json_name = "hash"]; + * @param value The hash to set. + * @return This builder for chaining. + */ + public Builder setHashValue(int value) { + copyOnWrite(); + instance.setHashValue(value); + return this; + } + /** + * .icon.proto.core.commitment.HashOp hash = 1 [json_name = "hash"]; + * @return The hash. + */ + @java.lang.Override + public com.icon.proto.core.commitment.HashOp getHash() { + return instance.getHash(); + } + /** + * .icon.proto.core.commitment.HashOp hash = 1 [json_name = "hash"]; + * @param value The enum numeric value on the wire for hash to set. + * @return This builder for chaining. + */ + public Builder setHash(com.icon.proto.core.commitment.HashOp value) { + copyOnWrite(); + instance.setHash(value); + return this; + } + /** + * .icon.proto.core.commitment.HashOp hash = 1 [json_name = "hash"]; + * @return This builder for chaining. + */ + public Builder clearHash() { + copyOnWrite(); + instance.clearHash(); + return this; + } + + /** + * bytes prefix = 2 [json_name = "prefix"]; + * @return The prefix. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPrefix() { + return instance.getPrefix(); + } + /** + * bytes prefix = 2 [json_name = "prefix"]; + * @param value The prefix to set. + * @return This builder for chaining. + */ + public Builder setPrefix(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setPrefix(value); + return this; + } + /** + * bytes prefix = 2 [json_name = "prefix"]; + * @return This builder for chaining. + */ + public Builder clearPrefix() { + copyOnWrite(); + instance.clearPrefix(); + return this; + } + + /** + * bytes suffix = 3 [json_name = "suffix"]; + * @return The suffix. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSuffix() { + return instance.getSuffix(); + } + /** + * bytes suffix = 3 [json_name = "suffix"]; + * @param value The suffix to set. + * @return This builder for chaining. + */ + public Builder setSuffix(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setSuffix(value); + return this; + } + /** + * bytes suffix = 3 [json_name = "suffix"]; + * @return This builder for chaining. + */ + public Builder clearSuffix() { + copyOnWrite(); + instance.clearSuffix(); + return this; + } + + // @@protoc_insertion_point(builder_scope:icon.proto.core.commitment.InnerOp) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.icon.proto.core.commitment.InnerOp(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "hash_", + "prefix_", + "suffix_", + }; + java.lang.String info = + "\u0000\u0003\u0000\u0000\u0001\u0003\u0003\u0000\u0000\u0000\u0001\f\u0002\n\u0003" + + "\n"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.icon.proto.core.commitment.InnerOp.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:icon.proto.core.commitment.InnerOp) + private static final com.icon.proto.core.commitment.InnerOp DEFAULT_INSTANCE; + static { + InnerOp defaultInstance = new InnerOp(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + InnerOp.class, defaultInstance); + } + + public static com.icon.proto.core.commitment.InnerOp getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/InnerOpOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/InnerOpOrBuilder.java new file mode 100644 index 000000000..d0c2c558e --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/InnerOpOrBuilder.java @@ -0,0 +1,32 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: core/23-commitment/proofs.proto + +package com.icon.proto.core.commitment; + +public interface InnerOpOrBuilder extends + // @@protoc_insertion_point(interface_extends:icon.proto.core.commitment.InnerOp) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * .icon.proto.core.commitment.HashOp hash = 1 [json_name = "hash"]; + * @return The enum numeric value on the wire for hash. + */ + int getHashValue(); + /** + * .icon.proto.core.commitment.HashOp hash = 1 [json_name = "hash"]; + * @return The hash. + */ + com.icon.proto.core.commitment.HashOp getHash(); + + /** + * bytes prefix = 2 [json_name = "prefix"]; + * @return The prefix. + */ + com.google.protobuf.ByteString getPrefix(); + + /** + * bytes suffix = 3 [json_name = "suffix"]; + * @return The suffix. + */ + com.google.protobuf.ByteString getSuffix(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/InnerSpec.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/InnerSpec.java new file mode 100644 index 000000000..7af62b5f0 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/InnerSpec.java @@ -0,0 +1,803 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: core/23-commitment/proofs.proto + +package com.icon.proto.core.commitment; + +/** + *
+ *InnerSpec contains all store-specific structure info to determine if two proofs from a
+ *given store are neighbors.
+ *This enables:
+ *isLeftMost(spec: InnerSpec, op: InnerOp)
+ *isRightMost(spec: InnerSpec, op: InnerOp)
+ *isLeftNeighbor(spec: InnerSpec, left: InnerOp, right: InnerOp)
+ * 
+ * + * Protobuf type {@code icon.proto.core.commitment.InnerSpec} + */ +public final class InnerSpec extends + com.google.protobuf.GeneratedMessageLite< + InnerSpec, InnerSpec.Builder> implements + // @@protoc_insertion_point(message_implements:icon.proto.core.commitment.InnerSpec) + InnerSpecOrBuilder { + private InnerSpec() { + childOrder_ = emptyIntList(); + emptyChild_ = com.google.protobuf.ByteString.EMPTY; + } + public static final int CHILD_ORDER_FIELD_NUMBER = 1; + private com.google.protobuf.Internal.IntList childOrder_; + /** + *
+   * Child order is the ordering of the children node, must count from 0
+   * iavl tree is [0, 1] (left then right)
+   * merk is [0, 2, 1] (left, right, here)
+   * 
+ * + * repeated int32 child_order = 1 [json_name = "childOrder"]; + * @return A list containing the childOrder. + */ + @java.lang.Override + public java.util.List + getChildOrderList() { + return childOrder_; + } + /** + *
+   * Child order is the ordering of the children node, must count from 0
+   * iavl tree is [0, 1] (left then right)
+   * merk is [0, 2, 1] (left, right, here)
+   * 
+ * + * repeated int32 child_order = 1 [json_name = "childOrder"]; + * @return The count of childOrder. + */ + @java.lang.Override + public int getChildOrderCount() { + return childOrder_.size(); + } + /** + *
+   * Child order is the ordering of the children node, must count from 0
+   * iavl tree is [0, 1] (left then right)
+   * merk is [0, 2, 1] (left, right, here)
+   * 
+ * + * repeated int32 child_order = 1 [json_name = "childOrder"]; + * @param index The index of the element to return. + * @return The childOrder at the given index. + */ + @java.lang.Override + public int getChildOrder(int index) { + return childOrder_.getInt(index); + } + private int childOrderMemoizedSerializedSize = -1; + private void ensureChildOrderIsMutable() { + com.google.protobuf.Internal.IntList tmp = childOrder_; + if (!tmp.isModifiable()) { + childOrder_ = + com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp); + } + } + /** + *
+   * Child order is the ordering of the children node, must count from 0
+   * iavl tree is [0, 1] (left then right)
+   * merk is [0, 2, 1] (left, right, here)
+   * 
+ * + * repeated int32 child_order = 1 [json_name = "childOrder"]; + * @param index The index to set the value at. + * @param value The childOrder to set. + */ + private void setChildOrder( + int index, int value) { + ensureChildOrderIsMutable(); + childOrder_.setInt(index, value); + } + /** + *
+   * Child order is the ordering of the children node, must count from 0
+   * iavl tree is [0, 1] (left then right)
+   * merk is [0, 2, 1] (left, right, here)
+   * 
+ * + * repeated int32 child_order = 1 [json_name = "childOrder"]; + * @param value The childOrder to add. + */ + private void addChildOrder(int value) { + ensureChildOrderIsMutable(); + childOrder_.addInt(value); + } + /** + *
+   * Child order is the ordering of the children node, must count from 0
+   * iavl tree is [0, 1] (left then right)
+   * merk is [0, 2, 1] (left, right, here)
+   * 
+ * + * repeated int32 child_order = 1 [json_name = "childOrder"]; + * @param values The childOrder to add. + */ + private void addAllChildOrder( + java.lang.Iterable values) { + ensureChildOrderIsMutable(); + com.google.protobuf.AbstractMessageLite.addAll( + values, childOrder_); + } + /** + *
+   * Child order is the ordering of the children node, must count from 0
+   * iavl tree is [0, 1] (left then right)
+   * merk is [0, 2, 1] (left, right, here)
+   * 
+ * + * repeated int32 child_order = 1 [json_name = "childOrder"]; + */ + private void clearChildOrder() { + childOrder_ = emptyIntList(); + } + + public static final int CHILD_SIZE_FIELD_NUMBER = 2; + private int childSize_; + /** + * int32 child_size = 2 [json_name = "childSize"]; + * @return The childSize. + */ + @java.lang.Override + public int getChildSize() { + return childSize_; + } + /** + * int32 child_size = 2 [json_name = "childSize"]; + * @param value The childSize to set. + */ + private void setChildSize(int value) { + + childSize_ = value; + } + /** + * int32 child_size = 2 [json_name = "childSize"]; + */ + private void clearChildSize() { + + childSize_ = 0; + } + + public static final int MIN_PREFIX_LENGTH_FIELD_NUMBER = 3; + private int minPrefixLength_; + /** + * int32 min_prefix_length = 3 [json_name = "minPrefixLength"]; + * @return The minPrefixLength. + */ + @java.lang.Override + public int getMinPrefixLength() { + return minPrefixLength_; + } + /** + * int32 min_prefix_length = 3 [json_name = "minPrefixLength"]; + * @param value The minPrefixLength to set. + */ + private void setMinPrefixLength(int value) { + + minPrefixLength_ = value; + } + /** + * int32 min_prefix_length = 3 [json_name = "minPrefixLength"]; + */ + private void clearMinPrefixLength() { + + minPrefixLength_ = 0; + } + + public static final int MAX_PREFIX_LENGTH_FIELD_NUMBER = 4; + private int maxPrefixLength_; + /** + * int32 max_prefix_length = 4 [json_name = "maxPrefixLength"]; + * @return The maxPrefixLength. + */ + @java.lang.Override + public int getMaxPrefixLength() { + return maxPrefixLength_; + } + /** + * int32 max_prefix_length = 4 [json_name = "maxPrefixLength"]; + * @param value The maxPrefixLength to set. + */ + private void setMaxPrefixLength(int value) { + + maxPrefixLength_ = value; + } + /** + * int32 max_prefix_length = 4 [json_name = "maxPrefixLength"]; + */ + private void clearMaxPrefixLength() { + + maxPrefixLength_ = 0; + } + + public static final int EMPTY_CHILD_FIELD_NUMBER = 5; + private com.google.protobuf.ByteString emptyChild_; + /** + *
+   * empty child is the prehash image that is used when one child is nil (eg. 20 bytes of 0)
+   * 
+ * + * bytes empty_child = 5 [json_name = "emptyChild"]; + * @return The emptyChild. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEmptyChild() { + return emptyChild_; + } + /** + *
+   * empty child is the prehash image that is used when one child is nil (eg. 20 bytes of 0)
+   * 
+ * + * bytes empty_child = 5 [json_name = "emptyChild"]; + * @param value The emptyChild to set. + */ + private void setEmptyChild(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + emptyChild_ = value; + } + /** + *
+   * empty child is the prehash image that is used when one child is nil (eg. 20 bytes of 0)
+   * 
+ * + * bytes empty_child = 5 [json_name = "emptyChild"]; + */ + private void clearEmptyChild() { + + emptyChild_ = getDefaultInstance().getEmptyChild(); + } + + public static final int HASH_FIELD_NUMBER = 6; + private int hash_; + /** + *
+   * hash is the algorithm that must be used for each InnerOp
+   * 
+ * + * .icon.proto.core.commitment.HashOp hash = 6 [json_name = "hash"]; + * @return The enum numeric value on the wire for hash. + */ + @java.lang.Override + public int getHashValue() { + return hash_; + } + /** + *
+   * hash is the algorithm that must be used for each InnerOp
+   * 
+ * + * .icon.proto.core.commitment.HashOp hash = 6 [json_name = "hash"]; + * @return The hash. + */ + @java.lang.Override + public com.icon.proto.core.commitment.HashOp getHash() { + com.icon.proto.core.commitment.HashOp result = com.icon.proto.core.commitment.HashOp.forNumber(hash_); + return result == null ? com.icon.proto.core.commitment.HashOp.UNRECOGNIZED : result; + } + /** + *
+   * hash is the algorithm that must be used for each InnerOp
+   * 
+ * + * .icon.proto.core.commitment.HashOp hash = 6 [json_name = "hash"]; + * @param value The enum numeric value on the wire for hash to set. + */ + private void setHashValue(int value) { + hash_ = value; + } + /** + *
+   * hash is the algorithm that must be used for each InnerOp
+   * 
+ * + * .icon.proto.core.commitment.HashOp hash = 6 [json_name = "hash"]; + * @param value The hash to set. + */ + private void setHash(com.icon.proto.core.commitment.HashOp value) { + hash_ = value.getNumber(); + + } + /** + *
+   * hash is the algorithm that must be used for each InnerOp
+   * 
+ * + * .icon.proto.core.commitment.HashOp hash = 6 [json_name = "hash"]; + */ + private void clearHash() { + + hash_ = 0; + } + + public static com.icon.proto.core.commitment.InnerSpec parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.commitment.InnerSpec parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.commitment.InnerSpec parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.commitment.InnerSpec parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.commitment.InnerSpec parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.commitment.InnerSpec parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.commitment.InnerSpec parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.commitment.InnerSpec parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.icon.proto.core.commitment.InnerSpec parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.commitment.InnerSpec parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.icon.proto.core.commitment.InnerSpec parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.commitment.InnerSpec parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.icon.proto.core.commitment.InnerSpec prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+   *InnerSpec contains all store-specific structure info to determine if two proofs from a
+   *given store are neighbors.
+   *This enables:
+   *isLeftMost(spec: InnerSpec, op: InnerOp)
+   *isRightMost(spec: InnerSpec, op: InnerOp)
+   *isLeftNeighbor(spec: InnerSpec, left: InnerOp, right: InnerOp)
+   * 
+ * + * Protobuf type {@code icon.proto.core.commitment.InnerSpec} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.icon.proto.core.commitment.InnerSpec, Builder> implements + // @@protoc_insertion_point(builder_implements:icon.proto.core.commitment.InnerSpec) + com.icon.proto.core.commitment.InnerSpecOrBuilder { + // Construct using com.icon.proto.core.commitment.InnerSpec.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + *
+     * Child order is the ordering of the children node, must count from 0
+     * iavl tree is [0, 1] (left then right)
+     * merk is [0, 2, 1] (left, right, here)
+     * 
+ * + * repeated int32 child_order = 1 [json_name = "childOrder"]; + * @return A list containing the childOrder. + */ + @java.lang.Override + public java.util.List + getChildOrderList() { + return java.util.Collections.unmodifiableList( + instance.getChildOrderList()); + } + /** + *
+     * Child order is the ordering of the children node, must count from 0
+     * iavl tree is [0, 1] (left then right)
+     * merk is [0, 2, 1] (left, right, here)
+     * 
+ * + * repeated int32 child_order = 1 [json_name = "childOrder"]; + * @return The count of childOrder. + */ + @java.lang.Override + public int getChildOrderCount() { + return instance.getChildOrderCount(); + } + /** + *
+     * Child order is the ordering of the children node, must count from 0
+     * iavl tree is [0, 1] (left then right)
+     * merk is [0, 2, 1] (left, right, here)
+     * 
+ * + * repeated int32 child_order = 1 [json_name = "childOrder"]; + * @param index The index of the element to return. + * @return The childOrder at the given index. + */ + @java.lang.Override + public int getChildOrder(int index) { + return instance.getChildOrder(index); + } + /** + *
+     * Child order is the ordering of the children node, must count from 0
+     * iavl tree is [0, 1] (left then right)
+     * merk is [0, 2, 1] (left, right, here)
+     * 
+ * + * repeated int32 child_order = 1 [json_name = "childOrder"]; + * @param value The childOrder to set. + * @return This builder for chaining. + */ + public Builder setChildOrder( + int index, int value) { + copyOnWrite(); + instance.setChildOrder(index, value); + return this; + } + /** + *
+     * Child order is the ordering of the children node, must count from 0
+     * iavl tree is [0, 1] (left then right)
+     * merk is [0, 2, 1] (left, right, here)
+     * 
+ * + * repeated int32 child_order = 1 [json_name = "childOrder"]; + * @param value The childOrder to add. + * @return This builder for chaining. + */ + public Builder addChildOrder(int value) { + copyOnWrite(); + instance.addChildOrder(value); + return this; + } + /** + *
+     * Child order is the ordering of the children node, must count from 0
+     * iavl tree is [0, 1] (left then right)
+     * merk is [0, 2, 1] (left, right, here)
+     * 
+ * + * repeated int32 child_order = 1 [json_name = "childOrder"]; + * @param values The childOrder to add. + * @return This builder for chaining. + */ + public Builder addAllChildOrder( + java.lang.Iterable values) { + copyOnWrite(); + instance.addAllChildOrder(values); + return this; + } + /** + *
+     * Child order is the ordering of the children node, must count from 0
+     * iavl tree is [0, 1] (left then right)
+     * merk is [0, 2, 1] (left, right, here)
+     * 
+ * + * repeated int32 child_order = 1 [json_name = "childOrder"]; + * @return This builder for chaining. + */ + public Builder clearChildOrder() { + copyOnWrite(); + instance.clearChildOrder(); + return this; + } + + /** + * int32 child_size = 2 [json_name = "childSize"]; + * @return The childSize. + */ + @java.lang.Override + public int getChildSize() { + return instance.getChildSize(); + } + /** + * int32 child_size = 2 [json_name = "childSize"]; + * @param value The childSize to set. + * @return This builder for chaining. + */ + public Builder setChildSize(int value) { + copyOnWrite(); + instance.setChildSize(value); + return this; + } + /** + * int32 child_size = 2 [json_name = "childSize"]; + * @return This builder for chaining. + */ + public Builder clearChildSize() { + copyOnWrite(); + instance.clearChildSize(); + return this; + } + + /** + * int32 min_prefix_length = 3 [json_name = "minPrefixLength"]; + * @return The minPrefixLength. + */ + @java.lang.Override + public int getMinPrefixLength() { + return instance.getMinPrefixLength(); + } + /** + * int32 min_prefix_length = 3 [json_name = "minPrefixLength"]; + * @param value The minPrefixLength to set. + * @return This builder for chaining. + */ + public Builder setMinPrefixLength(int value) { + copyOnWrite(); + instance.setMinPrefixLength(value); + return this; + } + /** + * int32 min_prefix_length = 3 [json_name = "minPrefixLength"]; + * @return This builder for chaining. + */ + public Builder clearMinPrefixLength() { + copyOnWrite(); + instance.clearMinPrefixLength(); + return this; + } + + /** + * int32 max_prefix_length = 4 [json_name = "maxPrefixLength"]; + * @return The maxPrefixLength. + */ + @java.lang.Override + public int getMaxPrefixLength() { + return instance.getMaxPrefixLength(); + } + /** + * int32 max_prefix_length = 4 [json_name = "maxPrefixLength"]; + * @param value The maxPrefixLength to set. + * @return This builder for chaining. + */ + public Builder setMaxPrefixLength(int value) { + copyOnWrite(); + instance.setMaxPrefixLength(value); + return this; + } + /** + * int32 max_prefix_length = 4 [json_name = "maxPrefixLength"]; + * @return This builder for chaining. + */ + public Builder clearMaxPrefixLength() { + copyOnWrite(); + instance.clearMaxPrefixLength(); + return this; + } + + /** + *
+     * empty child is the prehash image that is used when one child is nil (eg. 20 bytes of 0)
+     * 
+ * + * bytes empty_child = 5 [json_name = "emptyChild"]; + * @return The emptyChild. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEmptyChild() { + return instance.getEmptyChild(); + } + /** + *
+     * empty child is the prehash image that is used when one child is nil (eg. 20 bytes of 0)
+     * 
+ * + * bytes empty_child = 5 [json_name = "emptyChild"]; + * @param value The emptyChild to set. + * @return This builder for chaining. + */ + public Builder setEmptyChild(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setEmptyChild(value); + return this; + } + /** + *
+     * empty child is the prehash image that is used when one child is nil (eg. 20 bytes of 0)
+     * 
+ * + * bytes empty_child = 5 [json_name = "emptyChild"]; + * @return This builder for chaining. + */ + public Builder clearEmptyChild() { + copyOnWrite(); + instance.clearEmptyChild(); + return this; + } + + /** + *
+     * hash is the algorithm that must be used for each InnerOp
+     * 
+ * + * .icon.proto.core.commitment.HashOp hash = 6 [json_name = "hash"]; + * @return The enum numeric value on the wire for hash. + */ + @java.lang.Override + public int getHashValue() { + return instance.getHashValue(); + } + /** + *
+     * hash is the algorithm that must be used for each InnerOp
+     * 
+ * + * .icon.proto.core.commitment.HashOp hash = 6 [json_name = "hash"]; + * @param value The hash to set. + * @return This builder for chaining. + */ + public Builder setHashValue(int value) { + copyOnWrite(); + instance.setHashValue(value); + return this; + } + /** + *
+     * hash is the algorithm that must be used for each InnerOp
+     * 
+ * + * .icon.proto.core.commitment.HashOp hash = 6 [json_name = "hash"]; + * @return The hash. + */ + @java.lang.Override + public com.icon.proto.core.commitment.HashOp getHash() { + return instance.getHash(); + } + /** + *
+     * hash is the algorithm that must be used for each InnerOp
+     * 
+ * + * .icon.proto.core.commitment.HashOp hash = 6 [json_name = "hash"]; + * @param value The enum numeric value on the wire for hash to set. + * @return This builder for chaining. + */ + public Builder setHash(com.icon.proto.core.commitment.HashOp value) { + copyOnWrite(); + instance.setHash(value); + return this; + } + /** + *
+     * hash is the algorithm that must be used for each InnerOp
+     * 
+ * + * .icon.proto.core.commitment.HashOp hash = 6 [json_name = "hash"]; + * @return This builder for chaining. + */ + public Builder clearHash() { + copyOnWrite(); + instance.clearHash(); + return this; + } + + // @@protoc_insertion_point(builder_scope:icon.proto.core.commitment.InnerSpec) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.icon.proto.core.commitment.InnerSpec(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "childOrder_", + "childSize_", + "minPrefixLength_", + "maxPrefixLength_", + "emptyChild_", + "hash_", + }; + java.lang.String info = + "\u0000\u0006\u0000\u0000\u0001\u0006\u0006\u0000\u0001\u0000\u0001\'\u0002\u0004" + + "\u0003\u0004\u0004\u0004\u0005\n\u0006\f"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.icon.proto.core.commitment.InnerSpec.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:icon.proto.core.commitment.InnerSpec) + private static final com.icon.proto.core.commitment.InnerSpec DEFAULT_INSTANCE; + static { + InnerSpec defaultInstance = new InnerSpec(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + InnerSpec.class, defaultInstance); + } + + public static com.icon.proto.core.commitment.InnerSpec getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/InnerSpecOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/InnerSpecOrBuilder.java new file mode 100644 index 000000000..87f71285c --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/InnerSpecOrBuilder.java @@ -0,0 +1,91 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: core/23-commitment/proofs.proto + +package com.icon.proto.core.commitment; + +public interface InnerSpecOrBuilder extends + // @@protoc_insertion_point(interface_extends:icon.proto.core.commitment.InnerSpec) + com.google.protobuf.MessageLiteOrBuilder { + + /** + *
+   * Child order is the ordering of the children node, must count from 0
+   * iavl tree is [0, 1] (left then right)
+   * merk is [0, 2, 1] (left, right, here)
+   * 
+ * + * repeated int32 child_order = 1 [json_name = "childOrder"]; + * @return A list containing the childOrder. + */ + java.util.List getChildOrderList(); + /** + *
+   * Child order is the ordering of the children node, must count from 0
+   * iavl tree is [0, 1] (left then right)
+   * merk is [0, 2, 1] (left, right, here)
+   * 
+ * + * repeated int32 child_order = 1 [json_name = "childOrder"]; + * @return The count of childOrder. + */ + int getChildOrderCount(); + /** + *
+   * Child order is the ordering of the children node, must count from 0
+   * iavl tree is [0, 1] (left then right)
+   * merk is [0, 2, 1] (left, right, here)
+   * 
+ * + * repeated int32 child_order = 1 [json_name = "childOrder"]; + * @param index The index of the element to return. + * @return The childOrder at the given index. + */ + int getChildOrder(int index); + + /** + * int32 child_size = 2 [json_name = "childSize"]; + * @return The childSize. + */ + int getChildSize(); + + /** + * int32 min_prefix_length = 3 [json_name = "minPrefixLength"]; + * @return The minPrefixLength. + */ + int getMinPrefixLength(); + + /** + * int32 max_prefix_length = 4 [json_name = "maxPrefixLength"]; + * @return The maxPrefixLength. + */ + int getMaxPrefixLength(); + + /** + *
+   * empty child is the prehash image that is used when one child is nil (eg. 20 bytes of 0)
+   * 
+ * + * bytes empty_child = 5 [json_name = "emptyChild"]; + * @return The emptyChild. + */ + com.google.protobuf.ByteString getEmptyChild(); + + /** + *
+   * hash is the algorithm that must be used for each InnerOp
+   * 
+ * + * .icon.proto.core.commitment.HashOp hash = 6 [json_name = "hash"]; + * @return The enum numeric value on the wire for hash. + */ + int getHashValue(); + /** + *
+   * hash is the algorithm that must be used for each InnerOp
+   * 
+ * + * .icon.proto.core.commitment.HashOp hash = 6 [json_name = "hash"]; + * @return The hash. + */ + com.icon.proto.core.commitment.HashOp getHash(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/LeafOp.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/LeafOp.java new file mode 100644 index 000000000..75632aeb5 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/LeafOp.java @@ -0,0 +1,657 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: core/23-commitment/proofs.proto + +package com.icon.proto.core.commitment; + +/** + *
+ **
+ *LeafOp represents the raw key-value data we wish to prove, and
+ *must be flexible to represent the internal transformation from
+ *the original key-value pairs into the basis hash, for many existing
+ *merkle trees.
+ *key and value are passed in. So that the signature of this operation is:
+ *leafOp(key, value) -> output
+ *To process this, first prehash the keys and values if needed (ANY means no hash in this case):
+ *hkey = prehashKey(key)
+ *hvalue = prehashValue(value)
+ *Then combine the bytes, and hash it
+ *output = hash(prefix || length(hkey) || hkey || length(hvalue) || hvalue)
+ * 
+ * + * Protobuf type {@code icon.proto.core.commitment.LeafOp} + */ +public final class LeafOp extends + com.google.protobuf.GeneratedMessageLite< + LeafOp, LeafOp.Builder> implements + // @@protoc_insertion_point(message_implements:icon.proto.core.commitment.LeafOp) + LeafOpOrBuilder { + private LeafOp() { + prefix_ = com.google.protobuf.ByteString.EMPTY; + } + public static final int HASH_FIELD_NUMBER = 1; + private int hash_; + /** + * .icon.proto.core.commitment.HashOp hash = 1 [json_name = "hash"]; + * @return The enum numeric value on the wire for hash. + */ + @java.lang.Override + public int getHashValue() { + return hash_; + } + /** + * .icon.proto.core.commitment.HashOp hash = 1 [json_name = "hash"]; + * @return The hash. + */ + @java.lang.Override + public com.icon.proto.core.commitment.HashOp getHash() { + com.icon.proto.core.commitment.HashOp result = com.icon.proto.core.commitment.HashOp.forNumber(hash_); + return result == null ? com.icon.proto.core.commitment.HashOp.UNRECOGNIZED : result; + } + /** + * .icon.proto.core.commitment.HashOp hash = 1 [json_name = "hash"]; + * @param value The enum numeric value on the wire for hash to set. + */ + private void setHashValue(int value) { + hash_ = value; + } + /** + * .icon.proto.core.commitment.HashOp hash = 1 [json_name = "hash"]; + * @param value The hash to set. + */ + private void setHash(com.icon.proto.core.commitment.HashOp value) { + hash_ = value.getNumber(); + + } + /** + * .icon.proto.core.commitment.HashOp hash = 1 [json_name = "hash"]; + */ + private void clearHash() { + + hash_ = 0; + } + + public static final int PREHASH_KEY_FIELD_NUMBER = 2; + private int prehashKey_; + /** + * .icon.proto.core.commitment.HashOp prehash_key = 2 [json_name = "prehashKey"]; + * @return The enum numeric value on the wire for prehashKey. + */ + @java.lang.Override + public int getPrehashKeyValue() { + return prehashKey_; + } + /** + * .icon.proto.core.commitment.HashOp prehash_key = 2 [json_name = "prehashKey"]; + * @return The prehashKey. + */ + @java.lang.Override + public com.icon.proto.core.commitment.HashOp getPrehashKey() { + com.icon.proto.core.commitment.HashOp result = com.icon.proto.core.commitment.HashOp.forNumber(prehashKey_); + return result == null ? com.icon.proto.core.commitment.HashOp.UNRECOGNIZED : result; + } + /** + * .icon.proto.core.commitment.HashOp prehash_key = 2 [json_name = "prehashKey"]; + * @param value The enum numeric value on the wire for prehashKey to set. + */ + private void setPrehashKeyValue(int value) { + prehashKey_ = value; + } + /** + * .icon.proto.core.commitment.HashOp prehash_key = 2 [json_name = "prehashKey"]; + * @param value The prehashKey to set. + */ + private void setPrehashKey(com.icon.proto.core.commitment.HashOp value) { + prehashKey_ = value.getNumber(); + + } + /** + * .icon.proto.core.commitment.HashOp prehash_key = 2 [json_name = "prehashKey"]; + */ + private void clearPrehashKey() { + + prehashKey_ = 0; + } + + public static final int PREHASH_VALUE_FIELD_NUMBER = 3; + private int prehashValue_; + /** + * .icon.proto.core.commitment.HashOp prehash_value = 3 [json_name = "prehashValue"]; + * @return The enum numeric value on the wire for prehashValue. + */ + @java.lang.Override + public int getPrehashValueValue() { + return prehashValue_; + } + /** + * .icon.proto.core.commitment.HashOp prehash_value = 3 [json_name = "prehashValue"]; + * @return The prehashValue. + */ + @java.lang.Override + public com.icon.proto.core.commitment.HashOp getPrehashValue() { + com.icon.proto.core.commitment.HashOp result = com.icon.proto.core.commitment.HashOp.forNumber(prehashValue_); + return result == null ? com.icon.proto.core.commitment.HashOp.UNRECOGNIZED : result; + } + /** + * .icon.proto.core.commitment.HashOp prehash_value = 3 [json_name = "prehashValue"]; + * @param value The enum numeric value on the wire for prehashValue to set. + */ + private void setPrehashValueValue(int value) { + prehashValue_ = value; + } + /** + * .icon.proto.core.commitment.HashOp prehash_value = 3 [json_name = "prehashValue"]; + * @param value The prehashValue to set. + */ + private void setPrehashValue(com.icon.proto.core.commitment.HashOp value) { + prehashValue_ = value.getNumber(); + + } + /** + * .icon.proto.core.commitment.HashOp prehash_value = 3 [json_name = "prehashValue"]; + */ + private void clearPrehashValue() { + + prehashValue_ = 0; + } + + public static final int LENGTH_FIELD_NUMBER = 4; + private int length_; + /** + * .icon.proto.core.commitment.LengthOp length = 4 [json_name = "length"]; + * @return The enum numeric value on the wire for length. + */ + @java.lang.Override + public int getLengthValue() { + return length_; + } + /** + * .icon.proto.core.commitment.LengthOp length = 4 [json_name = "length"]; + * @return The length. + */ + @java.lang.Override + public com.icon.proto.core.commitment.LengthOp getLength() { + com.icon.proto.core.commitment.LengthOp result = com.icon.proto.core.commitment.LengthOp.forNumber(length_); + return result == null ? com.icon.proto.core.commitment.LengthOp.UNRECOGNIZED : result; + } + /** + * .icon.proto.core.commitment.LengthOp length = 4 [json_name = "length"]; + * @param value The enum numeric value on the wire for length to set. + */ + private void setLengthValue(int value) { + length_ = value; + } + /** + * .icon.proto.core.commitment.LengthOp length = 4 [json_name = "length"]; + * @param value The length to set. + */ + private void setLength(com.icon.proto.core.commitment.LengthOp value) { + length_ = value.getNumber(); + + } + /** + * .icon.proto.core.commitment.LengthOp length = 4 [json_name = "length"]; + */ + private void clearLength() { + + length_ = 0; + } + + public static final int PREFIX_FIELD_NUMBER = 5; + private com.google.protobuf.ByteString prefix_; + /** + *
+   * prefix is a fixed bytes that may optionally be included at the beginning to differentiate
+   * a leaf node from an inner node.
+   * 
+ * + * bytes prefix = 5 [json_name = "prefix"]; + * @return The prefix. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPrefix() { + return prefix_; + } + /** + *
+   * prefix is a fixed bytes that may optionally be included at the beginning to differentiate
+   * a leaf node from an inner node.
+   * 
+ * + * bytes prefix = 5 [json_name = "prefix"]; + * @param value The prefix to set. + */ + private void setPrefix(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + prefix_ = value; + } + /** + *
+   * prefix is a fixed bytes that may optionally be included at the beginning to differentiate
+   * a leaf node from an inner node.
+   * 
+ * + * bytes prefix = 5 [json_name = "prefix"]; + */ + private void clearPrefix() { + + prefix_ = getDefaultInstance().getPrefix(); + } + + public static com.icon.proto.core.commitment.LeafOp parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.commitment.LeafOp parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.commitment.LeafOp parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.commitment.LeafOp parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.commitment.LeafOp parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.commitment.LeafOp parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.commitment.LeafOp parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.commitment.LeafOp parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.icon.proto.core.commitment.LeafOp parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.commitment.LeafOp parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.icon.proto.core.commitment.LeafOp parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.commitment.LeafOp parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.icon.proto.core.commitment.LeafOp prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+   **
+   *LeafOp represents the raw key-value data we wish to prove, and
+   *must be flexible to represent the internal transformation from
+   *the original key-value pairs into the basis hash, for many existing
+   *merkle trees.
+   *key and value are passed in. So that the signature of this operation is:
+   *leafOp(key, value) -> output
+   *To process this, first prehash the keys and values if needed (ANY means no hash in this case):
+   *hkey = prehashKey(key)
+   *hvalue = prehashValue(value)
+   *Then combine the bytes, and hash it
+   *output = hash(prefix || length(hkey) || hkey || length(hvalue) || hvalue)
+   * 
+ * + * Protobuf type {@code icon.proto.core.commitment.LeafOp} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.icon.proto.core.commitment.LeafOp, Builder> implements + // @@protoc_insertion_point(builder_implements:icon.proto.core.commitment.LeafOp) + com.icon.proto.core.commitment.LeafOpOrBuilder { + // Construct using com.icon.proto.core.commitment.LeafOp.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * .icon.proto.core.commitment.HashOp hash = 1 [json_name = "hash"]; + * @return The enum numeric value on the wire for hash. + */ + @java.lang.Override + public int getHashValue() { + return instance.getHashValue(); + } + /** + * .icon.proto.core.commitment.HashOp hash = 1 [json_name = "hash"]; + * @param value The hash to set. + * @return This builder for chaining. + */ + public Builder setHashValue(int value) { + copyOnWrite(); + instance.setHashValue(value); + return this; + } + /** + * .icon.proto.core.commitment.HashOp hash = 1 [json_name = "hash"]; + * @return The hash. + */ + @java.lang.Override + public com.icon.proto.core.commitment.HashOp getHash() { + return instance.getHash(); + } + /** + * .icon.proto.core.commitment.HashOp hash = 1 [json_name = "hash"]; + * @param value The enum numeric value on the wire for hash to set. + * @return This builder for chaining. + */ + public Builder setHash(com.icon.proto.core.commitment.HashOp value) { + copyOnWrite(); + instance.setHash(value); + return this; + } + /** + * .icon.proto.core.commitment.HashOp hash = 1 [json_name = "hash"]; + * @return This builder for chaining. + */ + public Builder clearHash() { + copyOnWrite(); + instance.clearHash(); + return this; + } + + /** + * .icon.proto.core.commitment.HashOp prehash_key = 2 [json_name = "prehashKey"]; + * @return The enum numeric value on the wire for prehashKey. + */ + @java.lang.Override + public int getPrehashKeyValue() { + return instance.getPrehashKeyValue(); + } + /** + * .icon.proto.core.commitment.HashOp prehash_key = 2 [json_name = "prehashKey"]; + * @param value The prehashKey to set. + * @return This builder for chaining. + */ + public Builder setPrehashKeyValue(int value) { + copyOnWrite(); + instance.setPrehashKeyValue(value); + return this; + } + /** + * .icon.proto.core.commitment.HashOp prehash_key = 2 [json_name = "prehashKey"]; + * @return The prehashKey. + */ + @java.lang.Override + public com.icon.proto.core.commitment.HashOp getPrehashKey() { + return instance.getPrehashKey(); + } + /** + * .icon.proto.core.commitment.HashOp prehash_key = 2 [json_name = "prehashKey"]; + * @param value The enum numeric value on the wire for prehashKey to set. + * @return This builder for chaining. + */ + public Builder setPrehashKey(com.icon.proto.core.commitment.HashOp value) { + copyOnWrite(); + instance.setPrehashKey(value); + return this; + } + /** + * .icon.proto.core.commitment.HashOp prehash_key = 2 [json_name = "prehashKey"]; + * @return This builder for chaining. + */ + public Builder clearPrehashKey() { + copyOnWrite(); + instance.clearPrehashKey(); + return this; + } + + /** + * .icon.proto.core.commitment.HashOp prehash_value = 3 [json_name = "prehashValue"]; + * @return The enum numeric value on the wire for prehashValue. + */ + @java.lang.Override + public int getPrehashValueValue() { + return instance.getPrehashValueValue(); + } + /** + * .icon.proto.core.commitment.HashOp prehash_value = 3 [json_name = "prehashValue"]; + * @param value The prehashValue to set. + * @return This builder for chaining. + */ + public Builder setPrehashValueValue(int value) { + copyOnWrite(); + instance.setPrehashValueValue(value); + return this; + } + /** + * .icon.proto.core.commitment.HashOp prehash_value = 3 [json_name = "prehashValue"]; + * @return The prehashValue. + */ + @java.lang.Override + public com.icon.proto.core.commitment.HashOp getPrehashValue() { + return instance.getPrehashValue(); + } + /** + * .icon.proto.core.commitment.HashOp prehash_value = 3 [json_name = "prehashValue"]; + * @param value The enum numeric value on the wire for prehashValue to set. + * @return This builder for chaining. + */ + public Builder setPrehashValue(com.icon.proto.core.commitment.HashOp value) { + copyOnWrite(); + instance.setPrehashValue(value); + return this; + } + /** + * .icon.proto.core.commitment.HashOp prehash_value = 3 [json_name = "prehashValue"]; + * @return This builder for chaining. + */ + public Builder clearPrehashValue() { + copyOnWrite(); + instance.clearPrehashValue(); + return this; + } + + /** + * .icon.proto.core.commitment.LengthOp length = 4 [json_name = "length"]; + * @return The enum numeric value on the wire for length. + */ + @java.lang.Override + public int getLengthValue() { + return instance.getLengthValue(); + } + /** + * .icon.proto.core.commitment.LengthOp length = 4 [json_name = "length"]; + * @param value The length to set. + * @return This builder for chaining. + */ + public Builder setLengthValue(int value) { + copyOnWrite(); + instance.setLengthValue(value); + return this; + } + /** + * .icon.proto.core.commitment.LengthOp length = 4 [json_name = "length"]; + * @return The length. + */ + @java.lang.Override + public com.icon.proto.core.commitment.LengthOp getLength() { + return instance.getLength(); + } + /** + * .icon.proto.core.commitment.LengthOp length = 4 [json_name = "length"]; + * @param value The enum numeric value on the wire for length to set. + * @return This builder for chaining. + */ + public Builder setLength(com.icon.proto.core.commitment.LengthOp value) { + copyOnWrite(); + instance.setLength(value); + return this; + } + /** + * .icon.proto.core.commitment.LengthOp length = 4 [json_name = "length"]; + * @return This builder for chaining. + */ + public Builder clearLength() { + copyOnWrite(); + instance.clearLength(); + return this; + } + + /** + *
+     * prefix is a fixed bytes that may optionally be included at the beginning to differentiate
+     * a leaf node from an inner node.
+     * 
+ * + * bytes prefix = 5 [json_name = "prefix"]; + * @return The prefix. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPrefix() { + return instance.getPrefix(); + } + /** + *
+     * prefix is a fixed bytes that may optionally be included at the beginning to differentiate
+     * a leaf node from an inner node.
+     * 
+ * + * bytes prefix = 5 [json_name = "prefix"]; + * @param value The prefix to set. + * @return This builder for chaining. + */ + public Builder setPrefix(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setPrefix(value); + return this; + } + /** + *
+     * prefix is a fixed bytes that may optionally be included at the beginning to differentiate
+     * a leaf node from an inner node.
+     * 
+ * + * bytes prefix = 5 [json_name = "prefix"]; + * @return This builder for chaining. + */ + public Builder clearPrefix() { + copyOnWrite(); + instance.clearPrefix(); + return this; + } + + // @@protoc_insertion_point(builder_scope:icon.proto.core.commitment.LeafOp) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.icon.proto.core.commitment.LeafOp(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "hash_", + "prehashKey_", + "prehashValue_", + "length_", + "prefix_", + }; + java.lang.String info = + "\u0000\u0005\u0000\u0000\u0001\u0005\u0005\u0000\u0000\u0000\u0001\f\u0002\f\u0003" + + "\f\u0004\f\u0005\n"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.icon.proto.core.commitment.LeafOp.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:icon.proto.core.commitment.LeafOp) + private static final com.icon.proto.core.commitment.LeafOp DEFAULT_INSTANCE; + static { + LeafOp defaultInstance = new LeafOp(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + LeafOp.class, defaultInstance); + } + + public static com.icon.proto.core.commitment.LeafOp getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/LeafOpOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/LeafOpOrBuilder.java new file mode 100644 index 000000000..c98a0768f --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/LeafOpOrBuilder.java @@ -0,0 +1,64 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: core/23-commitment/proofs.proto + +package com.icon.proto.core.commitment; + +public interface LeafOpOrBuilder extends + // @@protoc_insertion_point(interface_extends:icon.proto.core.commitment.LeafOp) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * .icon.proto.core.commitment.HashOp hash = 1 [json_name = "hash"]; + * @return The enum numeric value on the wire for hash. + */ + int getHashValue(); + /** + * .icon.proto.core.commitment.HashOp hash = 1 [json_name = "hash"]; + * @return The hash. + */ + com.icon.proto.core.commitment.HashOp getHash(); + + /** + * .icon.proto.core.commitment.HashOp prehash_key = 2 [json_name = "prehashKey"]; + * @return The enum numeric value on the wire for prehashKey. + */ + int getPrehashKeyValue(); + /** + * .icon.proto.core.commitment.HashOp prehash_key = 2 [json_name = "prehashKey"]; + * @return The prehashKey. + */ + com.icon.proto.core.commitment.HashOp getPrehashKey(); + + /** + * .icon.proto.core.commitment.HashOp prehash_value = 3 [json_name = "prehashValue"]; + * @return The enum numeric value on the wire for prehashValue. + */ + int getPrehashValueValue(); + /** + * .icon.proto.core.commitment.HashOp prehash_value = 3 [json_name = "prehashValue"]; + * @return The prehashValue. + */ + com.icon.proto.core.commitment.HashOp getPrehashValue(); + + /** + * .icon.proto.core.commitment.LengthOp length = 4 [json_name = "length"]; + * @return The enum numeric value on the wire for length. + */ + int getLengthValue(); + /** + * .icon.proto.core.commitment.LengthOp length = 4 [json_name = "length"]; + * @return The length. + */ + com.icon.proto.core.commitment.LengthOp getLength(); + + /** + *
+   * prefix is a fixed bytes that may optionally be included at the beginning to differentiate
+   * a leaf node from an inner node.
+   * 
+ * + * bytes prefix = 5 [json_name = "prefix"]; + * @return The prefix. + */ + com.google.protobuf.ByteString getPrefix(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/LengthOp.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/LengthOp.java new file mode 100644 index 000000000..203a95b2a --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/LengthOp.java @@ -0,0 +1,237 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: core/23-commitment/proofs.proto + +package com.icon.proto.core.commitment; + +/** + *
+ **
+ *LengthOp defines how to process the key and value of the LeafOp
+ *to include length information. After encoding the length with the given
+ *algorithm, the length will be prepended to the key and value bytes.
+ *(Each one with it's own encoded length)
+ * 
+ * + * Protobuf enum {@code icon.proto.core.commitment.LengthOp} + */ +public enum LengthOp + implements com.google.protobuf.Internal.EnumLite { + /** + *
+   * NO_PREFIX don't include any length info
+   * 
+ * + * NO_PREFIX = 0; + */ + NO_PREFIX(0), + /** + *
+   * VAR_PROTO uses protobuf (and go-amino) varint encoding of the length
+   * 
+ * + * VAR_PROTO = 1; + */ + VAR_PROTO(1), + /** + *
+   * VAR_RLP uses rlp int encoding of the length
+   * 
+ * + * VAR_RLP = 2; + */ + VAR_RLP(2), + /** + *
+   * FIXED32_BIG uses big-endian encoding of the length as a 32 bit integer
+   * 
+ * + * FIXED32_BIG = 3; + */ + FIXED32_BIG(3), + /** + *
+   * FIXED32_LITTLE uses little-endian encoding of the length as a 32 bit integer
+   * 
+ * + * FIXED32_LITTLE = 4; + */ + FIXED32_LITTLE(4), + /** + *
+   * FIXED64_BIG uses big-endian encoding of the length as a 64 bit integer
+   * 
+ * + * FIXED64_BIG = 5; + */ + FIXED64_BIG(5), + /** + *
+   * FIXED64_LITTLE uses little-endian encoding of the length as a 64 bit integer
+   * 
+ * + * FIXED64_LITTLE = 6; + */ + FIXED64_LITTLE(6), + /** + *
+   * REQUIRE_32_BYTES is like NONE, but will fail if the input is not exactly 32 bytes (sha256 output)
+   * 
+ * + * REQUIRE_32_BYTES = 7; + */ + REQUIRE_32_BYTES(7), + /** + *
+   * REQUIRE_64_BYTES is like NONE, but will fail if the input is not exactly 64 bytes (sha512 output)
+   * 
+ * + * REQUIRE_64_BYTES = 8; + */ + REQUIRE_64_BYTES(8), + UNRECOGNIZED(-1), + ; + + /** + *
+   * NO_PREFIX don't include any length info
+   * 
+ * + * NO_PREFIX = 0; + */ + public static final int NO_PREFIX_VALUE = 0; + /** + *
+   * VAR_PROTO uses protobuf (and go-amino) varint encoding of the length
+   * 
+ * + * VAR_PROTO = 1; + */ + public static final int VAR_PROTO_VALUE = 1; + /** + *
+   * VAR_RLP uses rlp int encoding of the length
+   * 
+ * + * VAR_RLP = 2; + */ + public static final int VAR_RLP_VALUE = 2; + /** + *
+   * FIXED32_BIG uses big-endian encoding of the length as a 32 bit integer
+   * 
+ * + * FIXED32_BIG = 3; + */ + public static final int FIXED32_BIG_VALUE = 3; + /** + *
+   * FIXED32_LITTLE uses little-endian encoding of the length as a 32 bit integer
+   * 
+ * + * FIXED32_LITTLE = 4; + */ + public static final int FIXED32_LITTLE_VALUE = 4; + /** + *
+   * FIXED64_BIG uses big-endian encoding of the length as a 64 bit integer
+   * 
+ * + * FIXED64_BIG = 5; + */ + public static final int FIXED64_BIG_VALUE = 5; + /** + *
+   * FIXED64_LITTLE uses little-endian encoding of the length as a 64 bit integer
+   * 
+ * + * FIXED64_LITTLE = 6; + */ + public static final int FIXED64_LITTLE_VALUE = 6; + /** + *
+   * REQUIRE_32_BYTES is like NONE, but will fail if the input is not exactly 32 bytes (sha256 output)
+   * 
+ * + * REQUIRE_32_BYTES = 7; + */ + public static final int REQUIRE_32_BYTES_VALUE = 7; + /** + *
+   * REQUIRE_64_BYTES is like NONE, but will fail if the input is not exactly 64 bytes (sha512 output)
+   * 
+ * + * REQUIRE_64_BYTES = 8; + */ + public static final int REQUIRE_64_BYTES_VALUE = 8; + + + @java.lang.Override + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static LengthOp valueOf(int value) { + return forNumber(value); + } + + public static LengthOp forNumber(int value) { + switch (value) { + case 0: return NO_PREFIX; + case 1: return VAR_PROTO; + case 2: return VAR_RLP; + case 3: return FIXED32_BIG; + case 4: return FIXED32_LITTLE; + case 5: return FIXED64_BIG; + case 6: return FIXED64_LITTLE; + case 7: return REQUIRE_32_BYTES; + case 8: return REQUIRE_64_BYTES; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + LengthOp> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + @java.lang.Override + public LengthOp findValueByNumber(int number) { + return LengthOp.forNumber(number); + } + }; + + public static com.google.protobuf.Internal.EnumVerifier + internalGetVerifier() { + return LengthOpVerifier.INSTANCE; + } + + private static final class LengthOpVerifier implements + com.google.protobuf.Internal.EnumVerifier { + static final com.google.protobuf.Internal.EnumVerifier INSTANCE = new LengthOpVerifier(); + @java.lang.Override + public boolean isInRange(int number) { + return LengthOp.forNumber(number) != null; + } + }; + + private final int value; + + private LengthOp(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:icon.proto.core.commitment.LengthOp) +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/MerklePath.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/MerklePath.java new file mode 100644 index 000000000..09f901354 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/MerklePath.java @@ -0,0 +1,382 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: core/23-commitment/commitment.proto + +package com.icon.proto.core.commitment; + +/** + *
+ * MerklePath is the path used to verify commitment proofs, which can be an
+ * arbitrary structured object (defined by a commitment type).
+ * MerklePath is represented from root-to-leaf
+ * 
+ * + * Protobuf type {@code icon.proto.core.commitment.MerklePath} + */ +public final class MerklePath extends + com.google.protobuf.GeneratedMessageLite< + MerklePath, MerklePath.Builder> implements + // @@protoc_insertion_point(message_implements:icon.proto.core.commitment.MerklePath) + MerklePathOrBuilder { + private MerklePath() { + keyPath_ = com.google.protobuf.GeneratedMessageLite.emptyProtobufList(); + } + public static final int KEY_PATH_FIELD_NUMBER = 1; + private com.google.protobuf.Internal.ProtobufList keyPath_; + /** + * repeated string key_path = 1 [json_name = "keyPath"]; + * @return A list containing the keyPath. + */ + @java.lang.Override + public java.util.List getKeyPathList() { + return keyPath_; + } + /** + * repeated string key_path = 1 [json_name = "keyPath"]; + * @return The count of keyPath. + */ + @java.lang.Override + public int getKeyPathCount() { + return keyPath_.size(); + } + /** + * repeated string key_path = 1 [json_name = "keyPath"]; + * @param index The index of the element to return. + * @return The keyPath at the given index. + */ + @java.lang.Override + public java.lang.String getKeyPath(int index) { + return keyPath_.get(index); + } + /** + * repeated string key_path = 1 [json_name = "keyPath"]; + * @param index The index of the value to return. + * @return The bytes of the keyPath at the given index. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getKeyPathBytes(int index) { + return com.google.protobuf.ByteString.copyFromUtf8( + keyPath_.get(index)); + } + private void ensureKeyPathIsMutable() { + com.google.protobuf.Internal.ProtobufList tmp = + keyPath_; if (!tmp.isModifiable()) { + keyPath_ = + com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp); + } + } + /** + * repeated string key_path = 1 [json_name = "keyPath"]; + * @param index The index to set the value at. + * @param value The keyPath to set. + */ + private void setKeyPath( + int index, java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + ensureKeyPathIsMutable(); + keyPath_.set(index, value); + } + /** + * repeated string key_path = 1 [json_name = "keyPath"]; + * @param value The keyPath to add. + */ + private void addKeyPath( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + ensureKeyPathIsMutable(); + keyPath_.add(value); + } + /** + * repeated string key_path = 1 [json_name = "keyPath"]; + * @param values The keyPath to add. + */ + private void addAllKeyPath( + java.lang.Iterable values) { + ensureKeyPathIsMutable(); + com.google.protobuf.AbstractMessageLite.addAll( + values, keyPath_); + } + /** + * repeated string key_path = 1 [json_name = "keyPath"]; + */ + private void clearKeyPath() { + keyPath_ = com.google.protobuf.GeneratedMessageLite.emptyProtobufList(); + } + /** + * repeated string key_path = 1 [json_name = "keyPath"]; + * @param value The bytes of the keyPath to add. + */ + private void addKeyPathBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + ensureKeyPathIsMutable(); + keyPath_.add(value.toStringUtf8()); + } + + public static com.icon.proto.core.commitment.MerklePath parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.commitment.MerklePath parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.commitment.MerklePath parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.commitment.MerklePath parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.commitment.MerklePath parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.commitment.MerklePath parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.commitment.MerklePath parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.commitment.MerklePath parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.icon.proto.core.commitment.MerklePath parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.commitment.MerklePath parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.icon.proto.core.commitment.MerklePath parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.commitment.MerklePath parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.icon.proto.core.commitment.MerklePath prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+   * MerklePath is the path used to verify commitment proofs, which can be an
+   * arbitrary structured object (defined by a commitment type).
+   * MerklePath is represented from root-to-leaf
+   * 
+ * + * Protobuf type {@code icon.proto.core.commitment.MerklePath} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.icon.proto.core.commitment.MerklePath, Builder> implements + // @@protoc_insertion_point(builder_implements:icon.proto.core.commitment.MerklePath) + com.icon.proto.core.commitment.MerklePathOrBuilder { + // Construct using com.icon.proto.core.commitment.MerklePath.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * repeated string key_path = 1 [json_name = "keyPath"]; + * @return A list containing the keyPath. + */ + @java.lang.Override + public java.util.List + getKeyPathList() { + return java.util.Collections.unmodifiableList( + instance.getKeyPathList()); + } + /** + * repeated string key_path = 1 [json_name = "keyPath"]; + * @return The count of keyPath. + */ + @java.lang.Override + public int getKeyPathCount() { + return instance.getKeyPathCount(); + } + /** + * repeated string key_path = 1 [json_name = "keyPath"]; + * @param index The index of the element to return. + * @return The keyPath at the given index. + */ + @java.lang.Override + public java.lang.String getKeyPath(int index) { + return instance.getKeyPath(index); + } + /** + * repeated string key_path = 1 [json_name = "keyPath"]; + * @param index The index of the value to return. + * @return The bytes of the keyPath at the given index. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getKeyPathBytes(int index) { + return instance.getKeyPathBytes(index); + } + /** + * repeated string key_path = 1 [json_name = "keyPath"]; + * @param index The index to set the value at. + * @param value The keyPath to set. + * @return This builder for chaining. + */ + public Builder setKeyPath( + int index, java.lang.String value) { + copyOnWrite(); + instance.setKeyPath(index, value); + return this; + } + /** + * repeated string key_path = 1 [json_name = "keyPath"]; + * @param value The keyPath to add. + * @return This builder for chaining. + */ + public Builder addKeyPath( + java.lang.String value) { + copyOnWrite(); + instance.addKeyPath(value); + return this; + } + /** + * repeated string key_path = 1 [json_name = "keyPath"]; + * @param values The keyPath to add. + * @return This builder for chaining. + */ + public Builder addAllKeyPath( + java.lang.Iterable values) { + copyOnWrite(); + instance.addAllKeyPath(values); + return this; + } + /** + * repeated string key_path = 1 [json_name = "keyPath"]; + * @return This builder for chaining. + */ + public Builder clearKeyPath() { + copyOnWrite(); + instance.clearKeyPath(); + return this; + } + /** + * repeated string key_path = 1 [json_name = "keyPath"]; + * @param value The bytes of the keyPath to add. + * @return This builder for chaining. + */ + public Builder addKeyPathBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.addKeyPathBytes(value); + return this; + } + + // @@protoc_insertion_point(builder_scope:icon.proto.core.commitment.MerklePath) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.icon.proto.core.commitment.MerklePath(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "keyPath_", + }; + java.lang.String info = + "\u0000\u0001\u0000\u0000\u0001\u0001\u0001\u0000\u0001\u0000\u0001\u021a"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.icon.proto.core.commitment.MerklePath.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:icon.proto.core.commitment.MerklePath) + private static final com.icon.proto.core.commitment.MerklePath DEFAULT_INSTANCE; + static { + MerklePath defaultInstance = new MerklePath(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + MerklePath.class, defaultInstance); + } + + public static com.icon.proto.core.commitment.MerklePath getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/MerklePathOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/MerklePathOrBuilder.java new file mode 100644 index 000000000..760474fda --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/MerklePathOrBuilder.java @@ -0,0 +1,34 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: core/23-commitment/commitment.proto + +package com.icon.proto.core.commitment; + +public interface MerklePathOrBuilder extends + // @@protoc_insertion_point(interface_extends:icon.proto.core.commitment.MerklePath) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * repeated string key_path = 1 [json_name = "keyPath"]; + * @return A list containing the keyPath. + */ + java.util.List + getKeyPathList(); + /** + * repeated string key_path = 1 [json_name = "keyPath"]; + * @return The count of keyPath. + */ + int getKeyPathCount(); + /** + * repeated string key_path = 1 [json_name = "keyPath"]; + * @param index The index of the element to return. + * @return The keyPath at the given index. + */ + java.lang.String getKeyPath(int index); + /** + * repeated string key_path = 1 [json_name = "keyPath"]; + * @param index The index of the element to return. + * @return The keyPath at the given index. + */ + com.google.protobuf.ByteString + getKeyPathBytes(int index); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/MerklePrefix.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/MerklePrefix.java new file mode 100644 index 000000000..8233dcc36 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/MerklePrefix.java @@ -0,0 +1,252 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: core/23-commitment/commitment.proto + +package com.icon.proto.core.commitment; + +/** + *
+ * MerklePrefix is merkle path prefixed to the key.
+ * The constructed key from the Path and the key will be append(Path.KeyPath,
+ * append(Path.KeyPrefix, key...))
+ * 
+ * + * Protobuf type {@code icon.proto.core.commitment.MerklePrefix} + */ +public final class MerklePrefix extends + com.google.protobuf.GeneratedMessageLite< + MerklePrefix, MerklePrefix.Builder> implements + // @@protoc_insertion_point(message_implements:icon.proto.core.commitment.MerklePrefix) + MerklePrefixOrBuilder { + private MerklePrefix() { + keyPrefix_ = com.google.protobuf.ByteString.EMPTY; + } + public static final int KEY_PREFIX_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString keyPrefix_; + /** + * bytes key_prefix = 1 [json_name = "keyPrefix"]; + * @return The keyPrefix. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKeyPrefix() { + return keyPrefix_; + } + /** + * bytes key_prefix = 1 [json_name = "keyPrefix"]; + * @param value The keyPrefix to set. + */ + private void setKeyPrefix(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + keyPrefix_ = value; + } + /** + * bytes key_prefix = 1 [json_name = "keyPrefix"]; + */ + private void clearKeyPrefix() { + + keyPrefix_ = getDefaultInstance().getKeyPrefix(); + } + + public static com.icon.proto.core.commitment.MerklePrefix parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.commitment.MerklePrefix parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.commitment.MerklePrefix parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.commitment.MerklePrefix parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.commitment.MerklePrefix parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.commitment.MerklePrefix parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.commitment.MerklePrefix parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.commitment.MerklePrefix parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.icon.proto.core.commitment.MerklePrefix parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.commitment.MerklePrefix parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.icon.proto.core.commitment.MerklePrefix parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.commitment.MerklePrefix parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.icon.proto.core.commitment.MerklePrefix prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+   * MerklePrefix is merkle path prefixed to the key.
+   * The constructed key from the Path and the key will be append(Path.KeyPath,
+   * append(Path.KeyPrefix, key...))
+   * 
+ * + * Protobuf type {@code icon.proto.core.commitment.MerklePrefix} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.icon.proto.core.commitment.MerklePrefix, Builder> implements + // @@protoc_insertion_point(builder_implements:icon.proto.core.commitment.MerklePrefix) + com.icon.proto.core.commitment.MerklePrefixOrBuilder { + // Construct using com.icon.proto.core.commitment.MerklePrefix.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * bytes key_prefix = 1 [json_name = "keyPrefix"]; + * @return The keyPrefix. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKeyPrefix() { + return instance.getKeyPrefix(); + } + /** + * bytes key_prefix = 1 [json_name = "keyPrefix"]; + * @param value The keyPrefix to set. + * @return This builder for chaining. + */ + public Builder setKeyPrefix(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setKeyPrefix(value); + return this; + } + /** + * bytes key_prefix = 1 [json_name = "keyPrefix"]; + * @return This builder for chaining. + */ + public Builder clearKeyPrefix() { + copyOnWrite(); + instance.clearKeyPrefix(); + return this; + } + + // @@protoc_insertion_point(builder_scope:icon.proto.core.commitment.MerklePrefix) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.icon.proto.core.commitment.MerklePrefix(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "keyPrefix_", + }; + java.lang.String info = + "\u0000\u0001\u0000\u0000\u0001\u0001\u0001\u0000\u0000\u0000\u0001\n"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.icon.proto.core.commitment.MerklePrefix.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:icon.proto.core.commitment.MerklePrefix) + private static final com.icon.proto.core.commitment.MerklePrefix DEFAULT_INSTANCE; + static { + MerklePrefix defaultInstance = new MerklePrefix(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + MerklePrefix.class, defaultInstance); + } + + public static com.icon.proto.core.commitment.MerklePrefix getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/MerklePrefixOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/MerklePrefixOrBuilder.java new file mode 100644 index 000000000..ca35d7683 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/MerklePrefixOrBuilder.java @@ -0,0 +1,15 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: core/23-commitment/commitment.proto + +package com.icon.proto.core.commitment; + +public interface MerklePrefixOrBuilder extends + // @@protoc_insertion_point(interface_extends:icon.proto.core.commitment.MerklePrefix) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * bytes key_prefix = 1 [json_name = "keyPrefix"]; + * @return The keyPrefix. + */ + com.google.protobuf.ByteString getKeyPrefix(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/MerkleProof.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/MerkleProof.java new file mode 100644 index 000000000..513ad20d3 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/MerkleProof.java @@ -0,0 +1,398 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: core/23-commitment/commitment.proto + +package com.icon.proto.core.commitment; + +/** + *
+ * MerkleProof is a wrapper type over a chain of CommitmentProofs.
+ * It demonstrates membership or non-membership for an element or set of
+ * elements, verifiable in conjunction with a known commitment root. Proofs
+ * should be succinct.
+ * MerkleProofs are ordered from leaf-to-root
+ * 
+ * + * Protobuf type {@code icon.proto.core.commitment.MerkleProof} + */ +public final class MerkleProof extends + com.google.protobuf.GeneratedMessageLite< + MerkleProof, MerkleProof.Builder> implements + // @@protoc_insertion_point(message_implements:icon.proto.core.commitment.MerkleProof) + MerkleProofOrBuilder { + private MerkleProof() { + proofs_ = emptyProtobufList(); + } + public static final int PROOFS_FIELD_NUMBER = 1; + private com.google.protobuf.Internal.ProtobufList proofs_; + /** + * repeated .icon.proto.core.commitment.CommitmentProof proofs = 1 [json_name = "proofs"]; + */ + @java.lang.Override + public java.util.List getProofsList() { + return proofs_; + } + /** + * repeated .icon.proto.core.commitment.CommitmentProof proofs = 1 [json_name = "proofs"]; + */ + public java.util.List + getProofsOrBuilderList() { + return proofs_; + } + /** + * repeated .icon.proto.core.commitment.CommitmentProof proofs = 1 [json_name = "proofs"]; + */ + @java.lang.Override + public int getProofsCount() { + return proofs_.size(); + } + /** + * repeated .icon.proto.core.commitment.CommitmentProof proofs = 1 [json_name = "proofs"]; + */ + @java.lang.Override + public com.icon.proto.core.commitment.CommitmentProof getProofs(int index) { + return proofs_.get(index); + } + /** + * repeated .icon.proto.core.commitment.CommitmentProof proofs = 1 [json_name = "proofs"]; + */ + public com.icon.proto.core.commitment.CommitmentProofOrBuilder getProofsOrBuilder( + int index) { + return proofs_.get(index); + } + private void ensureProofsIsMutable() { + com.google.protobuf.Internal.ProtobufList tmp = proofs_; + if (!tmp.isModifiable()) { + proofs_ = + com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp); + } + } + + /** + * repeated .icon.proto.core.commitment.CommitmentProof proofs = 1 [json_name = "proofs"]; + */ + private void setProofs( + int index, com.icon.proto.core.commitment.CommitmentProof value) { + value.getClass(); + ensureProofsIsMutable(); + proofs_.set(index, value); + } + /** + * repeated .icon.proto.core.commitment.CommitmentProof proofs = 1 [json_name = "proofs"]; + */ + private void addProofs(com.icon.proto.core.commitment.CommitmentProof value) { + value.getClass(); + ensureProofsIsMutable(); + proofs_.add(value); + } + /** + * repeated .icon.proto.core.commitment.CommitmentProof proofs = 1 [json_name = "proofs"]; + */ + private void addProofs( + int index, com.icon.proto.core.commitment.CommitmentProof value) { + value.getClass(); + ensureProofsIsMutable(); + proofs_.add(index, value); + } + /** + * repeated .icon.proto.core.commitment.CommitmentProof proofs = 1 [json_name = "proofs"]; + */ + private void addAllProofs( + java.lang.Iterable values) { + ensureProofsIsMutable(); + com.google.protobuf.AbstractMessageLite.addAll( + values, proofs_); + } + /** + * repeated .icon.proto.core.commitment.CommitmentProof proofs = 1 [json_name = "proofs"]; + */ + private void clearProofs() { + proofs_ = emptyProtobufList(); + } + /** + * repeated .icon.proto.core.commitment.CommitmentProof proofs = 1 [json_name = "proofs"]; + */ + private void removeProofs(int index) { + ensureProofsIsMutable(); + proofs_.remove(index); + } + + public static com.icon.proto.core.commitment.MerkleProof parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.commitment.MerkleProof parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.commitment.MerkleProof parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.commitment.MerkleProof parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.commitment.MerkleProof parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.commitment.MerkleProof parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.commitment.MerkleProof parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.commitment.MerkleProof parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.icon.proto.core.commitment.MerkleProof parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.commitment.MerkleProof parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.icon.proto.core.commitment.MerkleProof parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.commitment.MerkleProof parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.icon.proto.core.commitment.MerkleProof prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+   * MerkleProof is a wrapper type over a chain of CommitmentProofs.
+   * It demonstrates membership or non-membership for an element or set of
+   * elements, verifiable in conjunction with a known commitment root. Proofs
+   * should be succinct.
+   * MerkleProofs are ordered from leaf-to-root
+   * 
+ * + * Protobuf type {@code icon.proto.core.commitment.MerkleProof} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.icon.proto.core.commitment.MerkleProof, Builder> implements + // @@protoc_insertion_point(builder_implements:icon.proto.core.commitment.MerkleProof) + com.icon.proto.core.commitment.MerkleProofOrBuilder { + // Construct using com.icon.proto.core.commitment.MerkleProof.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * repeated .icon.proto.core.commitment.CommitmentProof proofs = 1 [json_name = "proofs"]; + */ + @java.lang.Override + public java.util.List getProofsList() { + return java.util.Collections.unmodifiableList( + instance.getProofsList()); + } + /** + * repeated .icon.proto.core.commitment.CommitmentProof proofs = 1 [json_name = "proofs"]; + */ + @java.lang.Override + public int getProofsCount() { + return instance.getProofsCount(); + }/** + * repeated .icon.proto.core.commitment.CommitmentProof proofs = 1 [json_name = "proofs"]; + */ + @java.lang.Override + public com.icon.proto.core.commitment.CommitmentProof getProofs(int index) { + return instance.getProofs(index); + } + /** + * repeated .icon.proto.core.commitment.CommitmentProof proofs = 1 [json_name = "proofs"]; + */ + public Builder setProofs( + int index, com.icon.proto.core.commitment.CommitmentProof value) { + copyOnWrite(); + instance.setProofs(index, value); + return this; + } + /** + * repeated .icon.proto.core.commitment.CommitmentProof proofs = 1 [json_name = "proofs"]; + */ + public Builder setProofs( + int index, com.icon.proto.core.commitment.CommitmentProof.Builder builderForValue) { + copyOnWrite(); + instance.setProofs(index, + builderForValue.build()); + return this; + } + /** + * repeated .icon.proto.core.commitment.CommitmentProof proofs = 1 [json_name = "proofs"]; + */ + public Builder addProofs(com.icon.proto.core.commitment.CommitmentProof value) { + copyOnWrite(); + instance.addProofs(value); + return this; + } + /** + * repeated .icon.proto.core.commitment.CommitmentProof proofs = 1 [json_name = "proofs"]; + */ + public Builder addProofs( + int index, com.icon.proto.core.commitment.CommitmentProof value) { + copyOnWrite(); + instance.addProofs(index, value); + return this; + } + /** + * repeated .icon.proto.core.commitment.CommitmentProof proofs = 1 [json_name = "proofs"]; + */ + public Builder addProofs( + com.icon.proto.core.commitment.CommitmentProof.Builder builderForValue) { + copyOnWrite(); + instance.addProofs(builderForValue.build()); + return this; + } + /** + * repeated .icon.proto.core.commitment.CommitmentProof proofs = 1 [json_name = "proofs"]; + */ + public Builder addProofs( + int index, com.icon.proto.core.commitment.CommitmentProof.Builder builderForValue) { + copyOnWrite(); + instance.addProofs(index, + builderForValue.build()); + return this; + } + /** + * repeated .icon.proto.core.commitment.CommitmentProof proofs = 1 [json_name = "proofs"]; + */ + public Builder addAllProofs( + java.lang.Iterable values) { + copyOnWrite(); + instance.addAllProofs(values); + return this; + } + /** + * repeated .icon.proto.core.commitment.CommitmentProof proofs = 1 [json_name = "proofs"]; + */ + public Builder clearProofs() { + copyOnWrite(); + instance.clearProofs(); + return this; + } + /** + * repeated .icon.proto.core.commitment.CommitmentProof proofs = 1 [json_name = "proofs"]; + */ + public Builder removeProofs(int index) { + copyOnWrite(); + instance.removeProofs(index); + return this; + } + + // @@protoc_insertion_point(builder_scope:icon.proto.core.commitment.MerkleProof) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.icon.proto.core.commitment.MerkleProof(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "proofs_", + com.icon.proto.core.commitment.CommitmentProof.class, + }; + java.lang.String info = + "\u0000\u0001\u0000\u0000\u0001\u0001\u0001\u0000\u0001\u0000\u0001\u001b"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.icon.proto.core.commitment.MerkleProof.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:icon.proto.core.commitment.MerkleProof) + private static final com.icon.proto.core.commitment.MerkleProof DEFAULT_INSTANCE; + static { + MerkleProof defaultInstance = new MerkleProof(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + MerkleProof.class, defaultInstance); + } + + public static com.icon.proto.core.commitment.MerkleProof getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/MerkleProofOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/MerkleProofOrBuilder.java new file mode 100644 index 000000000..d9bc04a70 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/MerkleProofOrBuilder.java @@ -0,0 +1,23 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: core/23-commitment/commitment.proto + +package com.icon.proto.core.commitment; + +public interface MerkleProofOrBuilder extends + // @@protoc_insertion_point(interface_extends:icon.proto.core.commitment.MerkleProof) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * repeated .icon.proto.core.commitment.CommitmentProof proofs = 1 [json_name = "proofs"]; + */ + java.util.List + getProofsList(); + /** + * repeated .icon.proto.core.commitment.CommitmentProof proofs = 1 [json_name = "proofs"]; + */ + com.icon.proto.core.commitment.CommitmentProof getProofs(int index); + /** + * repeated .icon.proto.core.commitment.CommitmentProof proofs = 1 [json_name = "proofs"]; + */ + int getProofsCount(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/MerkleRoot.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/MerkleRoot.java new file mode 100644 index 000000000..5a2fb6823 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/MerkleRoot.java @@ -0,0 +1,250 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: core/23-commitment/commitment.proto + +package com.icon.proto.core.commitment; + +/** + *
+ * MerkleRoot defines a merkle root hash.
+ * In the Cosmos SDK, the AppHash of a block header becomes the root.
+ * 
+ * + * Protobuf type {@code icon.proto.core.commitment.MerkleRoot} + */ +public final class MerkleRoot extends + com.google.protobuf.GeneratedMessageLite< + MerkleRoot, MerkleRoot.Builder> implements + // @@protoc_insertion_point(message_implements:icon.proto.core.commitment.MerkleRoot) + MerkleRootOrBuilder { + private MerkleRoot() { + hash_ = com.google.protobuf.ByteString.EMPTY; + } + public static final int HASH_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString hash_; + /** + * bytes hash = 1 [json_name = "hash"]; + * @return The hash. + */ + @java.lang.Override + public com.google.protobuf.ByteString getHash() { + return hash_; + } + /** + * bytes hash = 1 [json_name = "hash"]; + * @param value The hash to set. + */ + private void setHash(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + hash_ = value; + } + /** + * bytes hash = 1 [json_name = "hash"]; + */ + private void clearHash() { + + hash_ = getDefaultInstance().getHash(); + } + + public static com.icon.proto.core.commitment.MerkleRoot parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.commitment.MerkleRoot parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.commitment.MerkleRoot parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.commitment.MerkleRoot parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.commitment.MerkleRoot parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.commitment.MerkleRoot parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.commitment.MerkleRoot parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.commitment.MerkleRoot parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.icon.proto.core.commitment.MerkleRoot parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.commitment.MerkleRoot parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.icon.proto.core.commitment.MerkleRoot parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.commitment.MerkleRoot parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.icon.proto.core.commitment.MerkleRoot prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+   * MerkleRoot defines a merkle root hash.
+   * In the Cosmos SDK, the AppHash of a block header becomes the root.
+   * 
+ * + * Protobuf type {@code icon.proto.core.commitment.MerkleRoot} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.icon.proto.core.commitment.MerkleRoot, Builder> implements + // @@protoc_insertion_point(builder_implements:icon.proto.core.commitment.MerkleRoot) + com.icon.proto.core.commitment.MerkleRootOrBuilder { + // Construct using com.icon.proto.core.commitment.MerkleRoot.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * bytes hash = 1 [json_name = "hash"]; + * @return The hash. + */ + @java.lang.Override + public com.google.protobuf.ByteString getHash() { + return instance.getHash(); + } + /** + * bytes hash = 1 [json_name = "hash"]; + * @param value The hash to set. + * @return This builder for chaining. + */ + public Builder setHash(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setHash(value); + return this; + } + /** + * bytes hash = 1 [json_name = "hash"]; + * @return This builder for chaining. + */ + public Builder clearHash() { + copyOnWrite(); + instance.clearHash(); + return this; + } + + // @@protoc_insertion_point(builder_scope:icon.proto.core.commitment.MerkleRoot) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.icon.proto.core.commitment.MerkleRoot(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "hash_", + }; + java.lang.String info = + "\u0000\u0001\u0000\u0000\u0001\u0001\u0001\u0000\u0000\u0000\u0001\n"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.icon.proto.core.commitment.MerkleRoot.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:icon.proto.core.commitment.MerkleRoot) + private static final com.icon.proto.core.commitment.MerkleRoot DEFAULT_INSTANCE; + static { + MerkleRoot defaultInstance = new MerkleRoot(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + MerkleRoot.class, defaultInstance); + } + + public static com.icon.proto.core.commitment.MerkleRoot getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/MerkleRootOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/MerkleRootOrBuilder.java new file mode 100644 index 000000000..f7954abe9 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/MerkleRootOrBuilder.java @@ -0,0 +1,15 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: core/23-commitment/commitment.proto + +package com.icon.proto.core.commitment; + +public interface MerkleRootOrBuilder extends + // @@protoc_insertion_point(interface_extends:icon.proto.core.commitment.MerkleRoot) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * bytes hash = 1 [json_name = "hash"]; + * @return The hash. + */ + com.google.protobuf.ByteString getHash(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/NonExistenceProof.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/NonExistenceProof.java new file mode 100644 index 000000000..478694d77 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/NonExistenceProof.java @@ -0,0 +1,465 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: core/23-commitment/proofs.proto + +package com.icon.proto.core.commitment; + +/** + *
+ *NonExistenceProof takes a proof of two neighbors, one left of the desired key,
+ *one right of the desired key. If both proofs are valid AND they are neighbors,
+ *then there is no valid proof for the given key.
+ * 
+ * + * Protobuf type {@code icon.proto.core.commitment.NonExistenceProof} + */ +public final class NonExistenceProof extends + com.google.protobuf.GeneratedMessageLite< + NonExistenceProof, NonExistenceProof.Builder> implements + // @@protoc_insertion_point(message_implements:icon.proto.core.commitment.NonExistenceProof) + NonExistenceProofOrBuilder { + private NonExistenceProof() { + key_ = com.google.protobuf.ByteString.EMPTY; + } + public static final int KEY_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString key_; + /** + *
+   * TODO: remove this as unnecessary??? we prove a range
+   * 
+ * + * bytes key = 1 [json_name = "key"]; + * @return The key. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKey() { + return key_; + } + /** + *
+   * TODO: remove this as unnecessary??? we prove a range
+   * 
+ * + * bytes key = 1 [json_name = "key"]; + * @param value The key to set. + */ + private void setKey(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + key_ = value; + } + /** + *
+   * TODO: remove this as unnecessary??? we prove a range
+   * 
+ * + * bytes key = 1 [json_name = "key"]; + */ + private void clearKey() { + + key_ = getDefaultInstance().getKey(); + } + + public static final int LEFT_FIELD_NUMBER = 2; + private com.icon.proto.core.commitment.ExistenceProof left_; + /** + * .icon.proto.core.commitment.ExistenceProof left = 2 [json_name = "left"]; + */ + @java.lang.Override + public boolean hasLeft() { + return left_ != null; + } + /** + * .icon.proto.core.commitment.ExistenceProof left = 2 [json_name = "left"]; + */ + @java.lang.Override + public com.icon.proto.core.commitment.ExistenceProof getLeft() { + return left_ == null ? com.icon.proto.core.commitment.ExistenceProof.getDefaultInstance() : left_; + } + /** + * .icon.proto.core.commitment.ExistenceProof left = 2 [json_name = "left"]; + */ + private void setLeft(com.icon.proto.core.commitment.ExistenceProof value) { + value.getClass(); + left_ = value; + + } + /** + * .icon.proto.core.commitment.ExistenceProof left = 2 [json_name = "left"]; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeLeft(com.icon.proto.core.commitment.ExistenceProof value) { + value.getClass(); + if (left_ != null && + left_ != com.icon.proto.core.commitment.ExistenceProof.getDefaultInstance()) { + left_ = + com.icon.proto.core.commitment.ExistenceProof.newBuilder(left_).mergeFrom(value).buildPartial(); + } else { + left_ = value; + } + + } + /** + * .icon.proto.core.commitment.ExistenceProof left = 2 [json_name = "left"]; + */ + private void clearLeft() { left_ = null; + + } + + public static final int RIGHT_FIELD_NUMBER = 3; + private com.icon.proto.core.commitment.ExistenceProof right_; + /** + * .icon.proto.core.commitment.ExistenceProof right = 3 [json_name = "right"]; + */ + @java.lang.Override + public boolean hasRight() { + return right_ != null; + } + /** + * .icon.proto.core.commitment.ExistenceProof right = 3 [json_name = "right"]; + */ + @java.lang.Override + public com.icon.proto.core.commitment.ExistenceProof getRight() { + return right_ == null ? com.icon.proto.core.commitment.ExistenceProof.getDefaultInstance() : right_; + } + /** + * .icon.proto.core.commitment.ExistenceProof right = 3 [json_name = "right"]; + */ + private void setRight(com.icon.proto.core.commitment.ExistenceProof value) { + value.getClass(); + right_ = value; + + } + /** + * .icon.proto.core.commitment.ExistenceProof right = 3 [json_name = "right"]; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeRight(com.icon.proto.core.commitment.ExistenceProof value) { + value.getClass(); + if (right_ != null && + right_ != com.icon.proto.core.commitment.ExistenceProof.getDefaultInstance()) { + right_ = + com.icon.proto.core.commitment.ExistenceProof.newBuilder(right_).mergeFrom(value).buildPartial(); + } else { + right_ = value; + } + + } + /** + * .icon.proto.core.commitment.ExistenceProof right = 3 [json_name = "right"]; + */ + private void clearRight() { right_ = null; + + } + + public static com.icon.proto.core.commitment.NonExistenceProof parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.commitment.NonExistenceProof parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.commitment.NonExistenceProof parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.commitment.NonExistenceProof parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.commitment.NonExistenceProof parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.commitment.NonExistenceProof parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.commitment.NonExistenceProof parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.commitment.NonExistenceProof parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.icon.proto.core.commitment.NonExistenceProof parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.commitment.NonExistenceProof parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.icon.proto.core.commitment.NonExistenceProof parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.commitment.NonExistenceProof parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.icon.proto.core.commitment.NonExistenceProof prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+   *NonExistenceProof takes a proof of two neighbors, one left of the desired key,
+   *one right of the desired key. If both proofs are valid AND they are neighbors,
+   *then there is no valid proof for the given key.
+   * 
+ * + * Protobuf type {@code icon.proto.core.commitment.NonExistenceProof} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.icon.proto.core.commitment.NonExistenceProof, Builder> implements + // @@protoc_insertion_point(builder_implements:icon.proto.core.commitment.NonExistenceProof) + com.icon.proto.core.commitment.NonExistenceProofOrBuilder { + // Construct using com.icon.proto.core.commitment.NonExistenceProof.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + *
+     * TODO: remove this as unnecessary??? we prove a range
+     * 
+ * + * bytes key = 1 [json_name = "key"]; + * @return The key. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKey() { + return instance.getKey(); + } + /** + *
+     * TODO: remove this as unnecessary??? we prove a range
+     * 
+ * + * bytes key = 1 [json_name = "key"]; + * @param value The key to set. + * @return This builder for chaining. + */ + public Builder setKey(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setKey(value); + return this; + } + /** + *
+     * TODO: remove this as unnecessary??? we prove a range
+     * 
+ * + * bytes key = 1 [json_name = "key"]; + * @return This builder for chaining. + */ + public Builder clearKey() { + copyOnWrite(); + instance.clearKey(); + return this; + } + + /** + * .icon.proto.core.commitment.ExistenceProof left = 2 [json_name = "left"]; + */ + @java.lang.Override + public boolean hasLeft() { + return instance.hasLeft(); + } + /** + * .icon.proto.core.commitment.ExistenceProof left = 2 [json_name = "left"]; + */ + @java.lang.Override + public com.icon.proto.core.commitment.ExistenceProof getLeft() { + return instance.getLeft(); + } + /** + * .icon.proto.core.commitment.ExistenceProof left = 2 [json_name = "left"]; + */ + public Builder setLeft(com.icon.proto.core.commitment.ExistenceProof value) { + copyOnWrite(); + instance.setLeft(value); + return this; + } + /** + * .icon.proto.core.commitment.ExistenceProof left = 2 [json_name = "left"]; + */ + public Builder setLeft( + com.icon.proto.core.commitment.ExistenceProof.Builder builderForValue) { + copyOnWrite(); + instance.setLeft(builderForValue.build()); + return this; + } + /** + * .icon.proto.core.commitment.ExistenceProof left = 2 [json_name = "left"]; + */ + public Builder mergeLeft(com.icon.proto.core.commitment.ExistenceProof value) { + copyOnWrite(); + instance.mergeLeft(value); + return this; + } + /** + * .icon.proto.core.commitment.ExistenceProof left = 2 [json_name = "left"]; + */ + public Builder clearLeft() { copyOnWrite(); + instance.clearLeft(); + return this; + } + + /** + * .icon.proto.core.commitment.ExistenceProof right = 3 [json_name = "right"]; + */ + @java.lang.Override + public boolean hasRight() { + return instance.hasRight(); + } + /** + * .icon.proto.core.commitment.ExistenceProof right = 3 [json_name = "right"]; + */ + @java.lang.Override + public com.icon.proto.core.commitment.ExistenceProof getRight() { + return instance.getRight(); + } + /** + * .icon.proto.core.commitment.ExistenceProof right = 3 [json_name = "right"]; + */ + public Builder setRight(com.icon.proto.core.commitment.ExistenceProof value) { + copyOnWrite(); + instance.setRight(value); + return this; + } + /** + * .icon.proto.core.commitment.ExistenceProof right = 3 [json_name = "right"]; + */ + public Builder setRight( + com.icon.proto.core.commitment.ExistenceProof.Builder builderForValue) { + copyOnWrite(); + instance.setRight(builderForValue.build()); + return this; + } + /** + * .icon.proto.core.commitment.ExistenceProof right = 3 [json_name = "right"]; + */ + public Builder mergeRight(com.icon.proto.core.commitment.ExistenceProof value) { + copyOnWrite(); + instance.mergeRight(value); + return this; + } + /** + * .icon.proto.core.commitment.ExistenceProof right = 3 [json_name = "right"]; + */ + public Builder clearRight() { copyOnWrite(); + instance.clearRight(); + return this; + } + + // @@protoc_insertion_point(builder_scope:icon.proto.core.commitment.NonExistenceProof) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.icon.proto.core.commitment.NonExistenceProof(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "key_", + "left_", + "right_", + }; + java.lang.String info = + "\u0000\u0003\u0000\u0000\u0001\u0003\u0003\u0000\u0000\u0000\u0001\n\u0002\t\u0003" + + "\t"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.icon.proto.core.commitment.NonExistenceProof.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:icon.proto.core.commitment.NonExistenceProof) + private static final com.icon.proto.core.commitment.NonExistenceProof DEFAULT_INSTANCE; + static { + NonExistenceProof defaultInstance = new NonExistenceProof(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + NonExistenceProof.class, defaultInstance); + } + + public static com.icon.proto.core.commitment.NonExistenceProof getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/NonExistenceProofOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/NonExistenceProofOrBuilder.java new file mode 100644 index 000000000..9539514ef --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/NonExistenceProofOrBuilder.java @@ -0,0 +1,41 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: core/23-commitment/proofs.proto + +package com.icon.proto.core.commitment; + +public interface NonExistenceProofOrBuilder extends + // @@protoc_insertion_point(interface_extends:icon.proto.core.commitment.NonExistenceProof) + com.google.protobuf.MessageLiteOrBuilder { + + /** + *
+   * TODO: remove this as unnecessary??? we prove a range
+   * 
+ * + * bytes key = 1 [json_name = "key"]; + * @return The key. + */ + com.google.protobuf.ByteString getKey(); + + /** + * .icon.proto.core.commitment.ExistenceProof left = 2 [json_name = "left"]; + * @return Whether the left field is set. + */ + boolean hasLeft(); + /** + * .icon.proto.core.commitment.ExistenceProof left = 2 [json_name = "left"]; + * @return The left. + */ + com.icon.proto.core.commitment.ExistenceProof getLeft(); + + /** + * .icon.proto.core.commitment.ExistenceProof right = 3 [json_name = "right"]; + * @return Whether the right field is set. + */ + boolean hasRight(); + /** + * .icon.proto.core.commitment.ExistenceProof right = 3 [json_name = "right"]; + * @return The right. + */ + com.icon.proto.core.commitment.ExistenceProof getRight(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/ProofSpec.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/ProofSpec.java new file mode 100644 index 000000000..478a80ce8 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/ProofSpec.java @@ -0,0 +1,700 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: core/23-commitment/proofs.proto + +package com.icon.proto.core.commitment; + +/** + *
+ **
+ *ProofSpec defines what the expected parameters are for a given proof type.
+ *This can be stored in the client and used to validate any incoming proofs.
+ *verify(ProofSpec, Proof) -> Proof | Error
+ *As demonstrated in tests, if we don't fix the algorithm used to calculate the
+ *LeafHash for a given tree, there are many possible key-value pairs that can
+ *generate a given hash (by interpretting the preimage differently).
+ *We need this for proper security, requires client knows a priori what
+ *tree format server uses. But not in code, rather a configuration object.
+ * 
+ * + * Protobuf type {@code icon.proto.core.commitment.ProofSpec} + */ +public final class ProofSpec extends + com.google.protobuf.GeneratedMessageLite< + ProofSpec, ProofSpec.Builder> implements + // @@protoc_insertion_point(message_implements:icon.proto.core.commitment.ProofSpec) + ProofSpecOrBuilder { + private ProofSpec() { + } + public static final int LEAF_SPEC_FIELD_NUMBER = 1; + private com.icon.proto.core.commitment.LeafOp leafSpec_; + /** + *
+   * any field in the ExistenceProof must be the same as in this spec.
+   * except Prefix, which is just the first bytes of prefix (spec can be longer)
+   * 
+ * + * .icon.proto.core.commitment.LeafOp leaf_spec = 1 [json_name = "leafSpec"]; + */ + @java.lang.Override + public boolean hasLeafSpec() { + return leafSpec_ != null; + } + /** + *
+   * any field in the ExistenceProof must be the same as in this spec.
+   * except Prefix, which is just the first bytes of prefix (spec can be longer)
+   * 
+ * + * .icon.proto.core.commitment.LeafOp leaf_spec = 1 [json_name = "leafSpec"]; + */ + @java.lang.Override + public com.icon.proto.core.commitment.LeafOp getLeafSpec() { + return leafSpec_ == null ? com.icon.proto.core.commitment.LeafOp.getDefaultInstance() : leafSpec_; + } + /** + *
+   * any field in the ExistenceProof must be the same as in this spec.
+   * except Prefix, which is just the first bytes of prefix (spec can be longer)
+   * 
+ * + * .icon.proto.core.commitment.LeafOp leaf_spec = 1 [json_name = "leafSpec"]; + */ + private void setLeafSpec(com.icon.proto.core.commitment.LeafOp value) { + value.getClass(); + leafSpec_ = value; + + } + /** + *
+   * any field in the ExistenceProof must be the same as in this spec.
+   * except Prefix, which is just the first bytes of prefix (spec can be longer)
+   * 
+ * + * .icon.proto.core.commitment.LeafOp leaf_spec = 1 [json_name = "leafSpec"]; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeLeafSpec(com.icon.proto.core.commitment.LeafOp value) { + value.getClass(); + if (leafSpec_ != null && + leafSpec_ != com.icon.proto.core.commitment.LeafOp.getDefaultInstance()) { + leafSpec_ = + com.icon.proto.core.commitment.LeafOp.newBuilder(leafSpec_).mergeFrom(value).buildPartial(); + } else { + leafSpec_ = value; + } + + } + /** + *
+   * any field in the ExistenceProof must be the same as in this spec.
+   * except Prefix, which is just the first bytes of prefix (spec can be longer)
+   * 
+ * + * .icon.proto.core.commitment.LeafOp leaf_spec = 1 [json_name = "leafSpec"]; + */ + private void clearLeafSpec() { leafSpec_ = null; + + } + + public static final int INNER_SPEC_FIELD_NUMBER = 2; + private com.icon.proto.core.commitment.InnerSpec innerSpec_; + /** + * .icon.proto.core.commitment.InnerSpec inner_spec = 2 [json_name = "innerSpec"]; + */ + @java.lang.Override + public boolean hasInnerSpec() { + return innerSpec_ != null; + } + /** + * .icon.proto.core.commitment.InnerSpec inner_spec = 2 [json_name = "innerSpec"]; + */ + @java.lang.Override + public com.icon.proto.core.commitment.InnerSpec getInnerSpec() { + return innerSpec_ == null ? com.icon.proto.core.commitment.InnerSpec.getDefaultInstance() : innerSpec_; + } + /** + * .icon.proto.core.commitment.InnerSpec inner_spec = 2 [json_name = "innerSpec"]; + */ + private void setInnerSpec(com.icon.proto.core.commitment.InnerSpec value) { + value.getClass(); + innerSpec_ = value; + + } + /** + * .icon.proto.core.commitment.InnerSpec inner_spec = 2 [json_name = "innerSpec"]; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeInnerSpec(com.icon.proto.core.commitment.InnerSpec value) { + value.getClass(); + if (innerSpec_ != null && + innerSpec_ != com.icon.proto.core.commitment.InnerSpec.getDefaultInstance()) { + innerSpec_ = + com.icon.proto.core.commitment.InnerSpec.newBuilder(innerSpec_).mergeFrom(value).buildPartial(); + } else { + innerSpec_ = value; + } + + } + /** + * .icon.proto.core.commitment.InnerSpec inner_spec = 2 [json_name = "innerSpec"]; + */ + private void clearInnerSpec() { innerSpec_ = null; + + } + + public static final int MAX_DEPTH_FIELD_NUMBER = 3; + private int maxDepth_; + /** + *
+   * max_depth (if > 0) is the maximum number of InnerOps allowed (mainly for fixed-depth tries)
+   * 
+ * + * int32 max_depth = 3 [json_name = "maxDepth"]; + * @return The maxDepth. + */ + @java.lang.Override + public int getMaxDepth() { + return maxDepth_; + } + /** + *
+   * max_depth (if > 0) is the maximum number of InnerOps allowed (mainly for fixed-depth tries)
+   * 
+ * + * int32 max_depth = 3 [json_name = "maxDepth"]; + * @param value The maxDepth to set. + */ + private void setMaxDepth(int value) { + + maxDepth_ = value; + } + /** + *
+   * max_depth (if > 0) is the maximum number of InnerOps allowed (mainly for fixed-depth tries)
+   * 
+ * + * int32 max_depth = 3 [json_name = "maxDepth"]; + */ + private void clearMaxDepth() { + + maxDepth_ = 0; + } + + public static final int MIN_DEPTH_FIELD_NUMBER = 4; + private int minDepth_; + /** + *
+   * min_depth (if > 0) is the minimum number of InnerOps allowed (mainly for fixed-depth tries)
+   * 
+ * + * int32 min_depth = 4 [json_name = "minDepth"]; + * @return The minDepth. + */ + @java.lang.Override + public int getMinDepth() { + return minDepth_; + } + /** + *
+   * min_depth (if > 0) is the minimum number of InnerOps allowed (mainly for fixed-depth tries)
+   * 
+ * + * int32 min_depth = 4 [json_name = "minDepth"]; + * @param value The minDepth to set. + */ + private void setMinDepth(int value) { + + minDepth_ = value; + } + /** + *
+   * min_depth (if > 0) is the minimum number of InnerOps allowed (mainly for fixed-depth tries)
+   * 
+ * + * int32 min_depth = 4 [json_name = "minDepth"]; + */ + private void clearMinDepth() { + + minDepth_ = 0; + } + + public static final int PREHASH_KEY_BEFORE_COMPARISON_FIELD_NUMBER = 5; + private boolean prehashKeyBeforeComparison_; + /** + *
+   * prehash_key_before_comparison is a flag that indicates whether to use the
+   * prehash_key specified by LeafOp to compare lexical ordering of keys for
+   * non-existence proofs.
+   * 
+ * + * bool prehash_key_before_comparison = 5 [json_name = "prehashKeyBeforeComparison"]; + * @return The prehashKeyBeforeComparison. + */ + @java.lang.Override + public boolean getPrehashKeyBeforeComparison() { + return prehashKeyBeforeComparison_; + } + /** + *
+   * prehash_key_before_comparison is a flag that indicates whether to use the
+   * prehash_key specified by LeafOp to compare lexical ordering of keys for
+   * non-existence proofs.
+   * 
+ * + * bool prehash_key_before_comparison = 5 [json_name = "prehashKeyBeforeComparison"]; + * @param value The prehashKeyBeforeComparison to set. + */ + private void setPrehashKeyBeforeComparison(boolean value) { + + prehashKeyBeforeComparison_ = value; + } + /** + *
+   * prehash_key_before_comparison is a flag that indicates whether to use the
+   * prehash_key specified by LeafOp to compare lexical ordering of keys for
+   * non-existence proofs.
+   * 
+ * + * bool prehash_key_before_comparison = 5 [json_name = "prehashKeyBeforeComparison"]; + */ + private void clearPrehashKeyBeforeComparison() { + + prehashKeyBeforeComparison_ = false; + } + + public static com.icon.proto.core.commitment.ProofSpec parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.commitment.ProofSpec parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.commitment.ProofSpec parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.commitment.ProofSpec parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.commitment.ProofSpec parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.commitment.ProofSpec parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.commitment.ProofSpec parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.commitment.ProofSpec parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.icon.proto.core.commitment.ProofSpec parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.commitment.ProofSpec parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.icon.proto.core.commitment.ProofSpec parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.commitment.ProofSpec parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.icon.proto.core.commitment.ProofSpec prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+   **
+   *ProofSpec defines what the expected parameters are for a given proof type.
+   *This can be stored in the client and used to validate any incoming proofs.
+   *verify(ProofSpec, Proof) -> Proof | Error
+   *As demonstrated in tests, if we don't fix the algorithm used to calculate the
+   *LeafHash for a given tree, there are many possible key-value pairs that can
+   *generate a given hash (by interpretting the preimage differently).
+   *We need this for proper security, requires client knows a priori what
+   *tree format server uses. But not in code, rather a configuration object.
+   * 
+ * + * Protobuf type {@code icon.proto.core.commitment.ProofSpec} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.icon.proto.core.commitment.ProofSpec, Builder> implements + // @@protoc_insertion_point(builder_implements:icon.proto.core.commitment.ProofSpec) + com.icon.proto.core.commitment.ProofSpecOrBuilder { + // Construct using com.icon.proto.core.commitment.ProofSpec.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + *
+     * any field in the ExistenceProof must be the same as in this spec.
+     * except Prefix, which is just the first bytes of prefix (spec can be longer)
+     * 
+ * + * .icon.proto.core.commitment.LeafOp leaf_spec = 1 [json_name = "leafSpec"]; + */ + @java.lang.Override + public boolean hasLeafSpec() { + return instance.hasLeafSpec(); + } + /** + *
+     * any field in the ExistenceProof must be the same as in this spec.
+     * except Prefix, which is just the first bytes of prefix (spec can be longer)
+     * 
+ * + * .icon.proto.core.commitment.LeafOp leaf_spec = 1 [json_name = "leafSpec"]; + */ + @java.lang.Override + public com.icon.proto.core.commitment.LeafOp getLeafSpec() { + return instance.getLeafSpec(); + } + /** + *
+     * any field in the ExistenceProof must be the same as in this spec.
+     * except Prefix, which is just the first bytes of prefix (spec can be longer)
+     * 
+ * + * .icon.proto.core.commitment.LeafOp leaf_spec = 1 [json_name = "leafSpec"]; + */ + public Builder setLeafSpec(com.icon.proto.core.commitment.LeafOp value) { + copyOnWrite(); + instance.setLeafSpec(value); + return this; + } + /** + *
+     * any field in the ExistenceProof must be the same as in this spec.
+     * except Prefix, which is just the first bytes of prefix (spec can be longer)
+     * 
+ * + * .icon.proto.core.commitment.LeafOp leaf_spec = 1 [json_name = "leafSpec"]; + */ + public Builder setLeafSpec( + com.icon.proto.core.commitment.LeafOp.Builder builderForValue) { + copyOnWrite(); + instance.setLeafSpec(builderForValue.build()); + return this; + } + /** + *
+     * any field in the ExistenceProof must be the same as in this spec.
+     * except Prefix, which is just the first bytes of prefix (spec can be longer)
+     * 
+ * + * .icon.proto.core.commitment.LeafOp leaf_spec = 1 [json_name = "leafSpec"]; + */ + public Builder mergeLeafSpec(com.icon.proto.core.commitment.LeafOp value) { + copyOnWrite(); + instance.mergeLeafSpec(value); + return this; + } + /** + *
+     * any field in the ExistenceProof must be the same as in this spec.
+     * except Prefix, which is just the first bytes of prefix (spec can be longer)
+     * 
+ * + * .icon.proto.core.commitment.LeafOp leaf_spec = 1 [json_name = "leafSpec"]; + */ + public Builder clearLeafSpec() { copyOnWrite(); + instance.clearLeafSpec(); + return this; + } + + /** + * .icon.proto.core.commitment.InnerSpec inner_spec = 2 [json_name = "innerSpec"]; + */ + @java.lang.Override + public boolean hasInnerSpec() { + return instance.hasInnerSpec(); + } + /** + * .icon.proto.core.commitment.InnerSpec inner_spec = 2 [json_name = "innerSpec"]; + */ + @java.lang.Override + public com.icon.proto.core.commitment.InnerSpec getInnerSpec() { + return instance.getInnerSpec(); + } + /** + * .icon.proto.core.commitment.InnerSpec inner_spec = 2 [json_name = "innerSpec"]; + */ + public Builder setInnerSpec(com.icon.proto.core.commitment.InnerSpec value) { + copyOnWrite(); + instance.setInnerSpec(value); + return this; + } + /** + * .icon.proto.core.commitment.InnerSpec inner_spec = 2 [json_name = "innerSpec"]; + */ + public Builder setInnerSpec( + com.icon.proto.core.commitment.InnerSpec.Builder builderForValue) { + copyOnWrite(); + instance.setInnerSpec(builderForValue.build()); + return this; + } + /** + * .icon.proto.core.commitment.InnerSpec inner_spec = 2 [json_name = "innerSpec"]; + */ + public Builder mergeInnerSpec(com.icon.proto.core.commitment.InnerSpec value) { + copyOnWrite(); + instance.mergeInnerSpec(value); + return this; + } + /** + * .icon.proto.core.commitment.InnerSpec inner_spec = 2 [json_name = "innerSpec"]; + */ + public Builder clearInnerSpec() { copyOnWrite(); + instance.clearInnerSpec(); + return this; + } + + /** + *
+     * max_depth (if > 0) is the maximum number of InnerOps allowed (mainly for fixed-depth tries)
+     * 
+ * + * int32 max_depth = 3 [json_name = "maxDepth"]; + * @return The maxDepth. + */ + @java.lang.Override + public int getMaxDepth() { + return instance.getMaxDepth(); + } + /** + *
+     * max_depth (if > 0) is the maximum number of InnerOps allowed (mainly for fixed-depth tries)
+     * 
+ * + * int32 max_depth = 3 [json_name = "maxDepth"]; + * @param value The maxDepth to set. + * @return This builder for chaining. + */ + public Builder setMaxDepth(int value) { + copyOnWrite(); + instance.setMaxDepth(value); + return this; + } + /** + *
+     * max_depth (if > 0) is the maximum number of InnerOps allowed (mainly for fixed-depth tries)
+     * 
+ * + * int32 max_depth = 3 [json_name = "maxDepth"]; + * @return This builder for chaining. + */ + public Builder clearMaxDepth() { + copyOnWrite(); + instance.clearMaxDepth(); + return this; + } + + /** + *
+     * min_depth (if > 0) is the minimum number of InnerOps allowed (mainly for fixed-depth tries)
+     * 
+ * + * int32 min_depth = 4 [json_name = "minDepth"]; + * @return The minDepth. + */ + @java.lang.Override + public int getMinDepth() { + return instance.getMinDepth(); + } + /** + *
+     * min_depth (if > 0) is the minimum number of InnerOps allowed (mainly for fixed-depth tries)
+     * 
+ * + * int32 min_depth = 4 [json_name = "minDepth"]; + * @param value The minDepth to set. + * @return This builder for chaining. + */ + public Builder setMinDepth(int value) { + copyOnWrite(); + instance.setMinDepth(value); + return this; + } + /** + *
+     * min_depth (if > 0) is the minimum number of InnerOps allowed (mainly for fixed-depth tries)
+     * 
+ * + * int32 min_depth = 4 [json_name = "minDepth"]; + * @return This builder for chaining. + */ + public Builder clearMinDepth() { + copyOnWrite(); + instance.clearMinDepth(); + return this; + } + + /** + *
+     * prehash_key_before_comparison is a flag that indicates whether to use the
+     * prehash_key specified by LeafOp to compare lexical ordering of keys for
+     * non-existence proofs.
+     * 
+ * + * bool prehash_key_before_comparison = 5 [json_name = "prehashKeyBeforeComparison"]; + * @return The prehashKeyBeforeComparison. + */ + @java.lang.Override + public boolean getPrehashKeyBeforeComparison() { + return instance.getPrehashKeyBeforeComparison(); + } + /** + *
+     * prehash_key_before_comparison is a flag that indicates whether to use the
+     * prehash_key specified by LeafOp to compare lexical ordering of keys for
+     * non-existence proofs.
+     * 
+ * + * bool prehash_key_before_comparison = 5 [json_name = "prehashKeyBeforeComparison"]; + * @param value The prehashKeyBeforeComparison to set. + * @return This builder for chaining. + */ + public Builder setPrehashKeyBeforeComparison(boolean value) { + copyOnWrite(); + instance.setPrehashKeyBeforeComparison(value); + return this; + } + /** + *
+     * prehash_key_before_comparison is a flag that indicates whether to use the
+     * prehash_key specified by LeafOp to compare lexical ordering of keys for
+     * non-existence proofs.
+     * 
+ * + * bool prehash_key_before_comparison = 5 [json_name = "prehashKeyBeforeComparison"]; + * @return This builder for chaining. + */ + public Builder clearPrehashKeyBeforeComparison() { + copyOnWrite(); + instance.clearPrehashKeyBeforeComparison(); + return this; + } + + // @@protoc_insertion_point(builder_scope:icon.proto.core.commitment.ProofSpec) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.icon.proto.core.commitment.ProofSpec(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "leafSpec_", + "innerSpec_", + "maxDepth_", + "minDepth_", + "prehashKeyBeforeComparison_", + }; + java.lang.String info = + "\u0000\u0005\u0000\u0000\u0001\u0005\u0005\u0000\u0000\u0000\u0001\t\u0002\t\u0003" + + "\u0004\u0004\u0004\u0005\u0007"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.icon.proto.core.commitment.ProofSpec.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:icon.proto.core.commitment.ProofSpec) + private static final com.icon.proto.core.commitment.ProofSpec DEFAULT_INSTANCE; + static { + ProofSpec defaultInstance = new ProofSpec(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + ProofSpec.class, defaultInstance); + } + + public static com.icon.proto.core.commitment.ProofSpec getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/ProofSpecOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/ProofSpecOrBuilder.java new file mode 100644 index 000000000..1173b9a69 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/ProofSpecOrBuilder.java @@ -0,0 +1,73 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: core/23-commitment/proofs.proto + +package com.icon.proto.core.commitment; + +public interface ProofSpecOrBuilder extends + // @@protoc_insertion_point(interface_extends:icon.proto.core.commitment.ProofSpec) + com.google.protobuf.MessageLiteOrBuilder { + + /** + *
+   * any field in the ExistenceProof must be the same as in this spec.
+   * except Prefix, which is just the first bytes of prefix (spec can be longer)
+   * 
+ * + * .icon.proto.core.commitment.LeafOp leaf_spec = 1 [json_name = "leafSpec"]; + * @return Whether the leafSpec field is set. + */ + boolean hasLeafSpec(); + /** + *
+   * any field in the ExistenceProof must be the same as in this spec.
+   * except Prefix, which is just the first bytes of prefix (spec can be longer)
+   * 
+ * + * .icon.proto.core.commitment.LeafOp leaf_spec = 1 [json_name = "leafSpec"]; + * @return The leafSpec. + */ + com.icon.proto.core.commitment.LeafOp getLeafSpec(); + + /** + * .icon.proto.core.commitment.InnerSpec inner_spec = 2 [json_name = "innerSpec"]; + * @return Whether the innerSpec field is set. + */ + boolean hasInnerSpec(); + /** + * .icon.proto.core.commitment.InnerSpec inner_spec = 2 [json_name = "innerSpec"]; + * @return The innerSpec. + */ + com.icon.proto.core.commitment.InnerSpec getInnerSpec(); + + /** + *
+   * max_depth (if > 0) is the maximum number of InnerOps allowed (mainly for fixed-depth tries)
+   * 
+ * + * int32 max_depth = 3 [json_name = "maxDepth"]; + * @return The maxDepth. + */ + int getMaxDepth(); + + /** + *
+   * min_depth (if > 0) is the minimum number of InnerOps allowed (mainly for fixed-depth tries)
+   * 
+ * + * int32 min_depth = 4 [json_name = "minDepth"]; + * @return The minDepth. + */ + int getMinDepth(); + + /** + *
+   * prehash_key_before_comparison is a flag that indicates whether to use the
+   * prehash_key specified by LeafOp to compare lexical ordering of keys for
+   * non-existence proofs.
+   * 
+ * + * bool prehash_key_before_comparison = 5 [json_name = "prehashKeyBeforeComparison"]; + * @return The prehashKeyBeforeComparison. + */ + boolean getPrehashKeyBeforeComparison(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/ProofsProto.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/ProofsProto.java new file mode 100644 index 000000000..cf5805e54 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/ProofsProto.java @@ -0,0 +1,16 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: core/23-commitment/proofs.proto + +package com.icon.proto.core.commitment; + +public final class ProofsProto { + private ProofsProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + static { + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/connection/ConnectionEnd.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/connection/ConnectionEnd.java new file mode 100644 index 000000000..6b9d9ea43 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/connection/ConnectionEnd.java @@ -0,0 +1,1154 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: core/03-connection/Connection.proto + +package com.icon.proto.core.connection; + +/** + *
+ * ConnectionEnd defines a stateful object on a chain connected to another
+ * separate one.
+ * NOTE: there must only be 2 defined ConnectionEnds to establish
+ * a connection between two chains.
+ * 
+ * + * Protobuf type {@code icon.proto.core.connection.ConnectionEnd} + */ +public final class ConnectionEnd extends + com.google.protobuf.GeneratedMessageLite< + ConnectionEnd, ConnectionEnd.Builder> implements + // @@protoc_insertion_point(message_implements:icon.proto.core.connection.ConnectionEnd) + ConnectionEndOrBuilder { + private ConnectionEnd() { + clientId_ = ""; + versions_ = emptyProtobufList(); + } + /** + *
+   * State defines if a connection is in one of the following states:
+   * INIT, TRYOPEN, OPEN or UNINITIALIZED.
+   * 
+ * + * Protobuf enum {@code icon.proto.core.connection.ConnectionEnd.State} + */ + public enum State + implements com.google.protobuf.Internal.EnumLite { + /** + *
+     * Default State
+     * 
+ * + * STATE_UNINITIALIZED_UNSPECIFIED = 0; + */ + STATE_UNINITIALIZED_UNSPECIFIED(0), + /** + *
+     * A connection end has just started the opening handshake.
+     * 
+ * + * STATE_INIT = 1; + */ + STATE_INIT(1), + /** + *
+     * A connection end has acknowledged the handshake step on the counterparty
+     * chain.
+     * 
+ * + * STATE_TRYOPEN = 2; + */ + STATE_TRYOPEN(2), + /** + *
+     * A connection end has completed the handshake.
+     * 
+ * + * STATE_OPEN = 3; + */ + STATE_OPEN(3), + UNRECOGNIZED(-1), + ; + + /** + *
+     * Default State
+     * 
+ * + * STATE_UNINITIALIZED_UNSPECIFIED = 0; + */ + public static final int STATE_UNINITIALIZED_UNSPECIFIED_VALUE = 0; + /** + *
+     * A connection end has just started the opening handshake.
+     * 
+ * + * STATE_INIT = 1; + */ + public static final int STATE_INIT_VALUE = 1; + /** + *
+     * A connection end has acknowledged the handshake step on the counterparty
+     * chain.
+     * 
+ * + * STATE_TRYOPEN = 2; + */ + public static final int STATE_TRYOPEN_VALUE = 2; + /** + *
+     * A connection end has completed the handshake.
+     * 
+ * + * STATE_OPEN = 3; + */ + public static final int STATE_OPEN_VALUE = 3; + + + @java.lang.Override + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static State valueOf(int value) { + return forNumber(value); + } + + public static State forNumber(int value) { + switch (value) { + case 0: return STATE_UNINITIALIZED_UNSPECIFIED; + case 1: return STATE_INIT; + case 2: return STATE_TRYOPEN; + case 3: return STATE_OPEN; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + State> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + @java.lang.Override + public State findValueByNumber(int number) { + return State.forNumber(number); + } + }; + + public static com.google.protobuf.Internal.EnumVerifier + internalGetVerifier() { + return StateVerifier.INSTANCE; + } + + private static final class StateVerifier implements + com.google.protobuf.Internal.EnumVerifier { + static final com.google.protobuf.Internal.EnumVerifier INSTANCE = new StateVerifier(); + @java.lang.Override + public boolean isInRange(int number) { + return State.forNumber(number) != null; + } + }; + + private final int value; + + private State(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:icon.proto.core.connection.ConnectionEnd.State) + } + + public static final int CLIENT_ID_FIELD_NUMBER = 1; + private java.lang.String clientId_; + /** + *
+   * client associated with this connection.
+   * 
+ * + * string client_id = 1 [json_name = "clientId"]; + * @return The clientId. + */ + @java.lang.Override + public java.lang.String getClientId() { + return clientId_; + } + /** + *
+   * client associated with this connection.
+   * 
+ * + * string client_id = 1 [json_name = "clientId"]; + * @return The bytes for clientId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getClientIdBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(clientId_); + } + /** + *
+   * client associated with this connection.
+   * 
+ * + * string client_id = 1 [json_name = "clientId"]; + * @param value The clientId to set. + */ + private void setClientId( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + clientId_ = value; + } + /** + *
+   * client associated with this connection.
+   * 
+ * + * string client_id = 1 [json_name = "clientId"]; + */ + private void clearClientId() { + + clientId_ = getDefaultInstance().getClientId(); + } + /** + *
+   * client associated with this connection.
+   * 
+ * + * string client_id = 1 [json_name = "clientId"]; + * @param value The bytes for clientId to set. + */ + private void setClientIdBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + clientId_ = value.toStringUtf8(); + + } + + public static final int VERSIONS_FIELD_NUMBER = 2; + private com.google.protobuf.Internal.ProtobufList versions_; + /** + *
+   * IBC version which can be utilised to determine encodings or protocols for
+   * channels or packets utilising this connection.
+   * 
+ * + * repeated .icon.proto.core.connection.Version versions = 2 [json_name = "versions"]; + */ + @java.lang.Override + public java.util.List getVersionsList() { + return versions_; + } + /** + *
+   * IBC version which can be utilised to determine encodings or protocols for
+   * channels or packets utilising this connection.
+   * 
+ * + * repeated .icon.proto.core.connection.Version versions = 2 [json_name = "versions"]; + */ + public java.util.List + getVersionsOrBuilderList() { + return versions_; + } + /** + *
+   * IBC version which can be utilised to determine encodings or protocols for
+   * channels or packets utilising this connection.
+   * 
+ * + * repeated .icon.proto.core.connection.Version versions = 2 [json_name = "versions"]; + */ + @java.lang.Override + public int getVersionsCount() { + return versions_.size(); + } + /** + *
+   * IBC version which can be utilised to determine encodings or protocols for
+   * channels or packets utilising this connection.
+   * 
+ * + * repeated .icon.proto.core.connection.Version versions = 2 [json_name = "versions"]; + */ + @java.lang.Override + public com.icon.proto.core.connection.Version getVersions(int index) { + return versions_.get(index); + } + /** + *
+   * IBC version which can be utilised to determine encodings or protocols for
+   * channels or packets utilising this connection.
+   * 
+ * + * repeated .icon.proto.core.connection.Version versions = 2 [json_name = "versions"]; + */ + public com.icon.proto.core.connection.VersionOrBuilder getVersionsOrBuilder( + int index) { + return versions_.get(index); + } + private void ensureVersionsIsMutable() { + com.google.protobuf.Internal.ProtobufList tmp = versions_; + if (!tmp.isModifiable()) { + versions_ = + com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp); + } + } + + /** + *
+   * IBC version which can be utilised to determine encodings or protocols for
+   * channels or packets utilising this connection.
+   * 
+ * + * repeated .icon.proto.core.connection.Version versions = 2 [json_name = "versions"]; + */ + private void setVersions( + int index, com.icon.proto.core.connection.Version value) { + value.getClass(); + ensureVersionsIsMutable(); + versions_.set(index, value); + } + /** + *
+   * IBC version which can be utilised to determine encodings or protocols for
+   * channels or packets utilising this connection.
+   * 
+ * + * repeated .icon.proto.core.connection.Version versions = 2 [json_name = "versions"]; + */ + private void addVersions(com.icon.proto.core.connection.Version value) { + value.getClass(); + ensureVersionsIsMutable(); + versions_.add(value); + } + /** + *
+   * IBC version which can be utilised to determine encodings or protocols for
+   * channels or packets utilising this connection.
+   * 
+ * + * repeated .icon.proto.core.connection.Version versions = 2 [json_name = "versions"]; + */ + private void addVersions( + int index, com.icon.proto.core.connection.Version value) { + value.getClass(); + ensureVersionsIsMutable(); + versions_.add(index, value); + } + /** + *
+   * IBC version which can be utilised to determine encodings or protocols for
+   * channels or packets utilising this connection.
+   * 
+ * + * repeated .icon.proto.core.connection.Version versions = 2 [json_name = "versions"]; + */ + private void addAllVersions( + java.lang.Iterable values) { + ensureVersionsIsMutable(); + com.google.protobuf.AbstractMessageLite.addAll( + values, versions_); + } + /** + *
+   * IBC version which can be utilised to determine encodings or protocols for
+   * channels or packets utilising this connection.
+   * 
+ * + * repeated .icon.proto.core.connection.Version versions = 2 [json_name = "versions"]; + */ + private void clearVersions() { + versions_ = emptyProtobufList(); + } + /** + *
+   * IBC version which can be utilised to determine encodings or protocols for
+   * channels or packets utilising this connection.
+   * 
+ * + * repeated .icon.proto.core.connection.Version versions = 2 [json_name = "versions"]; + */ + private void removeVersions(int index) { + ensureVersionsIsMutable(); + versions_.remove(index); + } + + public static final int STATE_FIELD_NUMBER = 3; + private int state_; + /** + *
+   * current state of the connection end.
+   * 
+ * + * .icon.proto.core.connection.ConnectionEnd.State state = 3 [json_name = "state"]; + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + *
+   * current state of the connection end.
+   * 
+ * + * .icon.proto.core.connection.ConnectionEnd.State state = 3 [json_name = "state"]; + * @return The state. + */ + @java.lang.Override + public com.icon.proto.core.connection.ConnectionEnd.State getState() { + com.icon.proto.core.connection.ConnectionEnd.State result = com.icon.proto.core.connection.ConnectionEnd.State.forNumber(state_); + return result == null ? com.icon.proto.core.connection.ConnectionEnd.State.UNRECOGNIZED : result; + } + /** + *
+   * current state of the connection end.
+   * 
+ * + * .icon.proto.core.connection.ConnectionEnd.State state = 3 [json_name = "state"]; + * @param value The enum numeric value on the wire for state to set. + */ + private void setStateValue(int value) { + state_ = value; + } + /** + *
+   * current state of the connection end.
+   * 
+ * + * .icon.proto.core.connection.ConnectionEnd.State state = 3 [json_name = "state"]; + * @param value The state to set. + */ + private void setState(com.icon.proto.core.connection.ConnectionEnd.State value) { + state_ = value.getNumber(); + + } + /** + *
+   * current state of the connection end.
+   * 
+ * + * .icon.proto.core.connection.ConnectionEnd.State state = 3 [json_name = "state"]; + */ + private void clearState() { + + state_ = 0; + } + + public static final int COUNTERPARTY_FIELD_NUMBER = 4; + private com.icon.proto.core.connection.Counterparty counterparty_; + /** + *
+   * counterparty chain associated with this connection.
+   * 
+ * + * .icon.proto.core.connection.Counterparty counterparty = 4 [json_name = "counterparty"]; + */ + @java.lang.Override + public boolean hasCounterparty() { + return counterparty_ != null; + } + /** + *
+   * counterparty chain associated with this connection.
+   * 
+ * + * .icon.proto.core.connection.Counterparty counterparty = 4 [json_name = "counterparty"]; + */ + @java.lang.Override + public com.icon.proto.core.connection.Counterparty getCounterparty() { + return counterparty_ == null ? com.icon.proto.core.connection.Counterparty.getDefaultInstance() : counterparty_; + } + /** + *
+   * counterparty chain associated with this connection.
+   * 
+ * + * .icon.proto.core.connection.Counterparty counterparty = 4 [json_name = "counterparty"]; + */ + private void setCounterparty(com.icon.proto.core.connection.Counterparty value) { + value.getClass(); + counterparty_ = value; + + } + /** + *
+   * counterparty chain associated with this connection.
+   * 
+ * + * .icon.proto.core.connection.Counterparty counterparty = 4 [json_name = "counterparty"]; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeCounterparty(com.icon.proto.core.connection.Counterparty value) { + value.getClass(); + if (counterparty_ != null && + counterparty_ != com.icon.proto.core.connection.Counterparty.getDefaultInstance()) { + counterparty_ = + com.icon.proto.core.connection.Counterparty.newBuilder(counterparty_).mergeFrom(value).buildPartial(); + } else { + counterparty_ = value; + } + + } + /** + *
+   * counterparty chain associated with this connection.
+   * 
+ * + * .icon.proto.core.connection.Counterparty counterparty = 4 [json_name = "counterparty"]; + */ + private void clearCounterparty() { counterparty_ = null; + + } + + public static final int DELAY_PERIOD_FIELD_NUMBER = 5; + private long delayPeriod_; + /** + *
+   * delay period that must pass before a consensus state can be used for
+   * packet-verification NOTE: delay period logic is only implemented by some
+   * clients.
+   * 
+ * + * uint64 delay_period = 5 [json_name = "delayPeriod"]; + * @return The delayPeriod. + */ + @java.lang.Override + public long getDelayPeriod() { + return delayPeriod_; + } + /** + *
+   * delay period that must pass before a consensus state can be used for
+   * packet-verification NOTE: delay period logic is only implemented by some
+   * clients.
+   * 
+ * + * uint64 delay_period = 5 [json_name = "delayPeriod"]; + * @param value The delayPeriod to set. + */ + private void setDelayPeriod(long value) { + + delayPeriod_ = value; + } + /** + *
+   * delay period that must pass before a consensus state can be used for
+   * packet-verification NOTE: delay period logic is only implemented by some
+   * clients.
+   * 
+ * + * uint64 delay_period = 5 [json_name = "delayPeriod"]; + */ + private void clearDelayPeriod() { + + delayPeriod_ = 0L; + } + + public static com.icon.proto.core.connection.ConnectionEnd parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.connection.ConnectionEnd parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.connection.ConnectionEnd parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.connection.ConnectionEnd parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.connection.ConnectionEnd parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.connection.ConnectionEnd parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.connection.ConnectionEnd parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.connection.ConnectionEnd parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.icon.proto.core.connection.ConnectionEnd parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.connection.ConnectionEnd parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.icon.proto.core.connection.ConnectionEnd parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.connection.ConnectionEnd parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.icon.proto.core.connection.ConnectionEnd prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+   * ConnectionEnd defines a stateful object on a chain connected to another
+   * separate one.
+   * NOTE: there must only be 2 defined ConnectionEnds to establish
+   * a connection between two chains.
+   * 
+ * + * Protobuf type {@code icon.proto.core.connection.ConnectionEnd} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.icon.proto.core.connection.ConnectionEnd, Builder> implements + // @@protoc_insertion_point(builder_implements:icon.proto.core.connection.ConnectionEnd) + com.icon.proto.core.connection.ConnectionEndOrBuilder { + // Construct using com.icon.proto.core.connection.ConnectionEnd.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + *
+     * client associated with this connection.
+     * 
+ * + * string client_id = 1 [json_name = "clientId"]; + * @return The clientId. + */ + @java.lang.Override + public java.lang.String getClientId() { + return instance.getClientId(); + } + /** + *
+     * client associated with this connection.
+     * 
+ * + * string client_id = 1 [json_name = "clientId"]; + * @return The bytes for clientId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getClientIdBytes() { + return instance.getClientIdBytes(); + } + /** + *
+     * client associated with this connection.
+     * 
+ * + * string client_id = 1 [json_name = "clientId"]; + * @param value The clientId to set. + * @return This builder for chaining. + */ + public Builder setClientId( + java.lang.String value) { + copyOnWrite(); + instance.setClientId(value); + return this; + } + /** + *
+     * client associated with this connection.
+     * 
+ * + * string client_id = 1 [json_name = "clientId"]; + * @return This builder for chaining. + */ + public Builder clearClientId() { + copyOnWrite(); + instance.clearClientId(); + return this; + } + /** + *
+     * client associated with this connection.
+     * 
+ * + * string client_id = 1 [json_name = "clientId"]; + * @param value The bytes for clientId to set. + * @return This builder for chaining. + */ + public Builder setClientIdBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setClientIdBytes(value); + return this; + } + + /** + *
+     * IBC version which can be utilised to determine encodings or protocols for
+     * channels or packets utilising this connection.
+     * 
+ * + * repeated .icon.proto.core.connection.Version versions = 2 [json_name = "versions"]; + */ + @java.lang.Override + public java.util.List getVersionsList() { + return java.util.Collections.unmodifiableList( + instance.getVersionsList()); + } + /** + *
+     * IBC version which can be utilised to determine encodings or protocols for
+     * channels or packets utilising this connection.
+     * 
+ * + * repeated .icon.proto.core.connection.Version versions = 2 [json_name = "versions"]; + */ + @java.lang.Override + public int getVersionsCount() { + return instance.getVersionsCount(); + }/** + *
+     * IBC version which can be utilised to determine encodings or protocols for
+     * channels or packets utilising this connection.
+     * 
+ * + * repeated .icon.proto.core.connection.Version versions = 2 [json_name = "versions"]; + */ + @java.lang.Override + public com.icon.proto.core.connection.Version getVersions(int index) { + return instance.getVersions(index); + } + /** + *
+     * IBC version which can be utilised to determine encodings or protocols for
+     * channels or packets utilising this connection.
+     * 
+ * + * repeated .icon.proto.core.connection.Version versions = 2 [json_name = "versions"]; + */ + public Builder setVersions( + int index, com.icon.proto.core.connection.Version value) { + copyOnWrite(); + instance.setVersions(index, value); + return this; + } + /** + *
+     * IBC version which can be utilised to determine encodings or protocols for
+     * channels or packets utilising this connection.
+     * 
+ * + * repeated .icon.proto.core.connection.Version versions = 2 [json_name = "versions"]; + */ + public Builder setVersions( + int index, com.icon.proto.core.connection.Version.Builder builderForValue) { + copyOnWrite(); + instance.setVersions(index, + builderForValue.build()); + return this; + } + /** + *
+     * IBC version which can be utilised to determine encodings or protocols for
+     * channels or packets utilising this connection.
+     * 
+ * + * repeated .icon.proto.core.connection.Version versions = 2 [json_name = "versions"]; + */ + public Builder addVersions(com.icon.proto.core.connection.Version value) { + copyOnWrite(); + instance.addVersions(value); + return this; + } + /** + *
+     * IBC version which can be utilised to determine encodings or protocols for
+     * channels or packets utilising this connection.
+     * 
+ * + * repeated .icon.proto.core.connection.Version versions = 2 [json_name = "versions"]; + */ + public Builder addVersions( + int index, com.icon.proto.core.connection.Version value) { + copyOnWrite(); + instance.addVersions(index, value); + return this; + } + /** + *
+     * IBC version which can be utilised to determine encodings or protocols for
+     * channels or packets utilising this connection.
+     * 
+ * + * repeated .icon.proto.core.connection.Version versions = 2 [json_name = "versions"]; + */ + public Builder addVersions( + com.icon.proto.core.connection.Version.Builder builderForValue) { + copyOnWrite(); + instance.addVersions(builderForValue.build()); + return this; + } + /** + *
+     * IBC version which can be utilised to determine encodings or protocols for
+     * channels or packets utilising this connection.
+     * 
+ * + * repeated .icon.proto.core.connection.Version versions = 2 [json_name = "versions"]; + */ + public Builder addVersions( + int index, com.icon.proto.core.connection.Version.Builder builderForValue) { + copyOnWrite(); + instance.addVersions(index, + builderForValue.build()); + return this; + } + /** + *
+     * IBC version which can be utilised to determine encodings or protocols for
+     * channels or packets utilising this connection.
+     * 
+ * + * repeated .icon.proto.core.connection.Version versions = 2 [json_name = "versions"]; + */ + public Builder addAllVersions( + java.lang.Iterable values) { + copyOnWrite(); + instance.addAllVersions(values); + return this; + } + /** + *
+     * IBC version which can be utilised to determine encodings or protocols for
+     * channels or packets utilising this connection.
+     * 
+ * + * repeated .icon.proto.core.connection.Version versions = 2 [json_name = "versions"]; + */ + public Builder clearVersions() { + copyOnWrite(); + instance.clearVersions(); + return this; + } + /** + *
+     * IBC version which can be utilised to determine encodings or protocols for
+     * channels or packets utilising this connection.
+     * 
+ * + * repeated .icon.proto.core.connection.Version versions = 2 [json_name = "versions"]; + */ + public Builder removeVersions(int index) { + copyOnWrite(); + instance.removeVersions(index); + return this; + } + + /** + *
+     * current state of the connection end.
+     * 
+ * + * .icon.proto.core.connection.ConnectionEnd.State state = 3 [json_name = "state"]; + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return instance.getStateValue(); + } + /** + *
+     * current state of the connection end.
+     * 
+ * + * .icon.proto.core.connection.ConnectionEnd.State state = 3 [json_name = "state"]; + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setStateValue(int value) { + copyOnWrite(); + instance.setStateValue(value); + return this; + } + /** + *
+     * current state of the connection end.
+     * 
+ * + * .icon.proto.core.connection.ConnectionEnd.State state = 3 [json_name = "state"]; + * @return The state. + */ + @java.lang.Override + public com.icon.proto.core.connection.ConnectionEnd.State getState() { + return instance.getState(); + } + /** + *
+     * current state of the connection end.
+     * 
+ * + * .icon.proto.core.connection.ConnectionEnd.State state = 3 [json_name = "state"]; + * @param value The enum numeric value on the wire for state to set. + * @return This builder for chaining. + */ + public Builder setState(com.icon.proto.core.connection.ConnectionEnd.State value) { + copyOnWrite(); + instance.setState(value); + return this; + } + /** + *
+     * current state of the connection end.
+     * 
+ * + * .icon.proto.core.connection.ConnectionEnd.State state = 3 [json_name = "state"]; + * @return This builder for chaining. + */ + public Builder clearState() { + copyOnWrite(); + instance.clearState(); + return this; + } + + /** + *
+     * counterparty chain associated with this connection.
+     * 
+ * + * .icon.proto.core.connection.Counterparty counterparty = 4 [json_name = "counterparty"]; + */ + @java.lang.Override + public boolean hasCounterparty() { + return instance.hasCounterparty(); + } + /** + *
+     * counterparty chain associated with this connection.
+     * 
+ * + * .icon.proto.core.connection.Counterparty counterparty = 4 [json_name = "counterparty"]; + */ + @java.lang.Override + public com.icon.proto.core.connection.Counterparty getCounterparty() { + return instance.getCounterparty(); + } + /** + *
+     * counterparty chain associated with this connection.
+     * 
+ * + * .icon.proto.core.connection.Counterparty counterparty = 4 [json_name = "counterparty"]; + */ + public Builder setCounterparty(com.icon.proto.core.connection.Counterparty value) { + copyOnWrite(); + instance.setCounterparty(value); + return this; + } + /** + *
+     * counterparty chain associated with this connection.
+     * 
+ * + * .icon.proto.core.connection.Counterparty counterparty = 4 [json_name = "counterparty"]; + */ + public Builder setCounterparty( + com.icon.proto.core.connection.Counterparty.Builder builderForValue) { + copyOnWrite(); + instance.setCounterparty(builderForValue.build()); + return this; + } + /** + *
+     * counterparty chain associated with this connection.
+     * 
+ * + * .icon.proto.core.connection.Counterparty counterparty = 4 [json_name = "counterparty"]; + */ + public Builder mergeCounterparty(com.icon.proto.core.connection.Counterparty value) { + copyOnWrite(); + instance.mergeCounterparty(value); + return this; + } + /** + *
+     * counterparty chain associated with this connection.
+     * 
+ * + * .icon.proto.core.connection.Counterparty counterparty = 4 [json_name = "counterparty"]; + */ + public Builder clearCounterparty() { copyOnWrite(); + instance.clearCounterparty(); + return this; + } + + /** + *
+     * delay period that must pass before a consensus state can be used for
+     * packet-verification NOTE: delay period logic is only implemented by some
+     * clients.
+     * 
+ * + * uint64 delay_period = 5 [json_name = "delayPeriod"]; + * @return The delayPeriod. + */ + @java.lang.Override + public long getDelayPeriod() { + return instance.getDelayPeriod(); + } + /** + *
+     * delay period that must pass before a consensus state can be used for
+     * packet-verification NOTE: delay period logic is only implemented by some
+     * clients.
+     * 
+ * + * uint64 delay_period = 5 [json_name = "delayPeriod"]; + * @param value The delayPeriod to set. + * @return This builder for chaining. + */ + public Builder setDelayPeriod(long value) { + copyOnWrite(); + instance.setDelayPeriod(value); + return this; + } + /** + *
+     * delay period that must pass before a consensus state can be used for
+     * packet-verification NOTE: delay period logic is only implemented by some
+     * clients.
+     * 
+ * + * uint64 delay_period = 5 [json_name = "delayPeriod"]; + * @return This builder for chaining. + */ + public Builder clearDelayPeriod() { + copyOnWrite(); + instance.clearDelayPeriod(); + return this; + } + + // @@protoc_insertion_point(builder_scope:icon.proto.core.connection.ConnectionEnd) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.icon.proto.core.connection.ConnectionEnd(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "clientId_", + "versions_", + com.icon.proto.core.connection.Version.class, + "state_", + "counterparty_", + "delayPeriod_", + }; + java.lang.String info = + "\u0000\u0005\u0000\u0000\u0001\u0005\u0005\u0000\u0001\u0000\u0001\u0208\u0002\u001b" + + "\u0003\f\u0004\t\u0005\u0003"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.icon.proto.core.connection.ConnectionEnd.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:icon.proto.core.connection.ConnectionEnd) + private static final com.icon.proto.core.connection.ConnectionEnd DEFAULT_INSTANCE; + static { + ConnectionEnd defaultInstance = new ConnectionEnd(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + ConnectionEnd.class, defaultInstance); + } + + public static com.icon.proto.core.connection.ConnectionEnd getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/connection/ConnectionEndOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/connection/ConnectionEndOrBuilder.java new file mode 100644 index 000000000..e7c3b6f03 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/connection/ConnectionEndOrBuilder.java @@ -0,0 +1,108 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: core/03-connection/Connection.proto + +package com.icon.proto.core.connection; + +public interface ConnectionEndOrBuilder extends + // @@protoc_insertion_point(interface_extends:icon.proto.core.connection.ConnectionEnd) + com.google.protobuf.MessageLiteOrBuilder { + + /** + *
+   * client associated with this connection.
+   * 
+ * + * string client_id = 1 [json_name = "clientId"]; + * @return The clientId. + */ + java.lang.String getClientId(); + /** + *
+   * client associated with this connection.
+   * 
+ * + * string client_id = 1 [json_name = "clientId"]; + * @return The bytes for clientId. + */ + com.google.protobuf.ByteString + getClientIdBytes(); + + /** + *
+   * IBC version which can be utilised to determine encodings or protocols for
+   * channels or packets utilising this connection.
+   * 
+ * + * repeated .icon.proto.core.connection.Version versions = 2 [json_name = "versions"]; + */ + java.util.List + getVersionsList(); + /** + *
+   * IBC version which can be utilised to determine encodings or protocols for
+   * channels or packets utilising this connection.
+   * 
+ * + * repeated .icon.proto.core.connection.Version versions = 2 [json_name = "versions"]; + */ + com.icon.proto.core.connection.Version getVersions(int index); + /** + *
+   * IBC version which can be utilised to determine encodings or protocols for
+   * channels or packets utilising this connection.
+   * 
+ * + * repeated .icon.proto.core.connection.Version versions = 2 [json_name = "versions"]; + */ + int getVersionsCount(); + + /** + *
+   * current state of the connection end.
+   * 
+ * + * .icon.proto.core.connection.ConnectionEnd.State state = 3 [json_name = "state"]; + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + *
+   * current state of the connection end.
+   * 
+ * + * .icon.proto.core.connection.ConnectionEnd.State state = 3 [json_name = "state"]; + * @return The state. + */ + com.icon.proto.core.connection.ConnectionEnd.State getState(); + + /** + *
+   * counterparty chain associated with this connection.
+   * 
+ * + * .icon.proto.core.connection.Counterparty counterparty = 4 [json_name = "counterparty"]; + * @return Whether the counterparty field is set. + */ + boolean hasCounterparty(); + /** + *
+   * counterparty chain associated with this connection.
+   * 
+ * + * .icon.proto.core.connection.Counterparty counterparty = 4 [json_name = "counterparty"]; + * @return The counterparty. + */ + com.icon.proto.core.connection.Counterparty getCounterparty(); + + /** + *
+   * delay period that must pass before a consensus state can be used for
+   * packet-verification NOTE: delay period logic is only implemented by some
+   * clients.
+   * 
+ * + * uint64 delay_period = 5 [json_name = "delayPeriod"]; + * @return The delayPeriod. + */ + long getDelayPeriod(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/connection/ConnectionProto.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/connection/ConnectionProto.java new file mode 100644 index 000000000..67a0a957c --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/connection/ConnectionProto.java @@ -0,0 +1,16 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: core/03-connection/Connection.proto + +package com.icon.proto.core.connection; + +public final class ConnectionProto { + private ConnectionProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + static { + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/connection/Counterparty.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/connection/Counterparty.java new file mode 100644 index 000000000..8ab948c5c --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/connection/Counterparty.java @@ -0,0 +1,626 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: core/03-connection/Connection.proto + +package com.icon.proto.core.connection; + +/** + *
+ * Counterparty defines the counterparty chain associated with a connection end.
+ * 
+ * + * Protobuf type {@code icon.proto.core.connection.Counterparty} + */ +public final class Counterparty extends + com.google.protobuf.GeneratedMessageLite< + Counterparty, Counterparty.Builder> implements + // @@protoc_insertion_point(message_implements:icon.proto.core.connection.Counterparty) + CounterpartyOrBuilder { + private Counterparty() { + clientId_ = ""; + connectionId_ = ""; + } + public static final int CLIENT_ID_FIELD_NUMBER = 1; + private java.lang.String clientId_; + /** + *
+   * identifies the client on the counterparty chain associated with a given
+   * connection.
+   * 
+ * + * string client_id = 1 [json_name = "clientId"]; + * @return The clientId. + */ + @java.lang.Override + public java.lang.String getClientId() { + return clientId_; + } + /** + *
+   * identifies the client on the counterparty chain associated with a given
+   * connection.
+   * 
+ * + * string client_id = 1 [json_name = "clientId"]; + * @return The bytes for clientId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getClientIdBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(clientId_); + } + /** + *
+   * identifies the client on the counterparty chain associated with a given
+   * connection.
+   * 
+ * + * string client_id = 1 [json_name = "clientId"]; + * @param value The clientId to set. + */ + private void setClientId( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + clientId_ = value; + } + /** + *
+   * identifies the client on the counterparty chain associated with a given
+   * connection.
+   * 
+ * + * string client_id = 1 [json_name = "clientId"]; + */ + private void clearClientId() { + + clientId_ = getDefaultInstance().getClientId(); + } + /** + *
+   * identifies the client on the counterparty chain associated with a given
+   * connection.
+   * 
+ * + * string client_id = 1 [json_name = "clientId"]; + * @param value The bytes for clientId to set. + */ + private void setClientIdBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + clientId_ = value.toStringUtf8(); + + } + + public static final int CONNECTION_ID_FIELD_NUMBER = 2; + private java.lang.String connectionId_; + /** + *
+   * identifies the connection end on the counterparty chain associated with a
+   * given connection.
+   * 
+ * + * string connection_id = 2 [json_name = "connectionId"]; + * @return The connectionId. + */ + @java.lang.Override + public java.lang.String getConnectionId() { + return connectionId_; + } + /** + *
+   * identifies the connection end on the counterparty chain associated with a
+   * given connection.
+   * 
+ * + * string connection_id = 2 [json_name = "connectionId"]; + * @return The bytes for connectionId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getConnectionIdBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(connectionId_); + } + /** + *
+   * identifies the connection end on the counterparty chain associated with a
+   * given connection.
+   * 
+ * + * string connection_id = 2 [json_name = "connectionId"]; + * @param value The connectionId to set. + */ + private void setConnectionId( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + connectionId_ = value; + } + /** + *
+   * identifies the connection end on the counterparty chain associated with a
+   * given connection.
+   * 
+ * + * string connection_id = 2 [json_name = "connectionId"]; + */ + private void clearConnectionId() { + + connectionId_ = getDefaultInstance().getConnectionId(); + } + /** + *
+   * identifies the connection end on the counterparty chain associated with a
+   * given connection.
+   * 
+ * + * string connection_id = 2 [json_name = "connectionId"]; + * @param value The bytes for connectionId to set. + */ + private void setConnectionIdBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + connectionId_ = value.toStringUtf8(); + + } + + public static final int PREFIX_FIELD_NUMBER = 3; + private com.icon.proto.core.commitment.MerklePrefix prefix_; + /** + *
+   * commitment merkle prefix of the counterparty chain.
+   * 
+ * + * .icon.proto.core.commitment.MerklePrefix prefix = 3 [json_name = "prefix"]; + */ + @java.lang.Override + public boolean hasPrefix() { + return prefix_ != null; + } + /** + *
+   * commitment merkle prefix of the counterparty chain.
+   * 
+ * + * .icon.proto.core.commitment.MerklePrefix prefix = 3 [json_name = "prefix"]; + */ + @java.lang.Override + public com.icon.proto.core.commitment.MerklePrefix getPrefix() { + return prefix_ == null ? com.icon.proto.core.commitment.MerklePrefix.getDefaultInstance() : prefix_; + } + /** + *
+   * commitment merkle prefix of the counterparty chain.
+   * 
+ * + * .icon.proto.core.commitment.MerklePrefix prefix = 3 [json_name = "prefix"]; + */ + private void setPrefix(com.icon.proto.core.commitment.MerklePrefix value) { + value.getClass(); + prefix_ = value; + + } + /** + *
+   * commitment merkle prefix of the counterparty chain.
+   * 
+ * + * .icon.proto.core.commitment.MerklePrefix prefix = 3 [json_name = "prefix"]; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergePrefix(com.icon.proto.core.commitment.MerklePrefix value) { + value.getClass(); + if (prefix_ != null && + prefix_ != com.icon.proto.core.commitment.MerklePrefix.getDefaultInstance()) { + prefix_ = + com.icon.proto.core.commitment.MerklePrefix.newBuilder(prefix_).mergeFrom(value).buildPartial(); + } else { + prefix_ = value; + } + + } + /** + *
+   * commitment merkle prefix of the counterparty chain.
+   * 
+ * + * .icon.proto.core.commitment.MerklePrefix prefix = 3 [json_name = "prefix"]; + */ + private void clearPrefix() { prefix_ = null; + + } + + public static com.icon.proto.core.connection.Counterparty parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.connection.Counterparty parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.connection.Counterparty parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.connection.Counterparty parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.connection.Counterparty parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.connection.Counterparty parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.connection.Counterparty parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.connection.Counterparty parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.icon.proto.core.connection.Counterparty parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.connection.Counterparty parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.icon.proto.core.connection.Counterparty parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.connection.Counterparty parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.icon.proto.core.connection.Counterparty prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+   * Counterparty defines the counterparty chain associated with a connection end.
+   * 
+ * + * Protobuf type {@code icon.proto.core.connection.Counterparty} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.icon.proto.core.connection.Counterparty, Builder> implements + // @@protoc_insertion_point(builder_implements:icon.proto.core.connection.Counterparty) + com.icon.proto.core.connection.CounterpartyOrBuilder { + // Construct using com.icon.proto.core.connection.Counterparty.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + *
+     * identifies the client on the counterparty chain associated with a given
+     * connection.
+     * 
+ * + * string client_id = 1 [json_name = "clientId"]; + * @return The clientId. + */ + @java.lang.Override + public java.lang.String getClientId() { + return instance.getClientId(); + } + /** + *
+     * identifies the client on the counterparty chain associated with a given
+     * connection.
+     * 
+ * + * string client_id = 1 [json_name = "clientId"]; + * @return The bytes for clientId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getClientIdBytes() { + return instance.getClientIdBytes(); + } + /** + *
+     * identifies the client on the counterparty chain associated with a given
+     * connection.
+     * 
+ * + * string client_id = 1 [json_name = "clientId"]; + * @param value The clientId to set. + * @return This builder for chaining. + */ + public Builder setClientId( + java.lang.String value) { + copyOnWrite(); + instance.setClientId(value); + return this; + } + /** + *
+     * identifies the client on the counterparty chain associated with a given
+     * connection.
+     * 
+ * + * string client_id = 1 [json_name = "clientId"]; + * @return This builder for chaining. + */ + public Builder clearClientId() { + copyOnWrite(); + instance.clearClientId(); + return this; + } + /** + *
+     * identifies the client on the counterparty chain associated with a given
+     * connection.
+     * 
+ * + * string client_id = 1 [json_name = "clientId"]; + * @param value The bytes for clientId to set. + * @return This builder for chaining. + */ + public Builder setClientIdBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setClientIdBytes(value); + return this; + } + + /** + *
+     * identifies the connection end on the counterparty chain associated with a
+     * given connection.
+     * 
+ * + * string connection_id = 2 [json_name = "connectionId"]; + * @return The connectionId. + */ + @java.lang.Override + public java.lang.String getConnectionId() { + return instance.getConnectionId(); + } + /** + *
+     * identifies the connection end on the counterparty chain associated with a
+     * given connection.
+     * 
+ * + * string connection_id = 2 [json_name = "connectionId"]; + * @return The bytes for connectionId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getConnectionIdBytes() { + return instance.getConnectionIdBytes(); + } + /** + *
+     * identifies the connection end on the counterparty chain associated with a
+     * given connection.
+     * 
+ * + * string connection_id = 2 [json_name = "connectionId"]; + * @param value The connectionId to set. + * @return This builder for chaining. + */ + public Builder setConnectionId( + java.lang.String value) { + copyOnWrite(); + instance.setConnectionId(value); + return this; + } + /** + *
+     * identifies the connection end on the counterparty chain associated with a
+     * given connection.
+     * 
+ * + * string connection_id = 2 [json_name = "connectionId"]; + * @return This builder for chaining. + */ + public Builder clearConnectionId() { + copyOnWrite(); + instance.clearConnectionId(); + return this; + } + /** + *
+     * identifies the connection end on the counterparty chain associated with a
+     * given connection.
+     * 
+ * + * string connection_id = 2 [json_name = "connectionId"]; + * @param value The bytes for connectionId to set. + * @return This builder for chaining. + */ + public Builder setConnectionIdBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setConnectionIdBytes(value); + return this; + } + + /** + *
+     * commitment merkle prefix of the counterparty chain.
+     * 
+ * + * .icon.proto.core.commitment.MerklePrefix prefix = 3 [json_name = "prefix"]; + */ + @java.lang.Override + public boolean hasPrefix() { + return instance.hasPrefix(); + } + /** + *
+     * commitment merkle prefix of the counterparty chain.
+     * 
+ * + * .icon.proto.core.commitment.MerklePrefix prefix = 3 [json_name = "prefix"]; + */ + @java.lang.Override + public com.icon.proto.core.commitment.MerklePrefix getPrefix() { + return instance.getPrefix(); + } + /** + *
+     * commitment merkle prefix of the counterparty chain.
+     * 
+ * + * .icon.proto.core.commitment.MerklePrefix prefix = 3 [json_name = "prefix"]; + */ + public Builder setPrefix(com.icon.proto.core.commitment.MerklePrefix value) { + copyOnWrite(); + instance.setPrefix(value); + return this; + } + /** + *
+     * commitment merkle prefix of the counterparty chain.
+     * 
+ * + * .icon.proto.core.commitment.MerklePrefix prefix = 3 [json_name = "prefix"]; + */ + public Builder setPrefix( + com.icon.proto.core.commitment.MerklePrefix.Builder builderForValue) { + copyOnWrite(); + instance.setPrefix(builderForValue.build()); + return this; + } + /** + *
+     * commitment merkle prefix of the counterparty chain.
+     * 
+ * + * .icon.proto.core.commitment.MerklePrefix prefix = 3 [json_name = "prefix"]; + */ + public Builder mergePrefix(com.icon.proto.core.commitment.MerklePrefix value) { + copyOnWrite(); + instance.mergePrefix(value); + return this; + } + /** + *
+     * commitment merkle prefix of the counterparty chain.
+     * 
+ * + * .icon.proto.core.commitment.MerklePrefix prefix = 3 [json_name = "prefix"]; + */ + public Builder clearPrefix() { copyOnWrite(); + instance.clearPrefix(); + return this; + } + + // @@protoc_insertion_point(builder_scope:icon.proto.core.connection.Counterparty) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.icon.proto.core.connection.Counterparty(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "clientId_", + "connectionId_", + "prefix_", + }; + java.lang.String info = + "\u0000\u0003\u0000\u0000\u0001\u0003\u0003\u0000\u0000\u0000\u0001\u0208\u0002\u0208" + + "\u0003\t"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.icon.proto.core.connection.Counterparty.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:icon.proto.core.connection.Counterparty) + private static final com.icon.proto.core.connection.Counterparty DEFAULT_INSTANCE; + static { + Counterparty defaultInstance = new Counterparty(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + Counterparty.class, defaultInstance); + } + + public static com.icon.proto.core.connection.Counterparty getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/connection/CounterpartyOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/connection/CounterpartyOrBuilder.java new file mode 100644 index 000000000..851ee2018 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/connection/CounterpartyOrBuilder.java @@ -0,0 +1,72 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: core/03-connection/Connection.proto + +package com.icon.proto.core.connection; + +public interface CounterpartyOrBuilder extends + // @@protoc_insertion_point(interface_extends:icon.proto.core.connection.Counterparty) + com.google.protobuf.MessageLiteOrBuilder { + + /** + *
+   * identifies the client on the counterparty chain associated with a given
+   * connection.
+   * 
+ * + * string client_id = 1 [json_name = "clientId"]; + * @return The clientId. + */ + java.lang.String getClientId(); + /** + *
+   * identifies the client on the counterparty chain associated with a given
+   * connection.
+   * 
+ * + * string client_id = 1 [json_name = "clientId"]; + * @return The bytes for clientId. + */ + com.google.protobuf.ByteString + getClientIdBytes(); + + /** + *
+   * identifies the connection end on the counterparty chain associated with a
+   * given connection.
+   * 
+ * + * string connection_id = 2 [json_name = "connectionId"]; + * @return The connectionId. + */ + java.lang.String getConnectionId(); + /** + *
+   * identifies the connection end on the counterparty chain associated with a
+   * given connection.
+   * 
+ * + * string connection_id = 2 [json_name = "connectionId"]; + * @return The bytes for connectionId. + */ + com.google.protobuf.ByteString + getConnectionIdBytes(); + + /** + *
+   * commitment merkle prefix of the counterparty chain.
+   * 
+ * + * .icon.proto.core.commitment.MerklePrefix prefix = 3 [json_name = "prefix"]; + * @return Whether the prefix field is set. + */ + boolean hasPrefix(); + /** + *
+   * commitment merkle prefix of the counterparty chain.
+   * 
+ * + * .icon.proto.core.commitment.MerklePrefix prefix = 3 [json_name = "prefix"]; + * @return The prefix. + */ + com.icon.proto.core.commitment.MerklePrefix getPrefix(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/connection/Version.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/connection/Version.java new file mode 100644 index 000000000..904653be9 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/connection/Version.java @@ -0,0 +1,591 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: core/03-connection/Connection.proto + +package com.icon.proto.core.connection; + +/** + *
+ * Version defines the versioning scheme used to negotiate the IBC verison in
+ * the connection handshake.
+ * 
+ * + * Protobuf type {@code icon.proto.core.connection.Version} + */ +public final class Version extends + com.google.protobuf.GeneratedMessageLite< + Version, Version.Builder> implements + // @@protoc_insertion_point(message_implements:icon.proto.core.connection.Version) + VersionOrBuilder { + private Version() { + identifier_ = ""; + features_ = com.google.protobuf.GeneratedMessageLite.emptyProtobufList(); + } + public static final int IDENTIFIER_FIELD_NUMBER = 1; + private java.lang.String identifier_; + /** + *
+   * unique version identifier
+   * 
+ * + * string identifier = 1 [json_name = "identifier"]; + * @return The identifier. + */ + @java.lang.Override + public java.lang.String getIdentifier() { + return identifier_; + } + /** + *
+   * unique version identifier
+   * 
+ * + * string identifier = 1 [json_name = "identifier"]; + * @return The bytes for identifier. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getIdentifierBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(identifier_); + } + /** + *
+   * unique version identifier
+   * 
+ * + * string identifier = 1 [json_name = "identifier"]; + * @param value The identifier to set. + */ + private void setIdentifier( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + identifier_ = value; + } + /** + *
+   * unique version identifier
+   * 
+ * + * string identifier = 1 [json_name = "identifier"]; + */ + private void clearIdentifier() { + + identifier_ = getDefaultInstance().getIdentifier(); + } + /** + *
+   * unique version identifier
+   * 
+ * + * string identifier = 1 [json_name = "identifier"]; + * @param value The bytes for identifier to set. + */ + private void setIdentifierBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + identifier_ = value.toStringUtf8(); + + } + + public static final int FEATURES_FIELD_NUMBER = 2; + private com.google.protobuf.Internal.ProtobufList features_; + /** + *
+   * list of features compatible with the specified identifier
+   * 
+ * + * repeated string features = 2 [json_name = "features"]; + * @return A list containing the features. + */ + @java.lang.Override + public java.util.List getFeaturesList() { + return features_; + } + /** + *
+   * list of features compatible with the specified identifier
+   * 
+ * + * repeated string features = 2 [json_name = "features"]; + * @return The count of features. + */ + @java.lang.Override + public int getFeaturesCount() { + return features_.size(); + } + /** + *
+   * list of features compatible with the specified identifier
+   * 
+ * + * repeated string features = 2 [json_name = "features"]; + * @param index The index of the element to return. + * @return The features at the given index. + */ + @java.lang.Override + public java.lang.String getFeatures(int index) { + return features_.get(index); + } + /** + *
+   * list of features compatible with the specified identifier
+   * 
+ * + * repeated string features = 2 [json_name = "features"]; + * @param index The index of the value to return. + * @return The bytes of the features at the given index. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getFeaturesBytes(int index) { + return com.google.protobuf.ByteString.copyFromUtf8( + features_.get(index)); + } + private void ensureFeaturesIsMutable() { + com.google.protobuf.Internal.ProtobufList tmp = + features_; if (!tmp.isModifiable()) { + features_ = + com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp); + } + } + /** + *
+   * list of features compatible with the specified identifier
+   * 
+ * + * repeated string features = 2 [json_name = "features"]; + * @param index The index to set the value at. + * @param value The features to set. + */ + private void setFeatures( + int index, java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + ensureFeaturesIsMutable(); + features_.set(index, value); + } + /** + *
+   * list of features compatible with the specified identifier
+   * 
+ * + * repeated string features = 2 [json_name = "features"]; + * @param value The features to add. + */ + private void addFeatures( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + ensureFeaturesIsMutable(); + features_.add(value); + } + /** + *
+   * list of features compatible with the specified identifier
+   * 
+ * + * repeated string features = 2 [json_name = "features"]; + * @param values The features to add. + */ + private void addAllFeatures( + java.lang.Iterable values) { + ensureFeaturesIsMutable(); + com.google.protobuf.AbstractMessageLite.addAll( + values, features_); + } + /** + *
+   * list of features compatible with the specified identifier
+   * 
+ * + * repeated string features = 2 [json_name = "features"]; + */ + private void clearFeatures() { + features_ = com.google.protobuf.GeneratedMessageLite.emptyProtobufList(); + } + /** + *
+   * list of features compatible with the specified identifier
+   * 
+ * + * repeated string features = 2 [json_name = "features"]; + * @param value The bytes of the features to add. + */ + private void addFeaturesBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + ensureFeaturesIsMutable(); + features_.add(value.toStringUtf8()); + } + + public static com.icon.proto.core.connection.Version parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.connection.Version parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.connection.Version parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.connection.Version parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.connection.Version parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.proto.core.connection.Version parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.proto.core.connection.Version parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.connection.Version parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.icon.proto.core.connection.Version parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.connection.Version parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.icon.proto.core.connection.Version parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.icon.proto.core.connection.Version parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.icon.proto.core.connection.Version prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+   * Version defines the versioning scheme used to negotiate the IBC verison in
+   * the connection handshake.
+   * 
+ * + * Protobuf type {@code icon.proto.core.connection.Version} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.icon.proto.core.connection.Version, Builder> implements + // @@protoc_insertion_point(builder_implements:icon.proto.core.connection.Version) + com.icon.proto.core.connection.VersionOrBuilder { + // Construct using com.icon.proto.core.connection.Version.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + *
+     * unique version identifier
+     * 
+ * + * string identifier = 1 [json_name = "identifier"]; + * @return The identifier. + */ + @java.lang.Override + public java.lang.String getIdentifier() { + return instance.getIdentifier(); + } + /** + *
+     * unique version identifier
+     * 
+ * + * string identifier = 1 [json_name = "identifier"]; + * @return The bytes for identifier. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getIdentifierBytes() { + return instance.getIdentifierBytes(); + } + /** + *
+     * unique version identifier
+     * 
+ * + * string identifier = 1 [json_name = "identifier"]; + * @param value The identifier to set. + * @return This builder for chaining. + */ + public Builder setIdentifier( + java.lang.String value) { + copyOnWrite(); + instance.setIdentifier(value); + return this; + } + /** + *
+     * unique version identifier
+     * 
+ * + * string identifier = 1 [json_name = "identifier"]; + * @return This builder for chaining. + */ + public Builder clearIdentifier() { + copyOnWrite(); + instance.clearIdentifier(); + return this; + } + /** + *
+     * unique version identifier
+     * 
+ * + * string identifier = 1 [json_name = "identifier"]; + * @param value The bytes for identifier to set. + * @return This builder for chaining. + */ + public Builder setIdentifierBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setIdentifierBytes(value); + return this; + } + + /** + *
+     * list of features compatible with the specified identifier
+     * 
+ * + * repeated string features = 2 [json_name = "features"]; + * @return A list containing the features. + */ + @java.lang.Override + public java.util.List + getFeaturesList() { + return java.util.Collections.unmodifiableList( + instance.getFeaturesList()); + } + /** + *
+     * list of features compatible with the specified identifier
+     * 
+ * + * repeated string features = 2 [json_name = "features"]; + * @return The count of features. + */ + @java.lang.Override + public int getFeaturesCount() { + return instance.getFeaturesCount(); + } + /** + *
+     * list of features compatible with the specified identifier
+     * 
+ * + * repeated string features = 2 [json_name = "features"]; + * @param index The index of the element to return. + * @return The features at the given index. + */ + @java.lang.Override + public java.lang.String getFeatures(int index) { + return instance.getFeatures(index); + } + /** + *
+     * list of features compatible with the specified identifier
+     * 
+ * + * repeated string features = 2 [json_name = "features"]; + * @param index The index of the value to return. + * @return The bytes of the features at the given index. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getFeaturesBytes(int index) { + return instance.getFeaturesBytes(index); + } + /** + *
+     * list of features compatible with the specified identifier
+     * 
+ * + * repeated string features = 2 [json_name = "features"]; + * @param index The index to set the value at. + * @param value The features to set. + * @return This builder for chaining. + */ + public Builder setFeatures( + int index, java.lang.String value) { + copyOnWrite(); + instance.setFeatures(index, value); + return this; + } + /** + *
+     * list of features compatible with the specified identifier
+     * 
+ * + * repeated string features = 2 [json_name = "features"]; + * @param value The features to add. + * @return This builder for chaining. + */ + public Builder addFeatures( + java.lang.String value) { + copyOnWrite(); + instance.addFeatures(value); + return this; + } + /** + *
+     * list of features compatible with the specified identifier
+     * 
+ * + * repeated string features = 2 [json_name = "features"]; + * @param values The features to add. + * @return This builder for chaining. + */ + public Builder addAllFeatures( + java.lang.Iterable values) { + copyOnWrite(); + instance.addAllFeatures(values); + return this; + } + /** + *
+     * list of features compatible with the specified identifier
+     * 
+ * + * repeated string features = 2 [json_name = "features"]; + * @return This builder for chaining. + */ + public Builder clearFeatures() { + copyOnWrite(); + instance.clearFeatures(); + return this; + } + /** + *
+     * list of features compatible with the specified identifier
+     * 
+ * + * repeated string features = 2 [json_name = "features"]; + * @param value The bytes of the features to add. + * @return This builder for chaining. + */ + public Builder addFeaturesBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.addFeaturesBytes(value); + return this; + } + + // @@protoc_insertion_point(builder_scope:icon.proto.core.connection.Version) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.icon.proto.core.connection.Version(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "identifier_", + "features_", + }; + java.lang.String info = + "\u0000\u0002\u0000\u0000\u0001\u0002\u0002\u0000\u0001\u0000\u0001\u0208\u0002\u021a" + + ""; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.icon.proto.core.connection.Version.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:icon.proto.core.connection.Version) + private static final com.icon.proto.core.connection.Version DEFAULT_INSTANCE; + static { + Version defaultInstance = new Version(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + Version.class, defaultInstance); + } + + public static com.icon.proto.core.connection.Version getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/connection/VersionOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/connection/VersionOrBuilder.java new file mode 100644 index 000000000..ef70c7d92 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/connection/VersionOrBuilder.java @@ -0,0 +1,70 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: core/03-connection/Connection.proto + +package com.icon.proto.core.connection; + +public interface VersionOrBuilder extends + // @@protoc_insertion_point(interface_extends:icon.proto.core.connection.Version) + com.google.protobuf.MessageLiteOrBuilder { + + /** + *
+   * unique version identifier
+   * 
+ * + * string identifier = 1 [json_name = "identifier"]; + * @return The identifier. + */ + java.lang.String getIdentifier(); + /** + *
+   * unique version identifier
+   * 
+ * + * string identifier = 1 [json_name = "identifier"]; + * @return The bytes for identifier. + */ + com.google.protobuf.ByteString + getIdentifierBytes(); + + /** + *
+   * list of features compatible with the specified identifier
+   * 
+ * + * repeated string features = 2 [json_name = "features"]; + * @return A list containing the features. + */ + java.util.List + getFeaturesList(); + /** + *
+   * list of features compatible with the specified identifier
+   * 
+ * + * repeated string features = 2 [json_name = "features"]; + * @return The count of features. + */ + int getFeaturesCount(); + /** + *
+   * list of features compatible with the specified identifier
+   * 
+ * + * repeated string features = 2 [json_name = "features"]; + * @param index The index of the element to return. + * @return The features at the given index. + */ + java.lang.String getFeatures(int index); + /** + *
+   * list of features compatible with the specified identifier
+   * 
+ * + * repeated string features = 2 [json_name = "features"]; + * @param index The index of the element to return. + * @return The features at the given index. + */ + com.google.protobuf.ByteString + getFeaturesBytes(int index); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/types/v1/BTPHeader.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/types/v1/BTPHeader.java new file mode 100644 index 000000000..6f0a21de5 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/types/v1/BTPHeader.java @@ -0,0 +1,972 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: icon/types/v1/types.proto + +package com.icon.types.v1; + +/** + * Protobuf type {@code icon.types.v1.BTPHeader} + */ +public final class BTPHeader extends + com.google.protobuf.GeneratedMessageLite< + BTPHeader, BTPHeader.Builder> implements + // @@protoc_insertion_point(message_implements:icon.types.v1.BTPHeader) + BTPHeaderOrBuilder { + private BTPHeader() { + nextProofContextHash_ = com.google.protobuf.ByteString.EMPTY; + networkSectionToRoot_ = emptyProtobufList(); + prevNetworkSectionHash_ = com.google.protobuf.ByteString.EMPTY; + messageRoot_ = com.google.protobuf.ByteString.EMPTY; + nextValidators_ = emptyProtobufList(); + } + public static final int MAIN_HEIGHT_FIELD_NUMBER = 1; + private long mainHeight_; + /** + * uint64 main_height = 1 [json_name = "mainHeight"]; + * @return The mainHeight. + */ + @java.lang.Override + public long getMainHeight() { + return mainHeight_; + } + /** + * uint64 main_height = 1 [json_name = "mainHeight"]; + * @param value The mainHeight to set. + */ + private void setMainHeight(long value) { + + mainHeight_ = value; + } + /** + * uint64 main_height = 1 [json_name = "mainHeight"]; + */ + private void clearMainHeight() { + + mainHeight_ = 0L; + } + + public static final int ROUND_FIELD_NUMBER = 2; + private int round_; + /** + * uint32 round = 2 [json_name = "round"]; + * @return The round. + */ + @java.lang.Override + public int getRound() { + return round_; + } + /** + * uint32 round = 2 [json_name = "round"]; + * @param value The round to set. + */ + private void setRound(int value) { + + round_ = value; + } + /** + * uint32 round = 2 [json_name = "round"]; + */ + private void clearRound() { + + round_ = 0; + } + + public static final int NEXT_PROOF_CONTEXT_HASH_FIELD_NUMBER = 3; + private com.google.protobuf.ByteString nextProofContextHash_; + /** + * bytes next_proof_context_hash = 3 [json_name = "nextProofContextHash"]; + * @return The nextProofContextHash. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextProofContextHash() { + return nextProofContextHash_; + } + /** + * bytes next_proof_context_hash = 3 [json_name = "nextProofContextHash"]; + * @param value The nextProofContextHash to set. + */ + private void setNextProofContextHash(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + nextProofContextHash_ = value; + } + /** + * bytes next_proof_context_hash = 3 [json_name = "nextProofContextHash"]; + */ + private void clearNextProofContextHash() { + + nextProofContextHash_ = getDefaultInstance().getNextProofContextHash(); + } + + public static final int NETWORK_SECTION_TO_ROOT_FIELD_NUMBER = 4; + private com.google.protobuf.Internal.ProtobufList networkSectionToRoot_; + /** + * repeated .icon.types.v1.MerkleNode network_section_to_root = 4 [json_name = "networkSectionToRoot"]; + */ + @java.lang.Override + public java.util.List getNetworkSectionToRootList() { + return networkSectionToRoot_; + } + /** + * repeated .icon.types.v1.MerkleNode network_section_to_root = 4 [json_name = "networkSectionToRoot"]; + */ + public java.util.List + getNetworkSectionToRootOrBuilderList() { + return networkSectionToRoot_; + } + /** + * repeated .icon.types.v1.MerkleNode network_section_to_root = 4 [json_name = "networkSectionToRoot"]; + */ + @java.lang.Override + public int getNetworkSectionToRootCount() { + return networkSectionToRoot_.size(); + } + /** + * repeated .icon.types.v1.MerkleNode network_section_to_root = 4 [json_name = "networkSectionToRoot"]; + */ + @java.lang.Override + public com.icon.types.v1.MerkleNode getNetworkSectionToRoot(int index) { + return networkSectionToRoot_.get(index); + } + /** + * repeated .icon.types.v1.MerkleNode network_section_to_root = 4 [json_name = "networkSectionToRoot"]; + */ + public com.icon.types.v1.MerkleNodeOrBuilder getNetworkSectionToRootOrBuilder( + int index) { + return networkSectionToRoot_.get(index); + } + private void ensureNetworkSectionToRootIsMutable() { + com.google.protobuf.Internal.ProtobufList tmp = networkSectionToRoot_; + if (!tmp.isModifiable()) { + networkSectionToRoot_ = + com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp); + } + } + + /** + * repeated .icon.types.v1.MerkleNode network_section_to_root = 4 [json_name = "networkSectionToRoot"]; + */ + private void setNetworkSectionToRoot( + int index, com.icon.types.v1.MerkleNode value) { + value.getClass(); + ensureNetworkSectionToRootIsMutable(); + networkSectionToRoot_.set(index, value); + } + /** + * repeated .icon.types.v1.MerkleNode network_section_to_root = 4 [json_name = "networkSectionToRoot"]; + */ + private void addNetworkSectionToRoot(com.icon.types.v1.MerkleNode value) { + value.getClass(); + ensureNetworkSectionToRootIsMutable(); + networkSectionToRoot_.add(value); + } + /** + * repeated .icon.types.v1.MerkleNode network_section_to_root = 4 [json_name = "networkSectionToRoot"]; + */ + private void addNetworkSectionToRoot( + int index, com.icon.types.v1.MerkleNode value) { + value.getClass(); + ensureNetworkSectionToRootIsMutable(); + networkSectionToRoot_.add(index, value); + } + /** + * repeated .icon.types.v1.MerkleNode network_section_to_root = 4 [json_name = "networkSectionToRoot"]; + */ + private void addAllNetworkSectionToRoot( + java.lang.Iterable values) { + ensureNetworkSectionToRootIsMutable(); + com.google.protobuf.AbstractMessageLite.addAll( + values, networkSectionToRoot_); + } + /** + * repeated .icon.types.v1.MerkleNode network_section_to_root = 4 [json_name = "networkSectionToRoot"]; + */ + private void clearNetworkSectionToRoot() { + networkSectionToRoot_ = emptyProtobufList(); + } + /** + * repeated .icon.types.v1.MerkleNode network_section_to_root = 4 [json_name = "networkSectionToRoot"]; + */ + private void removeNetworkSectionToRoot(int index) { + ensureNetworkSectionToRootIsMutable(); + networkSectionToRoot_.remove(index); + } + + public static final int NETWORK_ID_FIELD_NUMBER = 5; + private long networkId_; + /** + * uint64 network_id = 5 [json_name = "networkId"]; + * @return The networkId. + */ + @java.lang.Override + public long getNetworkId() { + return networkId_; + } + /** + * uint64 network_id = 5 [json_name = "networkId"]; + * @param value The networkId to set. + */ + private void setNetworkId(long value) { + + networkId_ = value; + } + /** + * uint64 network_id = 5 [json_name = "networkId"]; + */ + private void clearNetworkId() { + + networkId_ = 0L; + } + + public static final int UPDATE_NUMBER_FIELD_NUMBER = 6; + private long updateNumber_; + /** + * uint64 update_number = 6 [json_name = "updateNumber"]; + * @return The updateNumber. + */ + @java.lang.Override + public long getUpdateNumber() { + return updateNumber_; + } + /** + * uint64 update_number = 6 [json_name = "updateNumber"]; + * @param value The updateNumber to set. + */ + private void setUpdateNumber(long value) { + + updateNumber_ = value; + } + /** + * uint64 update_number = 6 [json_name = "updateNumber"]; + */ + private void clearUpdateNumber() { + + updateNumber_ = 0L; + } + + public static final int PREV_NETWORK_SECTION_HASH_FIELD_NUMBER = 7; + private com.google.protobuf.ByteString prevNetworkSectionHash_; + /** + * bytes prev_network_section_hash = 7 [json_name = "prevNetworkSectionHash"]; + * @return The prevNetworkSectionHash. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPrevNetworkSectionHash() { + return prevNetworkSectionHash_; + } + /** + * bytes prev_network_section_hash = 7 [json_name = "prevNetworkSectionHash"]; + * @param value The prevNetworkSectionHash to set. + */ + private void setPrevNetworkSectionHash(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + prevNetworkSectionHash_ = value; + } + /** + * bytes prev_network_section_hash = 7 [json_name = "prevNetworkSectionHash"]; + */ + private void clearPrevNetworkSectionHash() { + + prevNetworkSectionHash_ = getDefaultInstance().getPrevNetworkSectionHash(); + } + + public static final int MESSAGE_COUNT_FIELD_NUMBER = 8; + private long messageCount_; + /** + * uint64 message_count = 8 [json_name = "messageCount"]; + * @return The messageCount. + */ + @java.lang.Override + public long getMessageCount() { + return messageCount_; + } + /** + * uint64 message_count = 8 [json_name = "messageCount"]; + * @param value The messageCount to set. + */ + private void setMessageCount(long value) { + + messageCount_ = value; + } + /** + * uint64 message_count = 8 [json_name = "messageCount"]; + */ + private void clearMessageCount() { + + messageCount_ = 0L; + } + + public static final int MESSAGE_ROOT_FIELD_NUMBER = 9; + private com.google.protobuf.ByteString messageRoot_; + /** + * bytes message_root = 9 [json_name = "messageRoot"]; + * @return The messageRoot. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMessageRoot() { + return messageRoot_; + } + /** + * bytes message_root = 9 [json_name = "messageRoot"]; + * @param value The messageRoot to set. + */ + private void setMessageRoot(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + messageRoot_ = value; + } + /** + * bytes message_root = 9 [json_name = "messageRoot"]; + */ + private void clearMessageRoot() { + + messageRoot_ = getDefaultInstance().getMessageRoot(); + } + + public static final int NEXTVALIDATORS_FIELD_NUMBER = 10; + private com.google.protobuf.Internal.ProtobufList nextValidators_; + /** + * repeated bytes nextValidators = 10 [json_name = "nextValidators"]; + * @return A list containing the nextValidators. + */ + @java.lang.Override + public java.util.List + getNextValidatorsList() { + return nextValidators_; + } + /** + * repeated bytes nextValidators = 10 [json_name = "nextValidators"]; + * @return The count of nextValidators. + */ + @java.lang.Override + public int getNextValidatorsCount() { + return nextValidators_.size(); + } + /** + * repeated bytes nextValidators = 10 [json_name = "nextValidators"]; + * @param index The index of the element to return. + * @return The nextValidators at the given index. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextValidators(int index) { + return nextValidators_.get(index); + } + private void ensureNextValidatorsIsMutable() { + com.google.protobuf.Internal.ProtobufList tmp = nextValidators_; + if (!tmp.isModifiable()) { + nextValidators_ = + com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp); + } + } + /** + * repeated bytes nextValidators = 10 [json_name = "nextValidators"]; + * @param index The index to set the value at. + * @param value The nextValidators to set. + */ + private void setNextValidators( + int index, com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + ensureNextValidatorsIsMutable(); + nextValidators_.set(index, value); + } + /** + * repeated bytes nextValidators = 10 [json_name = "nextValidators"]; + * @param value The nextValidators to add. + */ + private void addNextValidators(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + ensureNextValidatorsIsMutable(); + nextValidators_.add(value); + } + /** + * repeated bytes nextValidators = 10 [json_name = "nextValidators"]; + * @param values The nextValidators to add. + */ + private void addAllNextValidators( + java.lang.Iterable values) { + ensureNextValidatorsIsMutable(); + com.google.protobuf.AbstractMessageLite.addAll( + values, nextValidators_); + } + /** + * repeated bytes nextValidators = 10 [json_name = "nextValidators"]; + */ + private void clearNextValidators() { + nextValidators_ = emptyProtobufList(); + } + + public static com.icon.types.v1.BTPHeader parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.types.v1.BTPHeader parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.types.v1.BTPHeader parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.types.v1.BTPHeader parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.types.v1.BTPHeader parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.types.v1.BTPHeader parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.types.v1.BTPHeader parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.icon.types.v1.BTPHeader parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.icon.types.v1.BTPHeader parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.icon.types.v1.BTPHeader parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.icon.types.v1.BTPHeader parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.icon.types.v1.BTPHeader parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.icon.types.v1.BTPHeader prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + * Protobuf type {@code icon.types.v1.BTPHeader} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.icon.types.v1.BTPHeader, Builder> implements + // @@protoc_insertion_point(builder_implements:icon.types.v1.BTPHeader) + com.icon.types.v1.BTPHeaderOrBuilder { + // Construct using com.icon.types.v1.BTPHeader.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * uint64 main_height = 1 [json_name = "mainHeight"]; + * @return The mainHeight. + */ + @java.lang.Override + public long getMainHeight() { + return instance.getMainHeight(); + } + /** + * uint64 main_height = 1 [json_name = "mainHeight"]; + * @param value The mainHeight to set. + * @return This builder for chaining. + */ + public Builder setMainHeight(long value) { + copyOnWrite(); + instance.setMainHeight(value); + return this; + } + /** + * uint64 main_height = 1 [json_name = "mainHeight"]; + * @return This builder for chaining. + */ + public Builder clearMainHeight() { + copyOnWrite(); + instance.clearMainHeight(); + return this; + } + + /** + * uint32 round = 2 [json_name = "round"]; + * @return The round. + */ + @java.lang.Override + public int getRound() { + return instance.getRound(); + } + /** + * uint32 round = 2 [json_name = "round"]; + * @param value The round to set. + * @return This builder for chaining. + */ + public Builder setRound(int value) { + copyOnWrite(); + instance.setRound(value); + return this; + } + /** + * uint32 round = 2 [json_name = "round"]; + * @return This builder for chaining. + */ + public Builder clearRound() { + copyOnWrite(); + instance.clearRound(); + return this; + } + + /** + * bytes next_proof_context_hash = 3 [json_name = "nextProofContextHash"]; + * @return The nextProofContextHash. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextProofContextHash() { + return instance.getNextProofContextHash(); + } + /** + * bytes next_proof_context_hash = 3 [json_name = "nextProofContextHash"]; + * @param value The nextProofContextHash to set. + * @return This builder for chaining. + */ + public Builder setNextProofContextHash(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setNextProofContextHash(value); + return this; + } + /** + * bytes next_proof_context_hash = 3 [json_name = "nextProofContextHash"]; + * @return This builder for chaining. + */ + public Builder clearNextProofContextHash() { + copyOnWrite(); + instance.clearNextProofContextHash(); + return this; + } + + /** + * repeated .icon.types.v1.MerkleNode network_section_to_root = 4 [json_name = "networkSectionToRoot"]; + */ + @java.lang.Override + public java.util.List getNetworkSectionToRootList() { + return java.util.Collections.unmodifiableList( + instance.getNetworkSectionToRootList()); + } + /** + * repeated .icon.types.v1.MerkleNode network_section_to_root = 4 [json_name = "networkSectionToRoot"]; + */ + @java.lang.Override + public int getNetworkSectionToRootCount() { + return instance.getNetworkSectionToRootCount(); + }/** + * repeated .icon.types.v1.MerkleNode network_section_to_root = 4 [json_name = "networkSectionToRoot"]; + */ + @java.lang.Override + public com.icon.types.v1.MerkleNode getNetworkSectionToRoot(int index) { + return instance.getNetworkSectionToRoot(index); + } + /** + * repeated .icon.types.v1.MerkleNode network_section_to_root = 4 [json_name = "networkSectionToRoot"]; + */ + public Builder setNetworkSectionToRoot( + int index, com.icon.types.v1.MerkleNode value) { + copyOnWrite(); + instance.setNetworkSectionToRoot(index, value); + return this; + } + /** + * repeated .icon.types.v1.MerkleNode network_section_to_root = 4 [json_name = "networkSectionToRoot"]; + */ + public Builder setNetworkSectionToRoot( + int index, com.icon.types.v1.MerkleNode.Builder builderForValue) { + copyOnWrite(); + instance.setNetworkSectionToRoot(index, + builderForValue.build()); + return this; + } + /** + * repeated .icon.types.v1.MerkleNode network_section_to_root = 4 [json_name = "networkSectionToRoot"]; + */ + public Builder addNetworkSectionToRoot(com.icon.types.v1.MerkleNode value) { + copyOnWrite(); + instance.addNetworkSectionToRoot(value); + return this; + } + /** + * repeated .icon.types.v1.MerkleNode network_section_to_root = 4 [json_name = "networkSectionToRoot"]; + */ + public Builder addNetworkSectionToRoot( + int index, com.icon.types.v1.MerkleNode value) { + copyOnWrite(); + instance.addNetworkSectionToRoot(index, value); + return this; + } + /** + * repeated .icon.types.v1.MerkleNode network_section_to_root = 4 [json_name = "networkSectionToRoot"]; + */ + public Builder addNetworkSectionToRoot( + com.icon.types.v1.MerkleNode.Builder builderForValue) { + copyOnWrite(); + instance.addNetworkSectionToRoot(builderForValue.build()); + return this; + } + /** + * repeated .icon.types.v1.MerkleNode network_section_to_root = 4 [json_name = "networkSectionToRoot"]; + */ + public Builder addNetworkSectionToRoot( + int index, com.icon.types.v1.MerkleNode.Builder builderForValue) { + copyOnWrite(); + instance.addNetworkSectionToRoot(index, + builderForValue.build()); + return this; + } + /** + * repeated .icon.types.v1.MerkleNode network_section_to_root = 4 [json_name = "networkSectionToRoot"]; + */ + public Builder addAllNetworkSectionToRoot( + java.lang.Iterable values) { + copyOnWrite(); + instance.addAllNetworkSectionToRoot(values); + return this; + } + /** + * repeated .icon.types.v1.MerkleNode network_section_to_root = 4 [json_name = "networkSectionToRoot"]; + */ + public Builder clearNetworkSectionToRoot() { + copyOnWrite(); + instance.clearNetworkSectionToRoot(); + return this; + } + /** + * repeated .icon.types.v1.MerkleNode network_section_to_root = 4 [json_name = "networkSectionToRoot"]; + */ + public Builder removeNetworkSectionToRoot(int index) { + copyOnWrite(); + instance.removeNetworkSectionToRoot(index); + return this; + } + + /** + * uint64 network_id = 5 [json_name = "networkId"]; + * @return The networkId. + */ + @java.lang.Override + public long getNetworkId() { + return instance.getNetworkId(); + } + /** + * uint64 network_id = 5 [json_name = "networkId"]; + * @param value The networkId to set. + * @return This builder for chaining. + */ + public Builder setNetworkId(long value) { + copyOnWrite(); + instance.setNetworkId(value); + return this; + } + /** + * uint64 network_id = 5 [json_name = "networkId"]; + * @return This builder for chaining. + */ + public Builder clearNetworkId() { + copyOnWrite(); + instance.clearNetworkId(); + return this; + } + + /** + * uint64 update_number = 6 [json_name = "updateNumber"]; + * @return The updateNumber. + */ + @java.lang.Override + public long getUpdateNumber() { + return instance.getUpdateNumber(); + } + /** + * uint64 update_number = 6 [json_name = "updateNumber"]; + * @param value The updateNumber to set. + * @return This builder for chaining. + */ + public Builder setUpdateNumber(long value) { + copyOnWrite(); + instance.setUpdateNumber(value); + return this; + } + /** + * uint64 update_number = 6 [json_name = "updateNumber"]; + * @return This builder for chaining. + */ + public Builder clearUpdateNumber() { + copyOnWrite(); + instance.clearUpdateNumber(); + return this; + } + + /** + * bytes prev_network_section_hash = 7 [json_name = "prevNetworkSectionHash"]; + * @return The prevNetworkSectionHash. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPrevNetworkSectionHash() { + return instance.getPrevNetworkSectionHash(); + } + /** + * bytes prev_network_section_hash = 7 [json_name = "prevNetworkSectionHash"]; + * @param value The prevNetworkSectionHash to set. + * @return This builder for chaining. + */ + public Builder setPrevNetworkSectionHash(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setPrevNetworkSectionHash(value); + return this; + } + /** + * bytes prev_network_section_hash = 7 [json_name = "prevNetworkSectionHash"]; + * @return This builder for chaining. + */ + public Builder clearPrevNetworkSectionHash() { + copyOnWrite(); + instance.clearPrevNetworkSectionHash(); + return this; + } + + /** + * uint64 message_count = 8 [json_name = "messageCount"]; + * @return The messageCount. + */ + @java.lang.Override + public long getMessageCount() { + return instance.getMessageCount(); + } + /** + * uint64 message_count = 8 [json_name = "messageCount"]; + * @param value The messageCount to set. + * @return This builder for chaining. + */ + public Builder setMessageCount(long value) { + copyOnWrite(); + instance.setMessageCount(value); + return this; + } + /** + * uint64 message_count = 8 [json_name = "messageCount"]; + * @return This builder for chaining. + */ + public Builder clearMessageCount() { + copyOnWrite(); + instance.clearMessageCount(); + return this; + } + + /** + * bytes message_root = 9 [json_name = "messageRoot"]; + * @return The messageRoot. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMessageRoot() { + return instance.getMessageRoot(); + } + /** + * bytes message_root = 9 [json_name = "messageRoot"]; + * @param value The messageRoot to set. + * @return This builder for chaining. + */ + public Builder setMessageRoot(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setMessageRoot(value); + return this; + } + /** + * bytes message_root = 9 [json_name = "messageRoot"]; + * @return This builder for chaining. + */ + public Builder clearMessageRoot() { + copyOnWrite(); + instance.clearMessageRoot(); + return this; + } + + /** + * repeated bytes nextValidators = 10 [json_name = "nextValidators"]; + * @return A list containing the nextValidators. + */ + @java.lang.Override + public java.util.List + getNextValidatorsList() { + return java.util.Collections.unmodifiableList( + instance.getNextValidatorsList()); + } + /** + * repeated bytes nextValidators = 10 [json_name = "nextValidators"]; + * @return The count of nextValidators. + */ + @java.lang.Override + public int getNextValidatorsCount() { + return instance.getNextValidatorsCount(); + } + /** + * repeated bytes nextValidators = 10 [json_name = "nextValidators"]; + * @param index The index of the element to return. + * @return The nextValidators at the given index. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextValidators(int index) { + return instance.getNextValidators(index); + } + /** + * repeated bytes nextValidators = 10 [json_name = "nextValidators"]; + * @param value The nextValidators to set. + * @return This builder for chaining. + */ + public Builder setNextValidators( + int index, com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setNextValidators(index, value); + return this; + } + /** + * repeated bytes nextValidators = 10 [json_name = "nextValidators"]; + * @param value The nextValidators to add. + * @return This builder for chaining. + */ + public Builder addNextValidators(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.addNextValidators(value); + return this; + } + /** + * repeated bytes nextValidators = 10 [json_name = "nextValidators"]; + * @param values The nextValidators to add. + * @return This builder for chaining. + */ + public Builder addAllNextValidators( + java.lang.Iterable values) { + copyOnWrite(); + instance.addAllNextValidators(values); + return this; + } + /** + * repeated bytes nextValidators = 10 [json_name = "nextValidators"]; + * @return This builder for chaining. + */ + public Builder clearNextValidators() { + copyOnWrite(); + instance.clearNextValidators(); + return this; + } + + // @@protoc_insertion_point(builder_scope:icon.types.v1.BTPHeader) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.icon.types.v1.BTPHeader(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "mainHeight_", + "round_", + "nextProofContextHash_", + "networkSectionToRoot_", + com.icon.types.v1.MerkleNode.class, + "networkId_", + "updateNumber_", + "prevNetworkSectionHash_", + "messageCount_", + "messageRoot_", + "nextValidators_", + }; + java.lang.String info = + "\u0000\n\u0000\u0000\u0001\n\n\u0000\u0002\u0000\u0001\u0003\u0002\u000b\u0003\n" + + "\u0004\u001b\u0005\u0003\u0006\u0003\u0007\n\b\u0003\t\n\n\u001c"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.icon.types.v1.BTPHeader.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:icon.types.v1.BTPHeader) + private static final com.icon.types.v1.BTPHeader DEFAULT_INSTANCE; + static { + BTPHeader defaultInstance = new BTPHeader(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + BTPHeader.class, defaultInstance); + } + + public static com.icon.types.v1.BTPHeader getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/types/v1/BTPHeaderOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/types/v1/BTPHeaderOrBuilder.java new file mode 100644 index 000000000..beebb1e56 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/types/v1/BTPHeaderOrBuilder.java @@ -0,0 +1,88 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: icon/types/v1/types.proto + +package com.icon.types.v1; + +public interface BTPHeaderOrBuilder extends + // @@protoc_insertion_point(interface_extends:icon.types.v1.BTPHeader) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * uint64 main_height = 1 [json_name = "mainHeight"]; + * @return The mainHeight. + */ + long getMainHeight(); + + /** + * uint32 round = 2 [json_name = "round"]; + * @return The round. + */ + int getRound(); + + /** + * bytes next_proof_context_hash = 3 [json_name = "nextProofContextHash"]; + * @return The nextProofContextHash. + */ + com.google.protobuf.ByteString getNextProofContextHash(); + + /** + * repeated .icon.types.v1.MerkleNode network_section_to_root = 4 [json_name = "networkSectionToRoot"]; + */ + java.util.List + getNetworkSectionToRootList(); + /** + * repeated .icon.types.v1.MerkleNode network_section_to_root = 4 [json_name = "networkSectionToRoot"]; + */ + com.icon.types.v1.MerkleNode getNetworkSectionToRoot(int index); + /** + * repeated .icon.types.v1.MerkleNode network_section_to_root = 4 [json_name = "networkSectionToRoot"]; + */ + int getNetworkSectionToRootCount(); + + /** + * uint64 network_id = 5 [json_name = "networkId"]; + * @return The networkId. + */ + long getNetworkId(); + + /** + * uint64 update_number = 6 [json_name = "updateNumber"]; + * @return The updateNumber. + */ + long getUpdateNumber(); + + /** + * bytes prev_network_section_hash = 7 [json_name = "prevNetworkSectionHash"]; + * @return The prevNetworkSectionHash. + */ + com.google.protobuf.ByteString getPrevNetworkSectionHash(); + + /** + * uint64 message_count = 8 [json_name = "messageCount"]; + * @return The messageCount. + */ + long getMessageCount(); + + /** + * bytes message_root = 9 [json_name = "messageRoot"]; + * @return The messageRoot. + */ + com.google.protobuf.ByteString getMessageRoot(); + + /** + * repeated bytes nextValidators = 10 [json_name = "nextValidators"]; + * @return A list containing the nextValidators. + */ + java.util.List getNextValidatorsList(); + /** + * repeated bytes nextValidators = 10 [json_name = "nextValidators"]; + * @return The count of nextValidators. + */ + int getNextValidatorsCount(); + /** + * repeated bytes nextValidators = 10 [json_name = "nextValidators"]; + * @param index The index of the element to return. + * @return The nextValidators at the given index. + */ + com.google.protobuf.ByteString getNextValidators(int index); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/types/v1/BlockIDFlag.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/types/v1/BlockIDFlag.java new file mode 100644 index 000000000..cb54ccf9d --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/types/v1/BlockIDFlag.java @@ -0,0 +1,116 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: icon/types/v1/types.proto + +package com.icon.types.v1; + +/** + *
+ * BlockIdFlag indicates which BlcokID the signature is for
+ * 
+ * + * Protobuf enum {@code icon.types.v1.BlockIDFlag} + */ +public enum BlockIDFlag + implements com.google.protobuf.Internal.EnumLite { + /** + * BLOCK_ID_FLAG_UNKNOWN = 0; + */ + BLOCK_ID_FLAG_UNKNOWN(0), + /** + * BLOCK_ID_FLAG_ABSENT = 1; + */ + BLOCK_ID_FLAG_ABSENT(1), + /** + * BLOCK_ID_FLAG_COMMIT = 2; + */ + BLOCK_ID_FLAG_COMMIT(2), + /** + * BLOCK_ID_FLAG_NIL = 3; + */ + BLOCK_ID_FLAG_NIL(3), + UNRECOGNIZED(-1), + ; + + /** + * BLOCK_ID_FLAG_UNKNOWN = 0; + */ + public static final int BLOCK_ID_FLAG_UNKNOWN_VALUE = 0; + /** + * BLOCK_ID_FLAG_ABSENT = 1; + */ + public static final int BLOCK_ID_FLAG_ABSENT_VALUE = 1; + /** + * BLOCK_ID_FLAG_COMMIT = 2; + */ + public static final int BLOCK_ID_FLAG_COMMIT_VALUE = 2; + /** + * BLOCK_ID_FLAG_NIL = 3; + */ + public static final int BLOCK_ID_FLAG_NIL_VALUE = 3; + + + @java.lang.Override + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static BlockIDFlag valueOf(int value) { + return forNumber(value); + } + + public static BlockIDFlag forNumber(int value) { + switch (value) { + case 0: return BLOCK_ID_FLAG_UNKNOWN; + case 1: return BLOCK_ID_FLAG_ABSENT; + case 2: return BLOCK_ID_FLAG_COMMIT; + case 3: return BLOCK_ID_FLAG_NIL; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + BlockIDFlag> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + @java.lang.Override + public BlockIDFlag findValueByNumber(int number) { + return BlockIDFlag.forNumber(number); + } + }; + + public static com.google.protobuf.Internal.EnumVerifier + internalGetVerifier() { + return BlockIDFlagVerifier.INSTANCE; + } + + private static final class BlockIDFlagVerifier implements + com.google.protobuf.Internal.EnumVerifier { + static final com.google.protobuf.Internal.EnumVerifier INSTANCE = new BlockIDFlagVerifier(); + @java.lang.Override + public boolean isInRange(int number) { + return BlockIDFlag.forNumber(number) != null; + } + }; + + private final int value; + + private BlockIDFlag(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:icon.types.v1.BlockIDFlag) +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/types/v1/MerkleNode.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/types/v1/MerkleNode.java new file mode 100644 index 000000000..3044dbc0a --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/types/v1/MerkleNode.java @@ -0,0 +1,296 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: icon/types/v1/types.proto + +package com.icon.types.v1; + +/** + * Protobuf type {@code icon.types.v1.MerkleNode} + */ +public final class MerkleNode extends + com.google.protobuf.GeneratedMessageLite< + MerkleNode, MerkleNode.Builder> implements + // @@protoc_insertion_point(message_implements:icon.types.v1.MerkleNode) + MerkleNodeOrBuilder { + private MerkleNode() { + value_ = com.google.protobuf.ByteString.EMPTY; + } + public static final int DIR_FIELD_NUMBER = 1; + private int dir_; + /** + * int32 Dir = 1 [json_name = "Dir"]; + * @return The dir. + */ + @java.lang.Override + public int getDir() { + return dir_; + } + /** + * int32 Dir = 1 [json_name = "Dir"]; + * @param value The dir to set. + */ + private void setDir(int value) { + + dir_ = value; + } + /** + * int32 Dir = 1 [json_name = "Dir"]; + */ + private void clearDir() { + + dir_ = 0; + } + + public static final int VALUE_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString value_; + /** + * bytes value = 2 [json_name = "value"]; + * @return The value. + */ + @java.lang.Override + public com.google.protobuf.ByteString getValue() { + return value_; + } + /** + * bytes value = 2 [json_name = "value"]; + * @param value The value to set. + */ + private void setValue(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + value_ = value; + } + /** + * bytes value = 2 [json_name = "value"]; + */ + private void clearValue() { + + value_ = getDefaultInstance().getValue(); + } + + public static com.icon.types.v1.MerkleNode parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.types.v1.MerkleNode parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.types.v1.MerkleNode parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.types.v1.MerkleNode parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.types.v1.MerkleNode parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.types.v1.MerkleNode parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.types.v1.MerkleNode parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.icon.types.v1.MerkleNode parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.icon.types.v1.MerkleNode parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.icon.types.v1.MerkleNode parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.icon.types.v1.MerkleNode parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.icon.types.v1.MerkleNode parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.icon.types.v1.MerkleNode prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + * Protobuf type {@code icon.types.v1.MerkleNode} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.icon.types.v1.MerkleNode, Builder> implements + // @@protoc_insertion_point(builder_implements:icon.types.v1.MerkleNode) + com.icon.types.v1.MerkleNodeOrBuilder { + // Construct using com.icon.types.v1.MerkleNode.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * int32 Dir = 1 [json_name = "Dir"]; + * @return The dir. + */ + @java.lang.Override + public int getDir() { + return instance.getDir(); + } + /** + * int32 Dir = 1 [json_name = "Dir"]; + * @param value The dir to set. + * @return This builder for chaining. + */ + public Builder setDir(int value) { + copyOnWrite(); + instance.setDir(value); + return this; + } + /** + * int32 Dir = 1 [json_name = "Dir"]; + * @return This builder for chaining. + */ + public Builder clearDir() { + copyOnWrite(); + instance.clearDir(); + return this; + } + + /** + * bytes value = 2 [json_name = "value"]; + * @return The value. + */ + @java.lang.Override + public com.google.protobuf.ByteString getValue() { + return instance.getValue(); + } + /** + * bytes value = 2 [json_name = "value"]; + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setValue(value); + return this; + } + /** + * bytes value = 2 [json_name = "value"]; + * @return This builder for chaining. + */ + public Builder clearValue() { + copyOnWrite(); + instance.clearValue(); + return this; + } + + // @@protoc_insertion_point(builder_scope:icon.types.v1.MerkleNode) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.icon.types.v1.MerkleNode(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "dir_", + "value_", + }; + java.lang.String info = + "\u0000\u0002\u0000\u0000\u0001\u0002\u0002\u0000\u0000\u0000\u0001\u0004\u0002\n" + + ""; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.icon.types.v1.MerkleNode.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:icon.types.v1.MerkleNode) + private static final com.icon.types.v1.MerkleNode DEFAULT_INSTANCE; + static { + MerkleNode defaultInstance = new MerkleNode(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + MerkleNode.class, defaultInstance); + } + + public static com.icon.types.v1.MerkleNode getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/types/v1/MerkleNodeOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/types/v1/MerkleNodeOrBuilder.java new file mode 100644 index 000000000..55188f2ed --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/types/v1/MerkleNodeOrBuilder.java @@ -0,0 +1,21 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: icon/types/v1/types.proto + +package com.icon.types.v1; + +public interface MerkleNodeOrBuilder extends + // @@protoc_insertion_point(interface_extends:icon.types.v1.MerkleNode) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * int32 Dir = 1 [json_name = "Dir"]; + * @return The dir. + */ + int getDir(); + + /** + * bytes value = 2 [json_name = "value"]; + * @return The value. + */ + com.google.protobuf.ByteString getValue(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/types/v1/MerkleProofs.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/types/v1/MerkleProofs.java new file mode 100644 index 000000000..28dddaf9b --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/types/v1/MerkleProofs.java @@ -0,0 +1,382 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: icon/types/v1/types.proto + +package com.icon.types.v1; + +/** + * Protobuf type {@code icon.types.v1.MerkleProofs} + */ +public final class MerkleProofs extends + com.google.protobuf.GeneratedMessageLite< + MerkleProofs, MerkleProofs.Builder> implements + // @@protoc_insertion_point(message_implements:icon.types.v1.MerkleProofs) + MerkleProofsOrBuilder { + private MerkleProofs() { + proofs_ = emptyProtobufList(); + } + public static final int PROOFS_FIELD_NUMBER = 1; + private com.google.protobuf.Internal.ProtobufList proofs_; + /** + * repeated .icon.types.v1.MerkleNode proofs = 1 [json_name = "proofs"]; + */ + @java.lang.Override + public java.util.List getProofsList() { + return proofs_; + } + /** + * repeated .icon.types.v1.MerkleNode proofs = 1 [json_name = "proofs"]; + */ + public java.util.List + getProofsOrBuilderList() { + return proofs_; + } + /** + * repeated .icon.types.v1.MerkleNode proofs = 1 [json_name = "proofs"]; + */ + @java.lang.Override + public int getProofsCount() { + return proofs_.size(); + } + /** + * repeated .icon.types.v1.MerkleNode proofs = 1 [json_name = "proofs"]; + */ + @java.lang.Override + public com.icon.types.v1.MerkleNode getProofs(int index) { + return proofs_.get(index); + } + /** + * repeated .icon.types.v1.MerkleNode proofs = 1 [json_name = "proofs"]; + */ + public com.icon.types.v1.MerkleNodeOrBuilder getProofsOrBuilder( + int index) { + return proofs_.get(index); + } + private void ensureProofsIsMutable() { + com.google.protobuf.Internal.ProtobufList tmp = proofs_; + if (!tmp.isModifiable()) { + proofs_ = + com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp); + } + } + + /** + * repeated .icon.types.v1.MerkleNode proofs = 1 [json_name = "proofs"]; + */ + private void setProofs( + int index, com.icon.types.v1.MerkleNode value) { + value.getClass(); + ensureProofsIsMutable(); + proofs_.set(index, value); + } + /** + * repeated .icon.types.v1.MerkleNode proofs = 1 [json_name = "proofs"]; + */ + private void addProofs(com.icon.types.v1.MerkleNode value) { + value.getClass(); + ensureProofsIsMutable(); + proofs_.add(value); + } + /** + * repeated .icon.types.v1.MerkleNode proofs = 1 [json_name = "proofs"]; + */ + private void addProofs( + int index, com.icon.types.v1.MerkleNode value) { + value.getClass(); + ensureProofsIsMutable(); + proofs_.add(index, value); + } + /** + * repeated .icon.types.v1.MerkleNode proofs = 1 [json_name = "proofs"]; + */ + private void addAllProofs( + java.lang.Iterable values) { + ensureProofsIsMutable(); + com.google.protobuf.AbstractMessageLite.addAll( + values, proofs_); + } + /** + * repeated .icon.types.v1.MerkleNode proofs = 1 [json_name = "proofs"]; + */ + private void clearProofs() { + proofs_ = emptyProtobufList(); + } + /** + * repeated .icon.types.v1.MerkleNode proofs = 1 [json_name = "proofs"]; + */ + private void removeProofs(int index) { + ensureProofsIsMutable(); + proofs_.remove(index); + } + + public static com.icon.types.v1.MerkleProofs parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.types.v1.MerkleProofs parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.types.v1.MerkleProofs parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.types.v1.MerkleProofs parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.types.v1.MerkleProofs parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.types.v1.MerkleProofs parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.types.v1.MerkleProofs parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.icon.types.v1.MerkleProofs parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.icon.types.v1.MerkleProofs parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.icon.types.v1.MerkleProofs parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.icon.types.v1.MerkleProofs parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.icon.types.v1.MerkleProofs parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.icon.types.v1.MerkleProofs prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + * Protobuf type {@code icon.types.v1.MerkleProofs} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.icon.types.v1.MerkleProofs, Builder> implements + // @@protoc_insertion_point(builder_implements:icon.types.v1.MerkleProofs) + com.icon.types.v1.MerkleProofsOrBuilder { + // Construct using com.icon.types.v1.MerkleProofs.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * repeated .icon.types.v1.MerkleNode proofs = 1 [json_name = "proofs"]; + */ + @java.lang.Override + public java.util.List getProofsList() { + return java.util.Collections.unmodifiableList( + instance.getProofsList()); + } + /** + * repeated .icon.types.v1.MerkleNode proofs = 1 [json_name = "proofs"]; + */ + @java.lang.Override + public int getProofsCount() { + return instance.getProofsCount(); + }/** + * repeated .icon.types.v1.MerkleNode proofs = 1 [json_name = "proofs"]; + */ + @java.lang.Override + public com.icon.types.v1.MerkleNode getProofs(int index) { + return instance.getProofs(index); + } + /** + * repeated .icon.types.v1.MerkleNode proofs = 1 [json_name = "proofs"]; + */ + public Builder setProofs( + int index, com.icon.types.v1.MerkleNode value) { + copyOnWrite(); + instance.setProofs(index, value); + return this; + } + /** + * repeated .icon.types.v1.MerkleNode proofs = 1 [json_name = "proofs"]; + */ + public Builder setProofs( + int index, com.icon.types.v1.MerkleNode.Builder builderForValue) { + copyOnWrite(); + instance.setProofs(index, + builderForValue.build()); + return this; + } + /** + * repeated .icon.types.v1.MerkleNode proofs = 1 [json_name = "proofs"]; + */ + public Builder addProofs(com.icon.types.v1.MerkleNode value) { + copyOnWrite(); + instance.addProofs(value); + return this; + } + /** + * repeated .icon.types.v1.MerkleNode proofs = 1 [json_name = "proofs"]; + */ + public Builder addProofs( + int index, com.icon.types.v1.MerkleNode value) { + copyOnWrite(); + instance.addProofs(index, value); + return this; + } + /** + * repeated .icon.types.v1.MerkleNode proofs = 1 [json_name = "proofs"]; + */ + public Builder addProofs( + com.icon.types.v1.MerkleNode.Builder builderForValue) { + copyOnWrite(); + instance.addProofs(builderForValue.build()); + return this; + } + /** + * repeated .icon.types.v1.MerkleNode proofs = 1 [json_name = "proofs"]; + */ + public Builder addProofs( + int index, com.icon.types.v1.MerkleNode.Builder builderForValue) { + copyOnWrite(); + instance.addProofs(index, + builderForValue.build()); + return this; + } + /** + * repeated .icon.types.v1.MerkleNode proofs = 1 [json_name = "proofs"]; + */ + public Builder addAllProofs( + java.lang.Iterable values) { + copyOnWrite(); + instance.addAllProofs(values); + return this; + } + /** + * repeated .icon.types.v1.MerkleNode proofs = 1 [json_name = "proofs"]; + */ + public Builder clearProofs() { + copyOnWrite(); + instance.clearProofs(); + return this; + } + /** + * repeated .icon.types.v1.MerkleNode proofs = 1 [json_name = "proofs"]; + */ + public Builder removeProofs(int index) { + copyOnWrite(); + instance.removeProofs(index); + return this; + } + + // @@protoc_insertion_point(builder_scope:icon.types.v1.MerkleProofs) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.icon.types.v1.MerkleProofs(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "proofs_", + com.icon.types.v1.MerkleNode.class, + }; + java.lang.String info = + "\u0000\u0001\u0000\u0000\u0001\u0001\u0001\u0000\u0001\u0000\u0001\u001b"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.icon.types.v1.MerkleProofs.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:icon.types.v1.MerkleProofs) + private static final com.icon.types.v1.MerkleProofs DEFAULT_INSTANCE; + static { + MerkleProofs defaultInstance = new MerkleProofs(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + MerkleProofs.class, defaultInstance); + } + + public static com.icon.types.v1.MerkleProofs getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/types/v1/MerkleProofsOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/types/v1/MerkleProofsOrBuilder.java new file mode 100644 index 000000000..8ecf8cae5 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/types/v1/MerkleProofsOrBuilder.java @@ -0,0 +1,23 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: icon/types/v1/types.proto + +package com.icon.types.v1; + +public interface MerkleProofsOrBuilder extends + // @@protoc_insertion_point(interface_extends:icon.types.v1.MerkleProofs) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * repeated .icon.types.v1.MerkleNode proofs = 1 [json_name = "proofs"]; + */ + java.util.List + getProofsList(); + /** + * repeated .icon.types.v1.MerkleNode proofs = 1 [json_name = "proofs"]; + */ + com.icon.types.v1.MerkleNode getProofs(int index); + /** + * repeated .icon.types.v1.MerkleNode proofs = 1 [json_name = "proofs"]; + */ + int getProofsCount(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/types/v1/SignedHeader.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/types/v1/SignedHeader.java new file mode 100644 index 000000000..0ff8b603f --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/types/v1/SignedHeader.java @@ -0,0 +1,619 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: icon/types/v1/types.proto + +package com.icon.types.v1; + +/** + * Protobuf type {@code icon.types.v1.SignedHeader} + */ +public final class SignedHeader extends + com.google.protobuf.GeneratedMessageLite< + SignedHeader, SignedHeader.Builder> implements + // @@protoc_insertion_point(message_implements:icon.types.v1.SignedHeader) + SignedHeaderOrBuilder { + private SignedHeader() { + signatures_ = emptyProtobufList(); + currentValidators_ = emptyProtobufList(); + } + public static final int HEADER_FIELD_NUMBER = 1; + private com.icon.types.v1.BTPHeader header_; + /** + * .icon.types.v1.BTPHeader header = 1 [json_name = "header"]; + */ + @java.lang.Override + public boolean hasHeader() { + return header_ != null; + } + /** + * .icon.types.v1.BTPHeader header = 1 [json_name = "header"]; + */ + @java.lang.Override + public com.icon.types.v1.BTPHeader getHeader() { + return header_ == null ? com.icon.types.v1.BTPHeader.getDefaultInstance() : header_; + } + /** + * .icon.types.v1.BTPHeader header = 1 [json_name = "header"]; + */ + private void setHeader(com.icon.types.v1.BTPHeader value) { + value.getClass(); + header_ = value; + + } + /** + * .icon.types.v1.BTPHeader header = 1 [json_name = "header"]; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeHeader(com.icon.types.v1.BTPHeader value) { + value.getClass(); + if (header_ != null && + header_ != com.icon.types.v1.BTPHeader.getDefaultInstance()) { + header_ = + com.icon.types.v1.BTPHeader.newBuilder(header_).mergeFrom(value).buildPartial(); + } else { + header_ = value; + } + + } + /** + * .icon.types.v1.BTPHeader header = 1 [json_name = "header"]; + */ + private void clearHeader() { header_ = null; + + } + + public static final int SIGNATURES_FIELD_NUMBER = 2; + private com.google.protobuf.Internal.ProtobufList signatures_; + /** + * repeated bytes signatures = 2 [json_name = "signatures"]; + * @return A list containing the signatures. + */ + @java.lang.Override + public java.util.List + getSignaturesList() { + return signatures_; + } + /** + * repeated bytes signatures = 2 [json_name = "signatures"]; + * @return The count of signatures. + */ + @java.lang.Override + public int getSignaturesCount() { + return signatures_.size(); + } + /** + * repeated bytes signatures = 2 [json_name = "signatures"]; + * @param index The index of the element to return. + * @return The signatures at the given index. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSignatures(int index) { + return signatures_.get(index); + } + private void ensureSignaturesIsMutable() { + com.google.protobuf.Internal.ProtobufList tmp = signatures_; + if (!tmp.isModifiable()) { + signatures_ = + com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp); + } + } + /** + * repeated bytes signatures = 2 [json_name = "signatures"]; + * @param index The index to set the value at. + * @param value The signatures to set. + */ + private void setSignatures( + int index, com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + ensureSignaturesIsMutable(); + signatures_.set(index, value); + } + /** + * repeated bytes signatures = 2 [json_name = "signatures"]; + * @param value The signatures to add. + */ + private void addSignatures(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + ensureSignaturesIsMutable(); + signatures_.add(value); + } + /** + * repeated bytes signatures = 2 [json_name = "signatures"]; + * @param values The signatures to add. + */ + private void addAllSignatures( + java.lang.Iterable values) { + ensureSignaturesIsMutable(); + com.google.protobuf.AbstractMessageLite.addAll( + values, signatures_); + } + /** + * repeated bytes signatures = 2 [json_name = "signatures"]; + */ + private void clearSignatures() { + signatures_ = emptyProtobufList(); + } + + public static final int CURRENTVALIDATORS_FIELD_NUMBER = 3; + private com.google.protobuf.Internal.ProtobufList currentValidators_; + /** + * repeated bytes currentValidators = 3 [json_name = "currentValidators"]; + * @return A list containing the currentValidators. + */ + @java.lang.Override + public java.util.List + getCurrentValidatorsList() { + return currentValidators_; + } + /** + * repeated bytes currentValidators = 3 [json_name = "currentValidators"]; + * @return The count of currentValidators. + */ + @java.lang.Override + public int getCurrentValidatorsCount() { + return currentValidators_.size(); + } + /** + * repeated bytes currentValidators = 3 [json_name = "currentValidators"]; + * @param index The index of the element to return. + * @return The currentValidators at the given index. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCurrentValidators(int index) { + return currentValidators_.get(index); + } + private void ensureCurrentValidatorsIsMutable() { + com.google.protobuf.Internal.ProtobufList tmp = currentValidators_; + if (!tmp.isModifiable()) { + currentValidators_ = + com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp); + } + } + /** + * repeated bytes currentValidators = 3 [json_name = "currentValidators"]; + * @param index The index to set the value at. + * @param value The currentValidators to set. + */ + private void setCurrentValidators( + int index, com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + ensureCurrentValidatorsIsMutable(); + currentValidators_.set(index, value); + } + /** + * repeated bytes currentValidators = 3 [json_name = "currentValidators"]; + * @param value The currentValidators to add. + */ + private void addCurrentValidators(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + ensureCurrentValidatorsIsMutable(); + currentValidators_.add(value); + } + /** + * repeated bytes currentValidators = 3 [json_name = "currentValidators"]; + * @param values The currentValidators to add. + */ + private void addAllCurrentValidators( + java.lang.Iterable values) { + ensureCurrentValidatorsIsMutable(); + com.google.protobuf.AbstractMessageLite.addAll( + values, currentValidators_); + } + /** + * repeated bytes currentValidators = 3 [json_name = "currentValidators"]; + */ + private void clearCurrentValidators() { + currentValidators_ = emptyProtobufList(); + } + + public static final int TRUSTED_HEIGHT_FIELD_NUMBER = 4; + private long trustedHeight_; + /** + * uint64 trusted_height = 4 [json_name = "trustedHeight"]; + * @return The trustedHeight. + */ + @java.lang.Override + public long getTrustedHeight() { + return trustedHeight_; + } + /** + * uint64 trusted_height = 4 [json_name = "trustedHeight"]; + * @param value The trustedHeight to set. + */ + private void setTrustedHeight(long value) { + + trustedHeight_ = value; + } + /** + * uint64 trusted_height = 4 [json_name = "trustedHeight"]; + */ + private void clearTrustedHeight() { + + trustedHeight_ = 0L; + } + + public static com.icon.types.v1.SignedHeader parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.types.v1.SignedHeader parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.types.v1.SignedHeader parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.types.v1.SignedHeader parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.types.v1.SignedHeader parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.icon.types.v1.SignedHeader parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.icon.types.v1.SignedHeader parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.icon.types.v1.SignedHeader parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.icon.types.v1.SignedHeader parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.icon.types.v1.SignedHeader parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.icon.types.v1.SignedHeader parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.icon.types.v1.SignedHeader parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.icon.types.v1.SignedHeader prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + * Protobuf type {@code icon.types.v1.SignedHeader} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.icon.types.v1.SignedHeader, Builder> implements + // @@protoc_insertion_point(builder_implements:icon.types.v1.SignedHeader) + com.icon.types.v1.SignedHeaderOrBuilder { + // Construct using com.icon.types.v1.SignedHeader.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * .icon.types.v1.BTPHeader header = 1 [json_name = "header"]; + */ + @java.lang.Override + public boolean hasHeader() { + return instance.hasHeader(); + } + /** + * .icon.types.v1.BTPHeader header = 1 [json_name = "header"]; + */ + @java.lang.Override + public com.icon.types.v1.BTPHeader getHeader() { + return instance.getHeader(); + } + /** + * .icon.types.v1.BTPHeader header = 1 [json_name = "header"]; + */ + public Builder setHeader(com.icon.types.v1.BTPHeader value) { + copyOnWrite(); + instance.setHeader(value); + return this; + } + /** + * .icon.types.v1.BTPHeader header = 1 [json_name = "header"]; + */ + public Builder setHeader( + com.icon.types.v1.BTPHeader.Builder builderForValue) { + copyOnWrite(); + instance.setHeader(builderForValue.build()); + return this; + } + /** + * .icon.types.v1.BTPHeader header = 1 [json_name = "header"]; + */ + public Builder mergeHeader(com.icon.types.v1.BTPHeader value) { + copyOnWrite(); + instance.mergeHeader(value); + return this; + } + /** + * .icon.types.v1.BTPHeader header = 1 [json_name = "header"]; + */ + public Builder clearHeader() { copyOnWrite(); + instance.clearHeader(); + return this; + } + + /** + * repeated bytes signatures = 2 [json_name = "signatures"]; + * @return A list containing the signatures. + */ + @java.lang.Override + public java.util.List + getSignaturesList() { + return java.util.Collections.unmodifiableList( + instance.getSignaturesList()); + } + /** + * repeated bytes signatures = 2 [json_name = "signatures"]; + * @return The count of signatures. + */ + @java.lang.Override + public int getSignaturesCount() { + return instance.getSignaturesCount(); + } + /** + * repeated bytes signatures = 2 [json_name = "signatures"]; + * @param index The index of the element to return. + * @return The signatures at the given index. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSignatures(int index) { + return instance.getSignatures(index); + } + /** + * repeated bytes signatures = 2 [json_name = "signatures"]; + * @param value The signatures to set. + * @return This builder for chaining. + */ + public Builder setSignatures( + int index, com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setSignatures(index, value); + return this; + } + /** + * repeated bytes signatures = 2 [json_name = "signatures"]; + * @param value The signatures to add. + * @return This builder for chaining. + */ + public Builder addSignatures(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.addSignatures(value); + return this; + } + /** + * repeated bytes signatures = 2 [json_name = "signatures"]; + * @param values The signatures to add. + * @return This builder for chaining. + */ + public Builder addAllSignatures( + java.lang.Iterable values) { + copyOnWrite(); + instance.addAllSignatures(values); + return this; + } + /** + * repeated bytes signatures = 2 [json_name = "signatures"]; + * @return This builder for chaining. + */ + public Builder clearSignatures() { + copyOnWrite(); + instance.clearSignatures(); + return this; + } + + /** + * repeated bytes currentValidators = 3 [json_name = "currentValidators"]; + * @return A list containing the currentValidators. + */ + @java.lang.Override + public java.util.List + getCurrentValidatorsList() { + return java.util.Collections.unmodifiableList( + instance.getCurrentValidatorsList()); + } + /** + * repeated bytes currentValidators = 3 [json_name = "currentValidators"]; + * @return The count of currentValidators. + */ + @java.lang.Override + public int getCurrentValidatorsCount() { + return instance.getCurrentValidatorsCount(); + } + /** + * repeated bytes currentValidators = 3 [json_name = "currentValidators"]; + * @param index The index of the element to return. + * @return The currentValidators at the given index. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCurrentValidators(int index) { + return instance.getCurrentValidators(index); + } + /** + * repeated bytes currentValidators = 3 [json_name = "currentValidators"]; + * @param value The currentValidators to set. + * @return This builder for chaining. + */ + public Builder setCurrentValidators( + int index, com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setCurrentValidators(index, value); + return this; + } + /** + * repeated bytes currentValidators = 3 [json_name = "currentValidators"]; + * @param value The currentValidators to add. + * @return This builder for chaining. + */ + public Builder addCurrentValidators(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.addCurrentValidators(value); + return this; + } + /** + * repeated bytes currentValidators = 3 [json_name = "currentValidators"]; + * @param values The currentValidators to add. + * @return This builder for chaining. + */ + public Builder addAllCurrentValidators( + java.lang.Iterable values) { + copyOnWrite(); + instance.addAllCurrentValidators(values); + return this; + } + /** + * repeated bytes currentValidators = 3 [json_name = "currentValidators"]; + * @return This builder for chaining. + */ + public Builder clearCurrentValidators() { + copyOnWrite(); + instance.clearCurrentValidators(); + return this; + } + + /** + * uint64 trusted_height = 4 [json_name = "trustedHeight"]; + * @return The trustedHeight. + */ + @java.lang.Override + public long getTrustedHeight() { + return instance.getTrustedHeight(); + } + /** + * uint64 trusted_height = 4 [json_name = "trustedHeight"]; + * @param value The trustedHeight to set. + * @return This builder for chaining. + */ + public Builder setTrustedHeight(long value) { + copyOnWrite(); + instance.setTrustedHeight(value); + return this; + } + /** + * uint64 trusted_height = 4 [json_name = "trustedHeight"]; + * @return This builder for chaining. + */ + public Builder clearTrustedHeight() { + copyOnWrite(); + instance.clearTrustedHeight(); + return this; + } + + // @@protoc_insertion_point(builder_scope:icon.types.v1.SignedHeader) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.icon.types.v1.SignedHeader(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "header_", + "signatures_", + "currentValidators_", + "trustedHeight_", + }; + java.lang.String info = + "\u0000\u0004\u0000\u0000\u0001\u0004\u0004\u0000\u0002\u0000\u0001\t\u0002\u001c" + + "\u0003\u001c\u0004\u0003"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.icon.types.v1.SignedHeader.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:icon.types.v1.SignedHeader) + private static final com.icon.types.v1.SignedHeader DEFAULT_INSTANCE; + static { + SignedHeader defaultInstance = new SignedHeader(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + SignedHeader.class, defaultInstance); + } + + public static com.icon.types.v1.SignedHeader getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/types/v1/SignedHeaderOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/types/v1/SignedHeaderOrBuilder.java new file mode 100644 index 000000000..a8b8026f7 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/types/v1/SignedHeaderOrBuilder.java @@ -0,0 +1,60 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: icon/types/v1/types.proto + +package com.icon.types.v1; + +public interface SignedHeaderOrBuilder extends + // @@protoc_insertion_point(interface_extends:icon.types.v1.SignedHeader) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * .icon.types.v1.BTPHeader header = 1 [json_name = "header"]; + * @return Whether the header field is set. + */ + boolean hasHeader(); + /** + * .icon.types.v1.BTPHeader header = 1 [json_name = "header"]; + * @return The header. + */ + com.icon.types.v1.BTPHeader getHeader(); + + /** + * repeated bytes signatures = 2 [json_name = "signatures"]; + * @return A list containing the signatures. + */ + java.util.List getSignaturesList(); + /** + * repeated bytes signatures = 2 [json_name = "signatures"]; + * @return The count of signatures. + */ + int getSignaturesCount(); + /** + * repeated bytes signatures = 2 [json_name = "signatures"]; + * @param index The index of the element to return. + * @return The signatures at the given index. + */ + com.google.protobuf.ByteString getSignatures(int index); + + /** + * repeated bytes currentValidators = 3 [json_name = "currentValidators"]; + * @return A list containing the currentValidators. + */ + java.util.List getCurrentValidatorsList(); + /** + * repeated bytes currentValidators = 3 [json_name = "currentValidators"]; + * @return The count of currentValidators. + */ + int getCurrentValidatorsCount(); + /** + * repeated bytes currentValidators = 3 [json_name = "currentValidators"]; + * @param index The index of the element to return. + * @return The currentValidators at the given index. + */ + com.google.protobuf.ByteString getCurrentValidators(int index); + + /** + * uint64 trusted_height = 4 [json_name = "trustedHeight"]; + * @return The trustedHeight. + */ + long getTrustedHeight(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/types/v1/SignedMsgType.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/types/v1/SignedMsgType.java new file mode 100644 index 000000000..ebaddc335 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/types/v1/SignedMsgType.java @@ -0,0 +1,132 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: icon/types/v1/types.proto + +package com.icon.types.v1; + +/** + *
+ * SignedMsgType is a type of signed message in the consensus.
+ * 
+ * + * Protobuf enum {@code icon.types.v1.SignedMsgType} + */ +public enum SignedMsgType + implements com.google.protobuf.Internal.EnumLite { + /** + * SIGNED_MSG_TYPE_UNKNOWN = 0; + */ + SIGNED_MSG_TYPE_UNKNOWN(0), + /** + *
+   * Votes
+   * 
+ * + * SIGNED_MSG_TYPE_PREVOTE = 1; + */ + SIGNED_MSG_TYPE_PREVOTE(1), + /** + * SIGNED_MSG_TYPE_PRECOMMIT = 2; + */ + SIGNED_MSG_TYPE_PRECOMMIT(2), + /** + *
+   * Proposals
+   * 
+ * + * SIGNED_MSG_TYPE_PROPOSAL = 32; + */ + SIGNED_MSG_TYPE_PROPOSAL(32), + UNRECOGNIZED(-1), + ; + + /** + * SIGNED_MSG_TYPE_UNKNOWN = 0; + */ + public static final int SIGNED_MSG_TYPE_UNKNOWN_VALUE = 0; + /** + *
+   * Votes
+   * 
+ * + * SIGNED_MSG_TYPE_PREVOTE = 1; + */ + public static final int SIGNED_MSG_TYPE_PREVOTE_VALUE = 1; + /** + * SIGNED_MSG_TYPE_PRECOMMIT = 2; + */ + public static final int SIGNED_MSG_TYPE_PRECOMMIT_VALUE = 2; + /** + *
+   * Proposals
+   * 
+ * + * SIGNED_MSG_TYPE_PROPOSAL = 32; + */ + public static final int SIGNED_MSG_TYPE_PROPOSAL_VALUE = 32; + + + @java.lang.Override + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SignedMsgType valueOf(int value) { + return forNumber(value); + } + + public static SignedMsgType forNumber(int value) { + switch (value) { + case 0: return SIGNED_MSG_TYPE_UNKNOWN; + case 1: return SIGNED_MSG_TYPE_PREVOTE; + case 2: return SIGNED_MSG_TYPE_PRECOMMIT; + case 32: return SIGNED_MSG_TYPE_PROPOSAL; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + SignedMsgType> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + @java.lang.Override + public SignedMsgType findValueByNumber(int number) { + return SignedMsgType.forNumber(number); + } + }; + + public static com.google.protobuf.Internal.EnumVerifier + internalGetVerifier() { + return SignedMsgTypeVerifier.INSTANCE; + } + + private static final class SignedMsgTypeVerifier implements + com.google.protobuf.Internal.EnumVerifier { + static final com.google.protobuf.Internal.EnumVerifier INSTANCE = new SignedMsgTypeVerifier(); + @java.lang.Override + public boolean isInRange(int number) { + return SignedMsgType.forNumber(number) != null; + } + }; + + private final int value; + + private SignedMsgType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:icon.types.v1.SignedMsgType) +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/types/v1/TypesProto.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/types/v1/TypesProto.java new file mode 100644 index 000000000..2f545ac67 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/types/v1/TypesProto.java @@ -0,0 +1,16 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: icon/types/v1/types.proto + +package com.icon.types.v1; + +public final class TypesProto { + private TypesProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + static { + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/DominoOp.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/DominoOp.java new file mode 100644 index 000000000..6b8a9febf --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/DominoOp.java @@ -0,0 +1,478 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tendermint/crypto/proof.proto + +package com.tendermint.crypto; + +/** + * Protobuf type {@code tendermint.crypto.DominoOp} + */ +public final class DominoOp extends + com.google.protobuf.GeneratedMessageLite< + DominoOp, DominoOp.Builder> implements + // @@protoc_insertion_point(message_implements:tendermint.crypto.DominoOp) + DominoOpOrBuilder { + private DominoOp() { + key_ = ""; + input_ = ""; + output_ = ""; + } + public static final int KEY_FIELD_NUMBER = 1; + private java.lang.String key_; + /** + * string key = 1 [json_name = "key"]; + * @return The key. + */ + @java.lang.Override + public java.lang.String getKey() { + return key_; + } + /** + * string key = 1 [json_name = "key"]; + * @return The bytes for key. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getKeyBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(key_); + } + /** + * string key = 1 [json_name = "key"]; + * @param value The key to set. + */ + private void setKey( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + key_ = value; + } + /** + * string key = 1 [json_name = "key"]; + */ + private void clearKey() { + + key_ = getDefaultInstance().getKey(); + } + /** + * string key = 1 [json_name = "key"]; + * @param value The bytes for key to set. + */ + private void setKeyBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + key_ = value.toStringUtf8(); + + } + + public static final int INPUT_FIELD_NUMBER = 2; + private java.lang.String input_; + /** + * string input = 2 [json_name = "input"]; + * @return The input. + */ + @java.lang.Override + public java.lang.String getInput() { + return input_; + } + /** + * string input = 2 [json_name = "input"]; + * @return The bytes for input. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getInputBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(input_); + } + /** + * string input = 2 [json_name = "input"]; + * @param value The input to set. + */ + private void setInput( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + input_ = value; + } + /** + * string input = 2 [json_name = "input"]; + */ + private void clearInput() { + + input_ = getDefaultInstance().getInput(); + } + /** + * string input = 2 [json_name = "input"]; + * @param value The bytes for input to set. + */ + private void setInputBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + input_ = value.toStringUtf8(); + + } + + public static final int OUTPUT_FIELD_NUMBER = 3; + private java.lang.String output_; + /** + * string output = 3 [json_name = "output"]; + * @return The output. + */ + @java.lang.Override + public java.lang.String getOutput() { + return output_; + } + /** + * string output = 3 [json_name = "output"]; + * @return The bytes for output. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getOutputBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(output_); + } + /** + * string output = 3 [json_name = "output"]; + * @param value The output to set. + */ + private void setOutput( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + output_ = value; + } + /** + * string output = 3 [json_name = "output"]; + */ + private void clearOutput() { + + output_ = getDefaultInstance().getOutput(); + } + /** + * string output = 3 [json_name = "output"]; + * @param value The bytes for output to set. + */ + private void setOutputBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + output_ = value.toStringUtf8(); + + } + + public static com.tendermint.crypto.DominoOp parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.tendermint.crypto.DominoOp parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.tendermint.crypto.DominoOp parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.tendermint.crypto.DominoOp parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.tendermint.crypto.DominoOp parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.tendermint.crypto.DominoOp parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.tendermint.crypto.DominoOp parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.tendermint.crypto.DominoOp parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.tendermint.crypto.DominoOp parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.tendermint.crypto.DominoOp parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.tendermint.crypto.DominoOp parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.tendermint.crypto.DominoOp parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.tendermint.crypto.DominoOp prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + * Protobuf type {@code tendermint.crypto.DominoOp} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.tendermint.crypto.DominoOp, Builder> implements + // @@protoc_insertion_point(builder_implements:tendermint.crypto.DominoOp) + com.tendermint.crypto.DominoOpOrBuilder { + // Construct using com.tendermint.crypto.DominoOp.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * string key = 1 [json_name = "key"]; + * @return The key. + */ + @java.lang.Override + public java.lang.String getKey() { + return instance.getKey(); + } + /** + * string key = 1 [json_name = "key"]; + * @return The bytes for key. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getKeyBytes() { + return instance.getKeyBytes(); + } + /** + * string key = 1 [json_name = "key"]; + * @param value The key to set. + * @return This builder for chaining. + */ + public Builder setKey( + java.lang.String value) { + copyOnWrite(); + instance.setKey(value); + return this; + } + /** + * string key = 1 [json_name = "key"]; + * @return This builder for chaining. + */ + public Builder clearKey() { + copyOnWrite(); + instance.clearKey(); + return this; + } + /** + * string key = 1 [json_name = "key"]; + * @param value The bytes for key to set. + * @return This builder for chaining. + */ + public Builder setKeyBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setKeyBytes(value); + return this; + } + + /** + * string input = 2 [json_name = "input"]; + * @return The input. + */ + @java.lang.Override + public java.lang.String getInput() { + return instance.getInput(); + } + /** + * string input = 2 [json_name = "input"]; + * @return The bytes for input. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getInputBytes() { + return instance.getInputBytes(); + } + /** + * string input = 2 [json_name = "input"]; + * @param value The input to set. + * @return This builder for chaining. + */ + public Builder setInput( + java.lang.String value) { + copyOnWrite(); + instance.setInput(value); + return this; + } + /** + * string input = 2 [json_name = "input"]; + * @return This builder for chaining. + */ + public Builder clearInput() { + copyOnWrite(); + instance.clearInput(); + return this; + } + /** + * string input = 2 [json_name = "input"]; + * @param value The bytes for input to set. + * @return This builder for chaining. + */ + public Builder setInputBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setInputBytes(value); + return this; + } + + /** + * string output = 3 [json_name = "output"]; + * @return The output. + */ + @java.lang.Override + public java.lang.String getOutput() { + return instance.getOutput(); + } + /** + * string output = 3 [json_name = "output"]; + * @return The bytes for output. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getOutputBytes() { + return instance.getOutputBytes(); + } + /** + * string output = 3 [json_name = "output"]; + * @param value The output to set. + * @return This builder for chaining. + */ + public Builder setOutput( + java.lang.String value) { + copyOnWrite(); + instance.setOutput(value); + return this; + } + /** + * string output = 3 [json_name = "output"]; + * @return This builder for chaining. + */ + public Builder clearOutput() { + copyOnWrite(); + instance.clearOutput(); + return this; + } + /** + * string output = 3 [json_name = "output"]; + * @param value The bytes for output to set. + * @return This builder for chaining. + */ + public Builder setOutputBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setOutputBytes(value); + return this; + } + + // @@protoc_insertion_point(builder_scope:tendermint.crypto.DominoOp) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.tendermint.crypto.DominoOp(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "key_", + "input_", + "output_", + }; + java.lang.String info = + "\u0000\u0003\u0000\u0000\u0001\u0003\u0003\u0000\u0000\u0000\u0001\u0208\u0002\u0208" + + "\u0003\u0208"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.tendermint.crypto.DominoOp.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:tendermint.crypto.DominoOp) + private static final com.tendermint.crypto.DominoOp DEFAULT_INSTANCE; + static { + DominoOp defaultInstance = new DominoOp(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + DominoOp.class, defaultInstance); + } + + public static com.tendermint.crypto.DominoOp getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/DominoOpOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/DominoOpOrBuilder.java new file mode 100644 index 000000000..86852dd1b --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/DominoOpOrBuilder.java @@ -0,0 +1,45 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tendermint/crypto/proof.proto + +package com.tendermint.crypto; + +public interface DominoOpOrBuilder extends + // @@protoc_insertion_point(interface_extends:tendermint.crypto.DominoOp) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * string key = 1 [json_name = "key"]; + * @return The key. + */ + java.lang.String getKey(); + /** + * string key = 1 [json_name = "key"]; + * @return The bytes for key. + */ + com.google.protobuf.ByteString + getKeyBytes(); + + /** + * string input = 2 [json_name = "input"]; + * @return The input. + */ + java.lang.String getInput(); + /** + * string input = 2 [json_name = "input"]; + * @return The bytes for input. + */ + com.google.protobuf.ByteString + getInputBytes(); + + /** + * string output = 3 [json_name = "output"]; + * @return The output. + */ + java.lang.String getOutput(); + /** + * string output = 3 [json_name = "output"]; + * @return The bytes for output. + */ + com.google.protobuf.ByteString + getOutputBytes(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/KeysProto.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/KeysProto.java new file mode 100644 index 000000000..0b5c27e0c --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/KeysProto.java @@ -0,0 +1,16 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tendermint/crypto/keys.proto + +package com.tendermint.crypto; + +public final class KeysProto { + private KeysProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + static { + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/Proof.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/Proof.java new file mode 100644 index 000000000..e9ead93eb --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/Proof.java @@ -0,0 +1,494 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tendermint/crypto/proof.proto + +package com.tendermint.crypto; + +/** + * Protobuf type {@code tendermint.crypto.Proof} + */ +public final class Proof extends + com.google.protobuf.GeneratedMessageLite< + Proof, Proof.Builder> implements + // @@protoc_insertion_point(message_implements:tendermint.crypto.Proof) + ProofOrBuilder { + private Proof() { + leafHash_ = com.google.protobuf.ByteString.EMPTY; + aunts_ = emptyProtobufList(); + } + public static final int TOTAL_FIELD_NUMBER = 1; + private long total_; + /** + * int64 total = 1 [json_name = "total"]; + * @return The total. + */ + @java.lang.Override + public long getTotal() { + return total_; + } + /** + * int64 total = 1 [json_name = "total"]; + * @param value The total to set. + */ + private void setTotal(long value) { + + total_ = value; + } + /** + * int64 total = 1 [json_name = "total"]; + */ + private void clearTotal() { + + total_ = 0L; + } + + public static final int INDEX_FIELD_NUMBER = 2; + private long index_; + /** + * int64 index = 2 [json_name = "index"]; + * @return The index. + */ + @java.lang.Override + public long getIndex() { + return index_; + } + /** + * int64 index = 2 [json_name = "index"]; + * @param value The index to set. + */ + private void setIndex(long value) { + + index_ = value; + } + /** + * int64 index = 2 [json_name = "index"]; + */ + private void clearIndex() { + + index_ = 0L; + } + + public static final int LEAF_HASH_FIELD_NUMBER = 3; + private com.google.protobuf.ByteString leafHash_; + /** + * bytes leaf_hash = 3 [json_name = "leafHash"]; + * @return The leafHash. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLeafHash() { + return leafHash_; + } + /** + * bytes leaf_hash = 3 [json_name = "leafHash"]; + * @param value The leafHash to set. + */ + private void setLeafHash(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + leafHash_ = value; + } + /** + * bytes leaf_hash = 3 [json_name = "leafHash"]; + */ + private void clearLeafHash() { + + leafHash_ = getDefaultInstance().getLeafHash(); + } + + public static final int AUNTS_FIELD_NUMBER = 4; + private com.google.protobuf.Internal.ProtobufList aunts_; + /** + * repeated bytes aunts = 4 [json_name = "aunts"]; + * @return A list containing the aunts. + */ + @java.lang.Override + public java.util.List + getAuntsList() { + return aunts_; + } + /** + * repeated bytes aunts = 4 [json_name = "aunts"]; + * @return The count of aunts. + */ + @java.lang.Override + public int getAuntsCount() { + return aunts_.size(); + } + /** + * repeated bytes aunts = 4 [json_name = "aunts"]; + * @param index The index of the element to return. + * @return The aunts at the given index. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAunts(int index) { + return aunts_.get(index); + } + private void ensureAuntsIsMutable() { + com.google.protobuf.Internal.ProtobufList tmp = aunts_; + if (!tmp.isModifiable()) { + aunts_ = + com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp); + } + } + /** + * repeated bytes aunts = 4 [json_name = "aunts"]; + * @param index The index to set the value at. + * @param value The aunts to set. + */ + private void setAunts( + int index, com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + ensureAuntsIsMutable(); + aunts_.set(index, value); + } + /** + * repeated bytes aunts = 4 [json_name = "aunts"]; + * @param value The aunts to add. + */ + private void addAunts(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + ensureAuntsIsMutable(); + aunts_.add(value); + } + /** + * repeated bytes aunts = 4 [json_name = "aunts"]; + * @param values The aunts to add. + */ + private void addAllAunts( + java.lang.Iterable values) { + ensureAuntsIsMutable(); + com.google.protobuf.AbstractMessageLite.addAll( + values, aunts_); + } + /** + * repeated bytes aunts = 4 [json_name = "aunts"]; + */ + private void clearAunts() { + aunts_ = emptyProtobufList(); + } + + public static com.tendermint.crypto.Proof parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.tendermint.crypto.Proof parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.tendermint.crypto.Proof parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.tendermint.crypto.Proof parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.tendermint.crypto.Proof parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.tendermint.crypto.Proof parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.tendermint.crypto.Proof parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.tendermint.crypto.Proof parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.tendermint.crypto.Proof parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.tendermint.crypto.Proof parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.tendermint.crypto.Proof parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.tendermint.crypto.Proof parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.tendermint.crypto.Proof prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + * Protobuf type {@code tendermint.crypto.Proof} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.tendermint.crypto.Proof, Builder> implements + // @@protoc_insertion_point(builder_implements:tendermint.crypto.Proof) + com.tendermint.crypto.ProofOrBuilder { + // Construct using com.tendermint.crypto.Proof.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * int64 total = 1 [json_name = "total"]; + * @return The total. + */ + @java.lang.Override + public long getTotal() { + return instance.getTotal(); + } + /** + * int64 total = 1 [json_name = "total"]; + * @param value The total to set. + * @return This builder for chaining. + */ + public Builder setTotal(long value) { + copyOnWrite(); + instance.setTotal(value); + return this; + } + /** + * int64 total = 1 [json_name = "total"]; + * @return This builder for chaining. + */ + public Builder clearTotal() { + copyOnWrite(); + instance.clearTotal(); + return this; + } + + /** + * int64 index = 2 [json_name = "index"]; + * @return The index. + */ + @java.lang.Override + public long getIndex() { + return instance.getIndex(); + } + /** + * int64 index = 2 [json_name = "index"]; + * @param value The index to set. + * @return This builder for chaining. + */ + public Builder setIndex(long value) { + copyOnWrite(); + instance.setIndex(value); + return this; + } + /** + * int64 index = 2 [json_name = "index"]; + * @return This builder for chaining. + */ + public Builder clearIndex() { + copyOnWrite(); + instance.clearIndex(); + return this; + } + + /** + * bytes leaf_hash = 3 [json_name = "leafHash"]; + * @return The leafHash. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLeafHash() { + return instance.getLeafHash(); + } + /** + * bytes leaf_hash = 3 [json_name = "leafHash"]; + * @param value The leafHash to set. + * @return This builder for chaining. + */ + public Builder setLeafHash(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setLeafHash(value); + return this; + } + /** + * bytes leaf_hash = 3 [json_name = "leafHash"]; + * @return This builder for chaining. + */ + public Builder clearLeafHash() { + copyOnWrite(); + instance.clearLeafHash(); + return this; + } + + /** + * repeated bytes aunts = 4 [json_name = "aunts"]; + * @return A list containing the aunts. + */ + @java.lang.Override + public java.util.List + getAuntsList() { + return java.util.Collections.unmodifiableList( + instance.getAuntsList()); + } + /** + * repeated bytes aunts = 4 [json_name = "aunts"]; + * @return The count of aunts. + */ + @java.lang.Override + public int getAuntsCount() { + return instance.getAuntsCount(); + } + /** + * repeated bytes aunts = 4 [json_name = "aunts"]; + * @param index The index of the element to return. + * @return The aunts at the given index. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAunts(int index) { + return instance.getAunts(index); + } + /** + * repeated bytes aunts = 4 [json_name = "aunts"]; + * @param value The aunts to set. + * @return This builder for chaining. + */ + public Builder setAunts( + int index, com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setAunts(index, value); + return this; + } + /** + * repeated bytes aunts = 4 [json_name = "aunts"]; + * @param value The aunts to add. + * @return This builder for chaining. + */ + public Builder addAunts(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.addAunts(value); + return this; + } + /** + * repeated bytes aunts = 4 [json_name = "aunts"]; + * @param values The aunts to add. + * @return This builder for chaining. + */ + public Builder addAllAunts( + java.lang.Iterable values) { + copyOnWrite(); + instance.addAllAunts(values); + return this; + } + /** + * repeated bytes aunts = 4 [json_name = "aunts"]; + * @return This builder for chaining. + */ + public Builder clearAunts() { + copyOnWrite(); + instance.clearAunts(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tendermint.crypto.Proof) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.tendermint.crypto.Proof(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "total_", + "index_", + "leafHash_", + "aunts_", + }; + java.lang.String info = + "\u0000\u0004\u0000\u0000\u0001\u0004\u0004\u0000\u0001\u0000\u0001\u0002\u0002\u0002" + + "\u0003\n\u0004\u001c"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.tendermint.crypto.Proof.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:tendermint.crypto.Proof) + private static final com.tendermint.crypto.Proof DEFAULT_INSTANCE; + static { + Proof defaultInstance = new Proof(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + Proof.class, defaultInstance); + } + + public static com.tendermint.crypto.Proof getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/ProofOp.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/ProofOp.java new file mode 100644 index 000000000..193bd98c4 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/ProofOp.java @@ -0,0 +1,408 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tendermint/crypto/proof.proto + +package com.tendermint.crypto; + +/** + *
+ * ProofOp defines an operation used for calculating Merkle root
+ * The data could be arbitrary format, providing nessecary data
+ * for example neighbouring node hash
+ * 
+ * + * Protobuf type {@code tendermint.crypto.ProofOp} + */ +public final class ProofOp extends + com.google.protobuf.GeneratedMessageLite< + ProofOp, ProofOp.Builder> implements + // @@protoc_insertion_point(message_implements:tendermint.crypto.ProofOp) + ProofOpOrBuilder { + private ProofOp() { + type_ = ""; + key_ = com.google.protobuf.ByteString.EMPTY; + data_ = com.google.protobuf.ByteString.EMPTY; + } + public static final int TYPE_FIELD_NUMBER = 1; + private java.lang.String type_; + /** + * string type = 1 [json_name = "type"]; + * @return The type. + */ + @java.lang.Override + public java.lang.String getType() { + return type_; + } + /** + * string type = 1 [json_name = "type"]; + * @return The bytes for type. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTypeBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(type_); + } + /** + * string type = 1 [json_name = "type"]; + * @param value The type to set. + */ + private void setType( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + type_ = value; + } + /** + * string type = 1 [json_name = "type"]; + */ + private void clearType() { + + type_ = getDefaultInstance().getType(); + } + /** + * string type = 1 [json_name = "type"]; + * @param value The bytes for type to set. + */ + private void setTypeBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + type_ = value.toStringUtf8(); + + } + + public static final int KEY_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString key_; + /** + * bytes key = 2 [json_name = "key"]; + * @return The key. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKey() { + return key_; + } + /** + * bytes key = 2 [json_name = "key"]; + * @param value The key to set. + */ + private void setKey(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + key_ = value; + } + /** + * bytes key = 2 [json_name = "key"]; + */ + private void clearKey() { + + key_ = getDefaultInstance().getKey(); + } + + public static final int DATA_FIELD_NUMBER = 3; + private com.google.protobuf.ByteString data_; + /** + * bytes data = 3 [json_name = "data"]; + * @return The data. + */ + @java.lang.Override + public com.google.protobuf.ByteString getData() { + return data_; + } + /** + * bytes data = 3 [json_name = "data"]; + * @param value The data to set. + */ + private void setData(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + data_ = value; + } + /** + * bytes data = 3 [json_name = "data"]; + */ + private void clearData() { + + data_ = getDefaultInstance().getData(); + } + + public static com.tendermint.crypto.ProofOp parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.tendermint.crypto.ProofOp parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.tendermint.crypto.ProofOp parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.tendermint.crypto.ProofOp parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.tendermint.crypto.ProofOp parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.tendermint.crypto.ProofOp parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.tendermint.crypto.ProofOp parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.tendermint.crypto.ProofOp parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.tendermint.crypto.ProofOp parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.tendermint.crypto.ProofOp parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.tendermint.crypto.ProofOp parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.tendermint.crypto.ProofOp parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.tendermint.crypto.ProofOp prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+   * ProofOp defines an operation used for calculating Merkle root
+   * The data could be arbitrary format, providing nessecary data
+   * for example neighbouring node hash
+   * 
+ * + * Protobuf type {@code tendermint.crypto.ProofOp} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.tendermint.crypto.ProofOp, Builder> implements + // @@protoc_insertion_point(builder_implements:tendermint.crypto.ProofOp) + com.tendermint.crypto.ProofOpOrBuilder { + // Construct using com.tendermint.crypto.ProofOp.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * string type = 1 [json_name = "type"]; + * @return The type. + */ + @java.lang.Override + public java.lang.String getType() { + return instance.getType(); + } + /** + * string type = 1 [json_name = "type"]; + * @return The bytes for type. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTypeBytes() { + return instance.getTypeBytes(); + } + /** + * string type = 1 [json_name = "type"]; + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType( + java.lang.String value) { + copyOnWrite(); + instance.setType(value); + return this; + } + /** + * string type = 1 [json_name = "type"]; + * @return This builder for chaining. + */ + public Builder clearType() { + copyOnWrite(); + instance.clearType(); + return this; + } + /** + * string type = 1 [json_name = "type"]; + * @param value The bytes for type to set. + * @return This builder for chaining. + */ + public Builder setTypeBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setTypeBytes(value); + return this; + } + + /** + * bytes key = 2 [json_name = "key"]; + * @return The key. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKey() { + return instance.getKey(); + } + /** + * bytes key = 2 [json_name = "key"]; + * @param value The key to set. + * @return This builder for chaining. + */ + public Builder setKey(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setKey(value); + return this; + } + /** + * bytes key = 2 [json_name = "key"]; + * @return This builder for chaining. + */ + public Builder clearKey() { + copyOnWrite(); + instance.clearKey(); + return this; + } + + /** + * bytes data = 3 [json_name = "data"]; + * @return The data. + */ + @java.lang.Override + public com.google.protobuf.ByteString getData() { + return instance.getData(); + } + /** + * bytes data = 3 [json_name = "data"]; + * @param value The data to set. + * @return This builder for chaining. + */ + public Builder setData(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setData(value); + return this; + } + /** + * bytes data = 3 [json_name = "data"]; + * @return This builder for chaining. + */ + public Builder clearData() { + copyOnWrite(); + instance.clearData(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tendermint.crypto.ProofOp) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.tendermint.crypto.ProofOp(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "type_", + "key_", + "data_", + }; + java.lang.String info = + "\u0000\u0003\u0000\u0000\u0001\u0003\u0003\u0000\u0000\u0000\u0001\u0208\u0002\n" + + "\u0003\n"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.tendermint.crypto.ProofOp.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:tendermint.crypto.ProofOp) + private static final com.tendermint.crypto.ProofOp DEFAULT_INSTANCE; + static { + ProofOp defaultInstance = new ProofOp(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + ProofOp.class, defaultInstance); + } + + public static com.tendermint.crypto.ProofOp getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/ProofOpOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/ProofOpOrBuilder.java new file mode 100644 index 000000000..a7368ebdd --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/ProofOpOrBuilder.java @@ -0,0 +1,33 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tendermint/crypto/proof.proto + +package com.tendermint.crypto; + +public interface ProofOpOrBuilder extends + // @@protoc_insertion_point(interface_extends:tendermint.crypto.ProofOp) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * string type = 1 [json_name = "type"]; + * @return The type. + */ + java.lang.String getType(); + /** + * string type = 1 [json_name = "type"]; + * @return The bytes for type. + */ + com.google.protobuf.ByteString + getTypeBytes(); + + /** + * bytes key = 2 [json_name = "key"]; + * @return The key. + */ + com.google.protobuf.ByteString getKey(); + + /** + * bytes data = 3 [json_name = "data"]; + * @return The data. + */ + com.google.protobuf.ByteString getData(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/ProofOps.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/ProofOps.java new file mode 100644 index 000000000..0cbeb28d0 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/ProofOps.java @@ -0,0 +1,390 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tendermint/crypto/proof.proto + +package com.tendermint.crypto; + +/** + *
+ * ProofOps is Merkle proof defined by the list of ProofOps
+ * 
+ * + * Protobuf type {@code tendermint.crypto.ProofOps} + */ +public final class ProofOps extends + com.google.protobuf.GeneratedMessageLite< + ProofOps, ProofOps.Builder> implements + // @@protoc_insertion_point(message_implements:tendermint.crypto.ProofOps) + ProofOpsOrBuilder { + private ProofOps() { + ops_ = emptyProtobufList(); + } + public static final int OPS_FIELD_NUMBER = 1; + private com.google.protobuf.Internal.ProtobufList ops_; + /** + * repeated .tendermint.crypto.ProofOp ops = 1 [json_name = "ops", (.gogoproto.nullable) = false]; + */ + @java.lang.Override + public java.util.List getOpsList() { + return ops_; + } + /** + * repeated .tendermint.crypto.ProofOp ops = 1 [json_name = "ops", (.gogoproto.nullable) = false]; + */ + public java.util.List + getOpsOrBuilderList() { + return ops_; + } + /** + * repeated .tendermint.crypto.ProofOp ops = 1 [json_name = "ops", (.gogoproto.nullable) = false]; + */ + @java.lang.Override + public int getOpsCount() { + return ops_.size(); + } + /** + * repeated .tendermint.crypto.ProofOp ops = 1 [json_name = "ops", (.gogoproto.nullable) = false]; + */ + @java.lang.Override + public com.tendermint.crypto.ProofOp getOps(int index) { + return ops_.get(index); + } + /** + * repeated .tendermint.crypto.ProofOp ops = 1 [json_name = "ops", (.gogoproto.nullable) = false]; + */ + public com.tendermint.crypto.ProofOpOrBuilder getOpsOrBuilder( + int index) { + return ops_.get(index); + } + private void ensureOpsIsMutable() { + com.google.protobuf.Internal.ProtobufList tmp = ops_; + if (!tmp.isModifiable()) { + ops_ = + com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp); + } + } + + /** + * repeated .tendermint.crypto.ProofOp ops = 1 [json_name = "ops", (.gogoproto.nullable) = false]; + */ + private void setOps( + int index, com.tendermint.crypto.ProofOp value) { + value.getClass(); + ensureOpsIsMutable(); + ops_.set(index, value); + } + /** + * repeated .tendermint.crypto.ProofOp ops = 1 [json_name = "ops", (.gogoproto.nullable) = false]; + */ + private void addOps(com.tendermint.crypto.ProofOp value) { + value.getClass(); + ensureOpsIsMutable(); + ops_.add(value); + } + /** + * repeated .tendermint.crypto.ProofOp ops = 1 [json_name = "ops", (.gogoproto.nullable) = false]; + */ + private void addOps( + int index, com.tendermint.crypto.ProofOp value) { + value.getClass(); + ensureOpsIsMutable(); + ops_.add(index, value); + } + /** + * repeated .tendermint.crypto.ProofOp ops = 1 [json_name = "ops", (.gogoproto.nullable) = false]; + */ + private void addAllOps( + java.lang.Iterable values) { + ensureOpsIsMutable(); + com.google.protobuf.AbstractMessageLite.addAll( + values, ops_); + } + /** + * repeated .tendermint.crypto.ProofOp ops = 1 [json_name = "ops", (.gogoproto.nullable) = false]; + */ + private void clearOps() { + ops_ = emptyProtobufList(); + } + /** + * repeated .tendermint.crypto.ProofOp ops = 1 [json_name = "ops", (.gogoproto.nullable) = false]; + */ + private void removeOps(int index) { + ensureOpsIsMutable(); + ops_.remove(index); + } + + public static com.tendermint.crypto.ProofOps parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.tendermint.crypto.ProofOps parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.tendermint.crypto.ProofOps parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.tendermint.crypto.ProofOps parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.tendermint.crypto.ProofOps parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.tendermint.crypto.ProofOps parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.tendermint.crypto.ProofOps parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.tendermint.crypto.ProofOps parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.tendermint.crypto.ProofOps parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.tendermint.crypto.ProofOps parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.tendermint.crypto.ProofOps parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.tendermint.crypto.ProofOps parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.tendermint.crypto.ProofOps prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+   * ProofOps is Merkle proof defined by the list of ProofOps
+   * 
+ * + * Protobuf type {@code tendermint.crypto.ProofOps} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.tendermint.crypto.ProofOps, Builder> implements + // @@protoc_insertion_point(builder_implements:tendermint.crypto.ProofOps) + com.tendermint.crypto.ProofOpsOrBuilder { + // Construct using com.tendermint.crypto.ProofOps.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * repeated .tendermint.crypto.ProofOp ops = 1 [json_name = "ops", (.gogoproto.nullable) = false]; + */ + @java.lang.Override + public java.util.List getOpsList() { + return java.util.Collections.unmodifiableList( + instance.getOpsList()); + } + /** + * repeated .tendermint.crypto.ProofOp ops = 1 [json_name = "ops", (.gogoproto.nullable) = false]; + */ + @java.lang.Override + public int getOpsCount() { + return instance.getOpsCount(); + }/** + * repeated .tendermint.crypto.ProofOp ops = 1 [json_name = "ops", (.gogoproto.nullable) = false]; + */ + @java.lang.Override + public com.tendermint.crypto.ProofOp getOps(int index) { + return instance.getOps(index); + } + /** + * repeated .tendermint.crypto.ProofOp ops = 1 [json_name = "ops", (.gogoproto.nullable) = false]; + */ + public Builder setOps( + int index, com.tendermint.crypto.ProofOp value) { + copyOnWrite(); + instance.setOps(index, value); + return this; + } + /** + * repeated .tendermint.crypto.ProofOp ops = 1 [json_name = "ops", (.gogoproto.nullable) = false]; + */ + public Builder setOps( + int index, com.tendermint.crypto.ProofOp.Builder builderForValue) { + copyOnWrite(); + instance.setOps(index, + builderForValue.build()); + return this; + } + /** + * repeated .tendermint.crypto.ProofOp ops = 1 [json_name = "ops", (.gogoproto.nullable) = false]; + */ + public Builder addOps(com.tendermint.crypto.ProofOp value) { + copyOnWrite(); + instance.addOps(value); + return this; + } + /** + * repeated .tendermint.crypto.ProofOp ops = 1 [json_name = "ops", (.gogoproto.nullable) = false]; + */ + public Builder addOps( + int index, com.tendermint.crypto.ProofOp value) { + copyOnWrite(); + instance.addOps(index, value); + return this; + } + /** + * repeated .tendermint.crypto.ProofOp ops = 1 [json_name = "ops", (.gogoproto.nullable) = false]; + */ + public Builder addOps( + com.tendermint.crypto.ProofOp.Builder builderForValue) { + copyOnWrite(); + instance.addOps(builderForValue.build()); + return this; + } + /** + * repeated .tendermint.crypto.ProofOp ops = 1 [json_name = "ops", (.gogoproto.nullable) = false]; + */ + public Builder addOps( + int index, com.tendermint.crypto.ProofOp.Builder builderForValue) { + copyOnWrite(); + instance.addOps(index, + builderForValue.build()); + return this; + } + /** + * repeated .tendermint.crypto.ProofOp ops = 1 [json_name = "ops", (.gogoproto.nullable) = false]; + */ + public Builder addAllOps( + java.lang.Iterable values) { + copyOnWrite(); + instance.addAllOps(values); + return this; + } + /** + * repeated .tendermint.crypto.ProofOp ops = 1 [json_name = "ops", (.gogoproto.nullable) = false]; + */ + public Builder clearOps() { + copyOnWrite(); + instance.clearOps(); + return this; + } + /** + * repeated .tendermint.crypto.ProofOp ops = 1 [json_name = "ops", (.gogoproto.nullable) = false]; + */ + public Builder removeOps(int index) { + copyOnWrite(); + instance.removeOps(index); + return this; + } + + // @@protoc_insertion_point(builder_scope:tendermint.crypto.ProofOps) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.tendermint.crypto.ProofOps(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "ops_", + com.tendermint.crypto.ProofOp.class, + }; + java.lang.String info = + "\u0000\u0001\u0000\u0000\u0001\u0001\u0001\u0000\u0001\u0000\u0001\u001b"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.tendermint.crypto.ProofOps.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:tendermint.crypto.ProofOps) + private static final com.tendermint.crypto.ProofOps DEFAULT_INSTANCE; + static { + ProofOps defaultInstance = new ProofOps(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + ProofOps.class, defaultInstance); + } + + public static com.tendermint.crypto.ProofOps getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/ProofOpsOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/ProofOpsOrBuilder.java new file mode 100644 index 000000000..a0662c85b --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/ProofOpsOrBuilder.java @@ -0,0 +1,23 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tendermint/crypto/proof.proto + +package com.tendermint.crypto; + +public interface ProofOpsOrBuilder extends + // @@protoc_insertion_point(interface_extends:tendermint.crypto.ProofOps) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * repeated .tendermint.crypto.ProofOp ops = 1 [json_name = "ops", (.gogoproto.nullable) = false]; + */ + java.util.List + getOpsList(); + /** + * repeated .tendermint.crypto.ProofOp ops = 1 [json_name = "ops", (.gogoproto.nullable) = false]; + */ + com.tendermint.crypto.ProofOp getOps(int index); + /** + * repeated .tendermint.crypto.ProofOp ops = 1 [json_name = "ops", (.gogoproto.nullable) = false]; + */ + int getOpsCount(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/ProofOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/ProofOrBuilder.java new file mode 100644 index 000000000..8f3047b32 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/ProofOrBuilder.java @@ -0,0 +1,44 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tendermint/crypto/proof.proto + +package com.tendermint.crypto; + +public interface ProofOrBuilder extends + // @@protoc_insertion_point(interface_extends:tendermint.crypto.Proof) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * int64 total = 1 [json_name = "total"]; + * @return The total. + */ + long getTotal(); + + /** + * int64 index = 2 [json_name = "index"]; + * @return The index. + */ + long getIndex(); + + /** + * bytes leaf_hash = 3 [json_name = "leafHash"]; + * @return The leafHash. + */ + com.google.protobuf.ByteString getLeafHash(); + + /** + * repeated bytes aunts = 4 [json_name = "aunts"]; + * @return A list containing the aunts. + */ + java.util.List getAuntsList(); + /** + * repeated bytes aunts = 4 [json_name = "aunts"]; + * @return The count of aunts. + */ + int getAuntsCount(); + /** + * repeated bytes aunts = 4 [json_name = "aunts"]; + * @param index The index of the element to return. + * @return The aunts at the given index. + */ + com.google.protobuf.ByteString getAunts(int index); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/ProofProto.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/ProofProto.java new file mode 100644 index 000000000..45cc0043e --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/ProofProto.java @@ -0,0 +1,16 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tendermint/crypto/proof.proto + +package com.tendermint.crypto; + +public final class ProofProto { + private ProofProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + static { + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/PublicKey.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/PublicKey.java new file mode 100644 index 000000000..596f9b650 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/PublicKey.java @@ -0,0 +1,399 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tendermint/crypto/keys.proto + +package com.tendermint.crypto; + +/** + *
+ * PublicKey defines the keys available for use with Validators
+ * 
+ * + * Protobuf type {@code tendermint.crypto.PublicKey} + */ +public final class PublicKey extends + com.google.protobuf.GeneratedMessageLite< + PublicKey, PublicKey.Builder> implements + // @@protoc_insertion_point(message_implements:tendermint.crypto.PublicKey) + PublicKeyOrBuilder { + private PublicKey() { + } + private int sumCase_ = 0; + private java.lang.Object sum_; + public enum SumCase { + ED25519(1), + SECP256K1(2), + SUM_NOT_SET(0); + private final int value; + private SumCase(int value) { + this.value = value; + } + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SumCase valueOf(int value) { + return forNumber(value); + } + + public static SumCase forNumber(int value) { + switch (value) { + case 1: return ED25519; + case 2: return SECP256K1; + case 0: return SUM_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + @java.lang.Override + public SumCase + getSumCase() { + return SumCase.forNumber( + sumCase_); + } + + private void clearSum() { + sumCase_ = 0; + sum_ = null; + } + + public static final int ED25519_FIELD_NUMBER = 1; + /** + * bytes ed25519 = 1 [json_name = "ed25519"]; + * @return Whether the ed25519 field is set. + */ + @java.lang.Override + public boolean hasEd25519() { + return sumCase_ == 1; + } + /** + * bytes ed25519 = 1 [json_name = "ed25519"]; + * @return The ed25519. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEd25519() { + if (sumCase_ == 1) { + return (com.google.protobuf.ByteString) sum_; + } + return com.google.protobuf.ByteString.EMPTY; + } + /** + * bytes ed25519 = 1 [json_name = "ed25519"]; + * @param value The ed25519 to set. + */ + private void setEd25519(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + sumCase_ = 1; + sum_ = value; + } + /** + * bytes ed25519 = 1 [json_name = "ed25519"]; + */ + private void clearEd25519() { + if (sumCase_ == 1) { + sumCase_ = 0; + sum_ = null; + } + } + + public static final int SECP256K1_FIELD_NUMBER = 2; + /** + * bytes secp256k1 = 2 [json_name = "secp256k1"]; + * @return Whether the secp256k1 field is set. + */ + @java.lang.Override + public boolean hasSecp256K1() { + return sumCase_ == 2; + } + /** + * bytes secp256k1 = 2 [json_name = "secp256k1"]; + * @return The secp256k1. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSecp256K1() { + if (sumCase_ == 2) { + return (com.google.protobuf.ByteString) sum_; + } + return com.google.protobuf.ByteString.EMPTY; + } + /** + * bytes secp256k1 = 2 [json_name = "secp256k1"]; + * @param value The secp256k1 to set. + */ + private void setSecp256K1(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + sumCase_ = 2; + sum_ = value; + } + /** + * bytes secp256k1 = 2 [json_name = "secp256k1"]; + */ + private void clearSecp256K1() { + if (sumCase_ == 2) { + sumCase_ = 0; + sum_ = null; + } + } + + public static com.tendermint.crypto.PublicKey parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.tendermint.crypto.PublicKey parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.tendermint.crypto.PublicKey parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.tendermint.crypto.PublicKey parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.tendermint.crypto.PublicKey parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.tendermint.crypto.PublicKey parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.tendermint.crypto.PublicKey parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.tendermint.crypto.PublicKey parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.tendermint.crypto.PublicKey parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.tendermint.crypto.PublicKey parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.tendermint.crypto.PublicKey parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.tendermint.crypto.PublicKey parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.tendermint.crypto.PublicKey prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+   * PublicKey defines the keys available for use with Validators
+   * 
+ * + * Protobuf type {@code tendermint.crypto.PublicKey} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.tendermint.crypto.PublicKey, Builder> implements + // @@protoc_insertion_point(builder_implements:tendermint.crypto.PublicKey) + com.tendermint.crypto.PublicKeyOrBuilder { + // Construct using com.tendermint.crypto.PublicKey.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + @java.lang.Override + public SumCase + getSumCase() { + return instance.getSumCase(); + } + + public Builder clearSum() { + copyOnWrite(); + instance.clearSum(); + return this; + } + + + /** + * bytes ed25519 = 1 [json_name = "ed25519"]; + * @return Whether the ed25519 field is set. + */ + @java.lang.Override + public boolean hasEd25519() { + return instance.hasEd25519(); + } + /** + * bytes ed25519 = 1 [json_name = "ed25519"]; + * @return The ed25519. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEd25519() { + return instance.getEd25519(); + } + /** + * bytes ed25519 = 1 [json_name = "ed25519"]; + * @param value The ed25519 to set. + * @return This builder for chaining. + */ + public Builder setEd25519(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setEd25519(value); + return this; + } + /** + * bytes ed25519 = 1 [json_name = "ed25519"]; + * @return This builder for chaining. + */ + public Builder clearEd25519() { + copyOnWrite(); + instance.clearEd25519(); + return this; + } + + /** + * bytes secp256k1 = 2 [json_name = "secp256k1"]; + * @return Whether the secp256k1 field is set. + */ + @java.lang.Override + public boolean hasSecp256K1() { + return instance.hasSecp256K1(); + } + /** + * bytes secp256k1 = 2 [json_name = "secp256k1"]; + * @return The secp256k1. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSecp256K1() { + return instance.getSecp256K1(); + } + /** + * bytes secp256k1 = 2 [json_name = "secp256k1"]; + * @param value The secp256k1 to set. + * @return This builder for chaining. + */ + public Builder setSecp256K1(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setSecp256K1(value); + return this; + } + /** + * bytes secp256k1 = 2 [json_name = "secp256k1"]; + * @return This builder for chaining. + */ + public Builder clearSecp256K1() { + copyOnWrite(); + instance.clearSecp256K1(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tendermint.crypto.PublicKey) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.tendermint.crypto.PublicKey(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "sum_", + "sumCase_", + }; + java.lang.String info = + "\u0000\u0002\u0001\u0000\u0001\u0002\u0002\u0000\u0000\u0000\u0001=\u0000\u0002=" + + "\u0000"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.tendermint.crypto.PublicKey.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:tendermint.crypto.PublicKey) + private static final com.tendermint.crypto.PublicKey DEFAULT_INSTANCE; + static { + PublicKey defaultInstance = new PublicKey(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + PublicKey.class, defaultInstance); + } + + public static com.tendermint.crypto.PublicKey getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/PublicKeyOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/PublicKeyOrBuilder.java new file mode 100644 index 000000000..0a9c932da --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/PublicKeyOrBuilder.java @@ -0,0 +1,33 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tendermint/crypto/keys.proto + +package com.tendermint.crypto; + +public interface PublicKeyOrBuilder extends + // @@protoc_insertion_point(interface_extends:tendermint.crypto.PublicKey) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * bytes ed25519 = 1 [json_name = "ed25519"]; + * @return Whether the ed25519 field is set. + */ + boolean hasEd25519(); + /** + * bytes ed25519 = 1 [json_name = "ed25519"]; + * @return The ed25519. + */ + com.google.protobuf.ByteString getEd25519(); + + /** + * bytes secp256k1 = 2 [json_name = "secp256k1"]; + * @return Whether the secp256k1 field is set. + */ + boolean hasSecp256K1(); + /** + * bytes secp256k1 = 2 [json_name = "secp256k1"]; + * @return The secp256k1. + */ + com.google.protobuf.ByteString getSecp256K1(); + + public com.tendermint.crypto.PublicKey.SumCase getSumCase(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/ValueOp.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/ValueOp.java new file mode 100644 index 000000000..fe5189e99 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/ValueOp.java @@ -0,0 +1,402 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tendermint/crypto/proof.proto + +package com.tendermint.crypto; + +/** + * Protobuf type {@code tendermint.crypto.ValueOp} + */ +public final class ValueOp extends + com.google.protobuf.GeneratedMessageLite< + ValueOp, ValueOp.Builder> implements + // @@protoc_insertion_point(message_implements:tendermint.crypto.ValueOp) + ValueOpOrBuilder { + private ValueOp() { + key_ = com.google.protobuf.ByteString.EMPTY; + } + public static final int KEY_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString key_; + /** + *
+   * Encoded in ProofOp.Key.
+   * 
+ * + * bytes key = 1 [json_name = "key"]; + * @return The key. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKey() { + return key_; + } + /** + *
+   * Encoded in ProofOp.Key.
+   * 
+ * + * bytes key = 1 [json_name = "key"]; + * @param value The key to set. + */ + private void setKey(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + key_ = value; + } + /** + *
+   * Encoded in ProofOp.Key.
+   * 
+ * + * bytes key = 1 [json_name = "key"]; + */ + private void clearKey() { + + key_ = getDefaultInstance().getKey(); + } + + public static final int PROOF_FIELD_NUMBER = 2; + private com.tendermint.crypto.Proof proof_; + /** + *
+   * To encode in ProofOp.Data
+   * 
+ * + * .tendermint.crypto.Proof proof = 2 [json_name = "proof"]; + */ + @java.lang.Override + public boolean hasProof() { + return proof_ != null; + } + /** + *
+   * To encode in ProofOp.Data
+   * 
+ * + * .tendermint.crypto.Proof proof = 2 [json_name = "proof"]; + */ + @java.lang.Override + public com.tendermint.crypto.Proof getProof() { + return proof_ == null ? com.tendermint.crypto.Proof.getDefaultInstance() : proof_; + } + /** + *
+   * To encode in ProofOp.Data
+   * 
+ * + * .tendermint.crypto.Proof proof = 2 [json_name = "proof"]; + */ + private void setProof(com.tendermint.crypto.Proof value) { + value.getClass(); + proof_ = value; + + } + /** + *
+   * To encode in ProofOp.Data
+   * 
+ * + * .tendermint.crypto.Proof proof = 2 [json_name = "proof"]; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeProof(com.tendermint.crypto.Proof value) { + value.getClass(); + if (proof_ != null && + proof_ != com.tendermint.crypto.Proof.getDefaultInstance()) { + proof_ = + com.tendermint.crypto.Proof.newBuilder(proof_).mergeFrom(value).buildPartial(); + } else { + proof_ = value; + } + + } + /** + *
+   * To encode in ProofOp.Data
+   * 
+ * + * .tendermint.crypto.Proof proof = 2 [json_name = "proof"]; + */ + private void clearProof() { proof_ = null; + + } + + public static com.tendermint.crypto.ValueOp parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.tendermint.crypto.ValueOp parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.tendermint.crypto.ValueOp parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.tendermint.crypto.ValueOp parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.tendermint.crypto.ValueOp parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.tendermint.crypto.ValueOp parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.tendermint.crypto.ValueOp parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.tendermint.crypto.ValueOp parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.tendermint.crypto.ValueOp parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.tendermint.crypto.ValueOp parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.tendermint.crypto.ValueOp parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.tendermint.crypto.ValueOp parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.tendermint.crypto.ValueOp prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + * Protobuf type {@code tendermint.crypto.ValueOp} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.tendermint.crypto.ValueOp, Builder> implements + // @@protoc_insertion_point(builder_implements:tendermint.crypto.ValueOp) + com.tendermint.crypto.ValueOpOrBuilder { + // Construct using com.tendermint.crypto.ValueOp.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + *
+     * Encoded in ProofOp.Key.
+     * 
+ * + * bytes key = 1 [json_name = "key"]; + * @return The key. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKey() { + return instance.getKey(); + } + /** + *
+     * Encoded in ProofOp.Key.
+     * 
+ * + * bytes key = 1 [json_name = "key"]; + * @param value The key to set. + * @return This builder for chaining. + */ + public Builder setKey(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setKey(value); + return this; + } + /** + *
+     * Encoded in ProofOp.Key.
+     * 
+ * + * bytes key = 1 [json_name = "key"]; + * @return This builder for chaining. + */ + public Builder clearKey() { + copyOnWrite(); + instance.clearKey(); + return this; + } + + /** + *
+     * To encode in ProofOp.Data
+     * 
+ * + * .tendermint.crypto.Proof proof = 2 [json_name = "proof"]; + */ + @java.lang.Override + public boolean hasProof() { + return instance.hasProof(); + } + /** + *
+     * To encode in ProofOp.Data
+     * 
+ * + * .tendermint.crypto.Proof proof = 2 [json_name = "proof"]; + */ + @java.lang.Override + public com.tendermint.crypto.Proof getProof() { + return instance.getProof(); + } + /** + *
+     * To encode in ProofOp.Data
+     * 
+ * + * .tendermint.crypto.Proof proof = 2 [json_name = "proof"]; + */ + public Builder setProof(com.tendermint.crypto.Proof value) { + copyOnWrite(); + instance.setProof(value); + return this; + } + /** + *
+     * To encode in ProofOp.Data
+     * 
+ * + * .tendermint.crypto.Proof proof = 2 [json_name = "proof"]; + */ + public Builder setProof( + com.tendermint.crypto.Proof.Builder builderForValue) { + copyOnWrite(); + instance.setProof(builderForValue.build()); + return this; + } + /** + *
+     * To encode in ProofOp.Data
+     * 
+ * + * .tendermint.crypto.Proof proof = 2 [json_name = "proof"]; + */ + public Builder mergeProof(com.tendermint.crypto.Proof value) { + copyOnWrite(); + instance.mergeProof(value); + return this; + } + /** + *
+     * To encode in ProofOp.Data
+     * 
+ * + * .tendermint.crypto.Proof proof = 2 [json_name = "proof"]; + */ + public Builder clearProof() { copyOnWrite(); + instance.clearProof(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tendermint.crypto.ValueOp) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.tendermint.crypto.ValueOp(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "key_", + "proof_", + }; + java.lang.String info = + "\u0000\u0002\u0000\u0000\u0001\u0002\u0002\u0000\u0000\u0000\u0001\n\u0002\t"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.tendermint.crypto.ValueOp.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:tendermint.crypto.ValueOp) + private static final com.tendermint.crypto.ValueOp DEFAULT_INSTANCE; + static { + ValueOp defaultInstance = new ValueOp(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + ValueOp.class, defaultInstance); + } + + public static com.tendermint.crypto.ValueOp getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/ValueOpOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/ValueOpOrBuilder.java new file mode 100644 index 000000000..0a4f7d58c --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/ValueOpOrBuilder.java @@ -0,0 +1,38 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tendermint/crypto/proof.proto + +package com.tendermint.crypto; + +public interface ValueOpOrBuilder extends + // @@protoc_insertion_point(interface_extends:tendermint.crypto.ValueOp) + com.google.protobuf.MessageLiteOrBuilder { + + /** + *
+   * Encoded in ProofOp.Key.
+   * 
+ * + * bytes key = 1 [json_name = "key"]; + * @return The key. + */ + com.google.protobuf.ByteString getKey(); + + /** + *
+   * To encode in ProofOp.Data
+   * 
+ * + * .tendermint.crypto.Proof proof = 2 [json_name = "proof"]; + * @return Whether the proof field is set. + */ + boolean hasProof(); + /** + *
+   * To encode in ProofOp.Data
+   * 
+ * + * .tendermint.crypto.Proof proof = 2 [json_name = "proof"]; + * @return The proof. + */ + com.tendermint.crypto.Proof getProof(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/BlockID.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/BlockID.java new file mode 100644 index 000000000..91fd350f8 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/BlockID.java @@ -0,0 +1,342 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tendermint/types/types.proto + +package com.tendermint.types; + +/** + *
+ * BlockID
+ * 
+ * + * Protobuf type {@code tendermint.types.BlockID} + */ +public final class BlockID extends + com.google.protobuf.GeneratedMessageLite< + BlockID, BlockID.Builder> implements + // @@protoc_insertion_point(message_implements:tendermint.types.BlockID) + BlockIDOrBuilder { + private BlockID() { + hash_ = com.google.protobuf.ByteString.EMPTY; + } + public static final int HASH_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString hash_; + /** + * bytes hash = 1 [json_name = "hash"]; + * @return The hash. + */ + @java.lang.Override + public com.google.protobuf.ByteString getHash() { + return hash_; + } + /** + * bytes hash = 1 [json_name = "hash"]; + * @param value The hash to set. + */ + private void setHash(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + hash_ = value; + } + /** + * bytes hash = 1 [json_name = "hash"]; + */ + private void clearHash() { + + hash_ = getDefaultInstance().getHash(); + } + + public static final int PART_SET_HEADER_FIELD_NUMBER = 2; + private com.tendermint.types.PartSetHeader partSetHeader_; + /** + * .tendermint.types.PartSetHeader part_set_header = 2 [json_name = "partSetHeader", (.gogoproto.nullable) = false]; + */ + @java.lang.Override + public boolean hasPartSetHeader() { + return partSetHeader_ != null; + } + /** + * .tendermint.types.PartSetHeader part_set_header = 2 [json_name = "partSetHeader", (.gogoproto.nullable) = false]; + */ + @java.lang.Override + public com.tendermint.types.PartSetHeader getPartSetHeader() { + return partSetHeader_ == null ? com.tendermint.types.PartSetHeader.getDefaultInstance() : partSetHeader_; + } + /** + * .tendermint.types.PartSetHeader part_set_header = 2 [json_name = "partSetHeader", (.gogoproto.nullable) = false]; + */ + private void setPartSetHeader(com.tendermint.types.PartSetHeader value) { + value.getClass(); + partSetHeader_ = value; + + } + /** + * .tendermint.types.PartSetHeader part_set_header = 2 [json_name = "partSetHeader", (.gogoproto.nullable) = false]; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergePartSetHeader(com.tendermint.types.PartSetHeader value) { + value.getClass(); + if (partSetHeader_ != null && + partSetHeader_ != com.tendermint.types.PartSetHeader.getDefaultInstance()) { + partSetHeader_ = + com.tendermint.types.PartSetHeader.newBuilder(partSetHeader_).mergeFrom(value).buildPartial(); + } else { + partSetHeader_ = value; + } + + } + /** + * .tendermint.types.PartSetHeader part_set_header = 2 [json_name = "partSetHeader", (.gogoproto.nullable) = false]; + */ + private void clearPartSetHeader() { partSetHeader_ = null; + + } + + public static com.tendermint.types.BlockID parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.tendermint.types.BlockID parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.tendermint.types.BlockID parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.tendermint.types.BlockID parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.tendermint.types.BlockID parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.tendermint.types.BlockID parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.tendermint.types.BlockID parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.tendermint.types.BlockID parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.tendermint.types.BlockID parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.tendermint.types.BlockID parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.tendermint.types.BlockID parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.tendermint.types.BlockID parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.tendermint.types.BlockID prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+   * BlockID
+   * 
+ * + * Protobuf type {@code tendermint.types.BlockID} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.tendermint.types.BlockID, Builder> implements + // @@protoc_insertion_point(builder_implements:tendermint.types.BlockID) + com.tendermint.types.BlockIDOrBuilder { + // Construct using com.tendermint.types.BlockID.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * bytes hash = 1 [json_name = "hash"]; + * @return The hash. + */ + @java.lang.Override + public com.google.protobuf.ByteString getHash() { + return instance.getHash(); + } + /** + * bytes hash = 1 [json_name = "hash"]; + * @param value The hash to set. + * @return This builder for chaining. + */ + public Builder setHash(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setHash(value); + return this; + } + /** + * bytes hash = 1 [json_name = "hash"]; + * @return This builder for chaining. + */ + public Builder clearHash() { + copyOnWrite(); + instance.clearHash(); + return this; + } + + /** + * .tendermint.types.PartSetHeader part_set_header = 2 [json_name = "partSetHeader", (.gogoproto.nullable) = false]; + */ + @java.lang.Override + public boolean hasPartSetHeader() { + return instance.hasPartSetHeader(); + } + /** + * .tendermint.types.PartSetHeader part_set_header = 2 [json_name = "partSetHeader", (.gogoproto.nullable) = false]; + */ + @java.lang.Override + public com.tendermint.types.PartSetHeader getPartSetHeader() { + return instance.getPartSetHeader(); + } + /** + * .tendermint.types.PartSetHeader part_set_header = 2 [json_name = "partSetHeader", (.gogoproto.nullable) = false]; + */ + public Builder setPartSetHeader(com.tendermint.types.PartSetHeader value) { + copyOnWrite(); + instance.setPartSetHeader(value); + return this; + } + /** + * .tendermint.types.PartSetHeader part_set_header = 2 [json_name = "partSetHeader", (.gogoproto.nullable) = false]; + */ + public Builder setPartSetHeader( + com.tendermint.types.PartSetHeader.Builder builderForValue) { + copyOnWrite(); + instance.setPartSetHeader(builderForValue.build()); + return this; + } + /** + * .tendermint.types.PartSetHeader part_set_header = 2 [json_name = "partSetHeader", (.gogoproto.nullable) = false]; + */ + public Builder mergePartSetHeader(com.tendermint.types.PartSetHeader value) { + copyOnWrite(); + instance.mergePartSetHeader(value); + return this; + } + /** + * .tendermint.types.PartSetHeader part_set_header = 2 [json_name = "partSetHeader", (.gogoproto.nullable) = false]; + */ + public Builder clearPartSetHeader() { copyOnWrite(); + instance.clearPartSetHeader(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tendermint.types.BlockID) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.tendermint.types.BlockID(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "hash_", + "partSetHeader_", + }; + java.lang.String info = + "\u0000\u0002\u0000\u0000\u0001\u0002\u0002\u0000\u0000\u0000\u0001\n\u0002\t"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.tendermint.types.BlockID.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:tendermint.types.BlockID) + private static final com.tendermint.types.BlockID DEFAULT_INSTANCE; + static { + BlockID defaultInstance = new BlockID(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + BlockID.class, defaultInstance); + } + + public static com.tendermint.types.BlockID getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/BlockIDFlag.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/BlockIDFlag.java new file mode 100644 index 000000000..0b61aed9b --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/BlockIDFlag.java @@ -0,0 +1,116 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tendermint/types/types.proto + +package com.tendermint.types; + +/** + *
+ * BlockIdFlag indicates which BlcokID the signature is for
+ * 
+ * + * Protobuf enum {@code tendermint.types.BlockIDFlag} + */ +public enum BlockIDFlag + implements com.google.protobuf.Internal.EnumLite { + /** + * BLOCK_ID_FLAG_UNKNOWN = 0 [(.gogoproto.enumvalue_customname) = "BlockIDFlagUnknown"]; + */ + BLOCK_ID_FLAG_UNKNOWN(0), + /** + * BLOCK_ID_FLAG_ABSENT = 1 [(.gogoproto.enumvalue_customname) = "BlockIDFlagAbsent"]; + */ + BLOCK_ID_FLAG_ABSENT(1), + /** + * BLOCK_ID_FLAG_COMMIT = 2 [(.gogoproto.enumvalue_customname) = "BlockIDFlagCommit"]; + */ + BLOCK_ID_FLAG_COMMIT(2), + /** + * BLOCK_ID_FLAG_NIL = 3 [(.gogoproto.enumvalue_customname) = "BlockIDFlagNil"]; + */ + BLOCK_ID_FLAG_NIL(3), + UNRECOGNIZED(-1), + ; + + /** + * BLOCK_ID_FLAG_UNKNOWN = 0 [(.gogoproto.enumvalue_customname) = "BlockIDFlagUnknown"]; + */ + public static final int BLOCK_ID_FLAG_UNKNOWN_VALUE = 0; + /** + * BLOCK_ID_FLAG_ABSENT = 1 [(.gogoproto.enumvalue_customname) = "BlockIDFlagAbsent"]; + */ + public static final int BLOCK_ID_FLAG_ABSENT_VALUE = 1; + /** + * BLOCK_ID_FLAG_COMMIT = 2 [(.gogoproto.enumvalue_customname) = "BlockIDFlagCommit"]; + */ + public static final int BLOCK_ID_FLAG_COMMIT_VALUE = 2; + /** + * BLOCK_ID_FLAG_NIL = 3 [(.gogoproto.enumvalue_customname) = "BlockIDFlagNil"]; + */ + public static final int BLOCK_ID_FLAG_NIL_VALUE = 3; + + + @java.lang.Override + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static BlockIDFlag valueOf(int value) { + return forNumber(value); + } + + public static BlockIDFlag forNumber(int value) { + switch (value) { + case 0: return BLOCK_ID_FLAG_UNKNOWN; + case 1: return BLOCK_ID_FLAG_ABSENT; + case 2: return BLOCK_ID_FLAG_COMMIT; + case 3: return BLOCK_ID_FLAG_NIL; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + BlockIDFlag> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + @java.lang.Override + public BlockIDFlag findValueByNumber(int number) { + return BlockIDFlag.forNumber(number); + } + }; + + public static com.google.protobuf.Internal.EnumVerifier + internalGetVerifier() { + return BlockIDFlagVerifier.INSTANCE; + } + + private static final class BlockIDFlagVerifier implements + com.google.protobuf.Internal.EnumVerifier { + static final com.google.protobuf.Internal.EnumVerifier INSTANCE = new BlockIDFlagVerifier(); + @java.lang.Override + public boolean isInRange(int number) { + return BlockIDFlag.forNumber(number) != null; + } + }; + + private final int value; + + private BlockIDFlag(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:tendermint.types.BlockIDFlag) +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/BlockIDOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/BlockIDOrBuilder.java new file mode 100644 index 000000000..fe6320643 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/BlockIDOrBuilder.java @@ -0,0 +1,26 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tendermint/types/types.proto + +package com.tendermint.types; + +public interface BlockIDOrBuilder extends + // @@protoc_insertion_point(interface_extends:tendermint.types.BlockID) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * bytes hash = 1 [json_name = "hash"]; + * @return The hash. + */ + com.google.protobuf.ByteString getHash(); + + /** + * .tendermint.types.PartSetHeader part_set_header = 2 [json_name = "partSetHeader", (.gogoproto.nullable) = false]; + * @return Whether the partSetHeader field is set. + */ + boolean hasPartSetHeader(); + /** + * .tendermint.types.PartSetHeader part_set_header = 2 [json_name = "partSetHeader", (.gogoproto.nullable) = false]; + * @return The partSetHeader. + */ + com.tendermint.types.PartSetHeader getPartSetHeader(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/BlockMeta.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/BlockMeta.java new file mode 100644 index 000000000..6961de56d --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/BlockMeta.java @@ -0,0 +1,482 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tendermint/types/types.proto + +package com.tendermint.types; + +/** + * Protobuf type {@code tendermint.types.BlockMeta} + */ +public final class BlockMeta extends + com.google.protobuf.GeneratedMessageLite< + BlockMeta, BlockMeta.Builder> implements + // @@protoc_insertion_point(message_implements:tendermint.types.BlockMeta) + BlockMetaOrBuilder { + private BlockMeta() { + } + public static final int BLOCK_ID_FIELD_NUMBER = 1; + private com.tendermint.types.BlockID blockId_; + /** + * .tendermint.types.BlockID block_id = 1 [json_name = "blockId", (.gogoproto.nullable) = false, (.gogoproto.customname) = "BlockID"]; + */ + @java.lang.Override + public boolean hasBlockId() { + return blockId_ != null; + } + /** + * .tendermint.types.BlockID block_id = 1 [json_name = "blockId", (.gogoproto.nullable) = false, (.gogoproto.customname) = "BlockID"]; + */ + @java.lang.Override + public com.tendermint.types.BlockID getBlockId() { + return blockId_ == null ? com.tendermint.types.BlockID.getDefaultInstance() : blockId_; + } + /** + * .tendermint.types.BlockID block_id = 1 [json_name = "blockId", (.gogoproto.nullable) = false, (.gogoproto.customname) = "BlockID"]; + */ + private void setBlockId(com.tendermint.types.BlockID value) { + value.getClass(); + blockId_ = value; + + } + /** + * .tendermint.types.BlockID block_id = 1 [json_name = "blockId", (.gogoproto.nullable) = false, (.gogoproto.customname) = "BlockID"]; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeBlockId(com.tendermint.types.BlockID value) { + value.getClass(); + if (blockId_ != null && + blockId_ != com.tendermint.types.BlockID.getDefaultInstance()) { + blockId_ = + com.tendermint.types.BlockID.newBuilder(blockId_).mergeFrom(value).buildPartial(); + } else { + blockId_ = value; + } + + } + /** + * .tendermint.types.BlockID block_id = 1 [json_name = "blockId", (.gogoproto.nullable) = false, (.gogoproto.customname) = "BlockID"]; + */ + private void clearBlockId() { blockId_ = null; + + } + + public static final int BLOCK_SIZE_FIELD_NUMBER = 2; + private long blockSize_; + /** + * int64 block_size = 2 [json_name = "blockSize"]; + * @return The blockSize. + */ + @java.lang.Override + public long getBlockSize() { + return blockSize_; + } + /** + * int64 block_size = 2 [json_name = "blockSize"]; + * @param value The blockSize to set. + */ + private void setBlockSize(long value) { + + blockSize_ = value; + } + /** + * int64 block_size = 2 [json_name = "blockSize"]; + */ + private void clearBlockSize() { + + blockSize_ = 0L; + } + + public static final int HEADER_FIELD_NUMBER = 3; + private com.tendermint.types.Header header_; + /** + * .tendermint.types.Header header = 3 [json_name = "header", (.gogoproto.nullable) = false]; + */ + @java.lang.Override + public boolean hasHeader() { + return header_ != null; + } + /** + * .tendermint.types.Header header = 3 [json_name = "header", (.gogoproto.nullable) = false]; + */ + @java.lang.Override + public com.tendermint.types.Header getHeader() { + return header_ == null ? com.tendermint.types.Header.getDefaultInstance() : header_; + } + /** + * .tendermint.types.Header header = 3 [json_name = "header", (.gogoproto.nullable) = false]; + */ + private void setHeader(com.tendermint.types.Header value) { + value.getClass(); + header_ = value; + + } + /** + * .tendermint.types.Header header = 3 [json_name = "header", (.gogoproto.nullable) = false]; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeHeader(com.tendermint.types.Header value) { + value.getClass(); + if (header_ != null && + header_ != com.tendermint.types.Header.getDefaultInstance()) { + header_ = + com.tendermint.types.Header.newBuilder(header_).mergeFrom(value).buildPartial(); + } else { + header_ = value; + } + + } + /** + * .tendermint.types.Header header = 3 [json_name = "header", (.gogoproto.nullable) = false]; + */ + private void clearHeader() { header_ = null; + + } + + public static final int NUM_TXS_FIELD_NUMBER = 4; + private long numTxs_; + /** + * int64 num_txs = 4 [json_name = "numTxs"]; + * @return The numTxs. + */ + @java.lang.Override + public long getNumTxs() { + return numTxs_; + } + /** + * int64 num_txs = 4 [json_name = "numTxs"]; + * @param value The numTxs to set. + */ + private void setNumTxs(long value) { + + numTxs_ = value; + } + /** + * int64 num_txs = 4 [json_name = "numTxs"]; + */ + private void clearNumTxs() { + + numTxs_ = 0L; + } + + public static com.tendermint.types.BlockMeta parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.tendermint.types.BlockMeta parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.tendermint.types.BlockMeta parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.tendermint.types.BlockMeta parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.tendermint.types.BlockMeta parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.tendermint.types.BlockMeta parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.tendermint.types.BlockMeta parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.tendermint.types.BlockMeta parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.tendermint.types.BlockMeta parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.tendermint.types.BlockMeta parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.tendermint.types.BlockMeta parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.tendermint.types.BlockMeta parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.tendermint.types.BlockMeta prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + * Protobuf type {@code tendermint.types.BlockMeta} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.tendermint.types.BlockMeta, Builder> implements + // @@protoc_insertion_point(builder_implements:tendermint.types.BlockMeta) + com.tendermint.types.BlockMetaOrBuilder { + // Construct using com.tendermint.types.BlockMeta.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * .tendermint.types.BlockID block_id = 1 [json_name = "blockId", (.gogoproto.nullable) = false, (.gogoproto.customname) = "BlockID"]; + */ + @java.lang.Override + public boolean hasBlockId() { + return instance.hasBlockId(); + } + /** + * .tendermint.types.BlockID block_id = 1 [json_name = "blockId", (.gogoproto.nullable) = false, (.gogoproto.customname) = "BlockID"]; + */ + @java.lang.Override + public com.tendermint.types.BlockID getBlockId() { + return instance.getBlockId(); + } + /** + * .tendermint.types.BlockID block_id = 1 [json_name = "blockId", (.gogoproto.nullable) = false, (.gogoproto.customname) = "BlockID"]; + */ + public Builder setBlockId(com.tendermint.types.BlockID value) { + copyOnWrite(); + instance.setBlockId(value); + return this; + } + /** + * .tendermint.types.BlockID block_id = 1 [json_name = "blockId", (.gogoproto.nullable) = false, (.gogoproto.customname) = "BlockID"]; + */ + public Builder setBlockId( + com.tendermint.types.BlockID.Builder builderForValue) { + copyOnWrite(); + instance.setBlockId(builderForValue.build()); + return this; + } + /** + * .tendermint.types.BlockID block_id = 1 [json_name = "blockId", (.gogoproto.nullable) = false, (.gogoproto.customname) = "BlockID"]; + */ + public Builder mergeBlockId(com.tendermint.types.BlockID value) { + copyOnWrite(); + instance.mergeBlockId(value); + return this; + } + /** + * .tendermint.types.BlockID block_id = 1 [json_name = "blockId", (.gogoproto.nullable) = false, (.gogoproto.customname) = "BlockID"]; + */ + public Builder clearBlockId() { copyOnWrite(); + instance.clearBlockId(); + return this; + } + + /** + * int64 block_size = 2 [json_name = "blockSize"]; + * @return The blockSize. + */ + @java.lang.Override + public long getBlockSize() { + return instance.getBlockSize(); + } + /** + * int64 block_size = 2 [json_name = "blockSize"]; + * @param value The blockSize to set. + * @return This builder for chaining. + */ + public Builder setBlockSize(long value) { + copyOnWrite(); + instance.setBlockSize(value); + return this; + } + /** + * int64 block_size = 2 [json_name = "blockSize"]; + * @return This builder for chaining. + */ + public Builder clearBlockSize() { + copyOnWrite(); + instance.clearBlockSize(); + return this; + } + + /** + * .tendermint.types.Header header = 3 [json_name = "header", (.gogoproto.nullable) = false]; + */ + @java.lang.Override + public boolean hasHeader() { + return instance.hasHeader(); + } + /** + * .tendermint.types.Header header = 3 [json_name = "header", (.gogoproto.nullable) = false]; + */ + @java.lang.Override + public com.tendermint.types.Header getHeader() { + return instance.getHeader(); + } + /** + * .tendermint.types.Header header = 3 [json_name = "header", (.gogoproto.nullable) = false]; + */ + public Builder setHeader(com.tendermint.types.Header value) { + copyOnWrite(); + instance.setHeader(value); + return this; + } + /** + * .tendermint.types.Header header = 3 [json_name = "header", (.gogoproto.nullable) = false]; + */ + public Builder setHeader( + com.tendermint.types.Header.Builder builderForValue) { + copyOnWrite(); + instance.setHeader(builderForValue.build()); + return this; + } + /** + * .tendermint.types.Header header = 3 [json_name = "header", (.gogoproto.nullable) = false]; + */ + public Builder mergeHeader(com.tendermint.types.Header value) { + copyOnWrite(); + instance.mergeHeader(value); + return this; + } + /** + * .tendermint.types.Header header = 3 [json_name = "header", (.gogoproto.nullable) = false]; + */ + public Builder clearHeader() { copyOnWrite(); + instance.clearHeader(); + return this; + } + + /** + * int64 num_txs = 4 [json_name = "numTxs"]; + * @return The numTxs. + */ + @java.lang.Override + public long getNumTxs() { + return instance.getNumTxs(); + } + /** + * int64 num_txs = 4 [json_name = "numTxs"]; + * @param value The numTxs to set. + * @return This builder for chaining. + */ + public Builder setNumTxs(long value) { + copyOnWrite(); + instance.setNumTxs(value); + return this; + } + /** + * int64 num_txs = 4 [json_name = "numTxs"]; + * @return This builder for chaining. + */ + public Builder clearNumTxs() { + copyOnWrite(); + instance.clearNumTxs(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tendermint.types.BlockMeta) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.tendermint.types.BlockMeta(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "blockId_", + "blockSize_", + "header_", + "numTxs_", + }; + java.lang.String info = + "\u0000\u0004\u0000\u0000\u0001\u0004\u0004\u0000\u0000\u0000\u0001\t\u0002\u0002" + + "\u0003\t\u0004\u0002"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.tendermint.types.BlockMeta.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:tendermint.types.BlockMeta) + private static final com.tendermint.types.BlockMeta DEFAULT_INSTANCE; + static { + BlockMeta defaultInstance = new BlockMeta(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + BlockMeta.class, defaultInstance); + } + + public static com.tendermint.types.BlockMeta getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/BlockMetaOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/BlockMetaOrBuilder.java new file mode 100644 index 000000000..8608e4a3f --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/BlockMetaOrBuilder.java @@ -0,0 +1,43 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tendermint/types/types.proto + +package com.tendermint.types; + +public interface BlockMetaOrBuilder extends + // @@protoc_insertion_point(interface_extends:tendermint.types.BlockMeta) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * .tendermint.types.BlockID block_id = 1 [json_name = "blockId", (.gogoproto.nullable) = false, (.gogoproto.customname) = "BlockID"]; + * @return Whether the blockId field is set. + */ + boolean hasBlockId(); + /** + * .tendermint.types.BlockID block_id = 1 [json_name = "blockId", (.gogoproto.nullable) = false, (.gogoproto.customname) = "BlockID"]; + * @return The blockId. + */ + com.tendermint.types.BlockID getBlockId(); + + /** + * int64 block_size = 2 [json_name = "blockSize"]; + * @return The blockSize. + */ + long getBlockSize(); + + /** + * .tendermint.types.Header header = 3 [json_name = "header", (.gogoproto.nullable) = false]; + * @return Whether the header field is set. + */ + boolean hasHeader(); + /** + * .tendermint.types.Header header = 3 [json_name = "header", (.gogoproto.nullable) = false]; + * @return The header. + */ + com.tendermint.types.Header getHeader(); + + /** + * int64 num_txs = 4 [json_name = "numTxs"]; + * @return The numTxs. + */ + long getNumTxs(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/Commit.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/Commit.java new file mode 100644 index 000000000..d104003bf --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/Commit.java @@ -0,0 +1,595 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tendermint/types/types.proto + +package com.tendermint.types; + +/** + *
+ * Commit contains the evidence that a block was committed by a set of validators.
+ * 
+ * + * Protobuf type {@code tendermint.types.Commit} + */ +public final class Commit extends + com.google.protobuf.GeneratedMessageLite< + Commit, Commit.Builder> implements + // @@protoc_insertion_point(message_implements:tendermint.types.Commit) + CommitOrBuilder { + private Commit() { + signatures_ = emptyProtobufList(); + } + public static final int HEIGHT_FIELD_NUMBER = 1; + private long height_; + /** + * int64 height = 1 [json_name = "height"]; + * @return The height. + */ + @java.lang.Override + public long getHeight() { + return height_; + } + /** + * int64 height = 1 [json_name = "height"]; + * @param value The height to set. + */ + private void setHeight(long value) { + + height_ = value; + } + /** + * int64 height = 1 [json_name = "height"]; + */ + private void clearHeight() { + + height_ = 0L; + } + + public static final int ROUND_FIELD_NUMBER = 2; + private int round_; + /** + * int32 round = 2 [json_name = "round"]; + * @return The round. + */ + @java.lang.Override + public int getRound() { + return round_; + } + /** + * int32 round = 2 [json_name = "round"]; + * @param value The round to set. + */ + private void setRound(int value) { + + round_ = value; + } + /** + * int32 round = 2 [json_name = "round"]; + */ + private void clearRound() { + + round_ = 0; + } + + public static final int BLOCK_ID_FIELD_NUMBER = 3; + private com.tendermint.types.BlockID blockId_; + /** + * .tendermint.types.BlockID block_id = 3 [json_name = "blockId", (.gogoproto.nullable) = false, (.gogoproto.customname) = "BlockID"]; + */ + @java.lang.Override + public boolean hasBlockId() { + return blockId_ != null; + } + /** + * .tendermint.types.BlockID block_id = 3 [json_name = "blockId", (.gogoproto.nullable) = false, (.gogoproto.customname) = "BlockID"]; + */ + @java.lang.Override + public com.tendermint.types.BlockID getBlockId() { + return blockId_ == null ? com.tendermint.types.BlockID.getDefaultInstance() : blockId_; + } + /** + * .tendermint.types.BlockID block_id = 3 [json_name = "blockId", (.gogoproto.nullable) = false, (.gogoproto.customname) = "BlockID"]; + */ + private void setBlockId(com.tendermint.types.BlockID value) { + value.getClass(); + blockId_ = value; + + } + /** + * .tendermint.types.BlockID block_id = 3 [json_name = "blockId", (.gogoproto.nullable) = false, (.gogoproto.customname) = "BlockID"]; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeBlockId(com.tendermint.types.BlockID value) { + value.getClass(); + if (blockId_ != null && + blockId_ != com.tendermint.types.BlockID.getDefaultInstance()) { + blockId_ = + com.tendermint.types.BlockID.newBuilder(blockId_).mergeFrom(value).buildPartial(); + } else { + blockId_ = value; + } + + } + /** + * .tendermint.types.BlockID block_id = 3 [json_name = "blockId", (.gogoproto.nullable) = false, (.gogoproto.customname) = "BlockID"]; + */ + private void clearBlockId() { blockId_ = null; + + } + + public static final int SIGNATURES_FIELD_NUMBER = 4; + private com.google.protobuf.Internal.ProtobufList signatures_; + /** + * repeated .tendermint.types.CommitSig signatures = 4 [json_name = "signatures", (.gogoproto.nullable) = false]; + */ + @java.lang.Override + public java.util.List getSignaturesList() { + return signatures_; + } + /** + * repeated .tendermint.types.CommitSig signatures = 4 [json_name = "signatures", (.gogoproto.nullable) = false]; + */ + public java.util.List + getSignaturesOrBuilderList() { + return signatures_; + } + /** + * repeated .tendermint.types.CommitSig signatures = 4 [json_name = "signatures", (.gogoproto.nullable) = false]; + */ + @java.lang.Override + public int getSignaturesCount() { + return signatures_.size(); + } + /** + * repeated .tendermint.types.CommitSig signatures = 4 [json_name = "signatures", (.gogoproto.nullable) = false]; + */ + @java.lang.Override + public com.tendermint.types.CommitSig getSignatures(int index) { + return signatures_.get(index); + } + /** + * repeated .tendermint.types.CommitSig signatures = 4 [json_name = "signatures", (.gogoproto.nullable) = false]; + */ + public com.tendermint.types.CommitSigOrBuilder getSignaturesOrBuilder( + int index) { + return signatures_.get(index); + } + private void ensureSignaturesIsMutable() { + com.google.protobuf.Internal.ProtobufList tmp = signatures_; + if (!tmp.isModifiable()) { + signatures_ = + com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp); + } + } + + /** + * repeated .tendermint.types.CommitSig signatures = 4 [json_name = "signatures", (.gogoproto.nullable) = false]; + */ + private void setSignatures( + int index, com.tendermint.types.CommitSig value) { + value.getClass(); + ensureSignaturesIsMutable(); + signatures_.set(index, value); + } + /** + * repeated .tendermint.types.CommitSig signatures = 4 [json_name = "signatures", (.gogoproto.nullable) = false]; + */ + private void addSignatures(com.tendermint.types.CommitSig value) { + value.getClass(); + ensureSignaturesIsMutable(); + signatures_.add(value); + } + /** + * repeated .tendermint.types.CommitSig signatures = 4 [json_name = "signatures", (.gogoproto.nullable) = false]; + */ + private void addSignatures( + int index, com.tendermint.types.CommitSig value) { + value.getClass(); + ensureSignaturesIsMutable(); + signatures_.add(index, value); + } + /** + * repeated .tendermint.types.CommitSig signatures = 4 [json_name = "signatures", (.gogoproto.nullable) = false]; + */ + private void addAllSignatures( + java.lang.Iterable values) { + ensureSignaturesIsMutable(); + com.google.protobuf.AbstractMessageLite.addAll( + values, signatures_); + } + /** + * repeated .tendermint.types.CommitSig signatures = 4 [json_name = "signatures", (.gogoproto.nullable) = false]; + */ + private void clearSignatures() { + signatures_ = emptyProtobufList(); + } + /** + * repeated .tendermint.types.CommitSig signatures = 4 [json_name = "signatures", (.gogoproto.nullable) = false]; + */ + private void removeSignatures(int index) { + ensureSignaturesIsMutable(); + signatures_.remove(index); + } + + public static com.tendermint.types.Commit parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.tendermint.types.Commit parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.tendermint.types.Commit parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.tendermint.types.Commit parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.tendermint.types.Commit parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.tendermint.types.Commit parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.tendermint.types.Commit parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.tendermint.types.Commit parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.tendermint.types.Commit parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.tendermint.types.Commit parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.tendermint.types.Commit parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.tendermint.types.Commit parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.tendermint.types.Commit prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+   * Commit contains the evidence that a block was committed by a set of validators.
+   * 
+ * + * Protobuf type {@code tendermint.types.Commit} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.tendermint.types.Commit, Builder> implements + // @@protoc_insertion_point(builder_implements:tendermint.types.Commit) + com.tendermint.types.CommitOrBuilder { + // Construct using com.tendermint.types.Commit.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * int64 height = 1 [json_name = "height"]; + * @return The height. + */ + @java.lang.Override + public long getHeight() { + return instance.getHeight(); + } + /** + * int64 height = 1 [json_name = "height"]; + * @param value The height to set. + * @return This builder for chaining. + */ + public Builder setHeight(long value) { + copyOnWrite(); + instance.setHeight(value); + return this; + } + /** + * int64 height = 1 [json_name = "height"]; + * @return This builder for chaining. + */ + public Builder clearHeight() { + copyOnWrite(); + instance.clearHeight(); + return this; + } + + /** + * int32 round = 2 [json_name = "round"]; + * @return The round. + */ + @java.lang.Override + public int getRound() { + return instance.getRound(); + } + /** + * int32 round = 2 [json_name = "round"]; + * @param value The round to set. + * @return This builder for chaining. + */ + public Builder setRound(int value) { + copyOnWrite(); + instance.setRound(value); + return this; + } + /** + * int32 round = 2 [json_name = "round"]; + * @return This builder for chaining. + */ + public Builder clearRound() { + copyOnWrite(); + instance.clearRound(); + return this; + } + + /** + * .tendermint.types.BlockID block_id = 3 [json_name = "blockId", (.gogoproto.nullable) = false, (.gogoproto.customname) = "BlockID"]; + */ + @java.lang.Override + public boolean hasBlockId() { + return instance.hasBlockId(); + } + /** + * .tendermint.types.BlockID block_id = 3 [json_name = "blockId", (.gogoproto.nullable) = false, (.gogoproto.customname) = "BlockID"]; + */ + @java.lang.Override + public com.tendermint.types.BlockID getBlockId() { + return instance.getBlockId(); + } + /** + * .tendermint.types.BlockID block_id = 3 [json_name = "blockId", (.gogoproto.nullable) = false, (.gogoproto.customname) = "BlockID"]; + */ + public Builder setBlockId(com.tendermint.types.BlockID value) { + copyOnWrite(); + instance.setBlockId(value); + return this; + } + /** + * .tendermint.types.BlockID block_id = 3 [json_name = "blockId", (.gogoproto.nullable) = false, (.gogoproto.customname) = "BlockID"]; + */ + public Builder setBlockId( + com.tendermint.types.BlockID.Builder builderForValue) { + copyOnWrite(); + instance.setBlockId(builderForValue.build()); + return this; + } + /** + * .tendermint.types.BlockID block_id = 3 [json_name = "blockId", (.gogoproto.nullable) = false, (.gogoproto.customname) = "BlockID"]; + */ + public Builder mergeBlockId(com.tendermint.types.BlockID value) { + copyOnWrite(); + instance.mergeBlockId(value); + return this; + } + /** + * .tendermint.types.BlockID block_id = 3 [json_name = "blockId", (.gogoproto.nullable) = false, (.gogoproto.customname) = "BlockID"]; + */ + public Builder clearBlockId() { copyOnWrite(); + instance.clearBlockId(); + return this; + } + + /** + * repeated .tendermint.types.CommitSig signatures = 4 [json_name = "signatures", (.gogoproto.nullable) = false]; + */ + @java.lang.Override + public java.util.List getSignaturesList() { + return java.util.Collections.unmodifiableList( + instance.getSignaturesList()); + } + /** + * repeated .tendermint.types.CommitSig signatures = 4 [json_name = "signatures", (.gogoproto.nullable) = false]; + */ + @java.lang.Override + public int getSignaturesCount() { + return instance.getSignaturesCount(); + }/** + * repeated .tendermint.types.CommitSig signatures = 4 [json_name = "signatures", (.gogoproto.nullable) = false]; + */ + @java.lang.Override + public com.tendermint.types.CommitSig getSignatures(int index) { + return instance.getSignatures(index); + } + /** + * repeated .tendermint.types.CommitSig signatures = 4 [json_name = "signatures", (.gogoproto.nullable) = false]; + */ + public Builder setSignatures( + int index, com.tendermint.types.CommitSig value) { + copyOnWrite(); + instance.setSignatures(index, value); + return this; + } + /** + * repeated .tendermint.types.CommitSig signatures = 4 [json_name = "signatures", (.gogoproto.nullable) = false]; + */ + public Builder setSignatures( + int index, com.tendermint.types.CommitSig.Builder builderForValue) { + copyOnWrite(); + instance.setSignatures(index, + builderForValue.build()); + return this; + } + /** + * repeated .tendermint.types.CommitSig signatures = 4 [json_name = "signatures", (.gogoproto.nullable) = false]; + */ + public Builder addSignatures(com.tendermint.types.CommitSig value) { + copyOnWrite(); + instance.addSignatures(value); + return this; + } + /** + * repeated .tendermint.types.CommitSig signatures = 4 [json_name = "signatures", (.gogoproto.nullable) = false]; + */ + public Builder addSignatures( + int index, com.tendermint.types.CommitSig value) { + copyOnWrite(); + instance.addSignatures(index, value); + return this; + } + /** + * repeated .tendermint.types.CommitSig signatures = 4 [json_name = "signatures", (.gogoproto.nullable) = false]; + */ + public Builder addSignatures( + com.tendermint.types.CommitSig.Builder builderForValue) { + copyOnWrite(); + instance.addSignatures(builderForValue.build()); + return this; + } + /** + * repeated .tendermint.types.CommitSig signatures = 4 [json_name = "signatures", (.gogoproto.nullable) = false]; + */ + public Builder addSignatures( + int index, com.tendermint.types.CommitSig.Builder builderForValue) { + copyOnWrite(); + instance.addSignatures(index, + builderForValue.build()); + return this; + } + /** + * repeated .tendermint.types.CommitSig signatures = 4 [json_name = "signatures", (.gogoproto.nullable) = false]; + */ + public Builder addAllSignatures( + java.lang.Iterable values) { + copyOnWrite(); + instance.addAllSignatures(values); + return this; + } + /** + * repeated .tendermint.types.CommitSig signatures = 4 [json_name = "signatures", (.gogoproto.nullable) = false]; + */ + public Builder clearSignatures() { + copyOnWrite(); + instance.clearSignatures(); + return this; + } + /** + * repeated .tendermint.types.CommitSig signatures = 4 [json_name = "signatures", (.gogoproto.nullable) = false]; + */ + public Builder removeSignatures(int index) { + copyOnWrite(); + instance.removeSignatures(index); + return this; + } + + // @@protoc_insertion_point(builder_scope:tendermint.types.Commit) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.tendermint.types.Commit(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "height_", + "round_", + "blockId_", + "signatures_", + com.tendermint.types.CommitSig.class, + }; + java.lang.String info = + "\u0000\u0004\u0000\u0000\u0001\u0004\u0004\u0000\u0001\u0000\u0001\u0002\u0002\u0004" + + "\u0003\t\u0004\u001b"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.tendermint.types.Commit.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:tendermint.types.Commit) + private static final com.tendermint.types.Commit DEFAULT_INSTANCE; + static { + Commit defaultInstance = new Commit(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + Commit.class, defaultInstance); + } + + public static com.tendermint.types.Commit getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/CommitOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/CommitOrBuilder.java new file mode 100644 index 000000000..8e7f43d25 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/CommitOrBuilder.java @@ -0,0 +1,46 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tendermint/types/types.proto + +package com.tendermint.types; + +public interface CommitOrBuilder extends + // @@protoc_insertion_point(interface_extends:tendermint.types.Commit) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * int64 height = 1 [json_name = "height"]; + * @return The height. + */ + long getHeight(); + + /** + * int32 round = 2 [json_name = "round"]; + * @return The round. + */ + int getRound(); + + /** + * .tendermint.types.BlockID block_id = 3 [json_name = "blockId", (.gogoproto.nullable) = false, (.gogoproto.customname) = "BlockID"]; + * @return Whether the blockId field is set. + */ + boolean hasBlockId(); + /** + * .tendermint.types.BlockID block_id = 3 [json_name = "blockId", (.gogoproto.nullable) = false, (.gogoproto.customname) = "BlockID"]; + * @return The blockId. + */ + com.tendermint.types.BlockID getBlockId(); + + /** + * repeated .tendermint.types.CommitSig signatures = 4 [json_name = "signatures", (.gogoproto.nullable) = false]; + */ + java.util.List + getSignaturesList(); + /** + * repeated .tendermint.types.CommitSig signatures = 4 [json_name = "signatures", (.gogoproto.nullable) = false]; + */ + com.tendermint.types.CommitSig getSignatures(int index); + /** + * repeated .tendermint.types.CommitSig signatures = 4 [json_name = "signatures", (.gogoproto.nullable) = false]; + */ + int getSignaturesCount(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/CommitSig.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/CommitSig.java new file mode 100644 index 000000000..ef30d6f62 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/CommitSig.java @@ -0,0 +1,489 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tendermint/types/types.proto + +package com.tendermint.types; + +/** + *
+ * CommitSig is a part of the Vote included in a Commit.
+ * 
+ * + * Protobuf type {@code tendermint.types.CommitSig} + */ +public final class CommitSig extends + com.google.protobuf.GeneratedMessageLite< + CommitSig, CommitSig.Builder> implements + // @@protoc_insertion_point(message_implements:tendermint.types.CommitSig) + CommitSigOrBuilder { + private CommitSig() { + validatorAddress_ = com.google.protobuf.ByteString.EMPTY; + signature_ = com.google.protobuf.ByteString.EMPTY; + } + public static final int BLOCK_ID_FLAG_FIELD_NUMBER = 1; + private int blockIdFlag_; + /** + * .tendermint.types.BlockIDFlag block_id_flag = 1 [json_name = "blockIdFlag"]; + * @return The enum numeric value on the wire for blockIdFlag. + */ + @java.lang.Override + public int getBlockIdFlagValue() { + return blockIdFlag_; + } + /** + * .tendermint.types.BlockIDFlag block_id_flag = 1 [json_name = "blockIdFlag"]; + * @return The blockIdFlag. + */ + @java.lang.Override + public com.tendermint.types.BlockIDFlag getBlockIdFlag() { + com.tendermint.types.BlockIDFlag result = com.tendermint.types.BlockIDFlag.forNumber(blockIdFlag_); + return result == null ? com.tendermint.types.BlockIDFlag.UNRECOGNIZED : result; + } + /** + * .tendermint.types.BlockIDFlag block_id_flag = 1 [json_name = "blockIdFlag"]; + * @param value The enum numeric value on the wire for blockIdFlag to set. + */ + private void setBlockIdFlagValue(int value) { + blockIdFlag_ = value; + } + /** + * .tendermint.types.BlockIDFlag block_id_flag = 1 [json_name = "blockIdFlag"]; + * @param value The blockIdFlag to set. + */ + private void setBlockIdFlag(com.tendermint.types.BlockIDFlag value) { + blockIdFlag_ = value.getNumber(); + + } + /** + * .tendermint.types.BlockIDFlag block_id_flag = 1 [json_name = "blockIdFlag"]; + */ + private void clearBlockIdFlag() { + + blockIdFlag_ = 0; + } + + public static final int VALIDATOR_ADDRESS_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString validatorAddress_; + /** + * bytes validator_address = 2 [json_name = "validatorAddress"]; + * @return The validatorAddress. + */ + @java.lang.Override + public com.google.protobuf.ByteString getValidatorAddress() { + return validatorAddress_; + } + /** + * bytes validator_address = 2 [json_name = "validatorAddress"]; + * @param value The validatorAddress to set. + */ + private void setValidatorAddress(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + validatorAddress_ = value; + } + /** + * bytes validator_address = 2 [json_name = "validatorAddress"]; + */ + private void clearValidatorAddress() { + + validatorAddress_ = getDefaultInstance().getValidatorAddress(); + } + + public static final int TIMESTAMP_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp timestamp_; + /** + * .google.protobuf.Timestamp timestamp = 3 [json_name = "timestamp", (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true]; + */ + @java.lang.Override + public boolean hasTimestamp() { + return timestamp_ != null; + } + /** + * .google.protobuf.Timestamp timestamp = 3 [json_name = "timestamp", (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true]; + */ + @java.lang.Override + public com.google.protobuf.Timestamp getTimestamp() { + return timestamp_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : timestamp_; + } + /** + * .google.protobuf.Timestamp timestamp = 3 [json_name = "timestamp", (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true]; + */ + private void setTimestamp(com.google.protobuf.Timestamp value) { + value.getClass(); + timestamp_ = value; + + } + /** + * .google.protobuf.Timestamp timestamp = 3 [json_name = "timestamp", (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true]; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeTimestamp(com.google.protobuf.Timestamp value) { + value.getClass(); + if (timestamp_ != null && + timestamp_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + timestamp_ = + com.google.protobuf.Timestamp.newBuilder(timestamp_).mergeFrom(value).buildPartial(); + } else { + timestamp_ = value; + } + + } + /** + * .google.protobuf.Timestamp timestamp = 3 [json_name = "timestamp", (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true]; + */ + private void clearTimestamp() { timestamp_ = null; + + } + + public static final int SIGNATURE_FIELD_NUMBER = 4; + private com.google.protobuf.ByteString signature_; + /** + * bytes signature = 4 [json_name = "signature"]; + * @return The signature. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSignature() { + return signature_; + } + /** + * bytes signature = 4 [json_name = "signature"]; + * @param value The signature to set. + */ + private void setSignature(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + signature_ = value; + } + /** + * bytes signature = 4 [json_name = "signature"]; + */ + private void clearSignature() { + + signature_ = getDefaultInstance().getSignature(); + } + + public static com.tendermint.types.CommitSig parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.tendermint.types.CommitSig parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.tendermint.types.CommitSig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.tendermint.types.CommitSig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.tendermint.types.CommitSig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.tendermint.types.CommitSig parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.tendermint.types.CommitSig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.tendermint.types.CommitSig parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.tendermint.types.CommitSig parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.tendermint.types.CommitSig parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.tendermint.types.CommitSig parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.tendermint.types.CommitSig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.tendermint.types.CommitSig prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+   * CommitSig is a part of the Vote included in a Commit.
+   * 
+ * + * Protobuf type {@code tendermint.types.CommitSig} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.tendermint.types.CommitSig, Builder> implements + // @@protoc_insertion_point(builder_implements:tendermint.types.CommitSig) + com.tendermint.types.CommitSigOrBuilder { + // Construct using com.tendermint.types.CommitSig.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * .tendermint.types.BlockIDFlag block_id_flag = 1 [json_name = "blockIdFlag"]; + * @return The enum numeric value on the wire for blockIdFlag. + */ + @java.lang.Override + public int getBlockIdFlagValue() { + return instance.getBlockIdFlagValue(); + } + /** + * .tendermint.types.BlockIDFlag block_id_flag = 1 [json_name = "blockIdFlag"]; + * @param value The blockIdFlag to set. + * @return This builder for chaining. + */ + public Builder setBlockIdFlagValue(int value) { + copyOnWrite(); + instance.setBlockIdFlagValue(value); + return this; + } + /** + * .tendermint.types.BlockIDFlag block_id_flag = 1 [json_name = "blockIdFlag"]; + * @return The blockIdFlag. + */ + @java.lang.Override + public com.tendermint.types.BlockIDFlag getBlockIdFlag() { + return instance.getBlockIdFlag(); + } + /** + * .tendermint.types.BlockIDFlag block_id_flag = 1 [json_name = "blockIdFlag"]; + * @param value The enum numeric value on the wire for blockIdFlag to set. + * @return This builder for chaining. + */ + public Builder setBlockIdFlag(com.tendermint.types.BlockIDFlag value) { + copyOnWrite(); + instance.setBlockIdFlag(value); + return this; + } + /** + * .tendermint.types.BlockIDFlag block_id_flag = 1 [json_name = "blockIdFlag"]; + * @return This builder for chaining. + */ + public Builder clearBlockIdFlag() { + copyOnWrite(); + instance.clearBlockIdFlag(); + return this; + } + + /** + * bytes validator_address = 2 [json_name = "validatorAddress"]; + * @return The validatorAddress. + */ + @java.lang.Override + public com.google.protobuf.ByteString getValidatorAddress() { + return instance.getValidatorAddress(); + } + /** + * bytes validator_address = 2 [json_name = "validatorAddress"]; + * @param value The validatorAddress to set. + * @return This builder for chaining. + */ + public Builder setValidatorAddress(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setValidatorAddress(value); + return this; + } + /** + * bytes validator_address = 2 [json_name = "validatorAddress"]; + * @return This builder for chaining. + */ + public Builder clearValidatorAddress() { + copyOnWrite(); + instance.clearValidatorAddress(); + return this; + } + + /** + * .google.protobuf.Timestamp timestamp = 3 [json_name = "timestamp", (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true]; + */ + @java.lang.Override + public boolean hasTimestamp() { + return instance.hasTimestamp(); + } + /** + * .google.protobuf.Timestamp timestamp = 3 [json_name = "timestamp", (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true]; + */ + @java.lang.Override + public com.google.protobuf.Timestamp getTimestamp() { + return instance.getTimestamp(); + } + /** + * .google.protobuf.Timestamp timestamp = 3 [json_name = "timestamp", (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true]; + */ + public Builder setTimestamp(com.google.protobuf.Timestamp value) { + copyOnWrite(); + instance.setTimestamp(value); + return this; + } + /** + * .google.protobuf.Timestamp timestamp = 3 [json_name = "timestamp", (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true]; + */ + public Builder setTimestamp( + com.google.protobuf.Timestamp.Builder builderForValue) { + copyOnWrite(); + instance.setTimestamp(builderForValue.build()); + return this; + } + /** + * .google.protobuf.Timestamp timestamp = 3 [json_name = "timestamp", (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true]; + */ + public Builder mergeTimestamp(com.google.protobuf.Timestamp value) { + copyOnWrite(); + instance.mergeTimestamp(value); + return this; + } + /** + * .google.protobuf.Timestamp timestamp = 3 [json_name = "timestamp", (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true]; + */ + public Builder clearTimestamp() { copyOnWrite(); + instance.clearTimestamp(); + return this; + } + + /** + * bytes signature = 4 [json_name = "signature"]; + * @return The signature. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSignature() { + return instance.getSignature(); + } + /** + * bytes signature = 4 [json_name = "signature"]; + * @param value The signature to set. + * @return This builder for chaining. + */ + public Builder setSignature(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setSignature(value); + return this; + } + /** + * bytes signature = 4 [json_name = "signature"]; + * @return This builder for chaining. + */ + public Builder clearSignature() { + copyOnWrite(); + instance.clearSignature(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tendermint.types.CommitSig) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.tendermint.types.CommitSig(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "blockIdFlag_", + "validatorAddress_", + "timestamp_", + "signature_", + }; + java.lang.String info = + "\u0000\u0004\u0000\u0000\u0001\u0004\u0004\u0000\u0000\u0000\u0001\f\u0002\n\u0003" + + "\t\u0004\n"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.tendermint.types.CommitSig.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:tendermint.types.CommitSig) + private static final com.tendermint.types.CommitSig DEFAULT_INSTANCE; + static { + CommitSig defaultInstance = new CommitSig(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + CommitSig.class, defaultInstance); + } + + public static com.tendermint.types.CommitSig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/CommitSigOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/CommitSigOrBuilder.java new file mode 100644 index 000000000..62188f063 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/CommitSigOrBuilder.java @@ -0,0 +1,43 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tendermint/types/types.proto + +package com.tendermint.types; + +public interface CommitSigOrBuilder extends + // @@protoc_insertion_point(interface_extends:tendermint.types.CommitSig) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * .tendermint.types.BlockIDFlag block_id_flag = 1 [json_name = "blockIdFlag"]; + * @return The enum numeric value on the wire for blockIdFlag. + */ + int getBlockIdFlagValue(); + /** + * .tendermint.types.BlockIDFlag block_id_flag = 1 [json_name = "blockIdFlag"]; + * @return The blockIdFlag. + */ + com.tendermint.types.BlockIDFlag getBlockIdFlag(); + + /** + * bytes validator_address = 2 [json_name = "validatorAddress"]; + * @return The validatorAddress. + */ + com.google.protobuf.ByteString getValidatorAddress(); + + /** + * .google.protobuf.Timestamp timestamp = 3 [json_name = "timestamp", (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true]; + * @return Whether the timestamp field is set. + */ + boolean hasTimestamp(); + /** + * .google.protobuf.Timestamp timestamp = 3 [json_name = "timestamp", (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true]; + * @return The timestamp. + */ + com.google.protobuf.Timestamp getTimestamp(); + + /** + * bytes signature = 4 [json_name = "signature"]; + * @return The signature. + */ + com.google.protobuf.ByteString getSignature(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/Data.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/Data.java new file mode 100644 index 000000000..f7330f3c2 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/Data.java @@ -0,0 +1,418 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tendermint/types/types.proto + +package com.tendermint.types; + +/** + *
+ * Data contains the set of transactions included in the block
+ * 
+ * + * Protobuf type {@code tendermint.types.Data} + */ +public final class Data extends + com.google.protobuf.GeneratedMessageLite< + Data, Data.Builder> implements + // @@protoc_insertion_point(message_implements:tendermint.types.Data) + DataOrBuilder { + private Data() { + txs_ = emptyProtobufList(); + } + public static final int TXS_FIELD_NUMBER = 1; + private com.google.protobuf.Internal.ProtobufList txs_; + /** + *
+   * Txs that will be applied by state @ block.Height+1.
+   * NOTE: not all txs here are valid.  We're just agreeing on the order first.
+   * This means that block.AppHash does not include these txs.
+   * 
+ * + * repeated bytes txs = 1 [json_name = "txs"]; + * @return A list containing the txs. + */ + @java.lang.Override + public java.util.List + getTxsList() { + return txs_; + } + /** + *
+   * Txs that will be applied by state @ block.Height+1.
+   * NOTE: not all txs here are valid.  We're just agreeing on the order first.
+   * This means that block.AppHash does not include these txs.
+   * 
+ * + * repeated bytes txs = 1 [json_name = "txs"]; + * @return The count of txs. + */ + @java.lang.Override + public int getTxsCount() { + return txs_.size(); + } + /** + *
+   * Txs that will be applied by state @ block.Height+1.
+   * NOTE: not all txs here are valid.  We're just agreeing on the order first.
+   * This means that block.AppHash does not include these txs.
+   * 
+ * + * repeated bytes txs = 1 [json_name = "txs"]; + * @param index The index of the element to return. + * @return The txs at the given index. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTxs(int index) { + return txs_.get(index); + } + private void ensureTxsIsMutable() { + com.google.protobuf.Internal.ProtobufList tmp = txs_; + if (!tmp.isModifiable()) { + txs_ = + com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp); + } + } + /** + *
+   * Txs that will be applied by state @ block.Height+1.
+   * NOTE: not all txs here are valid.  We're just agreeing on the order first.
+   * This means that block.AppHash does not include these txs.
+   * 
+ * + * repeated bytes txs = 1 [json_name = "txs"]; + * @param index The index to set the value at. + * @param value The txs to set. + */ + private void setTxs( + int index, com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + ensureTxsIsMutable(); + txs_.set(index, value); + } + /** + *
+   * Txs that will be applied by state @ block.Height+1.
+   * NOTE: not all txs here are valid.  We're just agreeing on the order first.
+   * This means that block.AppHash does not include these txs.
+   * 
+ * + * repeated bytes txs = 1 [json_name = "txs"]; + * @param value The txs to add. + */ + private void addTxs(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + ensureTxsIsMutable(); + txs_.add(value); + } + /** + *
+   * Txs that will be applied by state @ block.Height+1.
+   * NOTE: not all txs here are valid.  We're just agreeing on the order first.
+   * This means that block.AppHash does not include these txs.
+   * 
+ * + * repeated bytes txs = 1 [json_name = "txs"]; + * @param values The txs to add. + */ + private void addAllTxs( + java.lang.Iterable values) { + ensureTxsIsMutable(); + com.google.protobuf.AbstractMessageLite.addAll( + values, txs_); + } + /** + *
+   * Txs that will be applied by state @ block.Height+1.
+   * NOTE: not all txs here are valid.  We're just agreeing on the order first.
+   * This means that block.AppHash does not include these txs.
+   * 
+ * + * repeated bytes txs = 1 [json_name = "txs"]; + */ + private void clearTxs() { + txs_ = emptyProtobufList(); + } + + public static com.tendermint.types.Data parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.tendermint.types.Data parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.tendermint.types.Data parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.tendermint.types.Data parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.tendermint.types.Data parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.tendermint.types.Data parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.tendermint.types.Data parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.tendermint.types.Data parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.tendermint.types.Data parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.tendermint.types.Data parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.tendermint.types.Data parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.tendermint.types.Data parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.tendermint.types.Data prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+   * Data contains the set of transactions included in the block
+   * 
+ * + * Protobuf type {@code tendermint.types.Data} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.tendermint.types.Data, Builder> implements + // @@protoc_insertion_point(builder_implements:tendermint.types.Data) + com.tendermint.types.DataOrBuilder { + // Construct using com.tendermint.types.Data.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + *
+     * Txs that will be applied by state @ block.Height+1.
+     * NOTE: not all txs here are valid.  We're just agreeing on the order first.
+     * This means that block.AppHash does not include these txs.
+     * 
+ * + * repeated bytes txs = 1 [json_name = "txs"]; + * @return A list containing the txs. + */ + @java.lang.Override + public java.util.List + getTxsList() { + return java.util.Collections.unmodifiableList( + instance.getTxsList()); + } + /** + *
+     * Txs that will be applied by state @ block.Height+1.
+     * NOTE: not all txs here are valid.  We're just agreeing on the order first.
+     * This means that block.AppHash does not include these txs.
+     * 
+ * + * repeated bytes txs = 1 [json_name = "txs"]; + * @return The count of txs. + */ + @java.lang.Override + public int getTxsCount() { + return instance.getTxsCount(); + } + /** + *
+     * Txs that will be applied by state @ block.Height+1.
+     * NOTE: not all txs here are valid.  We're just agreeing on the order first.
+     * This means that block.AppHash does not include these txs.
+     * 
+ * + * repeated bytes txs = 1 [json_name = "txs"]; + * @param index The index of the element to return. + * @return The txs at the given index. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTxs(int index) { + return instance.getTxs(index); + } + /** + *
+     * Txs that will be applied by state @ block.Height+1.
+     * NOTE: not all txs here are valid.  We're just agreeing on the order first.
+     * This means that block.AppHash does not include these txs.
+     * 
+ * + * repeated bytes txs = 1 [json_name = "txs"]; + * @param value The txs to set. + * @return This builder for chaining. + */ + public Builder setTxs( + int index, com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setTxs(index, value); + return this; + } + /** + *
+     * Txs that will be applied by state @ block.Height+1.
+     * NOTE: not all txs here are valid.  We're just agreeing on the order first.
+     * This means that block.AppHash does not include these txs.
+     * 
+ * + * repeated bytes txs = 1 [json_name = "txs"]; + * @param value The txs to add. + * @return This builder for chaining. + */ + public Builder addTxs(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.addTxs(value); + return this; + } + /** + *
+     * Txs that will be applied by state @ block.Height+1.
+     * NOTE: not all txs here are valid.  We're just agreeing on the order first.
+     * This means that block.AppHash does not include these txs.
+     * 
+ * + * repeated bytes txs = 1 [json_name = "txs"]; + * @param values The txs to add. + * @return This builder for chaining. + */ + public Builder addAllTxs( + java.lang.Iterable values) { + copyOnWrite(); + instance.addAllTxs(values); + return this; + } + /** + *
+     * Txs that will be applied by state @ block.Height+1.
+     * NOTE: not all txs here are valid.  We're just agreeing on the order first.
+     * This means that block.AppHash does not include these txs.
+     * 
+ * + * repeated bytes txs = 1 [json_name = "txs"]; + * @return This builder for chaining. + */ + public Builder clearTxs() { + copyOnWrite(); + instance.clearTxs(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tendermint.types.Data) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.tendermint.types.Data(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "txs_", + }; + java.lang.String info = + "\u0000\u0001\u0000\u0000\u0001\u0001\u0001\u0000\u0001\u0000\u0001\u001c"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.tendermint.types.Data.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:tendermint.types.Data) + private static final com.tendermint.types.Data DEFAULT_INSTANCE; + static { + Data defaultInstance = new Data(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + Data.class, defaultInstance); + } + + public static com.tendermint.types.Data getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/DataOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/DataOrBuilder.java new file mode 100644 index 000000000..ce646fa51 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/DataOrBuilder.java @@ -0,0 +1,44 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tendermint/types/types.proto + +package com.tendermint.types; + +public interface DataOrBuilder extends + // @@protoc_insertion_point(interface_extends:tendermint.types.Data) + com.google.protobuf.MessageLiteOrBuilder { + + /** + *
+   * Txs that will be applied by state @ block.Height+1.
+   * NOTE: not all txs here are valid.  We're just agreeing on the order first.
+   * This means that block.AppHash does not include these txs.
+   * 
+ * + * repeated bytes txs = 1 [json_name = "txs"]; + * @return A list containing the txs. + */ + java.util.List getTxsList(); + /** + *
+   * Txs that will be applied by state @ block.Height+1.
+   * NOTE: not all txs here are valid.  We're just agreeing on the order first.
+   * This means that block.AppHash does not include these txs.
+   * 
+ * + * repeated bytes txs = 1 [json_name = "txs"]; + * @return The count of txs. + */ + int getTxsCount(); + /** + *
+   * Txs that will be applied by state @ block.Height+1.
+   * NOTE: not all txs here are valid.  We're just agreeing on the order first.
+   * This means that block.AppHash does not include these txs.
+   * 
+ * + * repeated bytes txs = 1 [json_name = "txs"]; + * @param index The index of the element to return. + * @return The txs at the given index. + */ + com.google.protobuf.ByteString getTxs(int index); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/Header.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/Header.java new file mode 100644 index 000000000..e6c5838bf --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/Header.java @@ -0,0 +1,1445 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tendermint/types/types.proto + +package com.tendermint.types; + +/** + *
+ * Header defines the structure of a block header.
+ * 
+ * + * Protobuf type {@code tendermint.types.Header} + */ +public final class Header extends + com.google.protobuf.GeneratedMessageLite< + Header, Header.Builder> implements + // @@protoc_insertion_point(message_implements:tendermint.types.Header) + HeaderOrBuilder { + private Header() { + chainId_ = ""; + lastCommitHash_ = com.google.protobuf.ByteString.EMPTY; + dataHash_ = com.google.protobuf.ByteString.EMPTY; + validatorsHash_ = com.google.protobuf.ByteString.EMPTY; + nextValidatorsHash_ = com.google.protobuf.ByteString.EMPTY; + consensusHash_ = com.google.protobuf.ByteString.EMPTY; + appHash_ = com.google.protobuf.ByteString.EMPTY; + lastResultsHash_ = com.google.protobuf.ByteString.EMPTY; + evidenceHash_ = com.google.protobuf.ByteString.EMPTY; + proposerAddress_ = com.google.protobuf.ByteString.EMPTY; + } + public static final int VERSION_FIELD_NUMBER = 1; + private com.tendermint.version.Consensus version_; + /** + *
+   * basic block info
+   * 
+ * + * .tendermint.version.Consensus version = 1 [json_name = "version", (.gogoproto.nullable) = false]; + */ + @java.lang.Override + public boolean hasVersion() { + return version_ != null; + } + /** + *
+   * basic block info
+   * 
+ * + * .tendermint.version.Consensus version = 1 [json_name = "version", (.gogoproto.nullable) = false]; + */ + @java.lang.Override + public com.tendermint.version.Consensus getVersion() { + return version_ == null ? com.tendermint.version.Consensus.getDefaultInstance() : version_; + } + /** + *
+   * basic block info
+   * 
+ * + * .tendermint.version.Consensus version = 1 [json_name = "version", (.gogoproto.nullable) = false]; + */ + private void setVersion(com.tendermint.version.Consensus value) { + value.getClass(); + version_ = value; + + } + /** + *
+   * basic block info
+   * 
+ * + * .tendermint.version.Consensus version = 1 [json_name = "version", (.gogoproto.nullable) = false]; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeVersion(com.tendermint.version.Consensus value) { + value.getClass(); + if (version_ != null && + version_ != com.tendermint.version.Consensus.getDefaultInstance()) { + version_ = + com.tendermint.version.Consensus.newBuilder(version_).mergeFrom(value).buildPartial(); + } else { + version_ = value; + } + + } + /** + *
+   * basic block info
+   * 
+ * + * .tendermint.version.Consensus version = 1 [json_name = "version", (.gogoproto.nullable) = false]; + */ + private void clearVersion() { version_ = null; + + } + + public static final int CHAIN_ID_FIELD_NUMBER = 2; + private java.lang.String chainId_; + /** + * string chain_id = 2 [json_name = "chainId", (.gogoproto.customname) = "ChainID"]; + * @return The chainId. + */ + @java.lang.Override + public java.lang.String getChainId() { + return chainId_; + } + /** + * string chain_id = 2 [json_name = "chainId", (.gogoproto.customname) = "ChainID"]; + * @return The bytes for chainId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getChainIdBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(chainId_); + } + /** + * string chain_id = 2 [json_name = "chainId", (.gogoproto.customname) = "ChainID"]; + * @param value The chainId to set. + */ + private void setChainId( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + chainId_ = value; + } + /** + * string chain_id = 2 [json_name = "chainId", (.gogoproto.customname) = "ChainID"]; + */ + private void clearChainId() { + + chainId_ = getDefaultInstance().getChainId(); + } + /** + * string chain_id = 2 [json_name = "chainId", (.gogoproto.customname) = "ChainID"]; + * @param value The bytes for chainId to set. + */ + private void setChainIdBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + chainId_ = value.toStringUtf8(); + + } + + public static final int HEIGHT_FIELD_NUMBER = 3; + private long height_; + /** + * int64 height = 3 [json_name = "height"]; + * @return The height. + */ + @java.lang.Override + public long getHeight() { + return height_; + } + /** + * int64 height = 3 [json_name = "height"]; + * @param value The height to set. + */ + private void setHeight(long value) { + + height_ = value; + } + /** + * int64 height = 3 [json_name = "height"]; + */ + private void clearHeight() { + + height_ = 0L; + } + + public static final int TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp time_; + /** + * .google.protobuf.Timestamp time = 4 [json_name = "time", (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true]; + */ + @java.lang.Override + public boolean hasTime() { + return time_ != null; + } + /** + * .google.protobuf.Timestamp time = 4 [json_name = "time", (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true]; + */ + @java.lang.Override + public com.google.protobuf.Timestamp getTime() { + return time_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : time_; + } + /** + * .google.protobuf.Timestamp time = 4 [json_name = "time", (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true]; + */ + private void setTime(com.google.protobuf.Timestamp value) { + value.getClass(); + time_ = value; + + } + /** + * .google.protobuf.Timestamp time = 4 [json_name = "time", (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true]; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeTime(com.google.protobuf.Timestamp value) { + value.getClass(); + if (time_ != null && + time_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + time_ = + com.google.protobuf.Timestamp.newBuilder(time_).mergeFrom(value).buildPartial(); + } else { + time_ = value; + } + + } + /** + * .google.protobuf.Timestamp time = 4 [json_name = "time", (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true]; + */ + private void clearTime() { time_ = null; + + } + + public static final int LAST_BLOCK_ID_FIELD_NUMBER = 5; + private com.tendermint.types.BlockID lastBlockId_; + /** + *
+   * prev block info
+   * 
+ * + * .tendermint.types.BlockID last_block_id = 5 [json_name = "lastBlockId", (.gogoproto.nullable) = false]; + */ + @java.lang.Override + public boolean hasLastBlockId() { + return lastBlockId_ != null; + } + /** + *
+   * prev block info
+   * 
+ * + * .tendermint.types.BlockID last_block_id = 5 [json_name = "lastBlockId", (.gogoproto.nullable) = false]; + */ + @java.lang.Override + public com.tendermint.types.BlockID getLastBlockId() { + return lastBlockId_ == null ? com.tendermint.types.BlockID.getDefaultInstance() : lastBlockId_; + } + /** + *
+   * prev block info
+   * 
+ * + * .tendermint.types.BlockID last_block_id = 5 [json_name = "lastBlockId", (.gogoproto.nullable) = false]; + */ + private void setLastBlockId(com.tendermint.types.BlockID value) { + value.getClass(); + lastBlockId_ = value; + + } + /** + *
+   * prev block info
+   * 
+ * + * .tendermint.types.BlockID last_block_id = 5 [json_name = "lastBlockId", (.gogoproto.nullable) = false]; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeLastBlockId(com.tendermint.types.BlockID value) { + value.getClass(); + if (lastBlockId_ != null && + lastBlockId_ != com.tendermint.types.BlockID.getDefaultInstance()) { + lastBlockId_ = + com.tendermint.types.BlockID.newBuilder(lastBlockId_).mergeFrom(value).buildPartial(); + } else { + lastBlockId_ = value; + } + + } + /** + *
+   * prev block info
+   * 
+ * + * .tendermint.types.BlockID last_block_id = 5 [json_name = "lastBlockId", (.gogoproto.nullable) = false]; + */ + private void clearLastBlockId() { lastBlockId_ = null; + + } + + public static final int LAST_COMMIT_HASH_FIELD_NUMBER = 6; + private com.google.protobuf.ByteString lastCommitHash_; + /** + *
+   * hashes of block data
+   * 
+ * + * bytes last_commit_hash = 6 [json_name = "lastCommitHash"]; + * @return The lastCommitHash. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLastCommitHash() { + return lastCommitHash_; + } + /** + *
+   * hashes of block data
+   * 
+ * + * bytes last_commit_hash = 6 [json_name = "lastCommitHash"]; + * @param value The lastCommitHash to set. + */ + private void setLastCommitHash(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + lastCommitHash_ = value; + } + /** + *
+   * hashes of block data
+   * 
+ * + * bytes last_commit_hash = 6 [json_name = "lastCommitHash"]; + */ + private void clearLastCommitHash() { + + lastCommitHash_ = getDefaultInstance().getLastCommitHash(); + } + + public static final int DATA_HASH_FIELD_NUMBER = 7; + private com.google.protobuf.ByteString dataHash_; + /** + *
+   * transactions
+   * 
+ * + * bytes data_hash = 7 [json_name = "dataHash"]; + * @return The dataHash. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDataHash() { + return dataHash_; + } + /** + *
+   * transactions
+   * 
+ * + * bytes data_hash = 7 [json_name = "dataHash"]; + * @param value The dataHash to set. + */ + private void setDataHash(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + dataHash_ = value; + } + /** + *
+   * transactions
+   * 
+ * + * bytes data_hash = 7 [json_name = "dataHash"]; + */ + private void clearDataHash() { + + dataHash_ = getDefaultInstance().getDataHash(); + } + + public static final int VALIDATORS_HASH_FIELD_NUMBER = 8; + private com.google.protobuf.ByteString validatorsHash_; + /** + *
+   * hashes from the app output from the prev block
+   * 
+ * + * bytes validators_hash = 8 [json_name = "validatorsHash"]; + * @return The validatorsHash. + */ + @java.lang.Override + public com.google.protobuf.ByteString getValidatorsHash() { + return validatorsHash_; + } + /** + *
+   * hashes from the app output from the prev block
+   * 
+ * + * bytes validators_hash = 8 [json_name = "validatorsHash"]; + * @param value The validatorsHash to set. + */ + private void setValidatorsHash(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + validatorsHash_ = value; + } + /** + *
+   * hashes from the app output from the prev block
+   * 
+ * + * bytes validators_hash = 8 [json_name = "validatorsHash"]; + */ + private void clearValidatorsHash() { + + validatorsHash_ = getDefaultInstance().getValidatorsHash(); + } + + public static final int NEXT_VALIDATORS_HASH_FIELD_NUMBER = 9; + private com.google.protobuf.ByteString nextValidatorsHash_; + /** + *
+   * validators for the next block
+   * 
+ * + * bytes next_validators_hash = 9 [json_name = "nextValidatorsHash"]; + * @return The nextValidatorsHash. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextValidatorsHash() { + return nextValidatorsHash_; + } + /** + *
+   * validators for the next block
+   * 
+ * + * bytes next_validators_hash = 9 [json_name = "nextValidatorsHash"]; + * @param value The nextValidatorsHash to set. + */ + private void setNextValidatorsHash(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + nextValidatorsHash_ = value; + } + /** + *
+   * validators for the next block
+   * 
+ * + * bytes next_validators_hash = 9 [json_name = "nextValidatorsHash"]; + */ + private void clearNextValidatorsHash() { + + nextValidatorsHash_ = getDefaultInstance().getNextValidatorsHash(); + } + + public static final int CONSENSUS_HASH_FIELD_NUMBER = 10; + private com.google.protobuf.ByteString consensusHash_; + /** + *
+   * consensus params for current block
+   * 
+ * + * bytes consensus_hash = 10 [json_name = "consensusHash"]; + * @return The consensusHash. + */ + @java.lang.Override + public com.google.protobuf.ByteString getConsensusHash() { + return consensusHash_; + } + /** + *
+   * consensus params for current block
+   * 
+ * + * bytes consensus_hash = 10 [json_name = "consensusHash"]; + * @param value The consensusHash to set. + */ + private void setConsensusHash(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + consensusHash_ = value; + } + /** + *
+   * consensus params for current block
+   * 
+ * + * bytes consensus_hash = 10 [json_name = "consensusHash"]; + */ + private void clearConsensusHash() { + + consensusHash_ = getDefaultInstance().getConsensusHash(); + } + + public static final int APP_HASH_FIELD_NUMBER = 11; + private com.google.protobuf.ByteString appHash_; + /** + *
+   * state after txs from the previous block
+   * 
+ * + * bytes app_hash = 11 [json_name = "appHash"]; + * @return The appHash. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAppHash() { + return appHash_; + } + /** + *
+   * state after txs from the previous block
+   * 
+ * + * bytes app_hash = 11 [json_name = "appHash"]; + * @param value The appHash to set. + */ + private void setAppHash(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + appHash_ = value; + } + /** + *
+   * state after txs from the previous block
+   * 
+ * + * bytes app_hash = 11 [json_name = "appHash"]; + */ + private void clearAppHash() { + + appHash_ = getDefaultInstance().getAppHash(); + } + + public static final int LAST_RESULTS_HASH_FIELD_NUMBER = 12; + private com.google.protobuf.ByteString lastResultsHash_; + /** + *
+   * root hash of all results from the txs from the previous block
+   * 
+ * + * bytes last_results_hash = 12 [json_name = "lastResultsHash"]; + * @return The lastResultsHash. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLastResultsHash() { + return lastResultsHash_; + } + /** + *
+   * root hash of all results from the txs from the previous block
+   * 
+ * + * bytes last_results_hash = 12 [json_name = "lastResultsHash"]; + * @param value The lastResultsHash to set. + */ + private void setLastResultsHash(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + lastResultsHash_ = value; + } + /** + *
+   * root hash of all results from the txs from the previous block
+   * 
+ * + * bytes last_results_hash = 12 [json_name = "lastResultsHash"]; + */ + private void clearLastResultsHash() { + + lastResultsHash_ = getDefaultInstance().getLastResultsHash(); + } + + public static final int EVIDENCE_HASH_FIELD_NUMBER = 13; + private com.google.protobuf.ByteString evidenceHash_; + /** + *
+   * consensus info
+   * 
+ * + * bytes evidence_hash = 13 [json_name = "evidenceHash"]; + * @return The evidenceHash. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEvidenceHash() { + return evidenceHash_; + } + /** + *
+   * consensus info
+   * 
+ * + * bytes evidence_hash = 13 [json_name = "evidenceHash"]; + * @param value The evidenceHash to set. + */ + private void setEvidenceHash(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + evidenceHash_ = value; + } + /** + *
+   * consensus info
+   * 
+ * + * bytes evidence_hash = 13 [json_name = "evidenceHash"]; + */ + private void clearEvidenceHash() { + + evidenceHash_ = getDefaultInstance().getEvidenceHash(); + } + + public static final int PROPOSER_ADDRESS_FIELD_NUMBER = 14; + private com.google.protobuf.ByteString proposerAddress_; + /** + *
+   * original proposer of the block
+   * 
+ * + * bytes proposer_address = 14 [json_name = "proposerAddress"]; + * @return The proposerAddress. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProposerAddress() { + return proposerAddress_; + } + /** + *
+   * original proposer of the block
+   * 
+ * + * bytes proposer_address = 14 [json_name = "proposerAddress"]; + * @param value The proposerAddress to set. + */ + private void setProposerAddress(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + proposerAddress_ = value; + } + /** + *
+   * original proposer of the block
+   * 
+ * + * bytes proposer_address = 14 [json_name = "proposerAddress"]; + */ + private void clearProposerAddress() { + + proposerAddress_ = getDefaultInstance().getProposerAddress(); + } + + public static com.tendermint.types.Header parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.tendermint.types.Header parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.tendermint.types.Header parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.tendermint.types.Header parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.tendermint.types.Header parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.tendermint.types.Header parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.tendermint.types.Header parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.tendermint.types.Header parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.tendermint.types.Header parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.tendermint.types.Header parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.tendermint.types.Header parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.tendermint.types.Header parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.tendermint.types.Header prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+   * Header defines the structure of a block header.
+   * 
+ * + * Protobuf type {@code tendermint.types.Header} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.tendermint.types.Header, Builder> implements + // @@protoc_insertion_point(builder_implements:tendermint.types.Header) + com.tendermint.types.HeaderOrBuilder { + // Construct using com.tendermint.types.Header.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + *
+     * basic block info
+     * 
+ * + * .tendermint.version.Consensus version = 1 [json_name = "version", (.gogoproto.nullable) = false]; + */ + @java.lang.Override + public boolean hasVersion() { + return instance.hasVersion(); + } + /** + *
+     * basic block info
+     * 
+ * + * .tendermint.version.Consensus version = 1 [json_name = "version", (.gogoproto.nullable) = false]; + */ + @java.lang.Override + public com.tendermint.version.Consensus getVersion() { + return instance.getVersion(); + } + /** + *
+     * basic block info
+     * 
+ * + * .tendermint.version.Consensus version = 1 [json_name = "version", (.gogoproto.nullable) = false]; + */ + public Builder setVersion(com.tendermint.version.Consensus value) { + copyOnWrite(); + instance.setVersion(value); + return this; + } + /** + *
+     * basic block info
+     * 
+ * + * .tendermint.version.Consensus version = 1 [json_name = "version", (.gogoproto.nullable) = false]; + */ + public Builder setVersion( + com.tendermint.version.Consensus.Builder builderForValue) { + copyOnWrite(); + instance.setVersion(builderForValue.build()); + return this; + } + /** + *
+     * basic block info
+     * 
+ * + * .tendermint.version.Consensus version = 1 [json_name = "version", (.gogoproto.nullable) = false]; + */ + public Builder mergeVersion(com.tendermint.version.Consensus value) { + copyOnWrite(); + instance.mergeVersion(value); + return this; + } + /** + *
+     * basic block info
+     * 
+ * + * .tendermint.version.Consensus version = 1 [json_name = "version", (.gogoproto.nullable) = false]; + */ + public Builder clearVersion() { copyOnWrite(); + instance.clearVersion(); + return this; + } + + /** + * string chain_id = 2 [json_name = "chainId", (.gogoproto.customname) = "ChainID"]; + * @return The chainId. + */ + @java.lang.Override + public java.lang.String getChainId() { + return instance.getChainId(); + } + /** + * string chain_id = 2 [json_name = "chainId", (.gogoproto.customname) = "ChainID"]; + * @return The bytes for chainId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getChainIdBytes() { + return instance.getChainIdBytes(); + } + /** + * string chain_id = 2 [json_name = "chainId", (.gogoproto.customname) = "ChainID"]; + * @param value The chainId to set. + * @return This builder for chaining. + */ + public Builder setChainId( + java.lang.String value) { + copyOnWrite(); + instance.setChainId(value); + return this; + } + /** + * string chain_id = 2 [json_name = "chainId", (.gogoproto.customname) = "ChainID"]; + * @return This builder for chaining. + */ + public Builder clearChainId() { + copyOnWrite(); + instance.clearChainId(); + return this; + } + /** + * string chain_id = 2 [json_name = "chainId", (.gogoproto.customname) = "ChainID"]; + * @param value The bytes for chainId to set. + * @return This builder for chaining. + */ + public Builder setChainIdBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setChainIdBytes(value); + return this; + } + + /** + * int64 height = 3 [json_name = "height"]; + * @return The height. + */ + @java.lang.Override + public long getHeight() { + return instance.getHeight(); + } + /** + * int64 height = 3 [json_name = "height"]; + * @param value The height to set. + * @return This builder for chaining. + */ + public Builder setHeight(long value) { + copyOnWrite(); + instance.setHeight(value); + return this; + } + /** + * int64 height = 3 [json_name = "height"]; + * @return This builder for chaining. + */ + public Builder clearHeight() { + copyOnWrite(); + instance.clearHeight(); + return this; + } + + /** + * .google.protobuf.Timestamp time = 4 [json_name = "time", (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true]; + */ + @java.lang.Override + public boolean hasTime() { + return instance.hasTime(); + } + /** + * .google.protobuf.Timestamp time = 4 [json_name = "time", (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true]; + */ + @java.lang.Override + public com.google.protobuf.Timestamp getTime() { + return instance.getTime(); + } + /** + * .google.protobuf.Timestamp time = 4 [json_name = "time", (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true]; + */ + public Builder setTime(com.google.protobuf.Timestamp value) { + copyOnWrite(); + instance.setTime(value); + return this; + } + /** + * .google.protobuf.Timestamp time = 4 [json_name = "time", (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true]; + */ + public Builder setTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + copyOnWrite(); + instance.setTime(builderForValue.build()); + return this; + } + /** + * .google.protobuf.Timestamp time = 4 [json_name = "time", (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true]; + */ + public Builder mergeTime(com.google.protobuf.Timestamp value) { + copyOnWrite(); + instance.mergeTime(value); + return this; + } + /** + * .google.protobuf.Timestamp time = 4 [json_name = "time", (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true]; + */ + public Builder clearTime() { copyOnWrite(); + instance.clearTime(); + return this; + } + + /** + *
+     * prev block info
+     * 
+ * + * .tendermint.types.BlockID last_block_id = 5 [json_name = "lastBlockId", (.gogoproto.nullable) = false]; + */ + @java.lang.Override + public boolean hasLastBlockId() { + return instance.hasLastBlockId(); + } + /** + *
+     * prev block info
+     * 
+ * + * .tendermint.types.BlockID last_block_id = 5 [json_name = "lastBlockId", (.gogoproto.nullable) = false]; + */ + @java.lang.Override + public com.tendermint.types.BlockID getLastBlockId() { + return instance.getLastBlockId(); + } + /** + *
+     * prev block info
+     * 
+ * + * .tendermint.types.BlockID last_block_id = 5 [json_name = "lastBlockId", (.gogoproto.nullable) = false]; + */ + public Builder setLastBlockId(com.tendermint.types.BlockID value) { + copyOnWrite(); + instance.setLastBlockId(value); + return this; + } + /** + *
+     * prev block info
+     * 
+ * + * .tendermint.types.BlockID last_block_id = 5 [json_name = "lastBlockId", (.gogoproto.nullable) = false]; + */ + public Builder setLastBlockId( + com.tendermint.types.BlockID.Builder builderForValue) { + copyOnWrite(); + instance.setLastBlockId(builderForValue.build()); + return this; + } + /** + *
+     * prev block info
+     * 
+ * + * .tendermint.types.BlockID last_block_id = 5 [json_name = "lastBlockId", (.gogoproto.nullable) = false]; + */ + public Builder mergeLastBlockId(com.tendermint.types.BlockID value) { + copyOnWrite(); + instance.mergeLastBlockId(value); + return this; + } + /** + *
+     * prev block info
+     * 
+ * + * .tendermint.types.BlockID last_block_id = 5 [json_name = "lastBlockId", (.gogoproto.nullable) = false]; + */ + public Builder clearLastBlockId() { copyOnWrite(); + instance.clearLastBlockId(); + return this; + } + + /** + *
+     * hashes of block data
+     * 
+ * + * bytes last_commit_hash = 6 [json_name = "lastCommitHash"]; + * @return The lastCommitHash. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLastCommitHash() { + return instance.getLastCommitHash(); + } + /** + *
+     * hashes of block data
+     * 
+ * + * bytes last_commit_hash = 6 [json_name = "lastCommitHash"]; + * @param value The lastCommitHash to set. + * @return This builder for chaining. + */ + public Builder setLastCommitHash(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setLastCommitHash(value); + return this; + } + /** + *
+     * hashes of block data
+     * 
+ * + * bytes last_commit_hash = 6 [json_name = "lastCommitHash"]; + * @return This builder for chaining. + */ + public Builder clearLastCommitHash() { + copyOnWrite(); + instance.clearLastCommitHash(); + return this; + } + + /** + *
+     * transactions
+     * 
+ * + * bytes data_hash = 7 [json_name = "dataHash"]; + * @return The dataHash. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDataHash() { + return instance.getDataHash(); + } + /** + *
+     * transactions
+     * 
+ * + * bytes data_hash = 7 [json_name = "dataHash"]; + * @param value The dataHash to set. + * @return This builder for chaining. + */ + public Builder setDataHash(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setDataHash(value); + return this; + } + /** + *
+     * transactions
+     * 
+ * + * bytes data_hash = 7 [json_name = "dataHash"]; + * @return This builder for chaining. + */ + public Builder clearDataHash() { + copyOnWrite(); + instance.clearDataHash(); + return this; + } + + /** + *
+     * hashes from the app output from the prev block
+     * 
+ * + * bytes validators_hash = 8 [json_name = "validatorsHash"]; + * @return The validatorsHash. + */ + @java.lang.Override + public com.google.protobuf.ByteString getValidatorsHash() { + return instance.getValidatorsHash(); + } + /** + *
+     * hashes from the app output from the prev block
+     * 
+ * + * bytes validators_hash = 8 [json_name = "validatorsHash"]; + * @param value The validatorsHash to set. + * @return This builder for chaining. + */ + public Builder setValidatorsHash(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setValidatorsHash(value); + return this; + } + /** + *
+     * hashes from the app output from the prev block
+     * 
+ * + * bytes validators_hash = 8 [json_name = "validatorsHash"]; + * @return This builder for chaining. + */ + public Builder clearValidatorsHash() { + copyOnWrite(); + instance.clearValidatorsHash(); + return this; + } + + /** + *
+     * validators for the next block
+     * 
+ * + * bytes next_validators_hash = 9 [json_name = "nextValidatorsHash"]; + * @return The nextValidatorsHash. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextValidatorsHash() { + return instance.getNextValidatorsHash(); + } + /** + *
+     * validators for the next block
+     * 
+ * + * bytes next_validators_hash = 9 [json_name = "nextValidatorsHash"]; + * @param value The nextValidatorsHash to set. + * @return This builder for chaining. + */ + public Builder setNextValidatorsHash(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setNextValidatorsHash(value); + return this; + } + /** + *
+     * validators for the next block
+     * 
+ * + * bytes next_validators_hash = 9 [json_name = "nextValidatorsHash"]; + * @return This builder for chaining. + */ + public Builder clearNextValidatorsHash() { + copyOnWrite(); + instance.clearNextValidatorsHash(); + return this; + } + + /** + *
+     * consensus params for current block
+     * 
+ * + * bytes consensus_hash = 10 [json_name = "consensusHash"]; + * @return The consensusHash. + */ + @java.lang.Override + public com.google.protobuf.ByteString getConsensusHash() { + return instance.getConsensusHash(); + } + /** + *
+     * consensus params for current block
+     * 
+ * + * bytes consensus_hash = 10 [json_name = "consensusHash"]; + * @param value The consensusHash to set. + * @return This builder for chaining. + */ + public Builder setConsensusHash(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setConsensusHash(value); + return this; + } + /** + *
+     * consensus params for current block
+     * 
+ * + * bytes consensus_hash = 10 [json_name = "consensusHash"]; + * @return This builder for chaining. + */ + public Builder clearConsensusHash() { + copyOnWrite(); + instance.clearConsensusHash(); + return this; + } + + /** + *
+     * state after txs from the previous block
+     * 
+ * + * bytes app_hash = 11 [json_name = "appHash"]; + * @return The appHash. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAppHash() { + return instance.getAppHash(); + } + /** + *
+     * state after txs from the previous block
+     * 
+ * + * bytes app_hash = 11 [json_name = "appHash"]; + * @param value The appHash to set. + * @return This builder for chaining. + */ + public Builder setAppHash(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setAppHash(value); + return this; + } + /** + *
+     * state after txs from the previous block
+     * 
+ * + * bytes app_hash = 11 [json_name = "appHash"]; + * @return This builder for chaining. + */ + public Builder clearAppHash() { + copyOnWrite(); + instance.clearAppHash(); + return this; + } + + /** + *
+     * root hash of all results from the txs from the previous block
+     * 
+ * + * bytes last_results_hash = 12 [json_name = "lastResultsHash"]; + * @return The lastResultsHash. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLastResultsHash() { + return instance.getLastResultsHash(); + } + /** + *
+     * root hash of all results from the txs from the previous block
+     * 
+ * + * bytes last_results_hash = 12 [json_name = "lastResultsHash"]; + * @param value The lastResultsHash to set. + * @return This builder for chaining. + */ + public Builder setLastResultsHash(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setLastResultsHash(value); + return this; + } + /** + *
+     * root hash of all results from the txs from the previous block
+     * 
+ * + * bytes last_results_hash = 12 [json_name = "lastResultsHash"]; + * @return This builder for chaining. + */ + public Builder clearLastResultsHash() { + copyOnWrite(); + instance.clearLastResultsHash(); + return this; + } + + /** + *
+     * consensus info
+     * 
+ * + * bytes evidence_hash = 13 [json_name = "evidenceHash"]; + * @return The evidenceHash. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEvidenceHash() { + return instance.getEvidenceHash(); + } + /** + *
+     * consensus info
+     * 
+ * + * bytes evidence_hash = 13 [json_name = "evidenceHash"]; + * @param value The evidenceHash to set. + * @return This builder for chaining. + */ + public Builder setEvidenceHash(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setEvidenceHash(value); + return this; + } + /** + *
+     * consensus info
+     * 
+ * + * bytes evidence_hash = 13 [json_name = "evidenceHash"]; + * @return This builder for chaining. + */ + public Builder clearEvidenceHash() { + copyOnWrite(); + instance.clearEvidenceHash(); + return this; + } + + /** + *
+     * original proposer of the block
+     * 
+ * + * bytes proposer_address = 14 [json_name = "proposerAddress"]; + * @return The proposerAddress. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProposerAddress() { + return instance.getProposerAddress(); + } + /** + *
+     * original proposer of the block
+     * 
+ * + * bytes proposer_address = 14 [json_name = "proposerAddress"]; + * @param value The proposerAddress to set. + * @return This builder for chaining. + */ + public Builder setProposerAddress(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setProposerAddress(value); + return this; + } + /** + *
+     * original proposer of the block
+     * 
+ * + * bytes proposer_address = 14 [json_name = "proposerAddress"]; + * @return This builder for chaining. + */ + public Builder clearProposerAddress() { + copyOnWrite(); + instance.clearProposerAddress(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tendermint.types.Header) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.tendermint.types.Header(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "version_", + "chainId_", + "height_", + "time_", + "lastBlockId_", + "lastCommitHash_", + "dataHash_", + "validatorsHash_", + "nextValidatorsHash_", + "consensusHash_", + "appHash_", + "lastResultsHash_", + "evidenceHash_", + "proposerAddress_", + }; + java.lang.String info = + "\u0000\u000e\u0000\u0000\u0001\u000e\u000e\u0000\u0000\u0000\u0001\t\u0002\u0208" + + "\u0003\u0002\u0004\t\u0005\t\u0006\n\u0007\n\b\n\t\n\n\n\u000b\n\f\n\r\n\u000e\n" + + ""; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.tendermint.types.Header.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:tendermint.types.Header) + private static final com.tendermint.types.Header DEFAULT_INSTANCE; + static { + Header defaultInstance = new Header(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + Header.class, defaultInstance); + } + + public static com.tendermint.types.Header getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser
PARSER; + + public static com.google.protobuf.Parser
parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/HeaderOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/HeaderOrBuilder.java new file mode 100644 index 000000000..05bc1259b --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/HeaderOrBuilder.java @@ -0,0 +1,166 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tendermint/types/types.proto + +package com.tendermint.types; + +public interface HeaderOrBuilder extends + // @@protoc_insertion_point(interface_extends:tendermint.types.Header) + com.google.protobuf.MessageLiteOrBuilder { + + /** + *
+   * basic block info
+   * 
+ * + * .tendermint.version.Consensus version = 1 [json_name = "version", (.gogoproto.nullable) = false]; + * @return Whether the version field is set. + */ + boolean hasVersion(); + /** + *
+   * basic block info
+   * 
+ * + * .tendermint.version.Consensus version = 1 [json_name = "version", (.gogoproto.nullable) = false]; + * @return The version. + */ + com.tendermint.version.Consensus getVersion(); + + /** + * string chain_id = 2 [json_name = "chainId", (.gogoproto.customname) = "ChainID"]; + * @return The chainId. + */ + java.lang.String getChainId(); + /** + * string chain_id = 2 [json_name = "chainId", (.gogoproto.customname) = "ChainID"]; + * @return The bytes for chainId. + */ + com.google.protobuf.ByteString + getChainIdBytes(); + + /** + * int64 height = 3 [json_name = "height"]; + * @return The height. + */ + long getHeight(); + + /** + * .google.protobuf.Timestamp time = 4 [json_name = "time", (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true]; + * @return Whether the time field is set. + */ + boolean hasTime(); + /** + * .google.protobuf.Timestamp time = 4 [json_name = "time", (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true]; + * @return The time. + */ + com.google.protobuf.Timestamp getTime(); + + /** + *
+   * prev block info
+   * 
+ * + * .tendermint.types.BlockID last_block_id = 5 [json_name = "lastBlockId", (.gogoproto.nullable) = false]; + * @return Whether the lastBlockId field is set. + */ + boolean hasLastBlockId(); + /** + *
+   * prev block info
+   * 
+ * + * .tendermint.types.BlockID last_block_id = 5 [json_name = "lastBlockId", (.gogoproto.nullable) = false]; + * @return The lastBlockId. + */ + com.tendermint.types.BlockID getLastBlockId(); + + /** + *
+   * hashes of block data
+   * 
+ * + * bytes last_commit_hash = 6 [json_name = "lastCommitHash"]; + * @return The lastCommitHash. + */ + com.google.protobuf.ByteString getLastCommitHash(); + + /** + *
+   * transactions
+   * 
+ * + * bytes data_hash = 7 [json_name = "dataHash"]; + * @return The dataHash. + */ + com.google.protobuf.ByteString getDataHash(); + + /** + *
+   * hashes from the app output from the prev block
+   * 
+ * + * bytes validators_hash = 8 [json_name = "validatorsHash"]; + * @return The validatorsHash. + */ + com.google.protobuf.ByteString getValidatorsHash(); + + /** + *
+   * validators for the next block
+   * 
+ * + * bytes next_validators_hash = 9 [json_name = "nextValidatorsHash"]; + * @return The nextValidatorsHash. + */ + com.google.protobuf.ByteString getNextValidatorsHash(); + + /** + *
+   * consensus params for current block
+   * 
+ * + * bytes consensus_hash = 10 [json_name = "consensusHash"]; + * @return The consensusHash. + */ + com.google.protobuf.ByteString getConsensusHash(); + + /** + *
+   * state after txs from the previous block
+   * 
+ * + * bytes app_hash = 11 [json_name = "appHash"]; + * @return The appHash. + */ + com.google.protobuf.ByteString getAppHash(); + + /** + *
+   * root hash of all results from the txs from the previous block
+   * 
+ * + * bytes last_results_hash = 12 [json_name = "lastResultsHash"]; + * @return The lastResultsHash. + */ + com.google.protobuf.ByteString getLastResultsHash(); + + /** + *
+   * consensus info
+   * 
+ * + * bytes evidence_hash = 13 [json_name = "evidenceHash"]; + * @return The evidenceHash. + */ + com.google.protobuf.ByteString getEvidenceHash(); + + /** + *
+   * original proposer of the block
+   * 
+ * + * bytes proposer_address = 14 [json_name = "proposerAddress"]; + * @return The proposerAddress. + */ + com.google.protobuf.ByteString getProposerAddress(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/LightBlock.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/LightBlock.java new file mode 100644 index 000000000..0ef7866b4 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/LightBlock.java @@ -0,0 +1,371 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tendermint/types/types.proto + +package com.tendermint.types; + +/** + * Protobuf type {@code tendermint.types.LightBlock} + */ +public final class LightBlock extends + com.google.protobuf.GeneratedMessageLite< + LightBlock, LightBlock.Builder> implements + // @@protoc_insertion_point(message_implements:tendermint.types.LightBlock) + LightBlockOrBuilder { + private LightBlock() { + } + public static final int SIGNED_HEADER_FIELD_NUMBER = 1; + private com.tendermint.types.SignedHeader signedHeader_; + /** + * .tendermint.types.SignedHeader signed_header = 1 [json_name = "signedHeader"]; + */ + @java.lang.Override + public boolean hasSignedHeader() { + return signedHeader_ != null; + } + /** + * .tendermint.types.SignedHeader signed_header = 1 [json_name = "signedHeader"]; + */ + @java.lang.Override + public com.tendermint.types.SignedHeader getSignedHeader() { + return signedHeader_ == null ? com.tendermint.types.SignedHeader.getDefaultInstance() : signedHeader_; + } + /** + * .tendermint.types.SignedHeader signed_header = 1 [json_name = "signedHeader"]; + */ + private void setSignedHeader(com.tendermint.types.SignedHeader value) { + value.getClass(); + signedHeader_ = value; + + } + /** + * .tendermint.types.SignedHeader signed_header = 1 [json_name = "signedHeader"]; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeSignedHeader(com.tendermint.types.SignedHeader value) { + value.getClass(); + if (signedHeader_ != null && + signedHeader_ != com.tendermint.types.SignedHeader.getDefaultInstance()) { + signedHeader_ = + com.tendermint.types.SignedHeader.newBuilder(signedHeader_).mergeFrom(value).buildPartial(); + } else { + signedHeader_ = value; + } + + } + /** + * .tendermint.types.SignedHeader signed_header = 1 [json_name = "signedHeader"]; + */ + private void clearSignedHeader() { signedHeader_ = null; + + } + + public static final int VALIDATOR_SET_FIELD_NUMBER = 2; + private com.tendermint.types.ValidatorSet validatorSet_; + /** + * .tendermint.types.ValidatorSet validator_set = 2 [json_name = "validatorSet"]; + */ + @java.lang.Override + public boolean hasValidatorSet() { + return validatorSet_ != null; + } + /** + * .tendermint.types.ValidatorSet validator_set = 2 [json_name = "validatorSet"]; + */ + @java.lang.Override + public com.tendermint.types.ValidatorSet getValidatorSet() { + return validatorSet_ == null ? com.tendermint.types.ValidatorSet.getDefaultInstance() : validatorSet_; + } + /** + * .tendermint.types.ValidatorSet validator_set = 2 [json_name = "validatorSet"]; + */ + private void setValidatorSet(com.tendermint.types.ValidatorSet value) { + value.getClass(); + validatorSet_ = value; + + } + /** + * .tendermint.types.ValidatorSet validator_set = 2 [json_name = "validatorSet"]; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeValidatorSet(com.tendermint.types.ValidatorSet value) { + value.getClass(); + if (validatorSet_ != null && + validatorSet_ != com.tendermint.types.ValidatorSet.getDefaultInstance()) { + validatorSet_ = + com.tendermint.types.ValidatorSet.newBuilder(validatorSet_).mergeFrom(value).buildPartial(); + } else { + validatorSet_ = value; + } + + } + /** + * .tendermint.types.ValidatorSet validator_set = 2 [json_name = "validatorSet"]; + */ + private void clearValidatorSet() { validatorSet_ = null; + + } + + public static com.tendermint.types.LightBlock parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.tendermint.types.LightBlock parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.tendermint.types.LightBlock parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.tendermint.types.LightBlock parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.tendermint.types.LightBlock parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.tendermint.types.LightBlock parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.tendermint.types.LightBlock parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.tendermint.types.LightBlock parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.tendermint.types.LightBlock parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.tendermint.types.LightBlock parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.tendermint.types.LightBlock parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.tendermint.types.LightBlock parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.tendermint.types.LightBlock prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + * Protobuf type {@code tendermint.types.LightBlock} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.tendermint.types.LightBlock, Builder> implements + // @@protoc_insertion_point(builder_implements:tendermint.types.LightBlock) + com.tendermint.types.LightBlockOrBuilder { + // Construct using com.tendermint.types.LightBlock.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * .tendermint.types.SignedHeader signed_header = 1 [json_name = "signedHeader"]; + */ + @java.lang.Override + public boolean hasSignedHeader() { + return instance.hasSignedHeader(); + } + /** + * .tendermint.types.SignedHeader signed_header = 1 [json_name = "signedHeader"]; + */ + @java.lang.Override + public com.tendermint.types.SignedHeader getSignedHeader() { + return instance.getSignedHeader(); + } + /** + * .tendermint.types.SignedHeader signed_header = 1 [json_name = "signedHeader"]; + */ + public Builder setSignedHeader(com.tendermint.types.SignedHeader value) { + copyOnWrite(); + instance.setSignedHeader(value); + return this; + } + /** + * .tendermint.types.SignedHeader signed_header = 1 [json_name = "signedHeader"]; + */ + public Builder setSignedHeader( + com.tendermint.types.SignedHeader.Builder builderForValue) { + copyOnWrite(); + instance.setSignedHeader(builderForValue.build()); + return this; + } + /** + * .tendermint.types.SignedHeader signed_header = 1 [json_name = "signedHeader"]; + */ + public Builder mergeSignedHeader(com.tendermint.types.SignedHeader value) { + copyOnWrite(); + instance.mergeSignedHeader(value); + return this; + } + /** + * .tendermint.types.SignedHeader signed_header = 1 [json_name = "signedHeader"]; + */ + public Builder clearSignedHeader() { copyOnWrite(); + instance.clearSignedHeader(); + return this; + } + + /** + * .tendermint.types.ValidatorSet validator_set = 2 [json_name = "validatorSet"]; + */ + @java.lang.Override + public boolean hasValidatorSet() { + return instance.hasValidatorSet(); + } + /** + * .tendermint.types.ValidatorSet validator_set = 2 [json_name = "validatorSet"]; + */ + @java.lang.Override + public com.tendermint.types.ValidatorSet getValidatorSet() { + return instance.getValidatorSet(); + } + /** + * .tendermint.types.ValidatorSet validator_set = 2 [json_name = "validatorSet"]; + */ + public Builder setValidatorSet(com.tendermint.types.ValidatorSet value) { + copyOnWrite(); + instance.setValidatorSet(value); + return this; + } + /** + * .tendermint.types.ValidatorSet validator_set = 2 [json_name = "validatorSet"]; + */ + public Builder setValidatorSet( + com.tendermint.types.ValidatorSet.Builder builderForValue) { + copyOnWrite(); + instance.setValidatorSet(builderForValue.build()); + return this; + } + /** + * .tendermint.types.ValidatorSet validator_set = 2 [json_name = "validatorSet"]; + */ + public Builder mergeValidatorSet(com.tendermint.types.ValidatorSet value) { + copyOnWrite(); + instance.mergeValidatorSet(value); + return this; + } + /** + * .tendermint.types.ValidatorSet validator_set = 2 [json_name = "validatorSet"]; + */ + public Builder clearValidatorSet() { copyOnWrite(); + instance.clearValidatorSet(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tendermint.types.LightBlock) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.tendermint.types.LightBlock(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "signedHeader_", + "validatorSet_", + }; + java.lang.String info = + "\u0000\u0002\u0000\u0000\u0001\u0002\u0002\u0000\u0000\u0000\u0001\t\u0002\t"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.tendermint.types.LightBlock.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:tendermint.types.LightBlock) + private static final com.tendermint.types.LightBlock DEFAULT_INSTANCE; + static { + LightBlock defaultInstance = new LightBlock(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + LightBlock.class, defaultInstance); + } + + public static com.tendermint.types.LightBlock getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/LightBlockOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/LightBlockOrBuilder.java new file mode 100644 index 000000000..c1e3a5b03 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/LightBlockOrBuilder.java @@ -0,0 +1,31 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tendermint/types/types.proto + +package com.tendermint.types; + +public interface LightBlockOrBuilder extends + // @@protoc_insertion_point(interface_extends:tendermint.types.LightBlock) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * .tendermint.types.SignedHeader signed_header = 1 [json_name = "signedHeader"]; + * @return Whether the signedHeader field is set. + */ + boolean hasSignedHeader(); + /** + * .tendermint.types.SignedHeader signed_header = 1 [json_name = "signedHeader"]; + * @return The signedHeader. + */ + com.tendermint.types.SignedHeader getSignedHeader(); + + /** + * .tendermint.types.ValidatorSet validator_set = 2 [json_name = "validatorSet"]; + * @return Whether the validatorSet field is set. + */ + boolean hasValidatorSet(); + /** + * .tendermint.types.ValidatorSet validator_set = 2 [json_name = "validatorSet"]; + * @return The validatorSet. + */ + com.tendermint.types.ValidatorSet getValidatorSet(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/Part.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/Part.java new file mode 100644 index 000000000..657583ed1 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/Part.java @@ -0,0 +1,390 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tendermint/types/types.proto + +package com.tendermint.types; + +/** + * Protobuf type {@code tendermint.types.Part} + */ +public final class Part extends + com.google.protobuf.GeneratedMessageLite< + Part, Part.Builder> implements + // @@protoc_insertion_point(message_implements:tendermint.types.Part) + PartOrBuilder { + private Part() { + bytes_ = com.google.protobuf.ByteString.EMPTY; + } + public static final int INDEX_FIELD_NUMBER = 1; + private int index_; + /** + * uint32 index = 1 [json_name = "index"]; + * @return The index. + */ + @java.lang.Override + public int getIndex() { + return index_; + } + /** + * uint32 index = 1 [json_name = "index"]; + * @param value The index to set. + */ + private void setIndex(int value) { + + index_ = value; + } + /** + * uint32 index = 1 [json_name = "index"]; + */ + private void clearIndex() { + + index_ = 0; + } + + public static final int BYTES_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString bytes_; + /** + * bytes bytes = 2 [json_name = "bytes"]; + * @return The bytes. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBytes() { + return bytes_; + } + /** + * bytes bytes = 2 [json_name = "bytes"]; + * @param value The bytes to set. + */ + private void setBytes(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + bytes_ = value; + } + /** + * bytes bytes = 2 [json_name = "bytes"]; + */ + private void clearBytes() { + + bytes_ = getDefaultInstance().getBytes(); + } + + public static final int PROOF_FIELD_NUMBER = 3; + private com.tendermint.crypto.Proof proof_; + /** + * .tendermint.crypto.Proof proof = 3 [json_name = "proof", (.gogoproto.nullable) = false]; + */ + @java.lang.Override + public boolean hasProof() { + return proof_ != null; + } + /** + * .tendermint.crypto.Proof proof = 3 [json_name = "proof", (.gogoproto.nullable) = false]; + */ + @java.lang.Override + public com.tendermint.crypto.Proof getProof() { + return proof_ == null ? com.tendermint.crypto.Proof.getDefaultInstance() : proof_; + } + /** + * .tendermint.crypto.Proof proof = 3 [json_name = "proof", (.gogoproto.nullable) = false]; + */ + private void setProof(com.tendermint.crypto.Proof value) { + value.getClass(); + proof_ = value; + + } + /** + * .tendermint.crypto.Proof proof = 3 [json_name = "proof", (.gogoproto.nullable) = false]; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeProof(com.tendermint.crypto.Proof value) { + value.getClass(); + if (proof_ != null && + proof_ != com.tendermint.crypto.Proof.getDefaultInstance()) { + proof_ = + com.tendermint.crypto.Proof.newBuilder(proof_).mergeFrom(value).buildPartial(); + } else { + proof_ = value; + } + + } + /** + * .tendermint.crypto.Proof proof = 3 [json_name = "proof", (.gogoproto.nullable) = false]; + */ + private void clearProof() { proof_ = null; + + } + + public static com.tendermint.types.Part parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.tendermint.types.Part parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.tendermint.types.Part parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.tendermint.types.Part parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.tendermint.types.Part parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.tendermint.types.Part parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.tendermint.types.Part parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.tendermint.types.Part parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.tendermint.types.Part parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.tendermint.types.Part parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.tendermint.types.Part parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.tendermint.types.Part parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.tendermint.types.Part prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + * Protobuf type {@code tendermint.types.Part} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.tendermint.types.Part, Builder> implements + // @@protoc_insertion_point(builder_implements:tendermint.types.Part) + com.tendermint.types.PartOrBuilder { + // Construct using com.tendermint.types.Part.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * uint32 index = 1 [json_name = "index"]; + * @return The index. + */ + @java.lang.Override + public int getIndex() { + return instance.getIndex(); + } + /** + * uint32 index = 1 [json_name = "index"]; + * @param value The index to set. + * @return This builder for chaining. + */ + public Builder setIndex(int value) { + copyOnWrite(); + instance.setIndex(value); + return this; + } + /** + * uint32 index = 1 [json_name = "index"]; + * @return This builder for chaining. + */ + public Builder clearIndex() { + copyOnWrite(); + instance.clearIndex(); + return this; + } + + /** + * bytes bytes = 2 [json_name = "bytes"]; + * @return The bytes. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBytes() { + return instance.getBytes(); + } + /** + * bytes bytes = 2 [json_name = "bytes"]; + * @param value The bytes to set. + * @return This builder for chaining. + */ + public Builder setBytes(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setBytes(value); + return this; + } + /** + * bytes bytes = 2 [json_name = "bytes"]; + * @return This builder for chaining. + */ + public Builder clearBytes() { + copyOnWrite(); + instance.clearBytes(); + return this; + } + + /** + * .tendermint.crypto.Proof proof = 3 [json_name = "proof", (.gogoproto.nullable) = false]; + */ + @java.lang.Override + public boolean hasProof() { + return instance.hasProof(); + } + /** + * .tendermint.crypto.Proof proof = 3 [json_name = "proof", (.gogoproto.nullable) = false]; + */ + @java.lang.Override + public com.tendermint.crypto.Proof getProof() { + return instance.getProof(); + } + /** + * .tendermint.crypto.Proof proof = 3 [json_name = "proof", (.gogoproto.nullable) = false]; + */ + public Builder setProof(com.tendermint.crypto.Proof value) { + copyOnWrite(); + instance.setProof(value); + return this; + } + /** + * .tendermint.crypto.Proof proof = 3 [json_name = "proof", (.gogoproto.nullable) = false]; + */ + public Builder setProof( + com.tendermint.crypto.Proof.Builder builderForValue) { + copyOnWrite(); + instance.setProof(builderForValue.build()); + return this; + } + /** + * .tendermint.crypto.Proof proof = 3 [json_name = "proof", (.gogoproto.nullable) = false]; + */ + public Builder mergeProof(com.tendermint.crypto.Proof value) { + copyOnWrite(); + instance.mergeProof(value); + return this; + } + /** + * .tendermint.crypto.Proof proof = 3 [json_name = "proof", (.gogoproto.nullable) = false]; + */ + public Builder clearProof() { copyOnWrite(); + instance.clearProof(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tendermint.types.Part) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.tendermint.types.Part(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "index_", + "bytes_", + "proof_", + }; + java.lang.String info = + "\u0000\u0003\u0000\u0000\u0001\u0003\u0003\u0000\u0000\u0000\u0001\u000b\u0002\n" + + "\u0003\t"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.tendermint.types.Part.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:tendermint.types.Part) + private static final com.tendermint.types.Part DEFAULT_INSTANCE; + static { + Part defaultInstance = new Part(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + Part.class, defaultInstance); + } + + public static com.tendermint.types.Part getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/PartOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/PartOrBuilder.java new file mode 100644 index 000000000..c787ee413 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/PartOrBuilder.java @@ -0,0 +1,32 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tendermint/types/types.proto + +package com.tendermint.types; + +public interface PartOrBuilder extends + // @@protoc_insertion_point(interface_extends:tendermint.types.Part) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * uint32 index = 1 [json_name = "index"]; + * @return The index. + */ + int getIndex(); + + /** + * bytes bytes = 2 [json_name = "bytes"]; + * @return The bytes. + */ + com.google.protobuf.ByteString getBytes(); + + /** + * .tendermint.crypto.Proof proof = 3 [json_name = "proof", (.gogoproto.nullable) = false]; + * @return Whether the proof field is set. + */ + boolean hasProof(); + /** + * .tendermint.crypto.Proof proof = 3 [json_name = "proof", (.gogoproto.nullable) = false]; + * @return The proof. + */ + com.tendermint.crypto.Proof getProof(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/PartSetHeader.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/PartSetHeader.java new file mode 100644 index 000000000..9c0c57197 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/PartSetHeader.java @@ -0,0 +1,304 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tendermint/types/types.proto + +package com.tendermint.types; + +/** + *
+ * PartsetHeader
+ * 
+ * + * Protobuf type {@code tendermint.types.PartSetHeader} + */ +public final class PartSetHeader extends + com.google.protobuf.GeneratedMessageLite< + PartSetHeader, PartSetHeader.Builder> implements + // @@protoc_insertion_point(message_implements:tendermint.types.PartSetHeader) + PartSetHeaderOrBuilder { + private PartSetHeader() { + hash_ = com.google.protobuf.ByteString.EMPTY; + } + public static final int TOTAL_FIELD_NUMBER = 1; + private int total_; + /** + * uint32 total = 1 [json_name = "total"]; + * @return The total. + */ + @java.lang.Override + public int getTotal() { + return total_; + } + /** + * uint32 total = 1 [json_name = "total"]; + * @param value The total to set. + */ + private void setTotal(int value) { + + total_ = value; + } + /** + * uint32 total = 1 [json_name = "total"]; + */ + private void clearTotal() { + + total_ = 0; + } + + public static final int HASH_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString hash_; + /** + * bytes hash = 2 [json_name = "hash"]; + * @return The hash. + */ + @java.lang.Override + public com.google.protobuf.ByteString getHash() { + return hash_; + } + /** + * bytes hash = 2 [json_name = "hash"]; + * @param value The hash to set. + */ + private void setHash(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + hash_ = value; + } + /** + * bytes hash = 2 [json_name = "hash"]; + */ + private void clearHash() { + + hash_ = getDefaultInstance().getHash(); + } + + public static com.tendermint.types.PartSetHeader parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.tendermint.types.PartSetHeader parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.tendermint.types.PartSetHeader parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.tendermint.types.PartSetHeader parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.tendermint.types.PartSetHeader parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.tendermint.types.PartSetHeader parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.tendermint.types.PartSetHeader parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.tendermint.types.PartSetHeader parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.tendermint.types.PartSetHeader parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.tendermint.types.PartSetHeader parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.tendermint.types.PartSetHeader parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.tendermint.types.PartSetHeader parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.tendermint.types.PartSetHeader prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+   * PartsetHeader
+   * 
+ * + * Protobuf type {@code tendermint.types.PartSetHeader} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.tendermint.types.PartSetHeader, Builder> implements + // @@protoc_insertion_point(builder_implements:tendermint.types.PartSetHeader) + com.tendermint.types.PartSetHeaderOrBuilder { + // Construct using com.tendermint.types.PartSetHeader.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * uint32 total = 1 [json_name = "total"]; + * @return The total. + */ + @java.lang.Override + public int getTotal() { + return instance.getTotal(); + } + /** + * uint32 total = 1 [json_name = "total"]; + * @param value The total to set. + * @return This builder for chaining. + */ + public Builder setTotal(int value) { + copyOnWrite(); + instance.setTotal(value); + return this; + } + /** + * uint32 total = 1 [json_name = "total"]; + * @return This builder for chaining. + */ + public Builder clearTotal() { + copyOnWrite(); + instance.clearTotal(); + return this; + } + + /** + * bytes hash = 2 [json_name = "hash"]; + * @return The hash. + */ + @java.lang.Override + public com.google.protobuf.ByteString getHash() { + return instance.getHash(); + } + /** + * bytes hash = 2 [json_name = "hash"]; + * @param value The hash to set. + * @return This builder for chaining. + */ + public Builder setHash(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setHash(value); + return this; + } + /** + * bytes hash = 2 [json_name = "hash"]; + * @return This builder for chaining. + */ + public Builder clearHash() { + copyOnWrite(); + instance.clearHash(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tendermint.types.PartSetHeader) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.tendermint.types.PartSetHeader(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "total_", + "hash_", + }; + java.lang.String info = + "\u0000\u0002\u0000\u0000\u0001\u0002\u0002\u0000\u0000\u0000\u0001\u000b\u0002\n" + + ""; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.tendermint.types.PartSetHeader.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:tendermint.types.PartSetHeader) + private static final com.tendermint.types.PartSetHeader DEFAULT_INSTANCE; + static { + PartSetHeader defaultInstance = new PartSetHeader(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + PartSetHeader.class, defaultInstance); + } + + public static com.tendermint.types.PartSetHeader getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/PartSetHeaderOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/PartSetHeaderOrBuilder.java new file mode 100644 index 000000000..b0e3342c7 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/PartSetHeaderOrBuilder.java @@ -0,0 +1,21 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tendermint/types/types.proto + +package com.tendermint.types; + +public interface PartSetHeaderOrBuilder extends + // @@protoc_insertion_point(interface_extends:tendermint.types.PartSetHeader) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * uint32 total = 1 [json_name = "total"]; + * @return The total. + */ + int getTotal(); + + /** + * bytes hash = 2 [json_name = "hash"]; + * @return The hash. + */ + com.google.protobuf.ByteString getHash(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/Proposal.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/Proposal.java new file mode 100644 index 000000000..59a6709f8 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/Proposal.java @@ -0,0 +1,683 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tendermint/types/types.proto + +package com.tendermint.types; + +/** + * Protobuf type {@code tendermint.types.Proposal} + */ +public final class Proposal extends + com.google.protobuf.GeneratedMessageLite< + Proposal, Proposal.Builder> implements + // @@protoc_insertion_point(message_implements:tendermint.types.Proposal) + ProposalOrBuilder { + private Proposal() { + signature_ = com.google.protobuf.ByteString.EMPTY; + } + public static final int TYPE_FIELD_NUMBER = 1; + private int type_; + /** + * .tendermint.types.SignedMsgType type = 1 [json_name = "type"]; + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + /** + * .tendermint.types.SignedMsgType type = 1 [json_name = "type"]; + * @return The type. + */ + @java.lang.Override + public com.tendermint.types.SignedMsgType getType() { + com.tendermint.types.SignedMsgType result = com.tendermint.types.SignedMsgType.forNumber(type_); + return result == null ? com.tendermint.types.SignedMsgType.UNRECOGNIZED : result; + } + /** + * .tendermint.types.SignedMsgType type = 1 [json_name = "type"]; + * @param value The enum numeric value on the wire for type to set. + */ + private void setTypeValue(int value) { + type_ = value; + } + /** + * .tendermint.types.SignedMsgType type = 1 [json_name = "type"]; + * @param value The type to set. + */ + private void setType(com.tendermint.types.SignedMsgType value) { + type_ = value.getNumber(); + + } + /** + * .tendermint.types.SignedMsgType type = 1 [json_name = "type"]; + */ + private void clearType() { + + type_ = 0; + } + + public static final int HEIGHT_FIELD_NUMBER = 2; + private long height_; + /** + * int64 height = 2 [json_name = "height"]; + * @return The height. + */ + @java.lang.Override + public long getHeight() { + return height_; + } + /** + * int64 height = 2 [json_name = "height"]; + * @param value The height to set. + */ + private void setHeight(long value) { + + height_ = value; + } + /** + * int64 height = 2 [json_name = "height"]; + */ + private void clearHeight() { + + height_ = 0L; + } + + public static final int ROUND_FIELD_NUMBER = 3; + private int round_; + /** + * int32 round = 3 [json_name = "round"]; + * @return The round. + */ + @java.lang.Override + public int getRound() { + return round_; + } + /** + * int32 round = 3 [json_name = "round"]; + * @param value The round to set. + */ + private void setRound(int value) { + + round_ = value; + } + /** + * int32 round = 3 [json_name = "round"]; + */ + private void clearRound() { + + round_ = 0; + } + + public static final int POL_ROUND_FIELD_NUMBER = 4; + private int polRound_; + /** + * int32 pol_round = 4 [json_name = "polRound"]; + * @return The polRound. + */ + @java.lang.Override + public int getPolRound() { + return polRound_; + } + /** + * int32 pol_round = 4 [json_name = "polRound"]; + * @param value The polRound to set. + */ + private void setPolRound(int value) { + + polRound_ = value; + } + /** + * int32 pol_round = 4 [json_name = "polRound"]; + */ + private void clearPolRound() { + + polRound_ = 0; + } + + public static final int BLOCK_ID_FIELD_NUMBER = 5; + private com.tendermint.types.BlockID blockId_; + /** + * .tendermint.types.BlockID block_id = 5 [json_name = "blockId", (.gogoproto.nullable) = false, (.gogoproto.customname) = "BlockID"]; + */ + @java.lang.Override + public boolean hasBlockId() { + return blockId_ != null; + } + /** + * .tendermint.types.BlockID block_id = 5 [json_name = "blockId", (.gogoproto.nullable) = false, (.gogoproto.customname) = "BlockID"]; + */ + @java.lang.Override + public com.tendermint.types.BlockID getBlockId() { + return blockId_ == null ? com.tendermint.types.BlockID.getDefaultInstance() : blockId_; + } + /** + * .tendermint.types.BlockID block_id = 5 [json_name = "blockId", (.gogoproto.nullable) = false, (.gogoproto.customname) = "BlockID"]; + */ + private void setBlockId(com.tendermint.types.BlockID value) { + value.getClass(); + blockId_ = value; + + } + /** + * .tendermint.types.BlockID block_id = 5 [json_name = "blockId", (.gogoproto.nullable) = false, (.gogoproto.customname) = "BlockID"]; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeBlockId(com.tendermint.types.BlockID value) { + value.getClass(); + if (blockId_ != null && + blockId_ != com.tendermint.types.BlockID.getDefaultInstance()) { + blockId_ = + com.tendermint.types.BlockID.newBuilder(blockId_).mergeFrom(value).buildPartial(); + } else { + blockId_ = value; + } + + } + /** + * .tendermint.types.BlockID block_id = 5 [json_name = "blockId", (.gogoproto.nullable) = false, (.gogoproto.customname) = "BlockID"]; + */ + private void clearBlockId() { blockId_ = null; + + } + + public static final int TIMESTAMP_FIELD_NUMBER = 6; + private com.google.protobuf.Timestamp timestamp_; + /** + * .google.protobuf.Timestamp timestamp = 6 [json_name = "timestamp", (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true]; + */ + @java.lang.Override + public boolean hasTimestamp() { + return timestamp_ != null; + } + /** + * .google.protobuf.Timestamp timestamp = 6 [json_name = "timestamp", (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true]; + */ + @java.lang.Override + public com.google.protobuf.Timestamp getTimestamp() { + return timestamp_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : timestamp_; + } + /** + * .google.protobuf.Timestamp timestamp = 6 [json_name = "timestamp", (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true]; + */ + private void setTimestamp(com.google.protobuf.Timestamp value) { + value.getClass(); + timestamp_ = value; + + } + /** + * .google.protobuf.Timestamp timestamp = 6 [json_name = "timestamp", (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true]; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeTimestamp(com.google.protobuf.Timestamp value) { + value.getClass(); + if (timestamp_ != null && + timestamp_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + timestamp_ = + com.google.protobuf.Timestamp.newBuilder(timestamp_).mergeFrom(value).buildPartial(); + } else { + timestamp_ = value; + } + + } + /** + * .google.protobuf.Timestamp timestamp = 6 [json_name = "timestamp", (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true]; + */ + private void clearTimestamp() { timestamp_ = null; + + } + + public static final int SIGNATURE_FIELD_NUMBER = 7; + private com.google.protobuf.ByteString signature_; + /** + * bytes signature = 7 [json_name = "signature"]; + * @return The signature. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSignature() { + return signature_; + } + /** + * bytes signature = 7 [json_name = "signature"]; + * @param value The signature to set. + */ + private void setSignature(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + signature_ = value; + } + /** + * bytes signature = 7 [json_name = "signature"]; + */ + private void clearSignature() { + + signature_ = getDefaultInstance().getSignature(); + } + + public static com.tendermint.types.Proposal parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.tendermint.types.Proposal parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.tendermint.types.Proposal parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.tendermint.types.Proposal parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.tendermint.types.Proposal parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.tendermint.types.Proposal parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.tendermint.types.Proposal parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.tendermint.types.Proposal parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.tendermint.types.Proposal parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.tendermint.types.Proposal parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.tendermint.types.Proposal parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.tendermint.types.Proposal parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.tendermint.types.Proposal prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + * Protobuf type {@code tendermint.types.Proposal} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.tendermint.types.Proposal, Builder> implements + // @@protoc_insertion_point(builder_implements:tendermint.types.Proposal) + com.tendermint.types.ProposalOrBuilder { + // Construct using com.tendermint.types.Proposal.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * .tendermint.types.SignedMsgType type = 1 [json_name = "type"]; + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return instance.getTypeValue(); + } + /** + * .tendermint.types.SignedMsgType type = 1 [json_name = "type"]; + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setTypeValue(int value) { + copyOnWrite(); + instance.setTypeValue(value); + return this; + } + /** + * .tendermint.types.SignedMsgType type = 1 [json_name = "type"]; + * @return The type. + */ + @java.lang.Override + public com.tendermint.types.SignedMsgType getType() { + return instance.getType(); + } + /** + * .tendermint.types.SignedMsgType type = 1 [json_name = "type"]; + * @param value The enum numeric value on the wire for type to set. + * @return This builder for chaining. + */ + public Builder setType(com.tendermint.types.SignedMsgType value) { + copyOnWrite(); + instance.setType(value); + return this; + } + /** + * .tendermint.types.SignedMsgType type = 1 [json_name = "type"]; + * @return This builder for chaining. + */ + public Builder clearType() { + copyOnWrite(); + instance.clearType(); + return this; + } + + /** + * int64 height = 2 [json_name = "height"]; + * @return The height. + */ + @java.lang.Override + public long getHeight() { + return instance.getHeight(); + } + /** + * int64 height = 2 [json_name = "height"]; + * @param value The height to set. + * @return This builder for chaining. + */ + public Builder setHeight(long value) { + copyOnWrite(); + instance.setHeight(value); + return this; + } + /** + * int64 height = 2 [json_name = "height"]; + * @return This builder for chaining. + */ + public Builder clearHeight() { + copyOnWrite(); + instance.clearHeight(); + return this; + } + + /** + * int32 round = 3 [json_name = "round"]; + * @return The round. + */ + @java.lang.Override + public int getRound() { + return instance.getRound(); + } + /** + * int32 round = 3 [json_name = "round"]; + * @param value The round to set. + * @return This builder for chaining. + */ + public Builder setRound(int value) { + copyOnWrite(); + instance.setRound(value); + return this; + } + /** + * int32 round = 3 [json_name = "round"]; + * @return This builder for chaining. + */ + public Builder clearRound() { + copyOnWrite(); + instance.clearRound(); + return this; + } + + /** + * int32 pol_round = 4 [json_name = "polRound"]; + * @return The polRound. + */ + @java.lang.Override + public int getPolRound() { + return instance.getPolRound(); + } + /** + * int32 pol_round = 4 [json_name = "polRound"]; + * @param value The polRound to set. + * @return This builder for chaining. + */ + public Builder setPolRound(int value) { + copyOnWrite(); + instance.setPolRound(value); + return this; + } + /** + * int32 pol_round = 4 [json_name = "polRound"]; + * @return This builder for chaining. + */ + public Builder clearPolRound() { + copyOnWrite(); + instance.clearPolRound(); + return this; + } + + /** + * .tendermint.types.BlockID block_id = 5 [json_name = "blockId", (.gogoproto.nullable) = false, (.gogoproto.customname) = "BlockID"]; + */ + @java.lang.Override + public boolean hasBlockId() { + return instance.hasBlockId(); + } + /** + * .tendermint.types.BlockID block_id = 5 [json_name = "blockId", (.gogoproto.nullable) = false, (.gogoproto.customname) = "BlockID"]; + */ + @java.lang.Override + public com.tendermint.types.BlockID getBlockId() { + return instance.getBlockId(); + } + /** + * .tendermint.types.BlockID block_id = 5 [json_name = "blockId", (.gogoproto.nullable) = false, (.gogoproto.customname) = "BlockID"]; + */ + public Builder setBlockId(com.tendermint.types.BlockID value) { + copyOnWrite(); + instance.setBlockId(value); + return this; + } + /** + * .tendermint.types.BlockID block_id = 5 [json_name = "blockId", (.gogoproto.nullable) = false, (.gogoproto.customname) = "BlockID"]; + */ + public Builder setBlockId( + com.tendermint.types.BlockID.Builder builderForValue) { + copyOnWrite(); + instance.setBlockId(builderForValue.build()); + return this; + } + /** + * .tendermint.types.BlockID block_id = 5 [json_name = "blockId", (.gogoproto.nullable) = false, (.gogoproto.customname) = "BlockID"]; + */ + public Builder mergeBlockId(com.tendermint.types.BlockID value) { + copyOnWrite(); + instance.mergeBlockId(value); + return this; + } + /** + * .tendermint.types.BlockID block_id = 5 [json_name = "blockId", (.gogoproto.nullable) = false, (.gogoproto.customname) = "BlockID"]; + */ + public Builder clearBlockId() { copyOnWrite(); + instance.clearBlockId(); + return this; + } + + /** + * .google.protobuf.Timestamp timestamp = 6 [json_name = "timestamp", (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true]; + */ + @java.lang.Override + public boolean hasTimestamp() { + return instance.hasTimestamp(); + } + /** + * .google.protobuf.Timestamp timestamp = 6 [json_name = "timestamp", (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true]; + */ + @java.lang.Override + public com.google.protobuf.Timestamp getTimestamp() { + return instance.getTimestamp(); + } + /** + * .google.protobuf.Timestamp timestamp = 6 [json_name = "timestamp", (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true]; + */ + public Builder setTimestamp(com.google.protobuf.Timestamp value) { + copyOnWrite(); + instance.setTimestamp(value); + return this; + } + /** + * .google.protobuf.Timestamp timestamp = 6 [json_name = "timestamp", (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true]; + */ + public Builder setTimestamp( + com.google.protobuf.Timestamp.Builder builderForValue) { + copyOnWrite(); + instance.setTimestamp(builderForValue.build()); + return this; + } + /** + * .google.protobuf.Timestamp timestamp = 6 [json_name = "timestamp", (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true]; + */ + public Builder mergeTimestamp(com.google.protobuf.Timestamp value) { + copyOnWrite(); + instance.mergeTimestamp(value); + return this; + } + /** + * .google.protobuf.Timestamp timestamp = 6 [json_name = "timestamp", (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true]; + */ + public Builder clearTimestamp() { copyOnWrite(); + instance.clearTimestamp(); + return this; + } + + /** + * bytes signature = 7 [json_name = "signature"]; + * @return The signature. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSignature() { + return instance.getSignature(); + } + /** + * bytes signature = 7 [json_name = "signature"]; + * @param value The signature to set. + * @return This builder for chaining. + */ + public Builder setSignature(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setSignature(value); + return this; + } + /** + * bytes signature = 7 [json_name = "signature"]; + * @return This builder for chaining. + */ + public Builder clearSignature() { + copyOnWrite(); + instance.clearSignature(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tendermint.types.Proposal) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.tendermint.types.Proposal(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "type_", + "height_", + "round_", + "polRound_", + "blockId_", + "timestamp_", + "signature_", + }; + java.lang.String info = + "\u0000\u0007\u0000\u0000\u0001\u0007\u0007\u0000\u0000\u0000\u0001\f\u0002\u0002" + + "\u0003\u0004\u0004\u0004\u0005\t\u0006\t\u0007\n"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.tendermint.types.Proposal.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:tendermint.types.Proposal) + private static final com.tendermint.types.Proposal DEFAULT_INSTANCE; + static { + Proposal defaultInstance = new Proposal(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + Proposal.class, defaultInstance); + } + + public static com.tendermint.types.Proposal getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/ProposalOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/ProposalOrBuilder.java new file mode 100644 index 000000000..678588e5d --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/ProposalOrBuilder.java @@ -0,0 +1,66 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tendermint/types/types.proto + +package com.tendermint.types; + +public interface ProposalOrBuilder extends + // @@protoc_insertion_point(interface_extends:tendermint.types.Proposal) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * .tendermint.types.SignedMsgType type = 1 [json_name = "type"]; + * @return The enum numeric value on the wire for type. + */ + int getTypeValue(); + /** + * .tendermint.types.SignedMsgType type = 1 [json_name = "type"]; + * @return The type. + */ + com.tendermint.types.SignedMsgType getType(); + + /** + * int64 height = 2 [json_name = "height"]; + * @return The height. + */ + long getHeight(); + + /** + * int32 round = 3 [json_name = "round"]; + * @return The round. + */ + int getRound(); + + /** + * int32 pol_round = 4 [json_name = "polRound"]; + * @return The polRound. + */ + int getPolRound(); + + /** + * .tendermint.types.BlockID block_id = 5 [json_name = "blockId", (.gogoproto.nullable) = false, (.gogoproto.customname) = "BlockID"]; + * @return Whether the blockId field is set. + */ + boolean hasBlockId(); + /** + * .tendermint.types.BlockID block_id = 5 [json_name = "blockId", (.gogoproto.nullable) = false, (.gogoproto.customname) = "BlockID"]; + * @return The blockId. + */ + com.tendermint.types.BlockID getBlockId(); + + /** + * .google.protobuf.Timestamp timestamp = 6 [json_name = "timestamp", (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true]; + * @return Whether the timestamp field is set. + */ + boolean hasTimestamp(); + /** + * .google.protobuf.Timestamp timestamp = 6 [json_name = "timestamp", (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true]; + * @return The timestamp. + */ + com.google.protobuf.Timestamp getTimestamp(); + + /** + * bytes signature = 7 [json_name = "signature"]; + * @return The signature. + */ + com.google.protobuf.ByteString getSignature(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/SignedHeader.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/SignedHeader.java new file mode 100644 index 000000000..88be5e2d0 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/SignedHeader.java @@ -0,0 +1,371 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tendermint/types/types.proto + +package com.tendermint.types; + +/** + * Protobuf type {@code tendermint.types.SignedHeader} + */ +public final class SignedHeader extends + com.google.protobuf.GeneratedMessageLite< + SignedHeader, SignedHeader.Builder> implements + // @@protoc_insertion_point(message_implements:tendermint.types.SignedHeader) + SignedHeaderOrBuilder { + private SignedHeader() { + } + public static final int HEADER_FIELD_NUMBER = 1; + private com.tendermint.types.Header header_; + /** + * .tendermint.types.Header header = 1 [json_name = "header"]; + */ + @java.lang.Override + public boolean hasHeader() { + return header_ != null; + } + /** + * .tendermint.types.Header header = 1 [json_name = "header"]; + */ + @java.lang.Override + public com.tendermint.types.Header getHeader() { + return header_ == null ? com.tendermint.types.Header.getDefaultInstance() : header_; + } + /** + * .tendermint.types.Header header = 1 [json_name = "header"]; + */ + private void setHeader(com.tendermint.types.Header value) { + value.getClass(); + header_ = value; + + } + /** + * .tendermint.types.Header header = 1 [json_name = "header"]; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeHeader(com.tendermint.types.Header value) { + value.getClass(); + if (header_ != null && + header_ != com.tendermint.types.Header.getDefaultInstance()) { + header_ = + com.tendermint.types.Header.newBuilder(header_).mergeFrom(value).buildPartial(); + } else { + header_ = value; + } + + } + /** + * .tendermint.types.Header header = 1 [json_name = "header"]; + */ + private void clearHeader() { header_ = null; + + } + + public static final int COMMIT_FIELD_NUMBER = 2; + private com.tendermint.types.Commit commit_; + /** + * .tendermint.types.Commit commit = 2 [json_name = "commit"]; + */ + @java.lang.Override + public boolean hasCommit() { + return commit_ != null; + } + /** + * .tendermint.types.Commit commit = 2 [json_name = "commit"]; + */ + @java.lang.Override + public com.tendermint.types.Commit getCommit() { + return commit_ == null ? com.tendermint.types.Commit.getDefaultInstance() : commit_; + } + /** + * .tendermint.types.Commit commit = 2 [json_name = "commit"]; + */ + private void setCommit(com.tendermint.types.Commit value) { + value.getClass(); + commit_ = value; + + } + /** + * .tendermint.types.Commit commit = 2 [json_name = "commit"]; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeCommit(com.tendermint.types.Commit value) { + value.getClass(); + if (commit_ != null && + commit_ != com.tendermint.types.Commit.getDefaultInstance()) { + commit_ = + com.tendermint.types.Commit.newBuilder(commit_).mergeFrom(value).buildPartial(); + } else { + commit_ = value; + } + + } + /** + * .tendermint.types.Commit commit = 2 [json_name = "commit"]; + */ + private void clearCommit() { commit_ = null; + + } + + public static com.tendermint.types.SignedHeader parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.tendermint.types.SignedHeader parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.tendermint.types.SignedHeader parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.tendermint.types.SignedHeader parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.tendermint.types.SignedHeader parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.tendermint.types.SignedHeader parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.tendermint.types.SignedHeader parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.tendermint.types.SignedHeader parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.tendermint.types.SignedHeader parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.tendermint.types.SignedHeader parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.tendermint.types.SignedHeader parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.tendermint.types.SignedHeader parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.tendermint.types.SignedHeader prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + * Protobuf type {@code tendermint.types.SignedHeader} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.tendermint.types.SignedHeader, Builder> implements + // @@protoc_insertion_point(builder_implements:tendermint.types.SignedHeader) + com.tendermint.types.SignedHeaderOrBuilder { + // Construct using com.tendermint.types.SignedHeader.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * .tendermint.types.Header header = 1 [json_name = "header"]; + */ + @java.lang.Override + public boolean hasHeader() { + return instance.hasHeader(); + } + /** + * .tendermint.types.Header header = 1 [json_name = "header"]; + */ + @java.lang.Override + public com.tendermint.types.Header getHeader() { + return instance.getHeader(); + } + /** + * .tendermint.types.Header header = 1 [json_name = "header"]; + */ + public Builder setHeader(com.tendermint.types.Header value) { + copyOnWrite(); + instance.setHeader(value); + return this; + } + /** + * .tendermint.types.Header header = 1 [json_name = "header"]; + */ + public Builder setHeader( + com.tendermint.types.Header.Builder builderForValue) { + copyOnWrite(); + instance.setHeader(builderForValue.build()); + return this; + } + /** + * .tendermint.types.Header header = 1 [json_name = "header"]; + */ + public Builder mergeHeader(com.tendermint.types.Header value) { + copyOnWrite(); + instance.mergeHeader(value); + return this; + } + /** + * .tendermint.types.Header header = 1 [json_name = "header"]; + */ + public Builder clearHeader() { copyOnWrite(); + instance.clearHeader(); + return this; + } + + /** + * .tendermint.types.Commit commit = 2 [json_name = "commit"]; + */ + @java.lang.Override + public boolean hasCommit() { + return instance.hasCommit(); + } + /** + * .tendermint.types.Commit commit = 2 [json_name = "commit"]; + */ + @java.lang.Override + public com.tendermint.types.Commit getCommit() { + return instance.getCommit(); + } + /** + * .tendermint.types.Commit commit = 2 [json_name = "commit"]; + */ + public Builder setCommit(com.tendermint.types.Commit value) { + copyOnWrite(); + instance.setCommit(value); + return this; + } + /** + * .tendermint.types.Commit commit = 2 [json_name = "commit"]; + */ + public Builder setCommit( + com.tendermint.types.Commit.Builder builderForValue) { + copyOnWrite(); + instance.setCommit(builderForValue.build()); + return this; + } + /** + * .tendermint.types.Commit commit = 2 [json_name = "commit"]; + */ + public Builder mergeCommit(com.tendermint.types.Commit value) { + copyOnWrite(); + instance.mergeCommit(value); + return this; + } + /** + * .tendermint.types.Commit commit = 2 [json_name = "commit"]; + */ + public Builder clearCommit() { copyOnWrite(); + instance.clearCommit(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tendermint.types.SignedHeader) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.tendermint.types.SignedHeader(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "header_", + "commit_", + }; + java.lang.String info = + "\u0000\u0002\u0000\u0000\u0001\u0002\u0002\u0000\u0000\u0000\u0001\t\u0002\t"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.tendermint.types.SignedHeader.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:tendermint.types.SignedHeader) + private static final com.tendermint.types.SignedHeader DEFAULT_INSTANCE; + static { + SignedHeader defaultInstance = new SignedHeader(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + SignedHeader.class, defaultInstance); + } + + public static com.tendermint.types.SignedHeader getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/SignedHeaderOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/SignedHeaderOrBuilder.java new file mode 100644 index 000000000..4f8a6a3e1 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/SignedHeaderOrBuilder.java @@ -0,0 +1,31 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tendermint/types/types.proto + +package com.tendermint.types; + +public interface SignedHeaderOrBuilder extends + // @@protoc_insertion_point(interface_extends:tendermint.types.SignedHeader) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * .tendermint.types.Header header = 1 [json_name = "header"]; + * @return Whether the header field is set. + */ + boolean hasHeader(); + /** + * .tendermint.types.Header header = 1 [json_name = "header"]; + * @return The header. + */ + com.tendermint.types.Header getHeader(); + + /** + * .tendermint.types.Commit commit = 2 [json_name = "commit"]; + * @return Whether the commit field is set. + */ + boolean hasCommit(); + /** + * .tendermint.types.Commit commit = 2 [json_name = "commit"]; + * @return The commit. + */ + com.tendermint.types.Commit getCommit(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/SignedMsgType.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/SignedMsgType.java new file mode 100644 index 000000000..95d266c4b --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/SignedMsgType.java @@ -0,0 +1,132 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tendermint/types/types.proto + +package com.tendermint.types; + +/** + *
+ * SignedMsgType is a type of signed message in the consensus.
+ * 
+ * + * Protobuf enum {@code tendermint.types.SignedMsgType} + */ +public enum SignedMsgType + implements com.google.protobuf.Internal.EnumLite { + /** + * SIGNED_MSG_TYPE_UNKNOWN = 0 [(.gogoproto.enumvalue_customname) = "UnknownType"]; + */ + SIGNED_MSG_TYPE_UNKNOWN(0), + /** + *
+   * Votes
+   * 
+ * + * SIGNED_MSG_TYPE_PREVOTE = 1 [(.gogoproto.enumvalue_customname) = "PrevoteType"]; + */ + SIGNED_MSG_TYPE_PREVOTE(1), + /** + * SIGNED_MSG_TYPE_PRECOMMIT = 2 [(.gogoproto.enumvalue_customname) = "PrecommitType"]; + */ + SIGNED_MSG_TYPE_PRECOMMIT(2), + /** + *
+   * Proposals
+   * 
+ * + * SIGNED_MSG_TYPE_PROPOSAL = 32 [(.gogoproto.enumvalue_customname) = "ProposalType"]; + */ + SIGNED_MSG_TYPE_PROPOSAL(32), + UNRECOGNIZED(-1), + ; + + /** + * SIGNED_MSG_TYPE_UNKNOWN = 0 [(.gogoproto.enumvalue_customname) = "UnknownType"]; + */ + public static final int SIGNED_MSG_TYPE_UNKNOWN_VALUE = 0; + /** + *
+   * Votes
+   * 
+ * + * SIGNED_MSG_TYPE_PREVOTE = 1 [(.gogoproto.enumvalue_customname) = "PrevoteType"]; + */ + public static final int SIGNED_MSG_TYPE_PREVOTE_VALUE = 1; + /** + * SIGNED_MSG_TYPE_PRECOMMIT = 2 [(.gogoproto.enumvalue_customname) = "PrecommitType"]; + */ + public static final int SIGNED_MSG_TYPE_PRECOMMIT_VALUE = 2; + /** + *
+   * Proposals
+   * 
+ * + * SIGNED_MSG_TYPE_PROPOSAL = 32 [(.gogoproto.enumvalue_customname) = "ProposalType"]; + */ + public static final int SIGNED_MSG_TYPE_PROPOSAL_VALUE = 32; + + + @java.lang.Override + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SignedMsgType valueOf(int value) { + return forNumber(value); + } + + public static SignedMsgType forNumber(int value) { + switch (value) { + case 0: return SIGNED_MSG_TYPE_UNKNOWN; + case 1: return SIGNED_MSG_TYPE_PREVOTE; + case 2: return SIGNED_MSG_TYPE_PRECOMMIT; + case 32: return SIGNED_MSG_TYPE_PROPOSAL; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + SignedMsgType> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + @java.lang.Override + public SignedMsgType findValueByNumber(int number) { + return SignedMsgType.forNumber(number); + } + }; + + public static com.google.protobuf.Internal.EnumVerifier + internalGetVerifier() { + return SignedMsgTypeVerifier.INSTANCE; + } + + private static final class SignedMsgTypeVerifier implements + com.google.protobuf.Internal.EnumVerifier { + static final com.google.protobuf.Internal.EnumVerifier INSTANCE = new SignedMsgTypeVerifier(); + @java.lang.Override + public boolean isInRange(int number) { + return SignedMsgType.forNumber(number) != null; + } + }; + + private final int value; + + private SignedMsgType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:tendermint.types.SignedMsgType) +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/SimpleValidator.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/SimpleValidator.java new file mode 100644 index 000000000..f6506aa6c --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/SimpleValidator.java @@ -0,0 +1,333 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tendermint/types/validator.proto + +package com.tendermint.types; + +/** + * Protobuf type {@code tendermint.types.SimpleValidator} + */ +public final class SimpleValidator extends + com.google.protobuf.GeneratedMessageLite< + SimpleValidator, SimpleValidator.Builder> implements + // @@protoc_insertion_point(message_implements:tendermint.types.SimpleValidator) + SimpleValidatorOrBuilder { + private SimpleValidator() { + } + public static final int PUB_KEY_FIELD_NUMBER = 1; + private com.tendermint.crypto.PublicKey pubKey_; + /** + * .tendermint.crypto.PublicKey pub_key = 1 [json_name = "pubKey"]; + */ + @java.lang.Override + public boolean hasPubKey() { + return pubKey_ != null; + } + /** + * .tendermint.crypto.PublicKey pub_key = 1 [json_name = "pubKey"]; + */ + @java.lang.Override + public com.tendermint.crypto.PublicKey getPubKey() { + return pubKey_ == null ? com.tendermint.crypto.PublicKey.getDefaultInstance() : pubKey_; + } + /** + * .tendermint.crypto.PublicKey pub_key = 1 [json_name = "pubKey"]; + */ + private void setPubKey(com.tendermint.crypto.PublicKey value) { + value.getClass(); + pubKey_ = value; + + } + /** + * .tendermint.crypto.PublicKey pub_key = 1 [json_name = "pubKey"]; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergePubKey(com.tendermint.crypto.PublicKey value) { + value.getClass(); + if (pubKey_ != null && + pubKey_ != com.tendermint.crypto.PublicKey.getDefaultInstance()) { + pubKey_ = + com.tendermint.crypto.PublicKey.newBuilder(pubKey_).mergeFrom(value).buildPartial(); + } else { + pubKey_ = value; + } + + } + /** + * .tendermint.crypto.PublicKey pub_key = 1 [json_name = "pubKey"]; + */ + private void clearPubKey() { pubKey_ = null; + + } + + public static final int VOTING_POWER_FIELD_NUMBER = 2; + private long votingPower_; + /** + * int64 voting_power = 2 [json_name = "votingPower"]; + * @return The votingPower. + */ + @java.lang.Override + public long getVotingPower() { + return votingPower_; + } + /** + * int64 voting_power = 2 [json_name = "votingPower"]; + * @param value The votingPower to set. + */ + private void setVotingPower(long value) { + + votingPower_ = value; + } + /** + * int64 voting_power = 2 [json_name = "votingPower"]; + */ + private void clearVotingPower() { + + votingPower_ = 0L; + } + + public static com.tendermint.types.SimpleValidator parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.tendermint.types.SimpleValidator parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.tendermint.types.SimpleValidator parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.tendermint.types.SimpleValidator parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.tendermint.types.SimpleValidator parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.tendermint.types.SimpleValidator parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.tendermint.types.SimpleValidator parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.tendermint.types.SimpleValidator parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.tendermint.types.SimpleValidator parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.tendermint.types.SimpleValidator parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.tendermint.types.SimpleValidator parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.tendermint.types.SimpleValidator parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.tendermint.types.SimpleValidator prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + * Protobuf type {@code tendermint.types.SimpleValidator} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.tendermint.types.SimpleValidator, Builder> implements + // @@protoc_insertion_point(builder_implements:tendermint.types.SimpleValidator) + com.tendermint.types.SimpleValidatorOrBuilder { + // Construct using com.tendermint.types.SimpleValidator.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * .tendermint.crypto.PublicKey pub_key = 1 [json_name = "pubKey"]; + */ + @java.lang.Override + public boolean hasPubKey() { + return instance.hasPubKey(); + } + /** + * .tendermint.crypto.PublicKey pub_key = 1 [json_name = "pubKey"]; + */ + @java.lang.Override + public com.tendermint.crypto.PublicKey getPubKey() { + return instance.getPubKey(); + } + /** + * .tendermint.crypto.PublicKey pub_key = 1 [json_name = "pubKey"]; + */ + public Builder setPubKey(com.tendermint.crypto.PublicKey value) { + copyOnWrite(); + instance.setPubKey(value); + return this; + } + /** + * .tendermint.crypto.PublicKey pub_key = 1 [json_name = "pubKey"]; + */ + public Builder setPubKey( + com.tendermint.crypto.PublicKey.Builder builderForValue) { + copyOnWrite(); + instance.setPubKey(builderForValue.build()); + return this; + } + /** + * .tendermint.crypto.PublicKey pub_key = 1 [json_name = "pubKey"]; + */ + public Builder mergePubKey(com.tendermint.crypto.PublicKey value) { + copyOnWrite(); + instance.mergePubKey(value); + return this; + } + /** + * .tendermint.crypto.PublicKey pub_key = 1 [json_name = "pubKey"]; + */ + public Builder clearPubKey() { copyOnWrite(); + instance.clearPubKey(); + return this; + } + + /** + * int64 voting_power = 2 [json_name = "votingPower"]; + * @return The votingPower. + */ + @java.lang.Override + public long getVotingPower() { + return instance.getVotingPower(); + } + /** + * int64 voting_power = 2 [json_name = "votingPower"]; + * @param value The votingPower to set. + * @return This builder for chaining. + */ + public Builder setVotingPower(long value) { + copyOnWrite(); + instance.setVotingPower(value); + return this; + } + /** + * int64 voting_power = 2 [json_name = "votingPower"]; + * @return This builder for chaining. + */ + public Builder clearVotingPower() { + copyOnWrite(); + instance.clearVotingPower(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tendermint.types.SimpleValidator) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.tendermint.types.SimpleValidator(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "pubKey_", + "votingPower_", + }; + java.lang.String info = + "\u0000\u0002\u0000\u0000\u0001\u0002\u0002\u0000\u0000\u0000\u0001\t\u0002\u0002" + + ""; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.tendermint.types.SimpleValidator.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:tendermint.types.SimpleValidator) + private static final com.tendermint.types.SimpleValidator DEFAULT_INSTANCE; + static { + SimpleValidator defaultInstance = new SimpleValidator(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + SimpleValidator.class, defaultInstance); + } + + public static com.tendermint.types.SimpleValidator getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/SimpleValidatorOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/SimpleValidatorOrBuilder.java new file mode 100644 index 000000000..8d6a3ba0a --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/SimpleValidatorOrBuilder.java @@ -0,0 +1,26 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tendermint/types/validator.proto + +package com.tendermint.types; + +public interface SimpleValidatorOrBuilder extends + // @@protoc_insertion_point(interface_extends:tendermint.types.SimpleValidator) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * .tendermint.crypto.PublicKey pub_key = 1 [json_name = "pubKey"]; + * @return Whether the pubKey field is set. + */ + boolean hasPubKey(); + /** + * .tendermint.crypto.PublicKey pub_key = 1 [json_name = "pubKey"]; + * @return The pubKey. + */ + com.tendermint.crypto.PublicKey getPubKey(); + + /** + * int64 voting_power = 2 [json_name = "votingPower"]; + * @return The votingPower. + */ + long getVotingPower(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/TxProof.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/TxProof.java new file mode 100644 index 000000000..401778516 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/TxProof.java @@ -0,0 +1,400 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tendermint/types/types.proto + +package com.tendermint.types; + +/** + *
+ * TxProof represents a Merkle proof of the presence of a transaction in the Merkle tree.
+ * 
+ * + * Protobuf type {@code tendermint.types.TxProof} + */ +public final class TxProof extends + com.google.protobuf.GeneratedMessageLite< + TxProof, TxProof.Builder> implements + // @@protoc_insertion_point(message_implements:tendermint.types.TxProof) + TxProofOrBuilder { + private TxProof() { + rootHash_ = com.google.protobuf.ByteString.EMPTY; + data_ = com.google.protobuf.ByteString.EMPTY; + } + public static final int ROOT_HASH_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString rootHash_; + /** + * bytes root_hash = 1 [json_name = "rootHash"]; + * @return The rootHash. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRootHash() { + return rootHash_; + } + /** + * bytes root_hash = 1 [json_name = "rootHash"]; + * @param value The rootHash to set. + */ + private void setRootHash(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + rootHash_ = value; + } + /** + * bytes root_hash = 1 [json_name = "rootHash"]; + */ + private void clearRootHash() { + + rootHash_ = getDefaultInstance().getRootHash(); + } + + public static final int DATA_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString data_; + /** + * bytes data = 2 [json_name = "data"]; + * @return The data. + */ + @java.lang.Override + public com.google.protobuf.ByteString getData() { + return data_; + } + /** + * bytes data = 2 [json_name = "data"]; + * @param value The data to set. + */ + private void setData(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + data_ = value; + } + /** + * bytes data = 2 [json_name = "data"]; + */ + private void clearData() { + + data_ = getDefaultInstance().getData(); + } + + public static final int PROOF_FIELD_NUMBER = 3; + private com.tendermint.crypto.Proof proof_; + /** + * .tendermint.crypto.Proof proof = 3 [json_name = "proof"]; + */ + @java.lang.Override + public boolean hasProof() { + return proof_ != null; + } + /** + * .tendermint.crypto.Proof proof = 3 [json_name = "proof"]; + */ + @java.lang.Override + public com.tendermint.crypto.Proof getProof() { + return proof_ == null ? com.tendermint.crypto.Proof.getDefaultInstance() : proof_; + } + /** + * .tendermint.crypto.Proof proof = 3 [json_name = "proof"]; + */ + private void setProof(com.tendermint.crypto.Proof value) { + value.getClass(); + proof_ = value; + + } + /** + * .tendermint.crypto.Proof proof = 3 [json_name = "proof"]; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeProof(com.tendermint.crypto.Proof value) { + value.getClass(); + if (proof_ != null && + proof_ != com.tendermint.crypto.Proof.getDefaultInstance()) { + proof_ = + com.tendermint.crypto.Proof.newBuilder(proof_).mergeFrom(value).buildPartial(); + } else { + proof_ = value; + } + + } + /** + * .tendermint.crypto.Proof proof = 3 [json_name = "proof"]; + */ + private void clearProof() { proof_ = null; + + } + + public static com.tendermint.types.TxProof parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.tendermint.types.TxProof parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.tendermint.types.TxProof parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.tendermint.types.TxProof parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.tendermint.types.TxProof parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.tendermint.types.TxProof parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.tendermint.types.TxProof parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.tendermint.types.TxProof parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.tendermint.types.TxProof parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.tendermint.types.TxProof parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.tendermint.types.TxProof parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.tendermint.types.TxProof parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.tendermint.types.TxProof prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+   * TxProof represents a Merkle proof of the presence of a transaction in the Merkle tree.
+   * 
+ * + * Protobuf type {@code tendermint.types.TxProof} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.tendermint.types.TxProof, Builder> implements + // @@protoc_insertion_point(builder_implements:tendermint.types.TxProof) + com.tendermint.types.TxProofOrBuilder { + // Construct using com.tendermint.types.TxProof.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * bytes root_hash = 1 [json_name = "rootHash"]; + * @return The rootHash. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRootHash() { + return instance.getRootHash(); + } + /** + * bytes root_hash = 1 [json_name = "rootHash"]; + * @param value The rootHash to set. + * @return This builder for chaining. + */ + public Builder setRootHash(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setRootHash(value); + return this; + } + /** + * bytes root_hash = 1 [json_name = "rootHash"]; + * @return This builder for chaining. + */ + public Builder clearRootHash() { + copyOnWrite(); + instance.clearRootHash(); + return this; + } + + /** + * bytes data = 2 [json_name = "data"]; + * @return The data. + */ + @java.lang.Override + public com.google.protobuf.ByteString getData() { + return instance.getData(); + } + /** + * bytes data = 2 [json_name = "data"]; + * @param value The data to set. + * @return This builder for chaining. + */ + public Builder setData(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setData(value); + return this; + } + /** + * bytes data = 2 [json_name = "data"]; + * @return This builder for chaining. + */ + public Builder clearData() { + copyOnWrite(); + instance.clearData(); + return this; + } + + /** + * .tendermint.crypto.Proof proof = 3 [json_name = "proof"]; + */ + @java.lang.Override + public boolean hasProof() { + return instance.hasProof(); + } + /** + * .tendermint.crypto.Proof proof = 3 [json_name = "proof"]; + */ + @java.lang.Override + public com.tendermint.crypto.Proof getProof() { + return instance.getProof(); + } + /** + * .tendermint.crypto.Proof proof = 3 [json_name = "proof"]; + */ + public Builder setProof(com.tendermint.crypto.Proof value) { + copyOnWrite(); + instance.setProof(value); + return this; + } + /** + * .tendermint.crypto.Proof proof = 3 [json_name = "proof"]; + */ + public Builder setProof( + com.tendermint.crypto.Proof.Builder builderForValue) { + copyOnWrite(); + instance.setProof(builderForValue.build()); + return this; + } + /** + * .tendermint.crypto.Proof proof = 3 [json_name = "proof"]; + */ + public Builder mergeProof(com.tendermint.crypto.Proof value) { + copyOnWrite(); + instance.mergeProof(value); + return this; + } + /** + * .tendermint.crypto.Proof proof = 3 [json_name = "proof"]; + */ + public Builder clearProof() { copyOnWrite(); + instance.clearProof(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tendermint.types.TxProof) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.tendermint.types.TxProof(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "rootHash_", + "data_", + "proof_", + }; + java.lang.String info = + "\u0000\u0003\u0000\u0000\u0001\u0003\u0003\u0000\u0000\u0000\u0001\n\u0002\n\u0003" + + "\t"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.tendermint.types.TxProof.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:tendermint.types.TxProof) + private static final com.tendermint.types.TxProof DEFAULT_INSTANCE; + static { + TxProof defaultInstance = new TxProof(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + TxProof.class, defaultInstance); + } + + public static com.tendermint.types.TxProof getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/TxProofOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/TxProofOrBuilder.java new file mode 100644 index 000000000..29ec00b80 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/TxProofOrBuilder.java @@ -0,0 +1,32 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tendermint/types/types.proto + +package com.tendermint.types; + +public interface TxProofOrBuilder extends + // @@protoc_insertion_point(interface_extends:tendermint.types.TxProof) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * bytes root_hash = 1 [json_name = "rootHash"]; + * @return The rootHash. + */ + com.google.protobuf.ByteString getRootHash(); + + /** + * bytes data = 2 [json_name = "data"]; + * @return The data. + */ + com.google.protobuf.ByteString getData(); + + /** + * .tendermint.crypto.Proof proof = 3 [json_name = "proof"]; + * @return Whether the proof field is set. + */ + boolean hasProof(); + /** + * .tendermint.crypto.Proof proof = 3 [json_name = "proof"]; + * @return The proof. + */ + com.tendermint.crypto.Proof getProof(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/TypesProto.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/TypesProto.java new file mode 100644 index 000000000..1ede31fd4 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/TypesProto.java @@ -0,0 +1,16 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tendermint/types/types.proto + +package com.tendermint.types; + +public final class TypesProto { + private TypesProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + static { + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/Validator.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/Validator.java new file mode 100644 index 000000000..68c391ea0 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/Validator.java @@ -0,0 +1,445 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tendermint/types/validator.proto + +package com.tendermint.types; + +/** + * Protobuf type {@code tendermint.types.Validator} + */ +public final class Validator extends + com.google.protobuf.GeneratedMessageLite< + Validator, Validator.Builder> implements + // @@protoc_insertion_point(message_implements:tendermint.types.Validator) + ValidatorOrBuilder { + private Validator() { + address_ = com.google.protobuf.ByteString.EMPTY; + } + public static final int ADDRESS_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString address_; + /** + * bytes address = 1 [json_name = "address"]; + * @return The address. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAddress() { + return address_; + } + /** + * bytes address = 1 [json_name = "address"]; + * @param value The address to set. + */ + private void setAddress(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + address_ = value; + } + /** + * bytes address = 1 [json_name = "address"]; + */ + private void clearAddress() { + + address_ = getDefaultInstance().getAddress(); + } + + public static final int PUB_KEY_FIELD_NUMBER = 2; + private com.tendermint.crypto.PublicKey pubKey_; + /** + * .tendermint.crypto.PublicKey pub_key = 2 [json_name = "pubKey", (.gogoproto.nullable) = false]; + */ + @java.lang.Override + public boolean hasPubKey() { + return pubKey_ != null; + } + /** + * .tendermint.crypto.PublicKey pub_key = 2 [json_name = "pubKey", (.gogoproto.nullable) = false]; + */ + @java.lang.Override + public com.tendermint.crypto.PublicKey getPubKey() { + return pubKey_ == null ? com.tendermint.crypto.PublicKey.getDefaultInstance() : pubKey_; + } + /** + * .tendermint.crypto.PublicKey pub_key = 2 [json_name = "pubKey", (.gogoproto.nullable) = false]; + */ + private void setPubKey(com.tendermint.crypto.PublicKey value) { + value.getClass(); + pubKey_ = value; + + } + /** + * .tendermint.crypto.PublicKey pub_key = 2 [json_name = "pubKey", (.gogoproto.nullable) = false]; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergePubKey(com.tendermint.crypto.PublicKey value) { + value.getClass(); + if (pubKey_ != null && + pubKey_ != com.tendermint.crypto.PublicKey.getDefaultInstance()) { + pubKey_ = + com.tendermint.crypto.PublicKey.newBuilder(pubKey_).mergeFrom(value).buildPartial(); + } else { + pubKey_ = value; + } + + } + /** + * .tendermint.crypto.PublicKey pub_key = 2 [json_name = "pubKey", (.gogoproto.nullable) = false]; + */ + private void clearPubKey() { pubKey_ = null; + + } + + public static final int VOTING_POWER_FIELD_NUMBER = 3; + private long votingPower_; + /** + * int64 voting_power = 3 [json_name = "votingPower"]; + * @return The votingPower. + */ + @java.lang.Override + public long getVotingPower() { + return votingPower_; + } + /** + * int64 voting_power = 3 [json_name = "votingPower"]; + * @param value The votingPower to set. + */ + private void setVotingPower(long value) { + + votingPower_ = value; + } + /** + * int64 voting_power = 3 [json_name = "votingPower"]; + */ + private void clearVotingPower() { + + votingPower_ = 0L; + } + + public static final int PROPOSER_PRIORITY_FIELD_NUMBER = 4; + private long proposerPriority_; + /** + * int64 proposer_priority = 4 [json_name = "proposerPriority"]; + * @return The proposerPriority. + */ + @java.lang.Override + public long getProposerPriority() { + return proposerPriority_; + } + /** + * int64 proposer_priority = 4 [json_name = "proposerPriority"]; + * @param value The proposerPriority to set. + */ + private void setProposerPriority(long value) { + + proposerPriority_ = value; + } + /** + * int64 proposer_priority = 4 [json_name = "proposerPriority"]; + */ + private void clearProposerPriority() { + + proposerPriority_ = 0L; + } + + public static com.tendermint.types.Validator parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.tendermint.types.Validator parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.tendermint.types.Validator parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.tendermint.types.Validator parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.tendermint.types.Validator parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.tendermint.types.Validator parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.tendermint.types.Validator parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.tendermint.types.Validator parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.tendermint.types.Validator parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.tendermint.types.Validator parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.tendermint.types.Validator parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.tendermint.types.Validator parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.tendermint.types.Validator prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + * Protobuf type {@code tendermint.types.Validator} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.tendermint.types.Validator, Builder> implements + // @@protoc_insertion_point(builder_implements:tendermint.types.Validator) + com.tendermint.types.ValidatorOrBuilder { + // Construct using com.tendermint.types.Validator.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * bytes address = 1 [json_name = "address"]; + * @return The address. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAddress() { + return instance.getAddress(); + } + /** + * bytes address = 1 [json_name = "address"]; + * @param value The address to set. + * @return This builder for chaining. + */ + public Builder setAddress(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setAddress(value); + return this; + } + /** + * bytes address = 1 [json_name = "address"]; + * @return This builder for chaining. + */ + public Builder clearAddress() { + copyOnWrite(); + instance.clearAddress(); + return this; + } + + /** + * .tendermint.crypto.PublicKey pub_key = 2 [json_name = "pubKey", (.gogoproto.nullable) = false]; + */ + @java.lang.Override + public boolean hasPubKey() { + return instance.hasPubKey(); + } + /** + * .tendermint.crypto.PublicKey pub_key = 2 [json_name = "pubKey", (.gogoproto.nullable) = false]; + */ + @java.lang.Override + public com.tendermint.crypto.PublicKey getPubKey() { + return instance.getPubKey(); + } + /** + * .tendermint.crypto.PublicKey pub_key = 2 [json_name = "pubKey", (.gogoproto.nullable) = false]; + */ + public Builder setPubKey(com.tendermint.crypto.PublicKey value) { + copyOnWrite(); + instance.setPubKey(value); + return this; + } + /** + * .tendermint.crypto.PublicKey pub_key = 2 [json_name = "pubKey", (.gogoproto.nullable) = false]; + */ + public Builder setPubKey( + com.tendermint.crypto.PublicKey.Builder builderForValue) { + copyOnWrite(); + instance.setPubKey(builderForValue.build()); + return this; + } + /** + * .tendermint.crypto.PublicKey pub_key = 2 [json_name = "pubKey", (.gogoproto.nullable) = false]; + */ + public Builder mergePubKey(com.tendermint.crypto.PublicKey value) { + copyOnWrite(); + instance.mergePubKey(value); + return this; + } + /** + * .tendermint.crypto.PublicKey pub_key = 2 [json_name = "pubKey", (.gogoproto.nullable) = false]; + */ + public Builder clearPubKey() { copyOnWrite(); + instance.clearPubKey(); + return this; + } + + /** + * int64 voting_power = 3 [json_name = "votingPower"]; + * @return The votingPower. + */ + @java.lang.Override + public long getVotingPower() { + return instance.getVotingPower(); + } + /** + * int64 voting_power = 3 [json_name = "votingPower"]; + * @param value The votingPower to set. + * @return This builder for chaining. + */ + public Builder setVotingPower(long value) { + copyOnWrite(); + instance.setVotingPower(value); + return this; + } + /** + * int64 voting_power = 3 [json_name = "votingPower"]; + * @return This builder for chaining. + */ + public Builder clearVotingPower() { + copyOnWrite(); + instance.clearVotingPower(); + return this; + } + + /** + * int64 proposer_priority = 4 [json_name = "proposerPriority"]; + * @return The proposerPriority. + */ + @java.lang.Override + public long getProposerPriority() { + return instance.getProposerPriority(); + } + /** + * int64 proposer_priority = 4 [json_name = "proposerPriority"]; + * @param value The proposerPriority to set. + * @return This builder for chaining. + */ + public Builder setProposerPriority(long value) { + copyOnWrite(); + instance.setProposerPriority(value); + return this; + } + /** + * int64 proposer_priority = 4 [json_name = "proposerPriority"]; + * @return This builder for chaining. + */ + public Builder clearProposerPriority() { + copyOnWrite(); + instance.clearProposerPriority(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tendermint.types.Validator) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.tendermint.types.Validator(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "address_", + "pubKey_", + "votingPower_", + "proposerPriority_", + }; + java.lang.String info = + "\u0000\u0004\u0000\u0000\u0001\u0004\u0004\u0000\u0000\u0000\u0001\n\u0002\t\u0003" + + "\u0002\u0004\u0002"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.tendermint.types.Validator.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:tendermint.types.Validator) + private static final com.tendermint.types.Validator DEFAULT_INSTANCE; + static { + Validator defaultInstance = new Validator(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + Validator.class, defaultInstance); + } + + public static com.tendermint.types.Validator getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/ValidatorOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/ValidatorOrBuilder.java new file mode 100644 index 000000000..0b3dde38a --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/ValidatorOrBuilder.java @@ -0,0 +1,38 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tendermint/types/validator.proto + +package com.tendermint.types; + +public interface ValidatorOrBuilder extends + // @@protoc_insertion_point(interface_extends:tendermint.types.Validator) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * bytes address = 1 [json_name = "address"]; + * @return The address. + */ + com.google.protobuf.ByteString getAddress(); + + /** + * .tendermint.crypto.PublicKey pub_key = 2 [json_name = "pubKey", (.gogoproto.nullable) = false]; + * @return Whether the pubKey field is set. + */ + boolean hasPubKey(); + /** + * .tendermint.crypto.PublicKey pub_key = 2 [json_name = "pubKey", (.gogoproto.nullable) = false]; + * @return The pubKey. + */ + com.tendermint.crypto.PublicKey getPubKey(); + + /** + * int64 voting_power = 3 [json_name = "votingPower"]; + * @return The votingPower. + */ + long getVotingPower(); + + /** + * int64 proposer_priority = 4 [json_name = "proposerPriority"]; + * @return The proposerPriority. + */ + long getProposerPriority(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/ValidatorProto.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/ValidatorProto.java new file mode 100644 index 000000000..2ef541f33 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/ValidatorProto.java @@ -0,0 +1,16 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tendermint/types/validator.proto + +package com.tendermint.types; + +public final class ValidatorProto { + private ValidatorProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + static { + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/ValidatorSet.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/ValidatorSet.java new file mode 100644 index 000000000..2e31e3dde --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/ValidatorSet.java @@ -0,0 +1,532 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tendermint/types/validator.proto + +package com.tendermint.types; + +/** + * Protobuf type {@code tendermint.types.ValidatorSet} + */ +public final class ValidatorSet extends + com.google.protobuf.GeneratedMessageLite< + ValidatorSet, ValidatorSet.Builder> implements + // @@protoc_insertion_point(message_implements:tendermint.types.ValidatorSet) + ValidatorSetOrBuilder { + private ValidatorSet() { + validators_ = emptyProtobufList(); + } + public static final int VALIDATORS_FIELD_NUMBER = 1; + private com.google.protobuf.Internal.ProtobufList validators_; + /** + * repeated .tendermint.types.Validator validators = 1 [json_name = "validators"]; + */ + @java.lang.Override + public java.util.List getValidatorsList() { + return validators_; + } + /** + * repeated .tendermint.types.Validator validators = 1 [json_name = "validators"]; + */ + public java.util.List + getValidatorsOrBuilderList() { + return validators_; + } + /** + * repeated .tendermint.types.Validator validators = 1 [json_name = "validators"]; + */ + @java.lang.Override + public int getValidatorsCount() { + return validators_.size(); + } + /** + * repeated .tendermint.types.Validator validators = 1 [json_name = "validators"]; + */ + @java.lang.Override + public com.tendermint.types.Validator getValidators(int index) { + return validators_.get(index); + } + /** + * repeated .tendermint.types.Validator validators = 1 [json_name = "validators"]; + */ + public com.tendermint.types.ValidatorOrBuilder getValidatorsOrBuilder( + int index) { + return validators_.get(index); + } + private void ensureValidatorsIsMutable() { + com.google.protobuf.Internal.ProtobufList tmp = validators_; + if (!tmp.isModifiable()) { + validators_ = + com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp); + } + } + + /** + * repeated .tendermint.types.Validator validators = 1 [json_name = "validators"]; + */ + private void setValidators( + int index, com.tendermint.types.Validator value) { + value.getClass(); + ensureValidatorsIsMutable(); + validators_.set(index, value); + } + /** + * repeated .tendermint.types.Validator validators = 1 [json_name = "validators"]; + */ + private void addValidators(com.tendermint.types.Validator value) { + value.getClass(); + ensureValidatorsIsMutable(); + validators_.add(value); + } + /** + * repeated .tendermint.types.Validator validators = 1 [json_name = "validators"]; + */ + private void addValidators( + int index, com.tendermint.types.Validator value) { + value.getClass(); + ensureValidatorsIsMutable(); + validators_.add(index, value); + } + /** + * repeated .tendermint.types.Validator validators = 1 [json_name = "validators"]; + */ + private void addAllValidators( + java.lang.Iterable values) { + ensureValidatorsIsMutable(); + com.google.protobuf.AbstractMessageLite.addAll( + values, validators_); + } + /** + * repeated .tendermint.types.Validator validators = 1 [json_name = "validators"]; + */ + private void clearValidators() { + validators_ = emptyProtobufList(); + } + /** + * repeated .tendermint.types.Validator validators = 1 [json_name = "validators"]; + */ + private void removeValidators(int index) { + ensureValidatorsIsMutable(); + validators_.remove(index); + } + + public static final int PROPOSER_FIELD_NUMBER = 2; + private com.tendermint.types.Validator proposer_; + /** + * .tendermint.types.Validator proposer = 2 [json_name = "proposer"]; + */ + @java.lang.Override + public boolean hasProposer() { + return proposer_ != null; + } + /** + * .tendermint.types.Validator proposer = 2 [json_name = "proposer"]; + */ + @java.lang.Override + public com.tendermint.types.Validator getProposer() { + return proposer_ == null ? com.tendermint.types.Validator.getDefaultInstance() : proposer_; + } + /** + * .tendermint.types.Validator proposer = 2 [json_name = "proposer"]; + */ + private void setProposer(com.tendermint.types.Validator value) { + value.getClass(); + proposer_ = value; + + } + /** + * .tendermint.types.Validator proposer = 2 [json_name = "proposer"]; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeProposer(com.tendermint.types.Validator value) { + value.getClass(); + if (proposer_ != null && + proposer_ != com.tendermint.types.Validator.getDefaultInstance()) { + proposer_ = + com.tendermint.types.Validator.newBuilder(proposer_).mergeFrom(value).buildPartial(); + } else { + proposer_ = value; + } + + } + /** + * .tendermint.types.Validator proposer = 2 [json_name = "proposer"]; + */ + private void clearProposer() { proposer_ = null; + + } + + public static final int TOTAL_VOTING_POWER_FIELD_NUMBER = 3; + private long totalVotingPower_; + /** + * int64 total_voting_power = 3 [json_name = "totalVotingPower"]; + * @return The totalVotingPower. + */ + @java.lang.Override + public long getTotalVotingPower() { + return totalVotingPower_; + } + /** + * int64 total_voting_power = 3 [json_name = "totalVotingPower"]; + * @param value The totalVotingPower to set. + */ + private void setTotalVotingPower(long value) { + + totalVotingPower_ = value; + } + /** + * int64 total_voting_power = 3 [json_name = "totalVotingPower"]; + */ + private void clearTotalVotingPower() { + + totalVotingPower_ = 0L; + } + + public static com.tendermint.types.ValidatorSet parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.tendermint.types.ValidatorSet parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.tendermint.types.ValidatorSet parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.tendermint.types.ValidatorSet parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.tendermint.types.ValidatorSet parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.tendermint.types.ValidatorSet parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.tendermint.types.ValidatorSet parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.tendermint.types.ValidatorSet parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.tendermint.types.ValidatorSet parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.tendermint.types.ValidatorSet parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.tendermint.types.ValidatorSet parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.tendermint.types.ValidatorSet parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.tendermint.types.ValidatorSet prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + * Protobuf type {@code tendermint.types.ValidatorSet} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.tendermint.types.ValidatorSet, Builder> implements + // @@protoc_insertion_point(builder_implements:tendermint.types.ValidatorSet) + com.tendermint.types.ValidatorSetOrBuilder { + // Construct using com.tendermint.types.ValidatorSet.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * repeated .tendermint.types.Validator validators = 1 [json_name = "validators"]; + */ + @java.lang.Override + public java.util.List getValidatorsList() { + return java.util.Collections.unmodifiableList( + instance.getValidatorsList()); + } + /** + * repeated .tendermint.types.Validator validators = 1 [json_name = "validators"]; + */ + @java.lang.Override + public int getValidatorsCount() { + return instance.getValidatorsCount(); + }/** + * repeated .tendermint.types.Validator validators = 1 [json_name = "validators"]; + */ + @java.lang.Override + public com.tendermint.types.Validator getValidators(int index) { + return instance.getValidators(index); + } + /** + * repeated .tendermint.types.Validator validators = 1 [json_name = "validators"]; + */ + public Builder setValidators( + int index, com.tendermint.types.Validator value) { + copyOnWrite(); + instance.setValidators(index, value); + return this; + } + /** + * repeated .tendermint.types.Validator validators = 1 [json_name = "validators"]; + */ + public Builder setValidators( + int index, com.tendermint.types.Validator.Builder builderForValue) { + copyOnWrite(); + instance.setValidators(index, + builderForValue.build()); + return this; + } + /** + * repeated .tendermint.types.Validator validators = 1 [json_name = "validators"]; + */ + public Builder addValidators(com.tendermint.types.Validator value) { + copyOnWrite(); + instance.addValidators(value); + return this; + } + /** + * repeated .tendermint.types.Validator validators = 1 [json_name = "validators"]; + */ + public Builder addValidators( + int index, com.tendermint.types.Validator value) { + copyOnWrite(); + instance.addValidators(index, value); + return this; + } + /** + * repeated .tendermint.types.Validator validators = 1 [json_name = "validators"]; + */ + public Builder addValidators( + com.tendermint.types.Validator.Builder builderForValue) { + copyOnWrite(); + instance.addValidators(builderForValue.build()); + return this; + } + /** + * repeated .tendermint.types.Validator validators = 1 [json_name = "validators"]; + */ + public Builder addValidators( + int index, com.tendermint.types.Validator.Builder builderForValue) { + copyOnWrite(); + instance.addValidators(index, + builderForValue.build()); + return this; + } + /** + * repeated .tendermint.types.Validator validators = 1 [json_name = "validators"]; + */ + public Builder addAllValidators( + java.lang.Iterable values) { + copyOnWrite(); + instance.addAllValidators(values); + return this; + } + /** + * repeated .tendermint.types.Validator validators = 1 [json_name = "validators"]; + */ + public Builder clearValidators() { + copyOnWrite(); + instance.clearValidators(); + return this; + } + /** + * repeated .tendermint.types.Validator validators = 1 [json_name = "validators"]; + */ + public Builder removeValidators(int index) { + copyOnWrite(); + instance.removeValidators(index); + return this; + } + + /** + * .tendermint.types.Validator proposer = 2 [json_name = "proposer"]; + */ + @java.lang.Override + public boolean hasProposer() { + return instance.hasProposer(); + } + /** + * .tendermint.types.Validator proposer = 2 [json_name = "proposer"]; + */ + @java.lang.Override + public com.tendermint.types.Validator getProposer() { + return instance.getProposer(); + } + /** + * .tendermint.types.Validator proposer = 2 [json_name = "proposer"]; + */ + public Builder setProposer(com.tendermint.types.Validator value) { + copyOnWrite(); + instance.setProposer(value); + return this; + } + /** + * .tendermint.types.Validator proposer = 2 [json_name = "proposer"]; + */ + public Builder setProposer( + com.tendermint.types.Validator.Builder builderForValue) { + copyOnWrite(); + instance.setProposer(builderForValue.build()); + return this; + } + /** + * .tendermint.types.Validator proposer = 2 [json_name = "proposer"]; + */ + public Builder mergeProposer(com.tendermint.types.Validator value) { + copyOnWrite(); + instance.mergeProposer(value); + return this; + } + /** + * .tendermint.types.Validator proposer = 2 [json_name = "proposer"]; + */ + public Builder clearProposer() { copyOnWrite(); + instance.clearProposer(); + return this; + } + + /** + * int64 total_voting_power = 3 [json_name = "totalVotingPower"]; + * @return The totalVotingPower. + */ + @java.lang.Override + public long getTotalVotingPower() { + return instance.getTotalVotingPower(); + } + /** + * int64 total_voting_power = 3 [json_name = "totalVotingPower"]; + * @param value The totalVotingPower to set. + * @return This builder for chaining. + */ + public Builder setTotalVotingPower(long value) { + copyOnWrite(); + instance.setTotalVotingPower(value); + return this; + } + /** + * int64 total_voting_power = 3 [json_name = "totalVotingPower"]; + * @return This builder for chaining. + */ + public Builder clearTotalVotingPower() { + copyOnWrite(); + instance.clearTotalVotingPower(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tendermint.types.ValidatorSet) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.tendermint.types.ValidatorSet(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "validators_", + com.tendermint.types.Validator.class, + "proposer_", + "totalVotingPower_", + }; + java.lang.String info = + "\u0000\u0003\u0000\u0000\u0001\u0003\u0003\u0000\u0001\u0000\u0001\u001b\u0002\t" + + "\u0003\u0002"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.tendermint.types.ValidatorSet.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:tendermint.types.ValidatorSet) + private static final com.tendermint.types.ValidatorSet DEFAULT_INSTANCE; + static { + ValidatorSet defaultInstance = new ValidatorSet(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + ValidatorSet.class, defaultInstance); + } + + public static com.tendermint.types.ValidatorSet getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/ValidatorSetOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/ValidatorSetOrBuilder.java new file mode 100644 index 000000000..76fc0be03 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/ValidatorSetOrBuilder.java @@ -0,0 +1,40 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tendermint/types/validator.proto + +package com.tendermint.types; + +public interface ValidatorSetOrBuilder extends + // @@protoc_insertion_point(interface_extends:tendermint.types.ValidatorSet) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * repeated .tendermint.types.Validator validators = 1 [json_name = "validators"]; + */ + java.util.List + getValidatorsList(); + /** + * repeated .tendermint.types.Validator validators = 1 [json_name = "validators"]; + */ + com.tendermint.types.Validator getValidators(int index); + /** + * repeated .tendermint.types.Validator validators = 1 [json_name = "validators"]; + */ + int getValidatorsCount(); + + /** + * .tendermint.types.Validator proposer = 2 [json_name = "proposer"]; + * @return Whether the proposer field is set. + */ + boolean hasProposer(); + /** + * .tendermint.types.Validator proposer = 2 [json_name = "proposer"]; + * @return The proposer. + */ + com.tendermint.types.Validator getProposer(); + + /** + * int64 total_voting_power = 3 [json_name = "totalVotingPower"]; + * @return The totalVotingPower. + */ + long getTotalVotingPower(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/Vote.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/Vote.java new file mode 100644 index 000000000..fa062bd07 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/Vote.java @@ -0,0 +1,794 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tendermint/types/types.proto + +package com.tendermint.types; + +/** + *
+ * Vote represents a prevote, precommit, or commit vote from validators for
+ * consensus.
+ * 
+ * + * Protobuf type {@code tendermint.types.Vote} + */ +public final class Vote extends + com.google.protobuf.GeneratedMessageLite< + Vote, Vote.Builder> implements + // @@protoc_insertion_point(message_implements:tendermint.types.Vote) + VoteOrBuilder { + private Vote() { + validatorAddress_ = com.google.protobuf.ByteString.EMPTY; + signature_ = com.google.protobuf.ByteString.EMPTY; + } + public static final int TYPE_FIELD_NUMBER = 1; + private int type_; + /** + * .tendermint.types.SignedMsgType type = 1 [json_name = "type"]; + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + /** + * .tendermint.types.SignedMsgType type = 1 [json_name = "type"]; + * @return The type. + */ + @java.lang.Override + public com.tendermint.types.SignedMsgType getType() { + com.tendermint.types.SignedMsgType result = com.tendermint.types.SignedMsgType.forNumber(type_); + return result == null ? com.tendermint.types.SignedMsgType.UNRECOGNIZED : result; + } + /** + * .tendermint.types.SignedMsgType type = 1 [json_name = "type"]; + * @param value The enum numeric value on the wire for type to set. + */ + private void setTypeValue(int value) { + type_ = value; + } + /** + * .tendermint.types.SignedMsgType type = 1 [json_name = "type"]; + * @param value The type to set. + */ + private void setType(com.tendermint.types.SignedMsgType value) { + type_ = value.getNumber(); + + } + /** + * .tendermint.types.SignedMsgType type = 1 [json_name = "type"]; + */ + private void clearType() { + + type_ = 0; + } + + public static final int HEIGHT_FIELD_NUMBER = 2; + private long height_; + /** + * int64 height = 2 [json_name = "height"]; + * @return The height. + */ + @java.lang.Override + public long getHeight() { + return height_; + } + /** + * int64 height = 2 [json_name = "height"]; + * @param value The height to set. + */ + private void setHeight(long value) { + + height_ = value; + } + /** + * int64 height = 2 [json_name = "height"]; + */ + private void clearHeight() { + + height_ = 0L; + } + + public static final int ROUND_FIELD_NUMBER = 3; + private int round_; + /** + * int32 round = 3 [json_name = "round"]; + * @return The round. + */ + @java.lang.Override + public int getRound() { + return round_; + } + /** + * int32 round = 3 [json_name = "round"]; + * @param value The round to set. + */ + private void setRound(int value) { + + round_ = value; + } + /** + * int32 round = 3 [json_name = "round"]; + */ + private void clearRound() { + + round_ = 0; + } + + public static final int BLOCK_ID_FIELD_NUMBER = 4; + private com.tendermint.types.BlockID blockId_; + /** + *
+   * zero if vote is nil.
+   * 
+ * + * .tendermint.types.BlockID block_id = 4 [json_name = "blockId", (.gogoproto.nullable) = false, (.gogoproto.customname) = "BlockID"]; + */ + @java.lang.Override + public boolean hasBlockId() { + return blockId_ != null; + } + /** + *
+   * zero if vote is nil.
+   * 
+ * + * .tendermint.types.BlockID block_id = 4 [json_name = "blockId", (.gogoproto.nullable) = false, (.gogoproto.customname) = "BlockID"]; + */ + @java.lang.Override + public com.tendermint.types.BlockID getBlockId() { + return blockId_ == null ? com.tendermint.types.BlockID.getDefaultInstance() : blockId_; + } + /** + *
+   * zero if vote is nil.
+   * 
+ * + * .tendermint.types.BlockID block_id = 4 [json_name = "blockId", (.gogoproto.nullable) = false, (.gogoproto.customname) = "BlockID"]; + */ + private void setBlockId(com.tendermint.types.BlockID value) { + value.getClass(); + blockId_ = value; + + } + /** + *
+   * zero if vote is nil.
+   * 
+ * + * .tendermint.types.BlockID block_id = 4 [json_name = "blockId", (.gogoproto.nullable) = false, (.gogoproto.customname) = "BlockID"]; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeBlockId(com.tendermint.types.BlockID value) { + value.getClass(); + if (blockId_ != null && + blockId_ != com.tendermint.types.BlockID.getDefaultInstance()) { + blockId_ = + com.tendermint.types.BlockID.newBuilder(blockId_).mergeFrom(value).buildPartial(); + } else { + blockId_ = value; + } + + } + /** + *
+   * zero if vote is nil.
+   * 
+ * + * .tendermint.types.BlockID block_id = 4 [json_name = "blockId", (.gogoproto.nullable) = false, (.gogoproto.customname) = "BlockID"]; + */ + private void clearBlockId() { blockId_ = null; + + } + + public static final int TIMESTAMP_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp timestamp_; + /** + * .google.protobuf.Timestamp timestamp = 5 [json_name = "timestamp", (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true]; + */ + @java.lang.Override + public boolean hasTimestamp() { + return timestamp_ != null; + } + /** + * .google.protobuf.Timestamp timestamp = 5 [json_name = "timestamp", (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true]; + */ + @java.lang.Override + public com.google.protobuf.Timestamp getTimestamp() { + return timestamp_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : timestamp_; + } + /** + * .google.protobuf.Timestamp timestamp = 5 [json_name = "timestamp", (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true]; + */ + private void setTimestamp(com.google.protobuf.Timestamp value) { + value.getClass(); + timestamp_ = value; + + } + /** + * .google.protobuf.Timestamp timestamp = 5 [json_name = "timestamp", (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true]; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeTimestamp(com.google.protobuf.Timestamp value) { + value.getClass(); + if (timestamp_ != null && + timestamp_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + timestamp_ = + com.google.protobuf.Timestamp.newBuilder(timestamp_).mergeFrom(value).buildPartial(); + } else { + timestamp_ = value; + } + + } + /** + * .google.protobuf.Timestamp timestamp = 5 [json_name = "timestamp", (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true]; + */ + private void clearTimestamp() { timestamp_ = null; + + } + + public static final int VALIDATOR_ADDRESS_FIELD_NUMBER = 6; + private com.google.protobuf.ByteString validatorAddress_; + /** + * bytes validator_address = 6 [json_name = "validatorAddress"]; + * @return The validatorAddress. + */ + @java.lang.Override + public com.google.protobuf.ByteString getValidatorAddress() { + return validatorAddress_; + } + /** + * bytes validator_address = 6 [json_name = "validatorAddress"]; + * @param value The validatorAddress to set. + */ + private void setValidatorAddress(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + validatorAddress_ = value; + } + /** + * bytes validator_address = 6 [json_name = "validatorAddress"]; + */ + private void clearValidatorAddress() { + + validatorAddress_ = getDefaultInstance().getValidatorAddress(); + } + + public static final int VALIDATOR_INDEX_FIELD_NUMBER = 7; + private int validatorIndex_; + /** + * int32 validator_index = 7 [json_name = "validatorIndex"]; + * @return The validatorIndex. + */ + @java.lang.Override + public int getValidatorIndex() { + return validatorIndex_; + } + /** + * int32 validator_index = 7 [json_name = "validatorIndex"]; + * @param value The validatorIndex to set. + */ + private void setValidatorIndex(int value) { + + validatorIndex_ = value; + } + /** + * int32 validator_index = 7 [json_name = "validatorIndex"]; + */ + private void clearValidatorIndex() { + + validatorIndex_ = 0; + } + + public static final int SIGNATURE_FIELD_NUMBER = 8; + private com.google.protobuf.ByteString signature_; + /** + * bytes signature = 8 [json_name = "signature"]; + * @return The signature. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSignature() { + return signature_; + } + /** + * bytes signature = 8 [json_name = "signature"]; + * @param value The signature to set. + */ + private void setSignature(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + signature_ = value; + } + /** + * bytes signature = 8 [json_name = "signature"]; + */ + private void clearSignature() { + + signature_ = getDefaultInstance().getSignature(); + } + + public static com.tendermint.types.Vote parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.tendermint.types.Vote parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.tendermint.types.Vote parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.tendermint.types.Vote parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.tendermint.types.Vote parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.tendermint.types.Vote parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.tendermint.types.Vote parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.tendermint.types.Vote parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.tendermint.types.Vote parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.tendermint.types.Vote parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.tendermint.types.Vote parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.tendermint.types.Vote parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.tendermint.types.Vote prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+   * Vote represents a prevote, precommit, or commit vote from validators for
+   * consensus.
+   * 
+ * + * Protobuf type {@code tendermint.types.Vote} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.tendermint.types.Vote, Builder> implements + // @@protoc_insertion_point(builder_implements:tendermint.types.Vote) + com.tendermint.types.VoteOrBuilder { + // Construct using com.tendermint.types.Vote.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * .tendermint.types.SignedMsgType type = 1 [json_name = "type"]; + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return instance.getTypeValue(); + } + /** + * .tendermint.types.SignedMsgType type = 1 [json_name = "type"]; + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setTypeValue(int value) { + copyOnWrite(); + instance.setTypeValue(value); + return this; + } + /** + * .tendermint.types.SignedMsgType type = 1 [json_name = "type"]; + * @return The type. + */ + @java.lang.Override + public com.tendermint.types.SignedMsgType getType() { + return instance.getType(); + } + /** + * .tendermint.types.SignedMsgType type = 1 [json_name = "type"]; + * @param value The enum numeric value on the wire for type to set. + * @return This builder for chaining. + */ + public Builder setType(com.tendermint.types.SignedMsgType value) { + copyOnWrite(); + instance.setType(value); + return this; + } + /** + * .tendermint.types.SignedMsgType type = 1 [json_name = "type"]; + * @return This builder for chaining. + */ + public Builder clearType() { + copyOnWrite(); + instance.clearType(); + return this; + } + + /** + * int64 height = 2 [json_name = "height"]; + * @return The height. + */ + @java.lang.Override + public long getHeight() { + return instance.getHeight(); + } + /** + * int64 height = 2 [json_name = "height"]; + * @param value The height to set. + * @return This builder for chaining. + */ + public Builder setHeight(long value) { + copyOnWrite(); + instance.setHeight(value); + return this; + } + /** + * int64 height = 2 [json_name = "height"]; + * @return This builder for chaining. + */ + public Builder clearHeight() { + copyOnWrite(); + instance.clearHeight(); + return this; + } + + /** + * int32 round = 3 [json_name = "round"]; + * @return The round. + */ + @java.lang.Override + public int getRound() { + return instance.getRound(); + } + /** + * int32 round = 3 [json_name = "round"]; + * @param value The round to set. + * @return This builder for chaining. + */ + public Builder setRound(int value) { + copyOnWrite(); + instance.setRound(value); + return this; + } + /** + * int32 round = 3 [json_name = "round"]; + * @return This builder for chaining. + */ + public Builder clearRound() { + copyOnWrite(); + instance.clearRound(); + return this; + } + + /** + *
+     * zero if vote is nil.
+     * 
+ * + * .tendermint.types.BlockID block_id = 4 [json_name = "blockId", (.gogoproto.nullable) = false, (.gogoproto.customname) = "BlockID"]; + */ + @java.lang.Override + public boolean hasBlockId() { + return instance.hasBlockId(); + } + /** + *
+     * zero if vote is nil.
+     * 
+ * + * .tendermint.types.BlockID block_id = 4 [json_name = "blockId", (.gogoproto.nullable) = false, (.gogoproto.customname) = "BlockID"]; + */ + @java.lang.Override + public com.tendermint.types.BlockID getBlockId() { + return instance.getBlockId(); + } + /** + *
+     * zero if vote is nil.
+     * 
+ * + * .tendermint.types.BlockID block_id = 4 [json_name = "blockId", (.gogoproto.nullable) = false, (.gogoproto.customname) = "BlockID"]; + */ + public Builder setBlockId(com.tendermint.types.BlockID value) { + copyOnWrite(); + instance.setBlockId(value); + return this; + } + /** + *
+     * zero if vote is nil.
+     * 
+ * + * .tendermint.types.BlockID block_id = 4 [json_name = "blockId", (.gogoproto.nullable) = false, (.gogoproto.customname) = "BlockID"]; + */ + public Builder setBlockId( + com.tendermint.types.BlockID.Builder builderForValue) { + copyOnWrite(); + instance.setBlockId(builderForValue.build()); + return this; + } + /** + *
+     * zero if vote is nil.
+     * 
+ * + * .tendermint.types.BlockID block_id = 4 [json_name = "blockId", (.gogoproto.nullable) = false, (.gogoproto.customname) = "BlockID"]; + */ + public Builder mergeBlockId(com.tendermint.types.BlockID value) { + copyOnWrite(); + instance.mergeBlockId(value); + return this; + } + /** + *
+     * zero if vote is nil.
+     * 
+ * + * .tendermint.types.BlockID block_id = 4 [json_name = "blockId", (.gogoproto.nullable) = false, (.gogoproto.customname) = "BlockID"]; + */ + public Builder clearBlockId() { copyOnWrite(); + instance.clearBlockId(); + return this; + } + + /** + * .google.protobuf.Timestamp timestamp = 5 [json_name = "timestamp", (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true]; + */ + @java.lang.Override + public boolean hasTimestamp() { + return instance.hasTimestamp(); + } + /** + * .google.protobuf.Timestamp timestamp = 5 [json_name = "timestamp", (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true]; + */ + @java.lang.Override + public com.google.protobuf.Timestamp getTimestamp() { + return instance.getTimestamp(); + } + /** + * .google.protobuf.Timestamp timestamp = 5 [json_name = "timestamp", (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true]; + */ + public Builder setTimestamp(com.google.protobuf.Timestamp value) { + copyOnWrite(); + instance.setTimestamp(value); + return this; + } + /** + * .google.protobuf.Timestamp timestamp = 5 [json_name = "timestamp", (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true]; + */ + public Builder setTimestamp( + com.google.protobuf.Timestamp.Builder builderForValue) { + copyOnWrite(); + instance.setTimestamp(builderForValue.build()); + return this; + } + /** + * .google.protobuf.Timestamp timestamp = 5 [json_name = "timestamp", (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true]; + */ + public Builder mergeTimestamp(com.google.protobuf.Timestamp value) { + copyOnWrite(); + instance.mergeTimestamp(value); + return this; + } + /** + * .google.protobuf.Timestamp timestamp = 5 [json_name = "timestamp", (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true]; + */ + public Builder clearTimestamp() { copyOnWrite(); + instance.clearTimestamp(); + return this; + } + + /** + * bytes validator_address = 6 [json_name = "validatorAddress"]; + * @return The validatorAddress. + */ + @java.lang.Override + public com.google.protobuf.ByteString getValidatorAddress() { + return instance.getValidatorAddress(); + } + /** + * bytes validator_address = 6 [json_name = "validatorAddress"]; + * @param value The validatorAddress to set. + * @return This builder for chaining. + */ + public Builder setValidatorAddress(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setValidatorAddress(value); + return this; + } + /** + * bytes validator_address = 6 [json_name = "validatorAddress"]; + * @return This builder for chaining. + */ + public Builder clearValidatorAddress() { + copyOnWrite(); + instance.clearValidatorAddress(); + return this; + } + + /** + * int32 validator_index = 7 [json_name = "validatorIndex"]; + * @return The validatorIndex. + */ + @java.lang.Override + public int getValidatorIndex() { + return instance.getValidatorIndex(); + } + /** + * int32 validator_index = 7 [json_name = "validatorIndex"]; + * @param value The validatorIndex to set. + * @return This builder for chaining. + */ + public Builder setValidatorIndex(int value) { + copyOnWrite(); + instance.setValidatorIndex(value); + return this; + } + /** + * int32 validator_index = 7 [json_name = "validatorIndex"]; + * @return This builder for chaining. + */ + public Builder clearValidatorIndex() { + copyOnWrite(); + instance.clearValidatorIndex(); + return this; + } + + /** + * bytes signature = 8 [json_name = "signature"]; + * @return The signature. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSignature() { + return instance.getSignature(); + } + /** + * bytes signature = 8 [json_name = "signature"]; + * @param value The signature to set. + * @return This builder for chaining. + */ + public Builder setSignature(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setSignature(value); + return this; + } + /** + * bytes signature = 8 [json_name = "signature"]; + * @return This builder for chaining. + */ + public Builder clearSignature() { + copyOnWrite(); + instance.clearSignature(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tendermint.types.Vote) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.tendermint.types.Vote(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "type_", + "height_", + "round_", + "blockId_", + "timestamp_", + "validatorAddress_", + "validatorIndex_", + "signature_", + }; + java.lang.String info = + "\u0000\b\u0000\u0000\u0001\b\b\u0000\u0000\u0000\u0001\f\u0002\u0002\u0003\u0004" + + "\u0004\t\u0005\t\u0006\n\u0007\u0004\b\n"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.tendermint.types.Vote.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:tendermint.types.Vote) + private static final com.tendermint.types.Vote DEFAULT_INSTANCE; + static { + Vote defaultInstance = new Vote(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + Vote.class, defaultInstance); + } + + public static com.tendermint.types.Vote getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/VoteOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/VoteOrBuilder.java new file mode 100644 index 000000000..45127e61f --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/VoteOrBuilder.java @@ -0,0 +1,80 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tendermint/types/types.proto + +package com.tendermint.types; + +public interface VoteOrBuilder extends + // @@protoc_insertion_point(interface_extends:tendermint.types.Vote) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * .tendermint.types.SignedMsgType type = 1 [json_name = "type"]; + * @return The enum numeric value on the wire for type. + */ + int getTypeValue(); + /** + * .tendermint.types.SignedMsgType type = 1 [json_name = "type"]; + * @return The type. + */ + com.tendermint.types.SignedMsgType getType(); + + /** + * int64 height = 2 [json_name = "height"]; + * @return The height. + */ + long getHeight(); + + /** + * int32 round = 3 [json_name = "round"]; + * @return The round. + */ + int getRound(); + + /** + *
+   * zero if vote is nil.
+   * 
+ * + * .tendermint.types.BlockID block_id = 4 [json_name = "blockId", (.gogoproto.nullable) = false, (.gogoproto.customname) = "BlockID"]; + * @return Whether the blockId field is set. + */ + boolean hasBlockId(); + /** + *
+   * zero if vote is nil.
+   * 
+ * + * .tendermint.types.BlockID block_id = 4 [json_name = "blockId", (.gogoproto.nullable) = false, (.gogoproto.customname) = "BlockID"]; + * @return The blockId. + */ + com.tendermint.types.BlockID getBlockId(); + + /** + * .google.protobuf.Timestamp timestamp = 5 [json_name = "timestamp", (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true]; + * @return Whether the timestamp field is set. + */ + boolean hasTimestamp(); + /** + * .google.protobuf.Timestamp timestamp = 5 [json_name = "timestamp", (.gogoproto.nullable) = false, (.gogoproto.stdtime) = true]; + * @return The timestamp. + */ + com.google.protobuf.Timestamp getTimestamp(); + + /** + * bytes validator_address = 6 [json_name = "validatorAddress"]; + * @return The validatorAddress. + */ + com.google.protobuf.ByteString getValidatorAddress(); + + /** + * int32 validator_index = 7 [json_name = "validatorIndex"]; + * @return The validatorIndex. + */ + int getValidatorIndex(); + + /** + * bytes signature = 8 [json_name = "signature"]; + * @return The signature. + */ + com.google.protobuf.ByteString getSignature(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/version/App.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/version/App.java new file mode 100644 index 000000000..c3ff9c6f6 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/version/App.java @@ -0,0 +1,349 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tendermint/version/types.proto + +package com.tendermint.version; + +/** + *
+ * App includes the protocol and software version for the application.
+ * This information is included in ResponseInfo. The App.Protocol can be
+ * updated in ResponseEndBlock.
+ * 
+ * + * Protobuf type {@code tendermint.version.App} + */ +public final class App extends + com.google.protobuf.GeneratedMessageLite< + App, App.Builder> implements + // @@protoc_insertion_point(message_implements:tendermint.version.App) + AppOrBuilder { + private App() { + software_ = ""; + } + public static final int PROTOCOL_FIELD_NUMBER = 1; + private long protocol_; + /** + * uint64 protocol = 1 [json_name = "protocol"]; + * @return The protocol. + */ + @java.lang.Override + public long getProtocol() { + return protocol_; + } + /** + * uint64 protocol = 1 [json_name = "protocol"]; + * @param value The protocol to set. + */ + private void setProtocol(long value) { + + protocol_ = value; + } + /** + * uint64 protocol = 1 [json_name = "protocol"]; + */ + private void clearProtocol() { + + protocol_ = 0L; + } + + public static final int SOFTWARE_FIELD_NUMBER = 2; + private java.lang.String software_; + /** + * string software = 2 [json_name = "software"]; + * @return The software. + */ + @java.lang.Override + public java.lang.String getSoftware() { + return software_; + } + /** + * string software = 2 [json_name = "software"]; + * @return The bytes for software. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getSoftwareBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(software_); + } + /** + * string software = 2 [json_name = "software"]; + * @param value The software to set. + */ + private void setSoftware( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + software_ = value; + } + /** + * string software = 2 [json_name = "software"]; + */ + private void clearSoftware() { + + software_ = getDefaultInstance().getSoftware(); + } + /** + * string software = 2 [json_name = "software"]; + * @param value The bytes for software to set. + */ + private void setSoftwareBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + software_ = value.toStringUtf8(); + + } + + public static com.tendermint.version.App parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.tendermint.version.App parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.tendermint.version.App parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.tendermint.version.App parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.tendermint.version.App parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.tendermint.version.App parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.tendermint.version.App parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.tendermint.version.App parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.tendermint.version.App parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.tendermint.version.App parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.tendermint.version.App parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.tendermint.version.App parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.tendermint.version.App prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+   * App includes the protocol and software version for the application.
+   * This information is included in ResponseInfo. The App.Protocol can be
+   * updated in ResponseEndBlock.
+   * 
+ * + * Protobuf type {@code tendermint.version.App} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.tendermint.version.App, Builder> implements + // @@protoc_insertion_point(builder_implements:tendermint.version.App) + com.tendermint.version.AppOrBuilder { + // Construct using com.tendermint.version.App.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * uint64 protocol = 1 [json_name = "protocol"]; + * @return The protocol. + */ + @java.lang.Override + public long getProtocol() { + return instance.getProtocol(); + } + /** + * uint64 protocol = 1 [json_name = "protocol"]; + * @param value The protocol to set. + * @return This builder for chaining. + */ + public Builder setProtocol(long value) { + copyOnWrite(); + instance.setProtocol(value); + return this; + } + /** + * uint64 protocol = 1 [json_name = "protocol"]; + * @return This builder for chaining. + */ + public Builder clearProtocol() { + copyOnWrite(); + instance.clearProtocol(); + return this; + } + + /** + * string software = 2 [json_name = "software"]; + * @return The software. + */ + @java.lang.Override + public java.lang.String getSoftware() { + return instance.getSoftware(); + } + /** + * string software = 2 [json_name = "software"]; + * @return The bytes for software. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getSoftwareBytes() { + return instance.getSoftwareBytes(); + } + /** + * string software = 2 [json_name = "software"]; + * @param value The software to set. + * @return This builder for chaining. + */ + public Builder setSoftware( + java.lang.String value) { + copyOnWrite(); + instance.setSoftware(value); + return this; + } + /** + * string software = 2 [json_name = "software"]; + * @return This builder for chaining. + */ + public Builder clearSoftware() { + copyOnWrite(); + instance.clearSoftware(); + return this; + } + /** + * string software = 2 [json_name = "software"]; + * @param value The bytes for software to set. + * @return This builder for chaining. + */ + public Builder setSoftwareBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setSoftwareBytes(value); + return this; + } + + // @@protoc_insertion_point(builder_scope:tendermint.version.App) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.tendermint.version.App(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "protocol_", + "software_", + }; + java.lang.String info = + "\u0000\u0002\u0000\u0000\u0001\u0002\u0002\u0000\u0000\u0000\u0001\u0003\u0002\u0208" + + ""; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.tendermint.version.App.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:tendermint.version.App) + private static final com.tendermint.version.App DEFAULT_INSTANCE; + static { + App defaultInstance = new App(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + App.class, defaultInstance); + } + + public static com.tendermint.version.App getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/version/AppOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/version/AppOrBuilder.java new file mode 100644 index 000000000..590bf97e4 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/version/AppOrBuilder.java @@ -0,0 +1,27 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tendermint/version/types.proto + +package com.tendermint.version; + +public interface AppOrBuilder extends + // @@protoc_insertion_point(interface_extends:tendermint.version.App) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * uint64 protocol = 1 [json_name = "protocol"]; + * @return The protocol. + */ + long getProtocol(); + + /** + * string software = 2 [json_name = "software"]; + * @return The software. + */ + java.lang.String getSoftware(); + /** + * string software = 2 [json_name = "software"]; + * @return The bytes for software. + */ + com.google.protobuf.ByteString + getSoftwareBytes(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/version/Consensus.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/version/Consensus.java new file mode 100644 index 000000000..e42c06c98 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/version/Consensus.java @@ -0,0 +1,306 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tendermint/version/types.proto + +package com.tendermint.version; + +/** + *
+ * Consensus captures the consensus rules for processing a block in the blockchain,
+ * including all blockchain data structures and the rules of the application's
+ * state transition machine.
+ * 
+ * + * Protobuf type {@code tendermint.version.Consensus} + */ +public final class Consensus extends + com.google.protobuf.GeneratedMessageLite< + Consensus, Consensus.Builder> implements + // @@protoc_insertion_point(message_implements:tendermint.version.Consensus) + ConsensusOrBuilder { + private Consensus() { + } + public static final int BLOCK_FIELD_NUMBER = 1; + private long block_; + /** + * uint64 block = 1 [json_name = "block"]; + * @return The block. + */ + @java.lang.Override + public long getBlock() { + return block_; + } + /** + * uint64 block = 1 [json_name = "block"]; + * @param value The block to set. + */ + private void setBlock(long value) { + + block_ = value; + } + /** + * uint64 block = 1 [json_name = "block"]; + */ + private void clearBlock() { + + block_ = 0L; + } + + public static final int APP_FIELD_NUMBER = 2; + private long app_; + /** + * uint64 app = 2 [json_name = "app"]; + * @return The app. + */ + @java.lang.Override + public long getApp() { + return app_; + } + /** + * uint64 app = 2 [json_name = "app"]; + * @param value The app to set. + */ + private void setApp(long value) { + + app_ = value; + } + /** + * uint64 app = 2 [json_name = "app"]; + */ + private void clearApp() { + + app_ = 0L; + } + + public static com.tendermint.version.Consensus parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.tendermint.version.Consensus parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.tendermint.version.Consensus parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.tendermint.version.Consensus parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.tendermint.version.Consensus parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static com.tendermint.version.Consensus parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static com.tendermint.version.Consensus parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.tendermint.version.Consensus parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.tendermint.version.Consensus parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static com.tendermint.version.Consensus parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static com.tendermint.version.Consensus parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static com.tendermint.version.Consensus parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(com.tendermint.version.Consensus prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+   * Consensus captures the consensus rules for processing a block in the blockchain,
+   * including all blockchain data structures and the rules of the application's
+   * state transition machine.
+   * 
+ * + * Protobuf type {@code tendermint.version.Consensus} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.tendermint.version.Consensus, Builder> implements + // @@protoc_insertion_point(builder_implements:tendermint.version.Consensus) + com.tendermint.version.ConsensusOrBuilder { + // Construct using com.tendermint.version.Consensus.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * uint64 block = 1 [json_name = "block"]; + * @return The block. + */ + @java.lang.Override + public long getBlock() { + return instance.getBlock(); + } + /** + * uint64 block = 1 [json_name = "block"]; + * @param value The block to set. + * @return This builder for chaining. + */ + public Builder setBlock(long value) { + copyOnWrite(); + instance.setBlock(value); + return this; + } + /** + * uint64 block = 1 [json_name = "block"]; + * @return This builder for chaining. + */ + public Builder clearBlock() { + copyOnWrite(); + instance.clearBlock(); + return this; + } + + /** + * uint64 app = 2 [json_name = "app"]; + * @return The app. + */ + @java.lang.Override + public long getApp() { + return instance.getApp(); + } + /** + * uint64 app = 2 [json_name = "app"]; + * @param value The app to set. + * @return This builder for chaining. + */ + public Builder setApp(long value) { + copyOnWrite(); + instance.setApp(value); + return this; + } + /** + * uint64 app = 2 [json_name = "app"]; + * @return This builder for chaining. + */ + public Builder clearApp() { + copyOnWrite(); + instance.clearApp(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tendermint.version.Consensus) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new com.tendermint.version.Consensus(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "block_", + "app_", + }; + java.lang.String info = + "\u0000\u0002\u0000\u0000\u0001\u0002\u0002\u0000\u0000\u0000\u0001\u0003\u0002\u0003" + + ""; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (com.tendermint.version.Consensus.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:tendermint.version.Consensus) + private static final com.tendermint.version.Consensus DEFAULT_INSTANCE; + static { + Consensus defaultInstance = new Consensus(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + Consensus.class, defaultInstance); + } + + public static com.tendermint.version.Consensus getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } +} + diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/version/ConsensusOrBuilder.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/version/ConsensusOrBuilder.java new file mode 100644 index 000000000..bafc955e2 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/version/ConsensusOrBuilder.java @@ -0,0 +1,21 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tendermint/version/types.proto + +package com.tendermint.version; + +public interface ConsensusOrBuilder extends + // @@protoc_insertion_point(interface_extends:tendermint.version.Consensus) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * uint64 block = 1 [json_name = "block"]; + * @return The block. + */ + long getBlock(); + + /** + * uint64 app = 2 [json_name = "app"]; + * @return The app. + */ + long getApp(); +} diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/version/TypesProto.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/version/TypesProto.java new file mode 100644 index 000000000..01c83c704 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/version/TypesProto.java @@ -0,0 +1,16 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tendermint/version/types.proto + +package com.tendermint.version; + +public final class TypesProto { + private TypesProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + static { + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/contracts/javascore/modules/mockapp/build.gradle b/contracts/javascore/modules/mockapp/build.gradle index fc1171679..e29c3ae42 100644 --- a/contracts/javascore/modules/mockapp/build.gradle +++ b/contracts/javascore/modules/mockapp/build.gradle @@ -4,6 +4,7 @@ dependencies { compileOnly("foundation.icon:javaee-api:$javaeeVersion") implementation("foundation.icon:javaee-scorex:$scorexVersion") implementation project(':lib') + implementation project(':proto-lib') implementation project(':score-util') implementation project(':ibc') diff --git a/contracts/javascore/modules/mockapp/src/main/java/ibc/mockapp/MockApp.java b/contracts/javascore/modules/mockapp/src/main/java/ibc/mockapp/MockApp.java index 7bb92287f..4b5c79882 100644 --- a/contracts/javascore/modules/mockapp/src/main/java/ibc/mockapp/MockApp.java +++ b/contracts/javascore/modules/mockapp/src/main/java/ibc/mockapp/MockApp.java @@ -3,10 +3,10 @@ import java.math.BigInteger; import java.util.Map; -import ibc.icon.interfaces.IIBCModule; -import icon.proto.core.client.Height; import icon.proto.core.channel.Packet; import icon.proto.core.channel.Channel.Counterparty; +import icon.proto.core.client.Height; +import icon.ibc.interfaces.IIBCModule; import score.Address; import score.Context; import score.VarDB; diff --git a/contracts/javascore/proto-lib/build.gradle b/contracts/javascore/proto-lib/build.gradle new file mode 100644 index 000000000..2112e7d15 --- /dev/null +++ b/contracts/javascore/proto-lib/build.gradle @@ -0,0 +1,17 @@ +version = '0.1.0' + +apply plugin: 'java-library' + +optimizedJar.enabled = false + +dependencies { + compileOnly("foundation.icon:javaee-api:$javaeeVersion") + implementation("foundation.icon:javaee-scorex:$scorexVersion") + implementation project(':score-util') + + compileOnly("foundation.icon:javaee-score-client:$scoreClientVersion") + annotationProcessor("foundation.icon:javaee-score-client:$scoreClientVersion") + compileOnly("com.fasterxml.jackson.core:jackson-databind:$jacksonVersion") + compileOnly("foundation.icon:icon-sdk:$iconsdkVersion") + +} \ No newline at end of file diff --git a/contracts/javascore/lib/src/main/java/icon/proto/core/commitment/BatchEntry.java b/contracts/javascore/proto-lib/src/main/java/cosmos/ics23/v1/BatchEntry.java similarity index 97% rename from contracts/javascore/lib/src/main/java/icon/proto/core/commitment/BatchEntry.java rename to contracts/javascore/proto-lib/src/main/java/cosmos/ics23/v1/BatchEntry.java index b52936cd9..800938350 100644 --- a/contracts/javascore/lib/src/main/java/icon/proto/core/commitment/BatchEntry.java +++ b/contracts/javascore/proto-lib/src/main/java/cosmos/ics23/v1/BatchEntry.java @@ -1,4 +1,4 @@ -package icon.proto.core.commitment; +package cosmos.ics23.v1; import ibc.icon.score.util.ByteUtil; import ibc.icon.score.util.Proto; diff --git a/contracts/javascore/lib/src/main/java/icon/proto/core/commitment/BatchProof.java b/contracts/javascore/proto-lib/src/main/java/cosmos/ics23/v1/BatchProof.java similarity index 96% rename from contracts/javascore/lib/src/main/java/icon/proto/core/commitment/BatchProof.java rename to contracts/javascore/proto-lib/src/main/java/cosmos/ics23/v1/BatchProof.java index bb711115c..c5e21efd6 100644 --- a/contracts/javascore/lib/src/main/java/icon/proto/core/commitment/BatchProof.java +++ b/contracts/javascore/proto-lib/src/main/java/cosmos/ics23/v1/BatchProof.java @@ -1,4 +1,4 @@ -package icon.proto.core.commitment; +package cosmos.ics23.v1; import ibc.icon.score.util.ByteUtil; import ibc.icon.score.util.Proto; diff --git a/contracts/javascore/lib/src/main/java/icon/proto/core/commitment/CommitmentProof.java b/contracts/javascore/proto-lib/src/main/java/cosmos/ics23/v1/CommitmentProof.java similarity index 98% rename from contracts/javascore/lib/src/main/java/icon/proto/core/commitment/CommitmentProof.java rename to contracts/javascore/proto-lib/src/main/java/cosmos/ics23/v1/CommitmentProof.java index 47fa142c6..ff34b02b3 100644 --- a/contracts/javascore/lib/src/main/java/icon/proto/core/commitment/CommitmentProof.java +++ b/contracts/javascore/proto-lib/src/main/java/cosmos/ics23/v1/CommitmentProof.java @@ -1,4 +1,4 @@ -package icon.proto.core.commitment; +package cosmos.ics23.v1; import ibc.icon.score.util.ByteUtil; import ibc.icon.score.util.Proto; diff --git a/contracts/javascore/lib/src/main/java/icon/proto/core/commitment/CompressedBatchEntry.java b/contracts/javascore/proto-lib/src/main/java/cosmos/ics23/v1/CompressedBatchEntry.java similarity index 97% rename from contracts/javascore/lib/src/main/java/icon/proto/core/commitment/CompressedBatchEntry.java rename to contracts/javascore/proto-lib/src/main/java/cosmos/ics23/v1/CompressedBatchEntry.java index 00be2e01b..61f7750c7 100644 --- a/contracts/javascore/lib/src/main/java/icon/proto/core/commitment/CompressedBatchEntry.java +++ b/contracts/javascore/proto-lib/src/main/java/cosmos/ics23/v1/CompressedBatchEntry.java @@ -1,4 +1,4 @@ -package icon.proto.core.commitment; +package cosmos.ics23.v1; import ibc.icon.score.util.ByteUtil; import ibc.icon.score.util.Proto; diff --git a/contracts/javascore/lib/src/main/java/icon/proto/core/commitment/CompressedBatchProof.java b/contracts/javascore/proto-lib/src/main/java/cosmos/ics23/v1/CompressedBatchProof.java similarity index 97% rename from contracts/javascore/lib/src/main/java/icon/proto/core/commitment/CompressedBatchProof.java rename to contracts/javascore/proto-lib/src/main/java/cosmos/ics23/v1/CompressedBatchProof.java index 639c1200a..79732904c 100644 --- a/contracts/javascore/lib/src/main/java/icon/proto/core/commitment/CompressedBatchProof.java +++ b/contracts/javascore/proto-lib/src/main/java/cosmos/ics23/v1/CompressedBatchProof.java @@ -1,4 +1,4 @@ -package icon.proto.core.commitment; +package cosmos.ics23.v1; import ibc.icon.score.util.ByteUtil; import ibc.icon.score.util.Proto; diff --git a/contracts/javascore/lib/src/main/java/icon/proto/core/commitment/CompressedExistenceProof.java b/contracts/javascore/proto-lib/src/main/java/cosmos/ics23/v1/CompressedExistenceProof.java similarity index 98% rename from contracts/javascore/lib/src/main/java/icon/proto/core/commitment/CompressedExistenceProof.java rename to contracts/javascore/proto-lib/src/main/java/cosmos/ics23/v1/CompressedExistenceProof.java index 0e65292e3..6ed3015a4 100644 --- a/contracts/javascore/lib/src/main/java/icon/proto/core/commitment/CompressedExistenceProof.java +++ b/contracts/javascore/proto-lib/src/main/java/cosmos/ics23/v1/CompressedExistenceProof.java @@ -1,4 +1,4 @@ -package icon.proto.core.commitment; +package cosmos.ics23.v1; import ibc.icon.score.util.ByteUtil; import ibc.icon.score.util.Proto; diff --git a/contracts/javascore/lib/src/main/java/icon/proto/core/commitment/CompressedNonExistenceProof.java b/contracts/javascore/proto-lib/src/main/java/cosmos/ics23/v1/CompressedNonExistenceProof.java similarity index 98% rename from contracts/javascore/lib/src/main/java/icon/proto/core/commitment/CompressedNonExistenceProof.java rename to contracts/javascore/proto-lib/src/main/java/cosmos/ics23/v1/CompressedNonExistenceProof.java index d69d005a6..5d4785b16 100644 --- a/contracts/javascore/lib/src/main/java/icon/proto/core/commitment/CompressedNonExistenceProof.java +++ b/contracts/javascore/proto-lib/src/main/java/cosmos/ics23/v1/CompressedNonExistenceProof.java @@ -1,4 +1,4 @@ -package icon.proto.core.commitment; +package cosmos.ics23.v1; import ibc.icon.score.util.ByteUtil; import ibc.icon.score.util.Proto; diff --git a/contracts/javascore/lib/src/main/java/icon/proto/core/commitment/ExistenceProof.java b/contracts/javascore/proto-lib/src/main/java/cosmos/ics23/v1/ExistenceProof.java similarity index 98% rename from contracts/javascore/lib/src/main/java/icon/proto/core/commitment/ExistenceProof.java rename to contracts/javascore/proto-lib/src/main/java/cosmos/ics23/v1/ExistenceProof.java index a1185209d..269baa23d 100644 --- a/contracts/javascore/lib/src/main/java/icon/proto/core/commitment/ExistenceProof.java +++ b/contracts/javascore/proto-lib/src/main/java/cosmos/ics23/v1/ExistenceProof.java @@ -1,4 +1,4 @@ -package icon.proto.core.commitment; +package cosmos.ics23.v1; import ibc.icon.score.util.ByteUtil; import ibc.icon.score.util.Proto; diff --git a/contracts/javascore/lib/src/main/java/icon/proto/core/commitment/HashOp.java b/contracts/javascore/proto-lib/src/main/java/cosmos/ics23/v1/HashOp.java similarity index 58% rename from contracts/javascore/lib/src/main/java/icon/proto/core/commitment/HashOp.java rename to contracts/javascore/proto-lib/src/main/java/cosmos/ics23/v1/HashOp.java index c678aca68..0343f0262 100644 --- a/contracts/javascore/lib/src/main/java/icon/proto/core/commitment/HashOp.java +++ b/contracts/javascore/proto-lib/src/main/java/cosmos/ics23/v1/HashOp.java @@ -1,4 +1,4 @@ -package icon.proto.core.commitment; +package cosmos.ics23.v1; public class HashOp { public static final int NO_HASH = 0; @@ -7,11 +7,17 @@ public class HashOp { public static final int SHA512 = 2; - public static final int KECCAK = 3; + public static final int KECCAK256 = 3; public static final int RIPEMD160 = 4; public static final int BITCOIN = 5; public static final int SHA512_256 = 6; + + public static final int BLAKE2B_512 = 7; + + public static final int BLAKE2S_256 = 8; + + public static final int BLAKE3 = 9; } diff --git a/contracts/javascore/lib/src/main/java/icon/proto/core/commitment/InnerOp.java b/contracts/javascore/proto-lib/src/main/java/cosmos/ics23/v1/InnerOp.java similarity index 97% rename from contracts/javascore/lib/src/main/java/icon/proto/core/commitment/InnerOp.java rename to contracts/javascore/proto-lib/src/main/java/cosmos/ics23/v1/InnerOp.java index 0dc6ec0f4..8fddcb22e 100644 --- a/contracts/javascore/lib/src/main/java/icon/proto/core/commitment/InnerOp.java +++ b/contracts/javascore/proto-lib/src/main/java/cosmos/ics23/v1/InnerOp.java @@ -1,4 +1,4 @@ -package icon.proto.core.commitment; +package cosmos.ics23.v1; import ibc.icon.score.util.ByteUtil; import ibc.icon.score.util.Proto; diff --git a/contracts/javascore/lib/src/main/java/icon/proto/core/commitment/InnerSpec.java b/contracts/javascore/proto-lib/src/main/java/cosmos/ics23/v1/InnerSpec.java similarity index 98% rename from contracts/javascore/lib/src/main/java/icon/proto/core/commitment/InnerSpec.java rename to contracts/javascore/proto-lib/src/main/java/cosmos/ics23/v1/InnerSpec.java index 35d85d14a..1a9498883 100644 --- a/contracts/javascore/lib/src/main/java/icon/proto/core/commitment/InnerSpec.java +++ b/contracts/javascore/proto-lib/src/main/java/cosmos/ics23/v1/InnerSpec.java @@ -1,4 +1,4 @@ -package icon.proto.core.commitment; +package cosmos.ics23.v1; import ibc.icon.score.util.ByteUtil; import ibc.icon.score.util.Proto; diff --git a/contracts/javascore/lib/src/main/java/icon/proto/core/commitment/LeafOp.java b/contracts/javascore/proto-lib/src/main/java/cosmos/ics23/v1/LeafOp.java similarity index 98% rename from contracts/javascore/lib/src/main/java/icon/proto/core/commitment/LeafOp.java rename to contracts/javascore/proto-lib/src/main/java/cosmos/ics23/v1/LeafOp.java index 162a98314..a2b488bab 100644 --- a/contracts/javascore/lib/src/main/java/icon/proto/core/commitment/LeafOp.java +++ b/contracts/javascore/proto-lib/src/main/java/cosmos/ics23/v1/LeafOp.java @@ -1,4 +1,4 @@ -package icon.proto.core.commitment; +package cosmos.ics23.v1; import ibc.icon.score.util.ByteUtil; import ibc.icon.score.util.Proto; diff --git a/contracts/javascore/lib/src/main/java/icon/proto/core/commitment/LengthOp.java b/contracts/javascore/proto-lib/src/main/java/cosmos/ics23/v1/LengthOp.java similarity index 92% rename from contracts/javascore/lib/src/main/java/icon/proto/core/commitment/LengthOp.java rename to contracts/javascore/proto-lib/src/main/java/cosmos/ics23/v1/LengthOp.java index d6849b353..07865cdfd 100644 --- a/contracts/javascore/lib/src/main/java/icon/proto/core/commitment/LengthOp.java +++ b/contracts/javascore/proto-lib/src/main/java/cosmos/ics23/v1/LengthOp.java @@ -1,4 +1,4 @@ -package icon.proto.core.commitment; +package cosmos.ics23.v1; public class LengthOp { public static final int NO_PREFIX = 0; diff --git a/contracts/javascore/lib/src/main/java/icon/proto/core/commitment/NonExistenceProof.java b/contracts/javascore/proto-lib/src/main/java/cosmos/ics23/v1/NonExistenceProof.java similarity index 98% rename from contracts/javascore/lib/src/main/java/icon/proto/core/commitment/NonExistenceProof.java rename to contracts/javascore/proto-lib/src/main/java/cosmos/ics23/v1/NonExistenceProof.java index 91a9b37e5..ad5ae39cc 100644 --- a/contracts/javascore/lib/src/main/java/icon/proto/core/commitment/NonExistenceProof.java +++ b/contracts/javascore/proto-lib/src/main/java/cosmos/ics23/v1/NonExistenceProof.java @@ -1,4 +1,4 @@ -package icon.proto.core.commitment; +package cosmos.ics23.v1; import ibc.icon.score.util.ByteUtil; import ibc.icon.score.util.Proto; diff --git a/contracts/javascore/lib/src/main/java/icon/proto/core/commitment/ProofSpec.java b/contracts/javascore/proto-lib/src/main/java/cosmos/ics23/v1/ProofSpec.java similarity index 98% rename from contracts/javascore/lib/src/main/java/icon/proto/core/commitment/ProofSpec.java rename to contracts/javascore/proto-lib/src/main/java/cosmos/ics23/v1/ProofSpec.java index 75e8d3b04..451af134b 100644 --- a/contracts/javascore/lib/src/main/java/icon/proto/core/commitment/ProofSpec.java +++ b/contracts/javascore/proto-lib/src/main/java/cosmos/ics23/v1/ProofSpec.java @@ -1,4 +1,4 @@ -package icon.proto.core.commitment; +package cosmos.ics23.v1; import ibc.icon.score.util.ByteUtil; import ibc.icon.score.util.Proto; diff --git a/contracts/javascore/proto-lib/src/main/java/cosmos/upgrade/v1beta1/CancelSoftwareUpgradeProposal.java b/contracts/javascore/proto-lib/src/main/java/cosmos/upgrade/v1beta1/CancelSoftwareUpgradeProposal.java new file mode 100644 index 000000000..7421efa44 --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/cosmos/upgrade/v1beta1/CancelSoftwareUpgradeProposal.java @@ -0,0 +1,60 @@ +package cosmos.upgrade.v1beta1; + +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ProtoMessage; +import java.lang.String; + +public class CancelSoftwareUpgradeProposal extends ProtoMessage { + private String title = ""; + + private String description = ""; + + public String getTitle() { + return this.title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getDescription() { + return this.description; + } + + public void setDescription(String description) { + this.description = description; + } + + public byte[] encode() { + return ByteUtil.join( + Proto.encode(1, this.title), + Proto.encode(2, this.description)); + } + + public static CancelSoftwareUpgradeProposal decode(byte[] data) { + CancelSoftwareUpgradeProposal obj = new CancelSoftwareUpgradeProposal(); + int index = 0; + int order; + int length = data.length; + while (index < length) { + order = data[index] >> 3; + index++; + switch(order) { + case 1: { + Proto.DecodeResponse resp = Proto.decodeString(data, index); + index = resp.index; + obj.title = resp.res; + break; + } + case 2: { + Proto.DecodeResponse resp = Proto.decodeString(data, index); + index = resp.index; + obj.description = resp.res; + break; + } + } + } + return obj; + } +} diff --git a/contracts/javascore/proto-lib/src/main/java/cosmos/upgrade/v1beta1/ModuleVersion.java b/contracts/javascore/proto-lib/src/main/java/cosmos/upgrade/v1beta1/ModuleVersion.java new file mode 100644 index 000000000..87f6812d3 --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/cosmos/upgrade/v1beta1/ModuleVersion.java @@ -0,0 +1,61 @@ +package cosmos.upgrade.v1beta1; + +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ProtoMessage; +import java.lang.String; +import java.math.BigInteger; + +public class ModuleVersion extends ProtoMessage { + private String name = ""; + + private BigInteger version = BigInteger.ZERO; + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public BigInteger getVersion() { + return this.version; + } + + public void setVersion(BigInteger version) { + this.version = version; + } + + public byte[] encode() { + return ByteUtil.join( + Proto.encode(1, this.name), + Proto.encode(2, this.version)); + } + + public static ModuleVersion decode(byte[] data) { + ModuleVersion obj = new ModuleVersion(); + int index = 0; + int order; + int length = data.length; + while (index < length) { + order = data[index] >> 3; + index++; + switch(order) { + case 1: { + Proto.DecodeResponse resp = Proto.decodeString(data, index); + index = resp.index; + obj.name = resp.res; + break; + } + case 2: { + Proto.DecodeResponse resp = Proto.decodeVarInt(data, index); + index = resp.index; + obj.version = resp.res; + break; + } + } + } + return obj; + } +} diff --git a/contracts/javascore/proto-lib/src/main/java/cosmos/upgrade/v1beta1/Plan.java b/contracts/javascore/proto-lib/src/main/java/cosmos/upgrade/v1beta1/Plan.java new file mode 100644 index 000000000..d72f1eca9 --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/cosmos/upgrade/v1beta1/Plan.java @@ -0,0 +1,114 @@ +package cosmos.upgrade.v1beta1; + +import google.protobuf.Any; +import google.protobuf.Timestamp; +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ProtoMessage; +import java.lang.String; +import java.math.BigInteger; + +public class Plan extends ProtoMessage { + private String name = ""; + + private Timestamp time = new google.protobuf.Timestamp(); + + private BigInteger height = BigInteger.ZERO; + + private String info = ""; + + private Any upgradedClientState = new google.protobuf.Any(); + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public Timestamp getTime() { + return this.time; + } + + public void setTime(Timestamp time) { + this.time = time; + } + + public BigInteger getHeight() { + return this.height; + } + + public void setHeight(BigInteger height) { + this.height = height; + } + + public String getInfo() { + return this.info; + } + + public void setInfo(String info) { + this.info = info; + } + + public Any getUpgradedClientState() { + return this.upgradedClientState; + } + + public void setUpgradedClientState(Any upgradedClientState) { + this.upgradedClientState = upgradedClientState; + } + + public byte[] encode() { + return ByteUtil.join( + Proto.encode(1, this.name), + Proto.encode(2, this.time), + Proto.encode(3, this.height), + Proto.encode(4, this.info), + Proto.encode(5, this.upgradedClientState)); + } + + public static Plan decode(byte[] data) { + Plan obj = new Plan(); + int index = 0; + int order; + int length = data.length; + while (index < length) { + order = data[index] >> 3; + index++; + switch(order) { + case 1: { + Proto.DecodeResponse resp = Proto.decodeString(data, index); + index = resp.index; + obj.name = resp.res; + break; + } + case 2: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.time = google.protobuf.Timestamp.decode(resp.res); + break; + } + case 3: { + Proto.DecodeResponse resp = Proto.decodeVarInt(data, index); + index = resp.index; + obj.height = resp.res; + break; + } + case 4: { + Proto.DecodeResponse resp = Proto.decodeString(data, index); + index = resp.index; + obj.info = resp.res; + break; + } + case 5: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.upgradedClientState = google.protobuf.Any.decode(resp.res); + break; + } + } + } + return obj; + } +} diff --git a/contracts/javascore/proto-lib/src/main/java/cosmos/upgrade/v1beta1/SoftwareUpgradeProposal.java b/contracts/javascore/proto-lib/src/main/java/cosmos/upgrade/v1beta1/SoftwareUpgradeProposal.java new file mode 100644 index 000000000..f8d30ae28 --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/cosmos/upgrade/v1beta1/SoftwareUpgradeProposal.java @@ -0,0 +1,77 @@ +package cosmos.upgrade.v1beta1; + +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ProtoMessage; +import java.lang.String; + +public class SoftwareUpgradeProposal extends ProtoMessage { + private String title = ""; + + private String description = ""; + + private Plan plan = new Plan(); + + public String getTitle() { + return this.title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getDescription() { + return this.description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Plan getPlan() { + return this.plan; + } + + public void setPlan(Plan plan) { + this.plan = plan; + } + + public byte[] encode() { + return ByteUtil.join( + Proto.encode(1, this.title), + Proto.encode(2, this.description), + Proto.encode(3, this.plan)); + } + + public static SoftwareUpgradeProposal decode(byte[] data) { + SoftwareUpgradeProposal obj = new SoftwareUpgradeProposal(); + int index = 0; + int order; + int length = data.length; + while (index < length) { + order = data[index] >> 3; + index++; + switch(order) { + case 1: { + Proto.DecodeResponse resp = Proto.decodeString(data, index); + index = resp.index; + obj.title = resp.res; + break; + } + case 2: { + Proto.DecodeResponse resp = Proto.decodeString(data, index); + index = resp.index; + obj.description = resp.res; + break; + } + case 3: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.plan = Plan.decode(resp.res); + break; + } + } + } + return obj; + } +} diff --git a/contracts/javascore/lib/src/main/java/icon/proto/icon/types/v1/MerkleNode.java b/contracts/javascore/proto-lib/src/main/java/google/protobuf/Any.java similarity index 62% rename from contracts/javascore/lib/src/main/java/icon/proto/icon/types/v1/MerkleNode.java rename to contracts/javascore/proto-lib/src/main/java/google/protobuf/Any.java index 7c95e7cde..7364d2c93 100644 --- a/contracts/javascore/lib/src/main/java/icon/proto/icon/types/v1/MerkleNode.java +++ b/contracts/javascore/proto-lib/src/main/java/google/protobuf/Any.java @@ -1,21 +1,21 @@ -package icon.proto.icon.types.v1; +package google.protobuf; import ibc.icon.score.util.ByteUtil; import ibc.icon.score.util.Proto; import ibc.icon.score.util.ProtoMessage; -import java.math.BigInteger; +import java.lang.String; -public class MerkleNode extends ProtoMessage { - private BigInteger dir = BigInteger.ZERO; +public class Any extends ProtoMessage { + private String typeUrl = ""; private byte[] value = new byte[0]; - public BigInteger getDir() { - return this.dir; + public String getTypeUrl() { + return this.typeUrl; } - public void setDir(BigInteger dir) { - this.dir = dir; + public void setTypeUrl(String typeUrl) { + this.typeUrl = typeUrl; } public byte[] getValue() { @@ -28,12 +28,12 @@ public void setValue(byte[] value) { public byte[] encode() { return ByteUtil.join( - Proto.encode(1, this.dir), + Proto.encode(1, this.typeUrl), Proto.encode(2, this.value)); } - public static MerkleNode decode(byte[] data) { - MerkleNode obj = new MerkleNode(); + public static Any decode(byte[] data) { + Any obj = new Any(); int index = 0; int order; int length = data.length; @@ -42,9 +42,9 @@ public static MerkleNode decode(byte[] data) { index++; switch(order) { case 1: { - Proto.DecodeResponse resp = Proto.decodeVarInt(data, index); + Proto.DecodeResponse resp = Proto.decodeString(data, index); index = resp.index; - obj.dir = resp.res; + obj.typeUrl = resp.res; break; } case 2: { diff --git a/contracts/javascore/lib/src/main/java/icon/proto/clients/tendermint/Duration.java b/contracts/javascore/proto-lib/src/main/java/google/protobuf/Duration.java similarity index 97% rename from contracts/javascore/lib/src/main/java/icon/proto/clients/tendermint/Duration.java rename to contracts/javascore/proto-lib/src/main/java/google/protobuf/Duration.java index d556663c2..a97424c53 100644 --- a/contracts/javascore/lib/src/main/java/icon/proto/clients/tendermint/Duration.java +++ b/contracts/javascore/proto-lib/src/main/java/google/protobuf/Duration.java @@ -1,4 +1,4 @@ -package icon.proto.clients.tendermint; +package google.protobuf; import ibc.icon.score.util.ByteUtil; import ibc.icon.score.util.Proto; diff --git a/contracts/javascore/lib/src/main/java/icon/proto/clients/tendermint/Timestamp.java b/contracts/javascore/proto-lib/src/main/java/google/protobuf/Timestamp.java similarity index 97% rename from contracts/javascore/lib/src/main/java/icon/proto/clients/tendermint/Timestamp.java rename to contracts/javascore/proto-lib/src/main/java/google/protobuf/Timestamp.java index 27bcfa95f..07c8313f4 100644 --- a/contracts/javascore/lib/src/main/java/icon/proto/clients/tendermint/Timestamp.java +++ b/contracts/javascore/proto-lib/src/main/java/google/protobuf/Timestamp.java @@ -1,4 +1,4 @@ -package icon.proto.clients.tendermint; +package google.protobuf; import ibc.icon.score.util.ByteUtil; import ibc.icon.score.util.Proto; diff --git a/contracts/javascore/proto-lib/src/main/java/ibc/core/client/v1/ClientConsensusStates.java b/contracts/javascore/proto-lib/src/main/java/ibc/core/client/v1/ClientConsensusStates.java new file mode 100644 index 000000000..5ef0247e4 --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/ibc/core/client/v1/ClientConsensusStates.java @@ -0,0 +1,62 @@ +package ibc.core.client.v1; + +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ProtoMessage; +import java.lang.String; +import java.util.List; +import scorex.util.ArrayList; + +public class ClientConsensusStates extends ProtoMessage { + private String clientId = ""; + + private List consensusStates = new ArrayList<>(); + + public String getClientId() { + return this.clientId; + } + + public void setClientId(String clientId) { + this.clientId = clientId; + } + + public List getConsensusStates() { + return this.consensusStates; + } + + public void setConsensusStates(List consensusStates) { + this.consensusStates = consensusStates; + } + + public byte[] encode() { + return ByteUtil.join( + Proto.encode(1, this.clientId), + Proto.encodeMessageArray(2, this.consensusStates)); + } + + public static ClientConsensusStates decode(byte[] data) { + ClientConsensusStates obj = new ClientConsensusStates(); + int index = 0; + int order; + int length = data.length; + while (index < length) { + order = data[index] >> 3; + index++; + switch(order) { + case 1: { + Proto.DecodeResponse resp = Proto.decodeString(data, index); + index = resp.index; + obj.clientId = resp.res; + break; + } + case 2: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.consensusStates.add(ConsensusStateWithHeight.decode(resp.res)); + break; + } + } + } + return obj; + } +} diff --git a/contracts/javascore/proto-lib/src/main/java/ibc/core/client/v1/ClientUpdateProposal.java b/contracts/javascore/proto-lib/src/main/java/ibc/core/client/v1/ClientUpdateProposal.java new file mode 100644 index 000000000..cf7edd8e4 --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/ibc/core/client/v1/ClientUpdateProposal.java @@ -0,0 +1,94 @@ +package ibc.core.client.v1; + +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ProtoMessage; +import java.lang.String; + +public class ClientUpdateProposal extends ProtoMessage { + private String title = ""; + + private String description = ""; + + private String subjectClientId = ""; + + private String substituteClientId = ""; + + public String getTitle() { + return this.title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getDescription() { + return this.description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getSubjectClientId() { + return this.subjectClientId; + } + + public void setSubjectClientId(String subjectClientId) { + this.subjectClientId = subjectClientId; + } + + public String getSubstituteClientId() { + return this.substituteClientId; + } + + public void setSubstituteClientId(String substituteClientId) { + this.substituteClientId = substituteClientId; + } + + public byte[] encode() { + return ByteUtil.join( + Proto.encode(1, this.title), + Proto.encode(2, this.description), + Proto.encode(3, this.subjectClientId), + Proto.encode(4, this.substituteClientId)); + } + + public static ClientUpdateProposal decode(byte[] data) { + ClientUpdateProposal obj = new ClientUpdateProposal(); + int index = 0; + int order; + int length = data.length; + while (index < length) { + order = data[index] >> 3; + index++; + switch(order) { + case 1: { + Proto.DecodeResponse resp = Proto.decodeString(data, index); + index = resp.index; + obj.title = resp.res; + break; + } + case 2: { + Proto.DecodeResponse resp = Proto.decodeString(data, index); + index = resp.index; + obj.description = resp.res; + break; + } + case 3: { + Proto.DecodeResponse resp = Proto.decodeString(data, index); + index = resp.index; + obj.subjectClientId = resp.res; + break; + } + case 4: { + Proto.DecodeResponse resp = Proto.decodeString(data, index); + index = resp.index; + obj.substituteClientId = resp.res; + break; + } + } + } + return obj; + } +} diff --git a/contracts/javascore/proto-lib/src/main/java/ibc/core/client/v1/ConsensusStateWithHeight.java b/contracts/javascore/proto-lib/src/main/java/ibc/core/client/v1/ConsensusStateWithHeight.java new file mode 100644 index 000000000..9372c85cf --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/ibc/core/client/v1/ConsensusStateWithHeight.java @@ -0,0 +1,60 @@ +package ibc.core.client.v1; + +import google.protobuf.Any; +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ProtoMessage; + +public class ConsensusStateWithHeight extends ProtoMessage { + private Height height = new Height(); + + private Any consensusState = new google.protobuf.Any(); + + public Height getHeight() { + return this.height; + } + + public void setHeight(Height height) { + this.height = height; + } + + public Any getConsensusState() { + return this.consensusState; + } + + public void setConsensusState(Any consensusState) { + this.consensusState = consensusState; + } + + public byte[] encode() { + return ByteUtil.join( + Proto.encode(1, this.height), + Proto.encode(2, this.consensusState)); + } + + public static ConsensusStateWithHeight decode(byte[] data) { + ConsensusStateWithHeight obj = new ConsensusStateWithHeight(); + int index = 0; + int order; + int length = data.length; + while (index < length) { + order = data[index] >> 3; + index++; + switch(order) { + case 1: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.height = Height.decode(resp.res); + break; + } + case 2: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.consensusState = google.protobuf.Any.decode(resp.res); + break; + } + } + } + return obj; + } +} diff --git a/contracts/javascore/proto-lib/src/main/java/ibc/core/client/v1/Height.java b/contracts/javascore/proto-lib/src/main/java/ibc/core/client/v1/Height.java new file mode 100644 index 000000000..24146f413 --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/ibc/core/client/v1/Height.java @@ -0,0 +1,60 @@ +package ibc.core.client.v1; + +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ProtoMessage; +import java.math.BigInteger; + +public class Height extends ProtoMessage { + private BigInteger revisionNumber = BigInteger.ZERO; + + private BigInteger revisionHeight = BigInteger.ZERO; + + public BigInteger getRevisionNumber() { + return this.revisionNumber; + } + + public void setRevisionNumber(BigInteger revisionNumber) { + this.revisionNumber = revisionNumber; + } + + public BigInteger getRevisionHeight() { + return this.revisionHeight; + } + + public void setRevisionHeight(BigInteger revisionHeight) { + this.revisionHeight = revisionHeight; + } + + public byte[] encode() { + return ByteUtil.join( + Proto.encode(1, this.revisionNumber), + Proto.encode(2, this.revisionHeight)); + } + + public static Height decode(byte[] data) { + Height obj = new Height(); + int index = 0; + int order; + int length = data.length; + while (index < length) { + order = data[index] >> 3; + index++; + switch(order) { + case 1: { + Proto.DecodeResponse resp = Proto.decodeVarInt(data, index); + index = resp.index; + obj.revisionNumber = resp.res; + break; + } + case 2: { + Proto.DecodeResponse resp = Proto.decodeVarInt(data, index); + index = resp.index; + obj.revisionHeight = resp.res; + break; + } + } + } + return obj; + } +} diff --git a/contracts/javascore/proto-lib/src/main/java/ibc/core/client/v1/IdentifiedClientState.java b/contracts/javascore/proto-lib/src/main/java/ibc/core/client/v1/IdentifiedClientState.java new file mode 100644 index 000000000..701772f6d --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/ibc/core/client/v1/IdentifiedClientState.java @@ -0,0 +1,61 @@ +package ibc.core.client.v1; + +import google.protobuf.Any; +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ProtoMessage; +import java.lang.String; + +public class IdentifiedClientState extends ProtoMessage { + private String clientId = ""; + + private Any clientState = new google.protobuf.Any(); + + public String getClientId() { + return this.clientId; + } + + public void setClientId(String clientId) { + this.clientId = clientId; + } + + public Any getClientState() { + return this.clientState; + } + + public void setClientState(Any clientState) { + this.clientState = clientState; + } + + public byte[] encode() { + return ByteUtil.join( + Proto.encode(1, this.clientId), + Proto.encode(2, this.clientState)); + } + + public static IdentifiedClientState decode(byte[] data) { + IdentifiedClientState obj = new IdentifiedClientState(); + int index = 0; + int order; + int length = data.length; + while (index < length) { + order = data[index] >> 3; + index++; + switch(order) { + case 1: { + Proto.DecodeResponse resp = Proto.decodeString(data, index); + index = resp.index; + obj.clientId = resp.res; + break; + } + case 2: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.clientState = google.protobuf.Any.decode(resp.res); + break; + } + } + } + return obj; + } +} diff --git a/contracts/javascore/proto-lib/src/main/java/ibc/core/client/v1/Params.java b/contracts/javascore/proto-lib/src/main/java/ibc/core/client/v1/Params.java new file mode 100644 index 000000000..ddae20d7b --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/ibc/core/client/v1/Params.java @@ -0,0 +1,45 @@ +package ibc.core.client.v1; + +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ProtoMessage; +import java.lang.String; +import java.util.List; +import scorex.util.ArrayList; + +public class Params extends ProtoMessage { + private List allowedClients = new ArrayList<>(); + + public List getAllowedClients() { + return this.allowedClients; + } + + public void setAllowedClients(List allowedClients) { + this.allowedClients = allowedClients; + } + + public byte[] encode() { + return ByteUtil.join( + Proto.encodeStringArray(1, this.allowedClients)); + } + + public static Params decode(byte[] data) { + Params obj = new Params(); + int index = 0; + int order; + int length = data.length; + while (index < length) { + order = data[index] >> 3; + index++; + switch(order) { + case 1: { + Proto.DecodeResponse resp = Proto.decodeString(data, index); + index = resp.index; + obj.allowedClients.add(resp.res); + break; + } + } + } + return obj; + } +} diff --git a/contracts/javascore/proto-lib/src/main/java/ibc/core/client/v1/UpgradeProposal.java b/contracts/javascore/proto-lib/src/main/java/ibc/core/client/v1/UpgradeProposal.java new file mode 100644 index 000000000..d78179229 --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/ibc/core/client/v1/UpgradeProposal.java @@ -0,0 +1,96 @@ +package ibc.core.client.v1; + +import cosmos.upgrade.v1beta1.Plan; +import google.protobuf.Any; +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ProtoMessage; +import java.lang.String; + +public class UpgradeProposal extends ProtoMessage { + private String title = ""; + + private String description = ""; + + private Plan plan = new cosmos.upgrade.v1beta1.Plan(); + + private Any upgradedClientState = new google.protobuf.Any(); + + public String getTitle() { + return this.title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getDescription() { + return this.description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Plan getPlan() { + return this.plan; + } + + public void setPlan(Plan plan) { + this.plan = plan; + } + + public Any getUpgradedClientState() { + return this.upgradedClientState; + } + + public void setUpgradedClientState(Any upgradedClientState) { + this.upgradedClientState = upgradedClientState; + } + + public byte[] encode() { + return ByteUtil.join( + Proto.encode(1, this.title), + Proto.encode(2, this.description), + Proto.encode(3, this.plan), + Proto.encode(4, this.upgradedClientState)); + } + + public static UpgradeProposal decode(byte[] data) { + UpgradeProposal obj = new UpgradeProposal(); + int index = 0; + int order; + int length = data.length; + while (index < length) { + order = data[index] >> 3; + index++; + switch(order) { + case 1: { + Proto.DecodeResponse resp = Proto.decodeString(data, index); + index = resp.index; + obj.title = resp.res; + break; + } + case 2: { + Proto.DecodeResponse resp = Proto.decodeString(data, index); + index = resp.index; + obj.description = resp.res; + break; + } + case 3: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.plan = cosmos.upgrade.v1beta1.Plan.decode(resp.res); + break; + } + case 4: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.upgradedClientState = google.protobuf.Any.decode(resp.res); + break; + } + } + } + return obj; + } +} diff --git a/contracts/javascore/lib/src/main/java/icon/proto/core/commitment/MerklePath.java b/contracts/javascore/proto-lib/src/main/java/ibc/core/commitment/v1/MerklePath.java similarity index 96% rename from contracts/javascore/lib/src/main/java/icon/proto/core/commitment/MerklePath.java rename to contracts/javascore/proto-lib/src/main/java/ibc/core/commitment/v1/MerklePath.java index 73a3efc40..dbd2c7908 100644 --- a/contracts/javascore/lib/src/main/java/icon/proto/core/commitment/MerklePath.java +++ b/contracts/javascore/proto-lib/src/main/java/ibc/core/commitment/v1/MerklePath.java @@ -1,4 +1,4 @@ -package icon.proto.core.commitment; +package ibc.core.commitment.v1; import ibc.icon.score.util.ByteUtil; import ibc.icon.score.util.Proto; diff --git a/contracts/javascore/lib/src/main/java/icon/proto/core/connection/MerklePrefix.java b/contracts/javascore/proto-lib/src/main/java/ibc/core/commitment/v1/MerklePrefix.java similarity index 96% rename from contracts/javascore/lib/src/main/java/icon/proto/core/connection/MerklePrefix.java rename to contracts/javascore/proto-lib/src/main/java/ibc/core/commitment/v1/MerklePrefix.java index 7939c734f..6f543b1e6 100644 --- a/contracts/javascore/lib/src/main/java/icon/proto/core/connection/MerklePrefix.java +++ b/contracts/javascore/proto-lib/src/main/java/ibc/core/commitment/v1/MerklePrefix.java @@ -1,4 +1,4 @@ -package icon.proto.core.connection; +package ibc.core.commitment.v1; import ibc.icon.score.util.ByteUtil; import ibc.icon.score.util.Proto; diff --git a/contracts/javascore/lib/src/main/java/icon/proto/core/commitment/MerkleProof.java b/contracts/javascore/proto-lib/src/main/java/ibc/core/commitment/v1/MerkleProof.java similarity index 86% rename from contracts/javascore/lib/src/main/java/icon/proto/core/commitment/MerkleProof.java rename to contracts/javascore/proto-lib/src/main/java/ibc/core/commitment/v1/MerkleProof.java index 063c82f2a..15cc2de20 100644 --- a/contracts/javascore/lib/src/main/java/icon/proto/core/commitment/MerkleProof.java +++ b/contracts/javascore/proto-lib/src/main/java/ibc/core/commitment/v1/MerkleProof.java @@ -1,5 +1,6 @@ -package icon.proto.core.commitment; +package ibc.core.commitment.v1; +import cosmos.ics23.v1.CommitmentProof; import ibc.icon.score.util.ByteUtil; import ibc.icon.score.util.Proto; import ibc.icon.score.util.ProtoMessage; @@ -34,7 +35,7 @@ public static MerkleProof decode(byte[] data) { case 1: { Proto.DecodeResponse resp = Proto.decodeBytes(data, index); index = resp.index; - obj.proofs.add(CommitmentProof.decode(resp.res)); + obj.proofs.add(cosmos.ics23.v1.CommitmentProof.decode(resp.res)); break; } } diff --git a/contracts/javascore/lib/src/main/java/icon/proto/core/commitment/MerkleRoot.java b/contracts/javascore/proto-lib/src/main/java/ibc/core/commitment/v1/MerkleRoot.java similarity index 96% rename from contracts/javascore/lib/src/main/java/icon/proto/core/commitment/MerkleRoot.java rename to contracts/javascore/proto-lib/src/main/java/ibc/core/commitment/v1/MerkleRoot.java index 0e1bd3eed..4a2508190 100644 --- a/contracts/javascore/lib/src/main/java/icon/proto/core/commitment/MerkleRoot.java +++ b/contracts/javascore/proto-lib/src/main/java/ibc/core/commitment/v1/MerkleRoot.java @@ -1,4 +1,4 @@ -package icon.proto.core.commitment; +package ibc.core.commitment.v1; import ibc.icon.score.util.ByteUtil; import ibc.icon.score.util.Proto; diff --git a/contracts/javascore/lib/src/main/java/icon/proto/clients/tendermint/ClientState.java b/contracts/javascore/proto-lib/src/main/java/ibc/lightclients/tendermint/v1/ClientState.java similarity index 62% rename from contracts/javascore/lib/src/main/java/icon/proto/clients/tendermint/ClientState.java rename to contracts/javascore/proto-lib/src/main/java/ibc/lightclients/tendermint/v1/ClientState.java index b40a46148..c7df44202 100644 --- a/contracts/javascore/lib/src/main/java/icon/proto/clients/tendermint/ClientState.java +++ b/contracts/javascore/proto-lib/src/main/java/ibc/lightclients/tendermint/v1/ClientState.java @@ -1,26 +1,34 @@ -package icon.proto.clients.tendermint; +package ibc.lightclients.tendermint.v1; +import cosmos.ics23.v1.ProofSpec; +import google.protobuf.Duration; +import ibc.core.client.v1.Height; import ibc.icon.score.util.ByteUtil; import ibc.icon.score.util.Proto; import ibc.icon.score.util.ProtoMessage; import java.lang.Boolean; import java.lang.String; -import java.math.BigInteger; +import java.util.List; +import scorex.util.ArrayList; public class ClientState extends ProtoMessage { private String chainId = ""; private Fraction trustLevel = new Fraction(); - private Duration trustingPeriod = new Duration(); + private Duration trustingPeriod = new google.protobuf.Duration(); - private Duration unbondingPeriod = new Duration(); + private Duration unbondingPeriod = new google.protobuf.Duration(); - private Duration maxClockDrift = new Duration(); + private Duration maxClockDrift = new google.protobuf.Duration(); - private BigInteger frozenHeight = BigInteger.ZERO; + private Height frozenHeight = new ibc.core.client.v1.Height(); - private BigInteger latestHeight = BigInteger.ZERO; + private Height latestHeight = new ibc.core.client.v1.Height(); + + private List proofSpecs = new ArrayList<>(); + + private List upgradePath = new ArrayList<>(); private boolean allowUpdateAfterExpiry = false; @@ -66,22 +74,38 @@ public void setMaxClockDrift(Duration maxClockDrift) { this.maxClockDrift = maxClockDrift; } - public BigInteger getFrozenHeight() { + public Height getFrozenHeight() { return this.frozenHeight; } - public void setFrozenHeight(BigInteger frozenHeight) { + public void setFrozenHeight(Height frozenHeight) { this.frozenHeight = frozenHeight; } - public BigInteger getLatestHeight() { + public Height getLatestHeight() { return this.latestHeight; } - public void setLatestHeight(BigInteger latestHeight) { + public void setLatestHeight(Height latestHeight) { this.latestHeight = latestHeight; } + public List getProofSpecs() { + return this.proofSpecs; + } + + public void setProofSpecs(List proofSpecs) { + this.proofSpecs = proofSpecs; + } + + public List getUpgradePath() { + return this.upgradePath; + } + + public void setUpgradePath(List upgradePath) { + this.upgradePath = upgradePath; + } + public boolean getAllowUpdateAfterExpiry() { return this.allowUpdateAfterExpiry; } @@ -107,8 +131,10 @@ public byte[] encode() { Proto.encode(5, this.maxClockDrift), Proto.encode(6, this.frozenHeight), Proto.encode(7, this.latestHeight), - Proto.encode(8, this.allowUpdateAfterExpiry), - Proto.encode(9, this.allowUpdateAfterMisbehaviour)); + Proto.encodeMessageArray(8, this.proofSpecs), + Proto.encodeStringArray(9, this.upgradePath), + Proto.encode(10, this.allowUpdateAfterExpiry), + Proto.encode(11, this.allowUpdateAfterMisbehaviour)); } public static ClientState decode(byte[] data) { @@ -135,40 +161,52 @@ public static ClientState decode(byte[] data) { case 3: { Proto.DecodeResponse resp = Proto.decodeBytes(data, index); index = resp.index; - obj.trustingPeriod = Duration.decode(resp.res); + obj.trustingPeriod = google.protobuf.Duration.decode(resp.res); break; } case 4: { Proto.DecodeResponse resp = Proto.decodeBytes(data, index); index = resp.index; - obj.unbondingPeriod = Duration.decode(resp.res); + obj.unbondingPeriod = google.protobuf.Duration.decode(resp.res); break; } case 5: { Proto.DecodeResponse resp = Proto.decodeBytes(data, index); index = resp.index; - obj.maxClockDrift = Duration.decode(resp.res); + obj.maxClockDrift = google.protobuf.Duration.decode(resp.res); break; } case 6: { - Proto.DecodeResponse resp = Proto.decodeVarInt(data, index); + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); index = resp.index; - obj.frozenHeight = resp.res; + obj.frozenHeight = ibc.core.client.v1.Height.decode(resp.res); break; } case 7: { - Proto.DecodeResponse resp = Proto.decodeVarInt(data, index); + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); index = resp.index; - obj.latestHeight = resp.res; + obj.latestHeight = ibc.core.client.v1.Height.decode(resp.res); break; } case 8: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.proofSpecs.add(cosmos.ics23.v1.ProofSpec.decode(resp.res)); + break; + } + case 9: { + Proto.DecodeResponse resp = Proto.decodeString(data, index); + index = resp.index; + obj.upgradePath.add(resp.res); + break; + } + case 10: { Proto.DecodeResponse resp = Proto.decodeBoolean(data, index); index = resp.index; obj.allowUpdateAfterExpiry = resp.res; break; } - case 9: { + case 11: { Proto.DecodeResponse resp = Proto.decodeBoolean(data, index); index = resp.index; obj.allowUpdateAfterMisbehaviour = resp.res; diff --git a/contracts/javascore/lib/src/main/java/icon/proto/clients/tendermint/ConsensusState.java b/contracts/javascore/proto-lib/src/main/java/ibc/lightclients/tendermint/v1/ConsensusState.java similarity index 81% rename from contracts/javascore/lib/src/main/java/icon/proto/clients/tendermint/ConsensusState.java rename to contracts/javascore/proto-lib/src/main/java/ibc/lightclients/tendermint/v1/ConsensusState.java index dd5869662..c909adeb8 100644 --- a/contracts/javascore/lib/src/main/java/icon/proto/clients/tendermint/ConsensusState.java +++ b/contracts/javascore/proto-lib/src/main/java/ibc/lightclients/tendermint/v1/ConsensusState.java @@ -1,13 +1,15 @@ -package icon.proto.clients.tendermint; +package ibc.lightclients.tendermint.v1; +import google.protobuf.Timestamp; +import ibc.core.commitment.v1.MerkleRoot; import ibc.icon.score.util.ByteUtil; import ibc.icon.score.util.Proto; import ibc.icon.score.util.ProtoMessage; public class ConsensusState extends ProtoMessage { - private Timestamp timestamp = new Timestamp(); + private Timestamp timestamp = new google.protobuf.Timestamp(); - private MerkleRoot root = new MerkleRoot(); + private MerkleRoot root = new ibc.core.commitment.v1.MerkleRoot(); private byte[] nextValidatorsHash = new byte[0]; @@ -54,13 +56,13 @@ public static ConsensusState decode(byte[] data) { case 1: { Proto.DecodeResponse resp = Proto.decodeBytes(data, index); index = resp.index; - obj.timestamp = Timestamp.decode(resp.res); + obj.timestamp = google.protobuf.Timestamp.decode(resp.res); break; } case 2: { Proto.DecodeResponse resp = Proto.decodeBytes(data, index); index = resp.index; - obj.root = MerkleRoot.decode(resp.res); + obj.root = ibc.core.commitment.v1.MerkleRoot.decode(resp.res); break; } case 3: { diff --git a/contracts/javascore/lib/src/main/java/icon/proto/clients/tendermint/Fraction.java b/contracts/javascore/proto-lib/src/main/java/ibc/lightclients/tendermint/v1/Fraction.java similarity index 97% rename from contracts/javascore/lib/src/main/java/icon/proto/clients/tendermint/Fraction.java rename to contracts/javascore/proto-lib/src/main/java/ibc/lightclients/tendermint/v1/Fraction.java index bfd27289e..fdd9ba5ad 100644 --- a/contracts/javascore/lib/src/main/java/icon/proto/clients/tendermint/Fraction.java +++ b/contracts/javascore/proto-lib/src/main/java/ibc/lightclients/tendermint/v1/Fraction.java @@ -1,4 +1,4 @@ -package icon.proto.clients.tendermint; +package ibc.lightclients.tendermint.v1; import ibc.icon.score.util.ByteUtil; import ibc.icon.score.util.Proto; diff --git a/contracts/javascore/lib/src/main/java/icon/proto/clients/tendermint/TmHeader.java b/contracts/javascore/proto-lib/src/main/java/ibc/lightclients/tendermint/v1/Header.java similarity index 62% rename from contracts/javascore/lib/src/main/java/icon/proto/clients/tendermint/TmHeader.java rename to contracts/javascore/proto-lib/src/main/java/ibc/lightclients/tendermint/v1/Header.java index 41ec037d0..46e30967f 100644 --- a/contracts/javascore/lib/src/main/java/icon/proto/clients/tendermint/TmHeader.java +++ b/contracts/javascore/proto-lib/src/main/java/ibc/lightclients/tendermint/v1/Header.java @@ -1,18 +1,20 @@ -package icon.proto.clients.tendermint; +package ibc.lightclients.tendermint.v1; +import ibc.core.client.v1.Height; import ibc.icon.score.util.ByteUtil; import ibc.icon.score.util.Proto; import ibc.icon.score.util.ProtoMessage; -import java.math.BigInteger; +import tendermint.types.SignedHeader; +import tendermint.types.ValidatorSet; -public class TmHeader extends ProtoMessage { - private SignedHeader signedHeader = new SignedHeader(); +public class Header extends ProtoMessage { + private SignedHeader signedHeader = new tendermint.types.SignedHeader(); - private ValidatorSet validatorSet = new ValidatorSet(); + private ValidatorSet validatorSet = new tendermint.types.ValidatorSet(); - private BigInteger trustedHeight = BigInteger.ZERO; + private Height trustedHeight = new ibc.core.client.v1.Height(); - private ValidatorSet trustedValidators = new ValidatorSet(); + private ValidatorSet trustedValidators = new tendermint.types.ValidatorSet(); public SignedHeader getSignedHeader() { return this.signedHeader; @@ -30,11 +32,11 @@ public void setValidatorSet(ValidatorSet validatorSet) { this.validatorSet = validatorSet; } - public BigInteger getTrustedHeight() { + public Height getTrustedHeight() { return this.trustedHeight; } - public void setTrustedHeight(BigInteger trustedHeight) { + public void setTrustedHeight(Height trustedHeight) { this.trustedHeight = trustedHeight; } @@ -54,8 +56,8 @@ public byte[] encode() { Proto.encode(4, this.trustedValidators)); } - public static TmHeader decode(byte[] data) { - TmHeader obj = new TmHeader(); + public static Header decode(byte[] data) { + Header obj = new Header(); int index = 0; int order; int length = data.length; @@ -66,25 +68,25 @@ public static TmHeader decode(byte[] data) { case 1: { Proto.DecodeResponse resp = Proto.decodeBytes(data, index); index = resp.index; - obj.signedHeader = SignedHeader.decode(resp.res); + obj.signedHeader = tendermint.types.SignedHeader.decode(resp.res); break; } case 2: { Proto.DecodeResponse resp = Proto.decodeBytes(data, index); index = resp.index; - obj.validatorSet = ValidatorSet.decode(resp.res); + obj.validatorSet = tendermint.types.ValidatorSet.decode(resp.res); break; } case 3: { - Proto.DecodeResponse resp = Proto.decodeVarInt(data, index); + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); index = resp.index; - obj.trustedHeight = resp.res; + obj.trustedHeight = ibc.core.client.v1.Height.decode(resp.res); break; } case 4: { Proto.DecodeResponse resp = Proto.decodeBytes(data, index); index = resp.index; - obj.trustedValidators = ValidatorSet.decode(resp.res); + obj.trustedValidators = tendermint.types.ValidatorSet.decode(resp.res); break; } } diff --git a/contracts/javascore/lib/src/main/java/icon/proto/icon/lightclient/v1/Misbehaviour.java b/contracts/javascore/proto-lib/src/main/java/ibc/lightclients/tendermint/v1/Misbehaviour.java similarity index 77% rename from contracts/javascore/lib/src/main/java/icon/proto/icon/lightclient/v1/Misbehaviour.java rename to contracts/javascore/proto-lib/src/main/java/ibc/lightclients/tendermint/v1/Misbehaviour.java index c04fbc7b2..5be2152ee 100644 --- a/contracts/javascore/lib/src/main/java/icon/proto/icon/lightclient/v1/Misbehaviour.java +++ b/contracts/javascore/proto-lib/src/main/java/ibc/lightclients/tendermint/v1/Misbehaviour.java @@ -1,4 +1,4 @@ -package icon.proto.icon.lightclient.v1; +package ibc.lightclients.tendermint.v1; import ibc.icon.score.util.ByteUtil; import ibc.icon.score.util.Proto; @@ -8,9 +8,9 @@ public class Misbehaviour extends ProtoMessage { private String clientId = ""; - private BlockUpdate header1 = new BlockUpdate(); + private Header header1 = new Header(); - private BlockUpdate header2 = new BlockUpdate(); + private Header header2 = new Header(); public String getClientId() { return this.clientId; @@ -20,19 +20,19 @@ public void setClientId(String clientId) { this.clientId = clientId; } - public BlockUpdate getHeader1() { + public Header getHeader1() { return this.header1; } - public void setHeader1(BlockUpdate header1) { + public void setHeader1(Header header1) { this.header1 = header1; } - public BlockUpdate getHeader2() { + public Header getHeader2() { return this.header2; } - public void setHeader2(BlockUpdate header2) { + public void setHeader2(Header header2) { this.header2 = header2; } @@ -61,13 +61,13 @@ public static Misbehaviour decode(byte[] data) { case 2: { Proto.DecodeResponse resp = Proto.decodeBytes(data, index); index = resp.index; - obj.header1 = BlockUpdate.decode(resp.res); + obj.header1 = Header.decode(resp.res); break; } case 3: { Proto.DecodeResponse resp = Proto.decodeBytes(data, index); index = resp.index; - obj.header2 = BlockUpdate.decode(resp.res); + obj.header2 = Header.decode(resp.res); break; } } diff --git a/contracts/javascore/lib/src/main/java/icon/proto/core/channel/Channel.java b/contracts/javascore/proto-lib/src/main/java/icon/proto/core/channel/Channel.java similarity index 100% rename from contracts/javascore/lib/src/main/java/icon/proto/core/channel/Channel.java rename to contracts/javascore/proto-lib/src/main/java/icon/proto/core/channel/Channel.java diff --git a/contracts/javascore/lib/src/main/java/icon/proto/core/channel/Packet.java b/contracts/javascore/proto-lib/src/main/java/icon/proto/core/channel/Packet.java similarity index 96% rename from contracts/javascore/lib/src/main/java/icon/proto/core/channel/Packet.java rename to contracts/javascore/proto-lib/src/main/java/icon/proto/core/channel/Packet.java index 2b375362d..a4fefca2d 100644 --- a/contracts/javascore/lib/src/main/java/icon/proto/core/channel/Packet.java +++ b/contracts/javascore/proto-lib/src/main/java/icon/proto/core/channel/Packet.java @@ -20,7 +20,7 @@ public class Packet extends ProtoMessage { private byte[] data = new byte[0]; - private Height timeoutHeight = new Height(); + private Height timeoutHeight = new icon.proto.core.client.Height(); private BigInteger timeoutTimestamp = BigInteger.ZERO; @@ -148,7 +148,7 @@ public static Packet decode(byte[] data) { case 7: { Proto.DecodeResponse resp = Proto.decodeBytes(data, index); index = resp.index; - obj.timeoutHeight = Height.decode(resp.res); + obj.timeoutHeight = icon.proto.core.client.Height.decode(resp.res); break; } case 8: { diff --git a/contracts/javascore/lib/src/main/java/icon/proto/core/channel/PacketState.java b/contracts/javascore/proto-lib/src/main/java/icon/proto/core/channel/PacketState.java similarity index 100% rename from contracts/javascore/lib/src/main/java/icon/proto/core/channel/PacketState.java rename to contracts/javascore/proto-lib/src/main/java/icon/proto/core/channel/PacketState.java diff --git a/contracts/javascore/lib/src/main/java/icon/proto/core/client/Height.java b/contracts/javascore/proto-lib/src/main/java/icon/proto/core/client/Height.java similarity index 100% rename from contracts/javascore/lib/src/main/java/icon/proto/core/client/Height.java rename to contracts/javascore/proto-lib/src/main/java/icon/proto/core/client/Height.java diff --git a/contracts/javascore/lib/src/main/java/icon/proto/core/connection/ConnectionEnd.java b/contracts/javascore/proto-lib/src/main/java/icon/proto/core/connection/ConnectionEnd.java similarity index 100% rename from contracts/javascore/lib/src/main/java/icon/proto/core/connection/ConnectionEnd.java rename to contracts/javascore/proto-lib/src/main/java/icon/proto/core/connection/ConnectionEnd.java diff --git a/contracts/javascore/lib/src/main/java/icon/proto/core/connection/Counterparty.java b/contracts/javascore/proto-lib/src/main/java/icon/proto/core/connection/Counterparty.java similarity index 89% rename from contracts/javascore/lib/src/main/java/icon/proto/core/connection/Counterparty.java rename to contracts/javascore/proto-lib/src/main/java/icon/proto/core/connection/Counterparty.java index e5696aa6b..118b2b780 100644 --- a/contracts/javascore/lib/src/main/java/icon/proto/core/connection/Counterparty.java +++ b/contracts/javascore/proto-lib/src/main/java/icon/proto/core/connection/Counterparty.java @@ -1,5 +1,6 @@ package icon.proto.core.connection; +import ibc.core.commitment.v1.MerklePrefix; import ibc.icon.score.util.ByteUtil; import ibc.icon.score.util.Proto; import ibc.icon.score.util.ProtoMessage; @@ -10,7 +11,7 @@ public class Counterparty extends ProtoMessage { private String connectionId = ""; - private MerklePrefix prefix = new MerklePrefix(); + private MerklePrefix prefix = new ibc.core.commitment.v1.MerklePrefix(); public String getClientId() { return this.clientId; @@ -67,7 +68,7 @@ public static Counterparty decode(byte[] data) { case 3: { Proto.DecodeResponse resp = Proto.decodeBytes(data, index); index = resp.index; - obj.prefix = MerklePrefix.decode(resp.res); + obj.prefix = ibc.core.commitment.v1.MerklePrefix.decode(resp.res); break; } } diff --git a/contracts/javascore/lib/src/main/java/icon/proto/core/connection/Version.java b/contracts/javascore/proto-lib/src/main/java/icon/proto/core/connection/Version.java similarity index 100% rename from contracts/javascore/lib/src/main/java/icon/proto/core/connection/Version.java rename to contracts/javascore/proto-lib/src/main/java/icon/proto/core/connection/Version.java diff --git a/contracts/javascore/proto-lib/src/main/java/tendermint/crypto/DominoOp.java b/contracts/javascore/proto-lib/src/main/java/tendermint/crypto/DominoOp.java new file mode 100644 index 000000000..4a05aa34c --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/tendermint/crypto/DominoOp.java @@ -0,0 +1,77 @@ +package tendermint.crypto; + +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ProtoMessage; +import java.lang.String; + +public class DominoOp extends ProtoMessage { + private String key = ""; + + private String input = ""; + + private String output = ""; + + public String getKey() { + return this.key; + } + + public void setKey(String key) { + this.key = key; + } + + public String getInput() { + return this.input; + } + + public void setInput(String input) { + this.input = input; + } + + public String getOutput() { + return this.output; + } + + public void setOutput(String output) { + this.output = output; + } + + public byte[] encode() { + return ByteUtil.join( + Proto.encode(1, this.key), + Proto.encode(2, this.input), + Proto.encode(3, this.output)); + } + + public static DominoOp decode(byte[] data) { + DominoOp obj = new DominoOp(); + int index = 0; + int order; + int length = data.length; + while (index < length) { + order = data[index] >> 3; + index++; + switch(order) { + case 1: { + Proto.DecodeResponse resp = Proto.decodeString(data, index); + index = resp.index; + obj.key = resp.res; + break; + } + case 2: { + Proto.DecodeResponse resp = Proto.decodeString(data, index); + index = resp.index; + obj.input = resp.res; + break; + } + case 3: { + Proto.DecodeResponse resp = Proto.decodeString(data, index); + index = resp.index; + obj.output = resp.res; + break; + } + } + } + return obj; + } +} diff --git a/contracts/javascore/proto-lib/src/main/java/tendermint/crypto/Proof.java b/contracts/javascore/proto-lib/src/main/java/tendermint/crypto/Proof.java new file mode 100644 index 000000000..3b0069731 --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/tendermint/crypto/Proof.java @@ -0,0 +1,96 @@ +package tendermint.crypto; + +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ProtoMessage; +import java.math.BigInteger; +import java.util.List; +import scorex.util.ArrayList; + +public class Proof extends ProtoMessage { + private BigInteger total = BigInteger.ZERO; + + private BigInteger index = BigInteger.ZERO; + + private byte[] leafHash = new byte[0]; + + private List aunts = new ArrayList<>(); + + public BigInteger getTotal() { + return this.total; + } + + public void setTotal(BigInteger total) { + this.total = total; + } + + public BigInteger getIndex() { + return this.index; + } + + public void setIndex(BigInteger index) { + this.index = index; + } + + public byte[] getLeafHash() { + return this.leafHash; + } + + public void setLeafHash(byte[] leafHash) { + this.leafHash = leafHash; + } + + public List getAunts() { + return this.aunts; + } + + public void setAunts(List aunts) { + this.aunts = aunts; + } + + public byte[] encode() { + return ByteUtil.join( + Proto.encode(1, this.total), + Proto.encode(2, this.index), + Proto.encode(3, this.leafHash), + Proto.encodeBytesArray(4, this.aunts)); + } + + public static Proof decode(byte[] data) { + Proof obj = new Proof(); + int index = 0; + int order; + int length = data.length; + while (index < length) { + order = data[index] >> 3; + index++; + switch(order) { + case 1: { + Proto.DecodeResponse resp = Proto.decodeVarInt(data, index); + index = resp.index; + obj.total = resp.res; + break; + } + case 2: { + Proto.DecodeResponse resp = Proto.decodeVarInt(data, index); + index = resp.index; + obj.index = resp.res; + break; + } + case 3: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.leafHash = resp.res; + break; + } + case 4: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.aunts.add(resp.res); + break; + } + } + } + return obj; + } +} diff --git a/contracts/javascore/proto-lib/src/main/java/tendermint/crypto/ProofOp.java b/contracts/javascore/proto-lib/src/main/java/tendermint/crypto/ProofOp.java new file mode 100644 index 000000000..768568b4b --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/tendermint/crypto/ProofOp.java @@ -0,0 +1,77 @@ +package tendermint.crypto; + +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ProtoMessage; +import java.lang.String; + +public class ProofOp extends ProtoMessage { + private String type = ""; + + private byte[] key = new byte[0]; + + private byte[] data = new byte[0]; + + public String getType() { + return this.type; + } + + public void setType(String type) { + this.type = type; + } + + public byte[] getKey() { + return this.key; + } + + public void setKey(byte[] key) { + this.key = key; + } + + public byte[] getData() { + return this.data; + } + + public void setData(byte[] data) { + this.data = data; + } + + public byte[] encode() { + return ByteUtil.join( + Proto.encode(1, this.type), + Proto.encode(2, this.key), + Proto.encode(3, this.data)); + } + + public static ProofOp decode(byte[] data) { + ProofOp obj = new ProofOp(); + int index = 0; + int order; + int length = data.length; + while (index < length) { + order = data[index] >> 3; + index++; + switch(order) { + case 1: { + Proto.DecodeResponse resp = Proto.decodeString(data, index); + index = resp.index; + obj.type = resp.res; + break; + } + case 2: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.key = resp.res; + break; + } + case 3: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.data = resp.res; + break; + } + } + } + return obj; + } +} diff --git a/contracts/javascore/lib/src/main/java/icon/proto/icon/types/v1/MerkleProofs.java b/contracts/javascore/proto-lib/src/main/java/tendermint/crypto/ProofOps.java similarity index 55% rename from contracts/javascore/lib/src/main/java/icon/proto/icon/types/v1/MerkleProofs.java rename to contracts/javascore/proto-lib/src/main/java/tendermint/crypto/ProofOps.java index 3142316c1..260c90940 100644 --- a/contracts/javascore/lib/src/main/java/icon/proto/icon/types/v1/MerkleProofs.java +++ b/contracts/javascore/proto-lib/src/main/java/tendermint/crypto/ProofOps.java @@ -1,4 +1,4 @@ -package icon.proto.icon.types.v1; +package tendermint.crypto; import ibc.icon.score.util.ByteUtil; import ibc.icon.score.util.Proto; @@ -6,24 +6,24 @@ import java.util.List; import scorex.util.ArrayList; -public class MerkleProofs extends ProtoMessage { - private List proofs = new ArrayList<>(); +public class ProofOps extends ProtoMessage { + private List ops = new ArrayList<>(); - public List getProofs() { - return this.proofs; + public List getOps() { + return this.ops; } - public void setProofs(List proofs) { - this.proofs = proofs; + public void setOps(List ops) { + this.ops = ops; } public byte[] encode() { return ByteUtil.join( - Proto.encodeMessageArray(1, this.proofs)); + Proto.encodeMessageArray(1, this.ops)); } - public static MerkleProofs decode(byte[] data) { - MerkleProofs obj = new MerkleProofs(); + public static ProofOps decode(byte[] data) { + ProofOps obj = new ProofOps(); int index = 0; int order; int length = data.length; @@ -34,7 +34,7 @@ public static MerkleProofs decode(byte[] data) { case 1: { Proto.DecodeResponse resp = Proto.decodeBytes(data, index); index = resp.index; - obj.proofs.add(MerkleNode.decode(resp.res)); + obj.ops.add(ProofOp.decode(resp.res)); break; } } diff --git a/contracts/javascore/lib/src/main/java/icon/proto/clients/tendermint/PublicKey.java b/contracts/javascore/proto-lib/src/main/java/tendermint/crypto/PublicKey.java similarity index 72% rename from contracts/javascore/lib/src/main/java/icon/proto/clients/tendermint/PublicKey.java rename to contracts/javascore/proto-lib/src/main/java/tendermint/crypto/PublicKey.java index 1ee5bb457..8cd0ce898 100644 --- a/contracts/javascore/lib/src/main/java/icon/proto/clients/tendermint/PublicKey.java +++ b/contracts/javascore/proto-lib/src/main/java/tendermint/crypto/PublicKey.java @@ -1,4 +1,4 @@ -package icon.proto.clients.tendermint; +package tendermint.crypto; import ibc.icon.score.util.ByteUtil; import ibc.icon.score.util.Proto; @@ -9,8 +9,6 @@ public class PublicKey extends ProtoMessage { private byte[] secp256k1 = new byte[0]; - private byte[] sr25519 = new byte[0]; - public byte[] getEd25519() { return this.ed25519; } @@ -27,19 +25,10 @@ public void setSecp256k1(byte[] secp256k1) { this.secp256k1 = secp256k1; } - public byte[] getSr25519() { - return this.sr25519; - } - - public void setSr25519(byte[] sr25519) { - this.sr25519 = sr25519; - } - public byte[] encode() { return ByteUtil.join( Proto.encode(1, this.ed25519), - Proto.encode(2, this.secp256k1), - Proto.encode(3, this.sr25519)); + Proto.encode(2, this.secp256k1)); } public static PublicKey decode(byte[] data) { @@ -63,12 +52,6 @@ public static PublicKey decode(byte[] data) { obj.secp256k1 = resp.res; break; } - case 3: { - Proto.DecodeResponse resp = Proto.decodeBytes(data, index); - index = resp.index; - obj.sr25519 = resp.res; - break; - } } } return obj; diff --git a/contracts/javascore/proto-lib/src/main/java/tendermint/crypto/ValueOp.java b/contracts/javascore/proto-lib/src/main/java/tendermint/crypto/ValueOp.java new file mode 100644 index 000000000..4deb2442e --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/tendermint/crypto/ValueOp.java @@ -0,0 +1,59 @@ +package tendermint.crypto; + +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ProtoMessage; + +public class ValueOp extends ProtoMessage { + private byte[] key = new byte[0]; + + private Proof proof = new Proof(); + + public byte[] getKey() { + return this.key; + } + + public void setKey(byte[] key) { + this.key = key; + } + + public Proof getProof() { + return this.proof; + } + + public void setProof(Proof proof) { + this.proof = proof; + } + + public byte[] encode() { + return ByteUtil.join( + Proto.encode(1, this.key), + Proto.encode(2, this.proof)); + } + + public static ValueOp decode(byte[] data) { + ValueOp obj = new ValueOp(); + int index = 0; + int order; + int length = data.length; + while (index < length) { + order = data[index] >> 3; + index++; + switch(order) { + case 1: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.key = resp.res; + break; + } + case 2: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.proof = Proof.decode(resp.res); + break; + } + } + } + return obj; + } +} diff --git a/contracts/javascore/proto-lib/src/main/java/tendermint/types/ABCIParams.java b/contracts/javascore/proto-lib/src/main/java/tendermint/types/ABCIParams.java new file mode 100644 index 000000000..49fba66ce --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/tendermint/types/ABCIParams.java @@ -0,0 +1,43 @@ +package tendermint.types; + +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ProtoMessage; +import java.math.BigInteger; + +public class ABCIParams extends ProtoMessage { + private BigInteger voteExtensionsEnableHeight = BigInteger.ZERO; + + public BigInteger getVoteExtensionsEnableHeight() { + return this.voteExtensionsEnableHeight; + } + + public void setVoteExtensionsEnableHeight(BigInteger voteExtensionsEnableHeight) { + this.voteExtensionsEnableHeight = voteExtensionsEnableHeight; + } + + public byte[] encode() { + return ByteUtil.join( + Proto.encode(1, this.voteExtensionsEnableHeight)); + } + + public static ABCIParams decode(byte[] data) { + ABCIParams obj = new ABCIParams(); + int index = 0; + int order; + int length = data.length; + while (index < length) { + order = data[index] >> 3; + index++; + switch(order) { + case 1: { + Proto.DecodeResponse resp = Proto.decodeVarInt(data, index); + index = resp.index; + obj.voteExtensionsEnableHeight = resp.res; + break; + } + } + } + return obj; + } +} diff --git a/contracts/javascore/proto-lib/src/main/java/tendermint/types/Block.java b/contracts/javascore/proto-lib/src/main/java/tendermint/types/Block.java new file mode 100644 index 000000000..a0c9391c3 --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/tendermint/types/Block.java @@ -0,0 +1,93 @@ +package tendermint.types; + +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ProtoMessage; + +public class Block extends ProtoMessage { + private Header header = new Header(); + + private Data data = new Data(); + + private EvidenceList evidence = new tendermint.types.EvidenceList(); + + private Commit lastCommit = new Commit(); + + public Header getHeader() { + return this.header; + } + + public void setHeader(Header header) { + this.header = header; + } + + public Data getData() { + return this.data; + } + + public void setData(Data data) { + this.data = data; + } + + public EvidenceList getEvidence() { + return this.evidence; + } + + public void setEvidence(EvidenceList evidence) { + this.evidence = evidence; + } + + public Commit getLastCommit() { + return this.lastCommit; + } + + public void setLastCommit(Commit lastCommit) { + this.lastCommit = lastCommit; + } + + public byte[] encode() { + return ByteUtil.join( + Proto.encode(1, this.header), + Proto.encode(2, this.data), + Proto.encode(3, this.evidence), + Proto.encode(4, this.lastCommit)); + } + + public static Block decode(byte[] data) { + Block obj = new Block(); + int index = 0; + int order; + int length = data.length; + while (index < length) { + order = data[index] >> 3; + index++; + switch(order) { + case 1: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.header = Header.decode(resp.res); + break; + } + case 2: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.data = Data.decode(resp.res); + break; + } + case 3: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.evidence = tendermint.types.EvidenceList.decode(resp.res); + break; + } + case 4: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.lastCommit = Commit.decode(resp.res); + break; + } + } + } + return obj; + } +} diff --git a/contracts/javascore/lib/src/main/java/icon/proto/clients/tendermint/BlockID.java b/contracts/javascore/proto-lib/src/main/java/tendermint/types/BlockID.java similarity index 97% rename from contracts/javascore/lib/src/main/java/icon/proto/clients/tendermint/BlockID.java rename to contracts/javascore/proto-lib/src/main/java/tendermint/types/BlockID.java index 84116722c..f2695b433 100644 --- a/contracts/javascore/lib/src/main/java/icon/proto/clients/tendermint/BlockID.java +++ b/contracts/javascore/proto-lib/src/main/java/tendermint/types/BlockID.java @@ -1,4 +1,4 @@ -package icon.proto.clients.tendermint; +package tendermint.types; import ibc.icon.score.util.ByteUtil; import ibc.icon.score.util.Proto; diff --git a/contracts/javascore/lib/src/main/java/icon/proto/icon/types/v1/BlockIDFlag.java b/contracts/javascore/proto-lib/src/main/java/tendermint/types/BlockIDFlag.java similarity index 87% rename from contracts/javascore/lib/src/main/java/icon/proto/icon/types/v1/BlockIDFlag.java rename to contracts/javascore/proto-lib/src/main/java/tendermint/types/BlockIDFlag.java index 15f6000ae..c556aa317 100644 --- a/contracts/javascore/lib/src/main/java/icon/proto/icon/types/v1/BlockIDFlag.java +++ b/contracts/javascore/proto-lib/src/main/java/tendermint/types/BlockIDFlag.java @@ -1,4 +1,4 @@ -package icon.proto.icon.types.v1; +package tendermint.types; public class BlockIDFlag { public static final int BLOCK_ID_FLAG_UNKNOWN = 0; diff --git a/contracts/javascore/proto-lib/src/main/java/tendermint/types/BlockMeta.java b/contracts/javascore/proto-lib/src/main/java/tendermint/types/BlockMeta.java new file mode 100644 index 000000000..0ee95e8c9 --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/tendermint/types/BlockMeta.java @@ -0,0 +1,94 @@ +package tendermint.types; + +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ProtoMessage; +import java.math.BigInteger; + +public class BlockMeta extends ProtoMessage { + private BlockID blockId = new BlockID(); + + private BigInteger blockSize = BigInteger.ZERO; + + private Header header = new Header(); + + private BigInteger numTxs = BigInteger.ZERO; + + public BlockID getBlockId() { + return this.blockId; + } + + public void setBlockId(BlockID blockId) { + this.blockId = blockId; + } + + public BigInteger getBlockSize() { + return this.blockSize; + } + + public void setBlockSize(BigInteger blockSize) { + this.blockSize = blockSize; + } + + public Header getHeader() { + return this.header; + } + + public void setHeader(Header header) { + this.header = header; + } + + public BigInteger getNumTxs() { + return this.numTxs; + } + + public void setNumTxs(BigInteger numTxs) { + this.numTxs = numTxs; + } + + public byte[] encode() { + return ByteUtil.join( + Proto.encode(1, this.blockId), + Proto.encode(2, this.blockSize), + Proto.encode(3, this.header), + Proto.encode(4, this.numTxs)); + } + + public static BlockMeta decode(byte[] data) { + BlockMeta obj = new BlockMeta(); + int index = 0; + int order; + int length = data.length; + while (index < length) { + order = data[index] >> 3; + index++; + switch(order) { + case 1: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.blockId = BlockID.decode(resp.res); + break; + } + case 2: { + Proto.DecodeResponse resp = Proto.decodeVarInt(data, index); + index = resp.index; + obj.blockSize = resp.res; + break; + } + case 3: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.header = Header.decode(resp.res); + break; + } + case 4: { + Proto.DecodeResponse resp = Proto.decodeVarInt(data, index); + index = resp.index; + obj.numTxs = resp.res; + break; + } + } + } + return obj; + } +} diff --git a/contracts/javascore/proto-lib/src/main/java/tendermint/types/BlockParams.java b/contracts/javascore/proto-lib/src/main/java/tendermint/types/BlockParams.java new file mode 100644 index 000000000..23c166496 --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/tendermint/types/BlockParams.java @@ -0,0 +1,60 @@ +package tendermint.types; + +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ProtoMessage; +import java.math.BigInteger; + +public class BlockParams extends ProtoMessage { + private BigInteger maxBytes = BigInteger.ZERO; + + private BigInteger maxGas = BigInteger.ZERO; + + public BigInteger getMaxBytes() { + return this.maxBytes; + } + + public void setMaxBytes(BigInteger maxBytes) { + this.maxBytes = maxBytes; + } + + public BigInteger getMaxGas() { + return this.maxGas; + } + + public void setMaxGas(BigInteger maxGas) { + this.maxGas = maxGas; + } + + public byte[] encode() { + return ByteUtil.join( + Proto.encode(1, this.maxBytes), + Proto.encode(2, this.maxGas)); + } + + public static BlockParams decode(byte[] data) { + BlockParams obj = new BlockParams(); + int index = 0; + int order; + int length = data.length; + while (index < length) { + order = data[index] >> 3; + index++; + switch(order) { + case 1: { + Proto.DecodeResponse resp = Proto.decodeVarInt(data, index); + index = resp.index; + obj.maxBytes = resp.res; + break; + } + case 2: { + Proto.DecodeResponse resp = Proto.decodeVarInt(data, index); + index = resp.index; + obj.maxGas = resp.res; + break; + } + } + } + return obj; + } +} diff --git a/contracts/javascore/lib/src/main/java/icon/proto/clients/tendermint/CanonicalBlockID.java b/contracts/javascore/proto-lib/src/main/java/tendermint/types/CanonicalBlockID.java similarity index 97% rename from contracts/javascore/lib/src/main/java/icon/proto/clients/tendermint/CanonicalBlockID.java rename to contracts/javascore/proto-lib/src/main/java/tendermint/types/CanonicalBlockID.java index 9f639a47e..b289d5eb8 100644 --- a/contracts/javascore/lib/src/main/java/icon/proto/clients/tendermint/CanonicalBlockID.java +++ b/contracts/javascore/proto-lib/src/main/java/tendermint/types/CanonicalBlockID.java @@ -1,4 +1,4 @@ -package icon.proto.clients.tendermint; +package tendermint.types; import ibc.icon.score.util.ByteUtil; import ibc.icon.score.util.Proto; diff --git a/contracts/javascore/lib/src/main/java/icon/proto/clients/tendermint/CanonicalPartSetHeader.java b/contracts/javascore/proto-lib/src/main/java/tendermint/types/CanonicalPartSetHeader.java similarity index 97% rename from contracts/javascore/lib/src/main/java/icon/proto/clients/tendermint/CanonicalPartSetHeader.java rename to contracts/javascore/proto-lib/src/main/java/tendermint/types/CanonicalPartSetHeader.java index cc287703b..fe403afd0 100644 --- a/contracts/javascore/lib/src/main/java/icon/proto/clients/tendermint/CanonicalPartSetHeader.java +++ b/contracts/javascore/proto-lib/src/main/java/tendermint/types/CanonicalPartSetHeader.java @@ -1,4 +1,4 @@ -package icon.proto.clients.tendermint; +package tendermint.types; import ibc.icon.score.util.ByteUtil; import ibc.icon.score.util.Proto; diff --git a/contracts/javascore/proto-lib/src/main/java/tendermint/types/CanonicalProposal.java b/contracts/javascore/proto-lib/src/main/java/tendermint/types/CanonicalProposal.java new file mode 100644 index 000000000..ce056ef2e --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/tendermint/types/CanonicalProposal.java @@ -0,0 +1,148 @@ +package tendermint.types; + +import google.protobuf.Timestamp; +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ProtoMessage; +import java.lang.Integer; +import java.lang.String; +import java.math.BigInteger; + +public class CanonicalProposal extends ProtoMessage { + private int type = 0; + + private BigInteger height = BigInteger.ZERO; + + private BigInteger round = BigInteger.ZERO; + + private BigInteger polRound = BigInteger.ZERO; + + private CanonicalBlockID blockId = new CanonicalBlockID(); + + private Timestamp timestamp = new google.protobuf.Timestamp(); + + private String chainId = ""; + + public int getType() { + return this.type; + } + + public void setType(int type) { + this.type = type; + } + + public BigInteger getHeight() { + return this.height; + } + + public void setHeight(BigInteger height) { + this.height = height; + } + + public BigInteger getRound() { + return this.round; + } + + public void setRound(BigInteger round) { + this.round = round; + } + + public BigInteger getPolRound() { + return this.polRound; + } + + public void setPolRound(BigInteger polRound) { + this.polRound = polRound; + } + + public CanonicalBlockID getBlockId() { + return this.blockId; + } + + public void setBlockId(CanonicalBlockID blockId) { + this.blockId = blockId; + } + + public Timestamp getTimestamp() { + return this.timestamp; + } + + public void setTimestamp(Timestamp timestamp) { + this.timestamp = timestamp; + } + + public String getChainId() { + return this.chainId; + } + + public void setChainId(String chainId) { + this.chainId = chainId; + } + + public byte[] encode() { + return ByteUtil.join( + Proto.encode(1, this.type), + Proto.encodeFixed64(2, this.height), + Proto.encodeFixed64(3, this.round), + Proto.encode(4, this.polRound), + Proto.encode(5, this.blockId), + Proto.encode(6, this.timestamp), + Proto.encode(7, this.chainId)); + } + + public static CanonicalProposal decode(byte[] data) { + CanonicalProposal obj = new CanonicalProposal(); + int index = 0; + int order; + int length = data.length; + while (index < length) { + order = data[index] >> 3; + index++; + switch(order) { + case 1: { + Proto.DecodeResponse resp = Proto.decodeEnum(data, index); + index = resp.index; + obj.type = resp.res; + break; + } + case 2: { + Proto.DecodeResponse resp = Proto.decodeFixed64(data, index); + index = resp.index; + obj.height = resp.res; + break; + } + case 3: { + Proto.DecodeResponse resp = Proto.decodeFixed64(data, index); + index = resp.index; + obj.round = resp.res; + break; + } + case 4: { + Proto.DecodeResponse resp = Proto.decodeVarInt(data, index); + index = resp.index; + obj.polRound = resp.res; + break; + } + case 5: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.blockId = CanonicalBlockID.decode(resp.res); + break; + } + case 6: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.timestamp = google.protobuf.Timestamp.decode(resp.res); + break; + } + case 7: { + Proto.DecodeResponse resp = Proto.decodeString(data, index); + index = resp.index; + obj.chainId = resp.res; + break; + } + } + } + return obj; + } +} diff --git a/contracts/javascore/lib/src/main/java/icon/proto/clients/tendermint/CanonicalVote.java b/contracts/javascore/proto-lib/src/main/java/tendermint/types/CanonicalVote.java similarity index 87% rename from contracts/javascore/lib/src/main/java/icon/proto/clients/tendermint/CanonicalVote.java rename to contracts/javascore/proto-lib/src/main/java/tendermint/types/CanonicalVote.java index 559b28383..5a5afbb58 100644 --- a/contracts/javascore/lib/src/main/java/icon/proto/clients/tendermint/CanonicalVote.java +++ b/contracts/javascore/proto-lib/src/main/java/tendermint/types/CanonicalVote.java @@ -1,5 +1,6 @@ -package icon.proto.clients.tendermint; +package tendermint.types; +import google.protobuf.Timestamp; import ibc.icon.score.util.ByteUtil; import ibc.icon.score.util.Proto; import ibc.icon.score.util.ProtoMessage; @@ -14,9 +15,9 @@ public class CanonicalVote extends ProtoMessage { private BigInteger round = BigInteger.ZERO; - private BlockID blockId = new BlockID(); + private CanonicalBlockID blockId = new CanonicalBlockID(); - private Timestamp timestamp = new Timestamp(); + private Timestamp timestamp = new google.protobuf.Timestamp(); private String chainId = ""; @@ -44,11 +45,11 @@ public void setRound(BigInteger round) { this.round = round; } - public BlockID getBlockId() { + public CanonicalBlockID getBlockId() { return this.blockId; } - public void setBlockId(BlockID blockId) { + public void setBlockId(CanonicalBlockID blockId) { this.blockId = blockId; } @@ -108,13 +109,13 @@ public static CanonicalVote decode(byte[] data) { case 4: { Proto.DecodeResponse resp = Proto.decodeBytes(data, index); index = resp.index; - obj.blockId = BlockID.decode(resp.res); + obj.blockId = CanonicalBlockID.decode(resp.res); break; } case 5: { Proto.DecodeResponse resp = Proto.decodeBytes(data, index); index = resp.index; - obj.timestamp = Timestamp.decode(resp.res); + obj.timestamp = google.protobuf.Timestamp.decode(resp.res); break; } case 6: { diff --git a/contracts/javascore/proto-lib/src/main/java/tendermint/types/CanonicalVoteExtension.java b/contracts/javascore/proto-lib/src/main/java/tendermint/types/CanonicalVoteExtension.java new file mode 100644 index 000000000..e1b8fb73d --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/tendermint/types/CanonicalVoteExtension.java @@ -0,0 +1,95 @@ +package tendermint.types; + +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ProtoMessage; +import java.lang.String; +import java.math.BigInteger; + +public class CanonicalVoteExtension extends ProtoMessage { + private byte[] extension = new byte[0]; + + private BigInteger height = BigInteger.ZERO; + + private BigInteger round = BigInteger.ZERO; + + private String chainId = ""; + + public byte[] getExtension() { + return this.extension; + } + + public void setExtension(byte[] extension) { + this.extension = extension; + } + + public BigInteger getHeight() { + return this.height; + } + + public void setHeight(BigInteger height) { + this.height = height; + } + + public BigInteger getRound() { + return this.round; + } + + public void setRound(BigInteger round) { + this.round = round; + } + + public String getChainId() { + return this.chainId; + } + + public void setChainId(String chainId) { + this.chainId = chainId; + } + + public byte[] encode() { + return ByteUtil.join( + Proto.encode(1, this.extension), + Proto.encodeFixed64(2, this.height), + Proto.encodeFixed64(3, this.round), + Proto.encode(4, this.chainId)); + } + + public static CanonicalVoteExtension decode(byte[] data) { + CanonicalVoteExtension obj = new CanonicalVoteExtension(); + int index = 0; + int order; + int length = data.length; + while (index < length) { + order = data[index] >> 3; + index++; + switch(order) { + case 1: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.extension = resp.res; + break; + } + case 2: { + Proto.DecodeResponse resp = Proto.decodeFixed64(data, index); + index = resp.index; + obj.height = resp.res; + break; + } + case 3: { + Proto.DecodeResponse resp = Proto.decodeFixed64(data, index); + index = resp.index; + obj.round = resp.res; + break; + } + case 4: { + Proto.DecodeResponse resp = Proto.decodeString(data, index); + index = resp.index; + obj.chainId = resp.res; + break; + } + } + } + return obj; + } +} diff --git a/contracts/javascore/lib/src/main/java/icon/proto/clients/tendermint/Commit.java b/contracts/javascore/proto-lib/src/main/java/tendermint/types/Commit.java similarity index 98% rename from contracts/javascore/lib/src/main/java/icon/proto/clients/tendermint/Commit.java rename to contracts/javascore/proto-lib/src/main/java/tendermint/types/Commit.java index 0a52c1d58..2eb510755 100644 --- a/contracts/javascore/lib/src/main/java/icon/proto/clients/tendermint/Commit.java +++ b/contracts/javascore/proto-lib/src/main/java/tendermint/types/Commit.java @@ -1,4 +1,4 @@ -package icon.proto.clients.tendermint; +package tendermint.types; import ibc.icon.score.util.ByteUtil; import ibc.icon.score.util.Proto; diff --git a/contracts/javascore/lib/src/main/java/icon/proto/clients/tendermint/CommitSig.java b/contracts/javascore/proto-lib/src/main/java/tendermint/types/CommitSig.java similarity index 91% rename from contracts/javascore/lib/src/main/java/icon/proto/clients/tendermint/CommitSig.java rename to contracts/javascore/proto-lib/src/main/java/tendermint/types/CommitSig.java index b55756288..caa49cbd4 100644 --- a/contracts/javascore/lib/src/main/java/icon/proto/clients/tendermint/CommitSig.java +++ b/contracts/javascore/proto-lib/src/main/java/tendermint/types/CommitSig.java @@ -1,5 +1,6 @@ -package icon.proto.clients.tendermint; +package tendermint.types; +import google.protobuf.Timestamp; import ibc.icon.score.util.ByteUtil; import ibc.icon.score.util.Proto; import ibc.icon.score.util.ProtoMessage; @@ -10,7 +11,7 @@ public class CommitSig extends ProtoMessage { private byte[] validatorAddress = new byte[0]; - private Timestamp timestamp = new Timestamp(); + private Timestamp timestamp = new google.protobuf.Timestamp(); private byte[] signature = new byte[0]; @@ -78,7 +79,7 @@ public static CommitSig decode(byte[] data) { case 3: { Proto.DecodeResponse resp = Proto.decodeBytes(data, index); index = resp.index; - obj.timestamp = Timestamp.decode(resp.res); + obj.timestamp = google.protobuf.Timestamp.decode(resp.res); break; } case 4: { diff --git a/contracts/javascore/proto-lib/src/main/java/tendermint/types/ConsensusParams.java b/contracts/javascore/proto-lib/src/main/java/tendermint/types/ConsensusParams.java new file mode 100644 index 000000000..7aaf3cc16 --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/tendermint/types/ConsensusParams.java @@ -0,0 +1,110 @@ +package tendermint.types; + +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ProtoMessage; + +public class ConsensusParams extends ProtoMessage { + private BlockParams block = new BlockParams(); + + private EvidenceParams evidence = new EvidenceParams(); + + private ValidatorParams validator = new ValidatorParams(); + + private VersionParams version = new VersionParams(); + + private ABCIParams abci = new ABCIParams(); + + public BlockParams getBlock() { + return this.block; + } + + public void setBlock(BlockParams block) { + this.block = block; + } + + public EvidenceParams getEvidence() { + return this.evidence; + } + + public void setEvidence(EvidenceParams evidence) { + this.evidence = evidence; + } + + public ValidatorParams getValidator() { + return this.validator; + } + + public void setValidator(ValidatorParams validator) { + this.validator = validator; + } + + public VersionParams getVersion() { + return this.version; + } + + public void setVersion(VersionParams version) { + this.version = version; + } + + public ABCIParams getAbci() { + return this.abci; + } + + public void setAbci(ABCIParams abci) { + this.abci = abci; + } + + public byte[] encode() { + return ByteUtil.join( + Proto.encode(1, this.block), + Proto.encode(2, this.evidence), + Proto.encode(3, this.validator), + Proto.encode(4, this.version), + Proto.encode(5, this.abci)); + } + + public static ConsensusParams decode(byte[] data) { + ConsensusParams obj = new ConsensusParams(); + int index = 0; + int order; + int length = data.length; + while (index < length) { + order = data[index] >> 3; + index++; + switch(order) { + case 1: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.block = BlockParams.decode(resp.res); + break; + } + case 2: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.evidence = EvidenceParams.decode(resp.res); + break; + } + case 3: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.validator = ValidatorParams.decode(resp.res); + break; + } + case 4: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.version = VersionParams.decode(resp.res); + break; + } + case 5: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.abci = ABCIParams.decode(resp.res); + break; + } + } + } + return obj; + } +} diff --git a/contracts/javascore/lib/src/main/java/icon/proto/clients/tendermint/MerkleRoot.java b/contracts/javascore/proto-lib/src/main/java/tendermint/types/Data.java similarity index 55% rename from contracts/javascore/lib/src/main/java/icon/proto/clients/tendermint/MerkleRoot.java rename to contracts/javascore/proto-lib/src/main/java/tendermint/types/Data.java index 562bf113e..99a42b9e1 100644 --- a/contracts/javascore/lib/src/main/java/icon/proto/clients/tendermint/MerkleRoot.java +++ b/contracts/javascore/proto-lib/src/main/java/tendermint/types/Data.java @@ -1,27 +1,29 @@ -package icon.proto.clients.tendermint; +package tendermint.types; import ibc.icon.score.util.ByteUtil; import ibc.icon.score.util.Proto; import ibc.icon.score.util.ProtoMessage; +import java.util.List; +import scorex.util.ArrayList; -public class MerkleRoot extends ProtoMessage { - private byte[] hash = new byte[0]; +public class Data extends ProtoMessage { + private List txs = new ArrayList<>(); - public byte[] getHash() { - return this.hash; + public List getTxs() { + return this.txs; } - public void setHash(byte[] hash) { - this.hash = hash; + public void setTxs(List txs) { + this.txs = txs; } public byte[] encode() { return ByteUtil.join( - Proto.encode(1, this.hash)); + Proto.encodeBytesArray(1, this.txs)); } - public static MerkleRoot decode(byte[] data) { - MerkleRoot obj = new MerkleRoot(); + public static Data decode(byte[] data) { + Data obj = new Data(); int index = 0; int order; int length = data.length; @@ -32,7 +34,7 @@ public static MerkleRoot decode(byte[] data) { case 1: { Proto.DecodeResponse resp = Proto.decodeBytes(data, index); index = resp.index; - obj.hash = resp.res; + obj.txs.add(resp.res); break; } } diff --git a/contracts/javascore/proto-lib/src/main/java/tendermint/types/DuplicateVoteEvidence.java b/contracts/javascore/proto-lib/src/main/java/tendermint/types/DuplicateVoteEvidence.java new file mode 100644 index 000000000..aa6573f66 --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/tendermint/types/DuplicateVoteEvidence.java @@ -0,0 +1,112 @@ +package tendermint.types; + +import google.protobuf.Timestamp; +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ProtoMessage; +import java.math.BigInteger; + +public class DuplicateVoteEvidence extends ProtoMessage { + private Vote voteA = new tendermint.types.Vote(); + + private Vote voteB = new tendermint.types.Vote(); + + private BigInteger totalVotingPower = BigInteger.ZERO; + + private BigInteger validatorPower = BigInteger.ZERO; + + private Timestamp timestamp = new google.protobuf.Timestamp(); + + public Vote getVoteA() { + return this.voteA; + } + + public void setVoteA(Vote voteA) { + this.voteA = voteA; + } + + public Vote getVoteB() { + return this.voteB; + } + + public void setVoteB(Vote voteB) { + this.voteB = voteB; + } + + public BigInteger getTotalVotingPower() { + return this.totalVotingPower; + } + + public void setTotalVotingPower(BigInteger totalVotingPower) { + this.totalVotingPower = totalVotingPower; + } + + public BigInteger getValidatorPower() { + return this.validatorPower; + } + + public void setValidatorPower(BigInteger validatorPower) { + this.validatorPower = validatorPower; + } + + public Timestamp getTimestamp() { + return this.timestamp; + } + + public void setTimestamp(Timestamp timestamp) { + this.timestamp = timestamp; + } + + public byte[] encode() { + return ByteUtil.join( + Proto.encode(1, this.voteA), + Proto.encode(2, this.voteB), + Proto.encode(3, this.totalVotingPower), + Proto.encode(4, this.validatorPower), + Proto.encode(5, this.timestamp)); + } + + public static DuplicateVoteEvidence decode(byte[] data) { + DuplicateVoteEvidence obj = new DuplicateVoteEvidence(); + int index = 0; + int order; + int length = data.length; + while (index < length) { + order = data[index] >> 3; + index++; + switch(order) { + case 1: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.voteA = tendermint.types.Vote.decode(resp.res); + break; + } + case 2: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.voteB = tendermint.types.Vote.decode(resp.res); + break; + } + case 3: { + Proto.DecodeResponse resp = Proto.decodeVarInt(data, index); + index = resp.index; + obj.totalVotingPower = resp.res; + break; + } + case 4: { + Proto.DecodeResponse resp = Proto.decodeVarInt(data, index); + index = resp.index; + obj.validatorPower = resp.res; + break; + } + case 5: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.timestamp = google.protobuf.Timestamp.decode(resp.res); + break; + } + } + } + return obj; + } +} diff --git a/contracts/javascore/proto-lib/src/main/java/tendermint/types/EventDataRoundState.java b/contracts/javascore/proto-lib/src/main/java/tendermint/types/EventDataRoundState.java new file mode 100644 index 000000000..74383d6c9 --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/tendermint/types/EventDataRoundState.java @@ -0,0 +1,78 @@ +package tendermint.types; + +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ProtoMessage; +import java.lang.String; +import java.math.BigInteger; + +public class EventDataRoundState extends ProtoMessage { + private BigInteger height = BigInteger.ZERO; + + private BigInteger round = BigInteger.ZERO; + + private String step = ""; + + public BigInteger getHeight() { + return this.height; + } + + public void setHeight(BigInteger height) { + this.height = height; + } + + public BigInteger getRound() { + return this.round; + } + + public void setRound(BigInteger round) { + this.round = round; + } + + public String getStep() { + return this.step; + } + + public void setStep(String step) { + this.step = step; + } + + public byte[] encode() { + return ByteUtil.join( + Proto.encode(1, this.height), + Proto.encode(2, this.round), + Proto.encode(3, this.step)); + } + + public static EventDataRoundState decode(byte[] data) { + EventDataRoundState obj = new EventDataRoundState(); + int index = 0; + int order; + int length = data.length; + while (index < length) { + order = data[index] >> 3; + index++; + switch(order) { + case 1: { + Proto.DecodeResponse resp = Proto.decodeVarInt(data, index); + index = resp.index; + obj.height = resp.res; + break; + } + case 2: { + Proto.DecodeResponse resp = Proto.decodeVarInt(data, index); + index = resp.index; + obj.round = resp.res; + break; + } + case 3: { + Proto.DecodeResponse resp = Proto.decodeString(data, index); + index = resp.index; + obj.step = resp.res; + break; + } + } + } + return obj; + } +} diff --git a/contracts/javascore/proto-lib/src/main/java/tendermint/types/Evidence.java b/contracts/javascore/proto-lib/src/main/java/tendermint/types/Evidence.java new file mode 100644 index 000000000..77207e347 --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/tendermint/types/Evidence.java @@ -0,0 +1,59 @@ +package tendermint.types; + +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ProtoMessage; + +public class Evidence extends ProtoMessage { + private DuplicateVoteEvidence duplicateVoteEvidence = new DuplicateVoteEvidence(); + + private LightClientAttackEvidence lightClientAttackEvidence = new LightClientAttackEvidence(); + + public DuplicateVoteEvidence getDuplicateVoteEvidence() { + return this.duplicateVoteEvidence; + } + + public void setDuplicateVoteEvidence(DuplicateVoteEvidence duplicateVoteEvidence) { + this.duplicateVoteEvidence = duplicateVoteEvidence; + } + + public LightClientAttackEvidence getLightClientAttackEvidence() { + return this.lightClientAttackEvidence; + } + + public void setLightClientAttackEvidence(LightClientAttackEvidence lightClientAttackEvidence) { + this.lightClientAttackEvidence = lightClientAttackEvidence; + } + + public byte[] encode() { + return ByteUtil.join( + Proto.encode(1, this.duplicateVoteEvidence), + Proto.encode(2, this.lightClientAttackEvidence)); + } + + public static Evidence decode(byte[] data) { + Evidence obj = new Evidence(); + int index = 0; + int order; + int length = data.length; + while (index < length) { + order = data[index] >> 3; + index++; + switch(order) { + case 1: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.duplicateVoteEvidence = DuplicateVoteEvidence.decode(resp.res); + break; + } + case 2: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.lightClientAttackEvidence = LightClientAttackEvidence.decode(resp.res); + break; + } + } + } + return obj; + } +} diff --git a/contracts/javascore/lib/src/main/java/icon/proto/core/commitment/MerklePrefix.java b/contracts/javascore/proto-lib/src/main/java/tendermint/types/EvidenceList.java similarity index 50% rename from contracts/javascore/lib/src/main/java/icon/proto/core/commitment/MerklePrefix.java rename to contracts/javascore/proto-lib/src/main/java/tendermint/types/EvidenceList.java index 13af209cb..5dc5a1798 100644 --- a/contracts/javascore/lib/src/main/java/icon/proto/core/commitment/MerklePrefix.java +++ b/contracts/javascore/proto-lib/src/main/java/tendermint/types/EvidenceList.java @@ -1,27 +1,29 @@ -package icon.proto.core.commitment; +package tendermint.types; import ibc.icon.score.util.ByteUtil; import ibc.icon.score.util.Proto; import ibc.icon.score.util.ProtoMessage; +import java.util.List; +import scorex.util.ArrayList; -public class MerklePrefix extends ProtoMessage { - private byte[] keyPrefix = new byte[0]; +public class EvidenceList extends ProtoMessage { + private List evidence = new ArrayList<>(); - public byte[] getKeyPrefix() { - return this.keyPrefix; + public List getEvidence() { + return this.evidence; } - public void setKeyPrefix(byte[] keyPrefix) { - this.keyPrefix = keyPrefix; + public void setEvidence(List evidence) { + this.evidence = evidence; } public byte[] encode() { return ByteUtil.join( - Proto.encode(1, this.keyPrefix)); + Proto.encodeMessageArray(1, this.evidence)); } - public static MerklePrefix decode(byte[] data) { - MerklePrefix obj = new MerklePrefix(); + public static EvidenceList decode(byte[] data) { + EvidenceList obj = new EvidenceList(); int index = 0; int order; int length = data.length; @@ -32,7 +34,7 @@ public static MerklePrefix decode(byte[] data) { case 1: { Proto.DecodeResponse resp = Proto.decodeBytes(data, index); index = resp.index; - obj.keyPrefix = resp.res; + obj.evidence.add(Evidence.decode(resp.res)); break; } } diff --git a/contracts/javascore/proto-lib/src/main/java/tendermint/types/EvidenceParams.java b/contracts/javascore/proto-lib/src/main/java/tendermint/types/EvidenceParams.java new file mode 100644 index 000000000..5048ecea0 --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/tendermint/types/EvidenceParams.java @@ -0,0 +1,78 @@ +package tendermint.types; + +import google.protobuf.Duration; +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ProtoMessage; +import java.math.BigInteger; + +public class EvidenceParams extends ProtoMessage { + private BigInteger maxAgeNumBlocks = BigInteger.ZERO; + + private Duration maxAgeDuration = new google.protobuf.Duration(); + + private BigInteger maxBytes = BigInteger.ZERO; + + public BigInteger getMaxAgeNumBlocks() { + return this.maxAgeNumBlocks; + } + + public void setMaxAgeNumBlocks(BigInteger maxAgeNumBlocks) { + this.maxAgeNumBlocks = maxAgeNumBlocks; + } + + public Duration getMaxAgeDuration() { + return this.maxAgeDuration; + } + + public void setMaxAgeDuration(Duration maxAgeDuration) { + this.maxAgeDuration = maxAgeDuration; + } + + public BigInteger getMaxBytes() { + return this.maxBytes; + } + + public void setMaxBytes(BigInteger maxBytes) { + this.maxBytes = maxBytes; + } + + public byte[] encode() { + return ByteUtil.join( + Proto.encode(1, this.maxAgeNumBlocks), + Proto.encode(2, this.maxAgeDuration), + Proto.encode(3, this.maxBytes)); + } + + public static EvidenceParams decode(byte[] data) { + EvidenceParams obj = new EvidenceParams(); + int index = 0; + int order; + int length = data.length; + while (index < length) { + order = data[index] >> 3; + index++; + switch(order) { + case 1: { + Proto.DecodeResponse resp = Proto.decodeVarInt(data, index); + index = resp.index; + obj.maxAgeNumBlocks = resp.res; + break; + } + case 2: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.maxAgeDuration = google.protobuf.Duration.decode(resp.res); + break; + } + case 3: { + Proto.DecodeResponse resp = Proto.decodeVarInt(data, index); + index = resp.index; + obj.maxBytes = resp.res; + break; + } + } + } + return obj; + } +} diff --git a/contracts/javascore/proto-lib/src/main/java/tendermint/types/ExtendedCommit.java b/contracts/javascore/proto-lib/src/main/java/tendermint/types/ExtendedCommit.java new file mode 100644 index 000000000..f7676988c --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/tendermint/types/ExtendedCommit.java @@ -0,0 +1,96 @@ +package tendermint.types; + +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ProtoMessage; +import java.math.BigInteger; +import java.util.List; +import scorex.util.ArrayList; + +public class ExtendedCommit extends ProtoMessage { + private BigInteger height = BigInteger.ZERO; + + private BigInteger round = BigInteger.ZERO; + + private BlockID blockId = new BlockID(); + + private List extendedSignatures = new ArrayList<>(); + + public BigInteger getHeight() { + return this.height; + } + + public void setHeight(BigInteger height) { + this.height = height; + } + + public BigInteger getRound() { + return this.round; + } + + public void setRound(BigInteger round) { + this.round = round; + } + + public BlockID getBlockId() { + return this.blockId; + } + + public void setBlockId(BlockID blockId) { + this.blockId = blockId; + } + + public List getExtendedSignatures() { + return this.extendedSignatures; + } + + public void setExtendedSignatures(List extendedSignatures) { + this.extendedSignatures = extendedSignatures; + } + + public byte[] encode() { + return ByteUtil.join( + Proto.encode(1, this.height), + Proto.encode(2, this.round), + Proto.encode(3, this.blockId), + Proto.encodeMessageArray(4, this.extendedSignatures)); + } + + public static ExtendedCommit decode(byte[] data) { + ExtendedCommit obj = new ExtendedCommit(); + int index = 0; + int order; + int length = data.length; + while (index < length) { + order = data[index] >> 3; + index++; + switch(order) { + case 1: { + Proto.DecodeResponse resp = Proto.decodeVarInt(data, index); + index = resp.index; + obj.height = resp.res; + break; + } + case 2: { + Proto.DecodeResponse resp = Proto.decodeVarInt(data, index); + index = resp.index; + obj.round = resp.res; + break; + } + case 3: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.blockId = BlockID.decode(resp.res); + break; + } + case 4: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.extendedSignatures.add(ExtendedCommitSig.decode(resp.res)); + break; + } + } + } + return obj; + } +} diff --git a/contracts/javascore/proto-lib/src/main/java/tendermint/types/ExtendedCommitSig.java b/contracts/javascore/proto-lib/src/main/java/tendermint/types/ExtendedCommitSig.java new file mode 100644 index 000000000..d5848ca54 --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/tendermint/types/ExtendedCommitSig.java @@ -0,0 +1,129 @@ +package tendermint.types; + +import google.protobuf.Timestamp; +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ProtoMessage; +import java.lang.Integer; + +public class ExtendedCommitSig extends ProtoMessage { + private int blockIdFlag = 0; + + private byte[] validatorAddress = new byte[0]; + + private Timestamp timestamp = new google.protobuf.Timestamp(); + + private byte[] signature = new byte[0]; + + private byte[] extension = new byte[0]; + + private byte[] extensionSignature = new byte[0]; + + public int getBlockIdFlag() { + return this.blockIdFlag; + } + + public void setBlockIdFlag(int blockIdFlag) { + this.blockIdFlag = blockIdFlag; + } + + public byte[] getValidatorAddress() { + return this.validatorAddress; + } + + public void setValidatorAddress(byte[] validatorAddress) { + this.validatorAddress = validatorAddress; + } + + public Timestamp getTimestamp() { + return this.timestamp; + } + + public void setTimestamp(Timestamp timestamp) { + this.timestamp = timestamp; + } + + public byte[] getSignature() { + return this.signature; + } + + public void setSignature(byte[] signature) { + this.signature = signature; + } + + public byte[] getExtension() { + return this.extension; + } + + public void setExtension(byte[] extension) { + this.extension = extension; + } + + public byte[] getExtensionSignature() { + return this.extensionSignature; + } + + public void setExtensionSignature(byte[] extensionSignature) { + this.extensionSignature = extensionSignature; + } + + public byte[] encode() { + return ByteUtil.join( + Proto.encode(1, this.blockIdFlag), + Proto.encode(2, this.validatorAddress), + Proto.encode(3, this.timestamp), + Proto.encode(4, this.signature), + Proto.encode(5, this.extension), + Proto.encode(6, this.extensionSignature)); + } + + public static ExtendedCommitSig decode(byte[] data) { + ExtendedCommitSig obj = new ExtendedCommitSig(); + int index = 0; + int order; + int length = data.length; + while (index < length) { + order = data[index] >> 3; + index++; + switch(order) { + case 1: { + Proto.DecodeResponse resp = Proto.decodeEnum(data, index); + index = resp.index; + obj.blockIdFlag = resp.res; + break; + } + case 2: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.validatorAddress = resp.res; + break; + } + case 3: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.timestamp = google.protobuf.Timestamp.decode(resp.res); + break; + } + case 4: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.signature = resp.res; + break; + } + case 5: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.extension = resp.res; + break; + } + case 6: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.extensionSignature = resp.res; + break; + } + } + } + return obj; + } +} diff --git a/contracts/javascore/proto-lib/src/main/java/tendermint/types/HashedParams.java b/contracts/javascore/proto-lib/src/main/java/tendermint/types/HashedParams.java new file mode 100644 index 000000000..32aeb16bb --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/tendermint/types/HashedParams.java @@ -0,0 +1,60 @@ +package tendermint.types; + +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ProtoMessage; +import java.math.BigInteger; + +public class HashedParams extends ProtoMessage { + private BigInteger blockMaxBytes = BigInteger.ZERO; + + private BigInteger blockMaxGas = BigInteger.ZERO; + + public BigInteger getBlockMaxBytes() { + return this.blockMaxBytes; + } + + public void setBlockMaxBytes(BigInteger blockMaxBytes) { + this.blockMaxBytes = blockMaxBytes; + } + + public BigInteger getBlockMaxGas() { + return this.blockMaxGas; + } + + public void setBlockMaxGas(BigInteger blockMaxGas) { + this.blockMaxGas = blockMaxGas; + } + + public byte[] encode() { + return ByteUtil.join( + Proto.encode(1, this.blockMaxBytes), + Proto.encode(2, this.blockMaxGas)); + } + + public static HashedParams decode(byte[] data) { + HashedParams obj = new HashedParams(); + int index = 0; + int order; + int length = data.length; + while (index < length) { + order = data[index] >> 3; + index++; + switch(order) { + case 1: { + Proto.DecodeResponse resp = Proto.decodeVarInt(data, index); + index = resp.index; + obj.blockMaxBytes = resp.res; + break; + } + case 2: { + Proto.DecodeResponse resp = Proto.decodeVarInt(data, index); + index = resp.index; + obj.blockMaxGas = resp.res; + break; + } + } + } + return obj; + } +} diff --git a/contracts/javascore/lib/src/main/java/icon/proto/clients/tendermint/LightHeader.java b/contracts/javascore/proto-lib/src/main/java/tendermint/types/Header.java similarity index 93% rename from contracts/javascore/lib/src/main/java/icon/proto/clients/tendermint/LightHeader.java rename to contracts/javascore/proto-lib/src/main/java/tendermint/types/Header.java index 5dbae16e9..7f4973998 100644 --- a/contracts/javascore/lib/src/main/java/icon/proto/clients/tendermint/LightHeader.java +++ b/contracts/javascore/proto-lib/src/main/java/tendermint/types/Header.java @@ -1,19 +1,21 @@ -package icon.proto.clients.tendermint; +package tendermint.types; +import google.protobuf.Timestamp; import ibc.icon.score.util.ByteUtil; import ibc.icon.score.util.Proto; import ibc.icon.score.util.ProtoMessage; import java.lang.String; import java.math.BigInteger; +import tendermint.version.Consensus; -public class LightHeader extends ProtoMessage { - private Consensus version = new Consensus(); +public class Header extends ProtoMessage { + private Consensus version = new tendermint.version.Consensus(); private String chainId = ""; private BigInteger height = BigInteger.ZERO; - private Timestamp time = new Timestamp(); + private Timestamp time = new google.protobuf.Timestamp(); private BlockID lastBlockId = new BlockID(); @@ -165,8 +167,8 @@ public byte[] encode() { Proto.encode(14, this.proposerAddress)); } - public static LightHeader decode(byte[] data) { - LightHeader obj = new LightHeader(); + public static Header decode(byte[] data) { + Header obj = new Header(); int index = 0; int order; int length = data.length; @@ -177,7 +179,7 @@ public static LightHeader decode(byte[] data) { case 1: { Proto.DecodeResponse resp = Proto.decodeBytes(data, index); index = resp.index; - obj.version = Consensus.decode(resp.res); + obj.version = tendermint.version.Consensus.decode(resp.res); break; } case 2: { @@ -195,7 +197,7 @@ public static LightHeader decode(byte[] data) { case 4: { Proto.DecodeResponse resp = Proto.decodeBytes(data, index); index = resp.index; - obj.time = Timestamp.decode(resp.res); + obj.time = google.protobuf.Timestamp.decode(resp.res); break; } case 5: { diff --git a/contracts/javascore/proto-lib/src/main/java/tendermint/types/LightBlock.java b/contracts/javascore/proto-lib/src/main/java/tendermint/types/LightBlock.java new file mode 100644 index 000000000..1f50317b7 --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/tendermint/types/LightBlock.java @@ -0,0 +1,59 @@ +package tendermint.types; + +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ProtoMessage; + +public class LightBlock extends ProtoMessage { + private SignedHeader signedHeader = new SignedHeader(); + + private ValidatorSet validatorSet = new tendermint.types.ValidatorSet(); + + public SignedHeader getSignedHeader() { + return this.signedHeader; + } + + public void setSignedHeader(SignedHeader signedHeader) { + this.signedHeader = signedHeader; + } + + public ValidatorSet getValidatorSet() { + return this.validatorSet; + } + + public void setValidatorSet(ValidatorSet validatorSet) { + this.validatorSet = validatorSet; + } + + public byte[] encode() { + return ByteUtil.join( + Proto.encode(1, this.signedHeader), + Proto.encode(2, this.validatorSet)); + } + + public static LightBlock decode(byte[] data) { + LightBlock obj = new LightBlock(); + int index = 0; + int order; + int length = data.length; + while (index < length) { + order = data[index] >> 3; + index++; + switch(order) { + case 1: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.signedHeader = SignedHeader.decode(resp.res); + break; + } + case 2: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.validatorSet = tendermint.types.ValidatorSet.decode(resp.res); + break; + } + } + } + return obj; + } +} diff --git a/contracts/javascore/proto-lib/src/main/java/tendermint/types/LightClientAttackEvidence.java b/contracts/javascore/proto-lib/src/main/java/tendermint/types/LightClientAttackEvidence.java new file mode 100644 index 000000000..91c7adb97 --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/tendermint/types/LightClientAttackEvidence.java @@ -0,0 +1,114 @@ +package tendermint.types; + +import google.protobuf.Timestamp; +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ProtoMessage; +import java.math.BigInteger; +import java.util.List; +import scorex.util.ArrayList; + +public class LightClientAttackEvidence extends ProtoMessage { + private LightBlock conflictingBlock = new tendermint.types.LightBlock(); + + private BigInteger commonHeight = BigInteger.ZERO; + + private List byzantineValidators = new ArrayList<>(); + + private BigInteger totalVotingPower = BigInteger.ZERO; + + private Timestamp timestamp = new google.protobuf.Timestamp(); + + public LightBlock getConflictingBlock() { + return this.conflictingBlock; + } + + public void setConflictingBlock(LightBlock conflictingBlock) { + this.conflictingBlock = conflictingBlock; + } + + public BigInteger getCommonHeight() { + return this.commonHeight; + } + + public void setCommonHeight(BigInteger commonHeight) { + this.commonHeight = commonHeight; + } + + public List getByzantineValidators() { + return this.byzantineValidators; + } + + public void setByzantineValidators(List byzantineValidators) { + this.byzantineValidators = byzantineValidators; + } + + public BigInteger getTotalVotingPower() { + return this.totalVotingPower; + } + + public void setTotalVotingPower(BigInteger totalVotingPower) { + this.totalVotingPower = totalVotingPower; + } + + public Timestamp getTimestamp() { + return this.timestamp; + } + + public void setTimestamp(Timestamp timestamp) { + this.timestamp = timestamp; + } + + public byte[] encode() { + return ByteUtil.join( + Proto.encode(1, this.conflictingBlock), + Proto.encode(2, this.commonHeight), + Proto.encodeMessageArray(3, this.byzantineValidators), + Proto.encode(4, this.totalVotingPower), + Proto.encode(5, this.timestamp)); + } + + public static LightClientAttackEvidence decode(byte[] data) { + LightClientAttackEvidence obj = new LightClientAttackEvidence(); + int index = 0; + int order; + int length = data.length; + while (index < length) { + order = data[index] >> 3; + index++; + switch(order) { + case 1: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.conflictingBlock = tendermint.types.LightBlock.decode(resp.res); + break; + } + case 2: { + Proto.DecodeResponse resp = Proto.decodeVarInt(data, index); + index = resp.index; + obj.commonHeight = resp.res; + break; + } + case 3: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.byzantineValidators.add(tendermint.types.Validator.decode(resp.res)); + break; + } + case 4: { + Proto.DecodeResponse resp = Proto.decodeVarInt(data, index); + index = resp.index; + obj.totalVotingPower = resp.res; + break; + } + case 5: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.timestamp = google.protobuf.Timestamp.decode(resp.res); + break; + } + } + } + return obj; + } +} diff --git a/contracts/javascore/proto-lib/src/main/java/tendermint/types/Part.java b/contracts/javascore/proto-lib/src/main/java/tendermint/types/Part.java new file mode 100644 index 000000000..861ec4515 --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/tendermint/types/Part.java @@ -0,0 +1,78 @@ +package tendermint.types; + +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ProtoMessage; +import java.math.BigInteger; +import tendermint.crypto.Proof; + +public class Part extends ProtoMessage { + private BigInteger index = BigInteger.ZERO; + + private byte[] bytes = new byte[0]; + + private Proof proof = new tendermint.crypto.Proof(); + + public BigInteger getIndex() { + return this.index; + } + + public void setIndex(BigInteger index) { + this.index = index; + } + + public byte[] getBytes() { + return this.bytes; + } + + public void setBytes(byte[] bytes) { + this.bytes = bytes; + } + + public Proof getProof() { + return this.proof; + } + + public void setProof(Proof proof) { + this.proof = proof; + } + + public byte[] encode() { + return ByteUtil.join( + Proto.encode(1, this.index), + Proto.encode(2, this.bytes), + Proto.encode(3, this.proof)); + } + + public static Part decode(byte[] data) { + Part obj = new Part(); + int index = 0; + int order; + int length = data.length; + while (index < length) { + order = data[index] >> 3; + index++; + switch(order) { + case 1: { + Proto.DecodeResponse resp = Proto.decodeVarInt(data, index); + index = resp.index; + obj.index = resp.res; + break; + } + case 2: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.bytes = resp.res; + break; + } + case 3: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.proof = tendermint.crypto.Proof.decode(resp.res); + break; + } + } + } + return obj; + } +} diff --git a/contracts/javascore/lib/src/main/java/icon/proto/clients/tendermint/PartSetHeader.java b/contracts/javascore/proto-lib/src/main/java/tendermint/types/PartSetHeader.java similarity index 97% rename from contracts/javascore/lib/src/main/java/icon/proto/clients/tendermint/PartSetHeader.java rename to contracts/javascore/proto-lib/src/main/java/tendermint/types/PartSetHeader.java index 919b02c28..5a4da6a91 100644 --- a/contracts/javascore/lib/src/main/java/icon/proto/clients/tendermint/PartSetHeader.java +++ b/contracts/javascore/proto-lib/src/main/java/tendermint/types/PartSetHeader.java @@ -1,4 +1,4 @@ -package icon.proto.clients.tendermint; +package tendermint.types; import ibc.icon.score.util.ByteUtil; import ibc.icon.score.util.Proto; diff --git a/contracts/javascore/proto-lib/src/main/java/tendermint/types/Proposal.java b/contracts/javascore/proto-lib/src/main/java/tendermint/types/Proposal.java new file mode 100644 index 000000000..76829fbf9 --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/tendermint/types/Proposal.java @@ -0,0 +1,147 @@ +package tendermint.types; + +import google.protobuf.Timestamp; +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ProtoMessage; +import java.lang.Integer; +import java.math.BigInteger; + +public class Proposal extends ProtoMessage { + private int type = 0; + + private BigInteger height = BigInteger.ZERO; + + private BigInteger round = BigInteger.ZERO; + + private BigInteger polRound = BigInteger.ZERO; + + private BlockID blockId = new BlockID(); + + private Timestamp timestamp = new google.protobuf.Timestamp(); + + private byte[] signature = new byte[0]; + + public int getType() { + return this.type; + } + + public void setType(int type) { + this.type = type; + } + + public BigInteger getHeight() { + return this.height; + } + + public void setHeight(BigInteger height) { + this.height = height; + } + + public BigInteger getRound() { + return this.round; + } + + public void setRound(BigInteger round) { + this.round = round; + } + + public BigInteger getPolRound() { + return this.polRound; + } + + public void setPolRound(BigInteger polRound) { + this.polRound = polRound; + } + + public BlockID getBlockId() { + return this.blockId; + } + + public void setBlockId(BlockID blockId) { + this.blockId = blockId; + } + + public Timestamp getTimestamp() { + return this.timestamp; + } + + public void setTimestamp(Timestamp timestamp) { + this.timestamp = timestamp; + } + + public byte[] getSignature() { + return this.signature; + } + + public void setSignature(byte[] signature) { + this.signature = signature; + } + + public byte[] encode() { + return ByteUtil.join( + Proto.encode(1, this.type), + Proto.encode(2, this.height), + Proto.encode(3, this.round), + Proto.encode(4, this.polRound), + Proto.encode(5, this.blockId), + Proto.encode(6, this.timestamp), + Proto.encode(7, this.signature)); + } + + public static Proposal decode(byte[] data) { + Proposal obj = new Proposal(); + int index = 0; + int order; + int length = data.length; + while (index < length) { + order = data[index] >> 3; + index++; + switch(order) { + case 1: { + Proto.DecodeResponse resp = Proto.decodeEnum(data, index); + index = resp.index; + obj.type = resp.res; + break; + } + case 2: { + Proto.DecodeResponse resp = Proto.decodeVarInt(data, index); + index = resp.index; + obj.height = resp.res; + break; + } + case 3: { + Proto.DecodeResponse resp = Proto.decodeVarInt(data, index); + index = resp.index; + obj.round = resp.res; + break; + } + case 4: { + Proto.DecodeResponse resp = Proto.decodeVarInt(data, index); + index = resp.index; + obj.polRound = resp.res; + break; + } + case 5: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.blockId = BlockID.decode(resp.res); + break; + } + case 6: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.timestamp = google.protobuf.Timestamp.decode(resp.res); + break; + } + case 7: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.signature = resp.res; + break; + } + } + } + return obj; + } +} diff --git a/contracts/javascore/lib/src/main/java/icon/proto/clients/tendermint/SignedHeader.java b/contracts/javascore/proto-lib/src/main/java/tendermint/types/SignedHeader.java similarity index 84% rename from contracts/javascore/lib/src/main/java/icon/proto/clients/tendermint/SignedHeader.java rename to contracts/javascore/proto-lib/src/main/java/tendermint/types/SignedHeader.java index b3ef2c33a..7f99bafb3 100644 --- a/contracts/javascore/lib/src/main/java/icon/proto/clients/tendermint/SignedHeader.java +++ b/contracts/javascore/proto-lib/src/main/java/tendermint/types/SignedHeader.java @@ -1,19 +1,19 @@ -package icon.proto.clients.tendermint; +package tendermint.types; import ibc.icon.score.util.ByteUtil; import ibc.icon.score.util.Proto; import ibc.icon.score.util.ProtoMessage; public class SignedHeader extends ProtoMessage { - private LightHeader header = new LightHeader(); + private Header header = new Header(); private Commit commit = new Commit(); - public LightHeader getHeader() { + public Header getHeader() { return this.header; } - public void setHeader(LightHeader header) { + public void setHeader(Header header) { this.header = header; } @@ -43,7 +43,7 @@ public static SignedHeader decode(byte[] data) { case 1: { Proto.DecodeResponse resp = Proto.decodeBytes(data, index); index = resp.index; - obj.header = LightHeader.decode(resp.res); + obj.header = Header.decode(resp.res); break; } case 2: { diff --git a/contracts/javascore/lib/src/main/java/icon/proto/icon/types/v1/SignedMsgType.java b/contracts/javascore/proto-lib/src/main/java/tendermint/types/SignedMsgType.java similarity index 88% rename from contracts/javascore/lib/src/main/java/icon/proto/icon/types/v1/SignedMsgType.java rename to contracts/javascore/proto-lib/src/main/java/tendermint/types/SignedMsgType.java index 252482627..0681c8d8b 100644 --- a/contracts/javascore/lib/src/main/java/icon/proto/icon/types/v1/SignedMsgType.java +++ b/contracts/javascore/proto-lib/src/main/java/tendermint/types/SignedMsgType.java @@ -1,4 +1,4 @@ -package icon.proto.icon.types.v1; +package tendermint.types; public class SignedMsgType { public static final int SIGNED_MSG_TYPE_UNKNOWN = 0; diff --git a/contracts/javascore/lib/src/main/java/icon/proto/clients/tendermint/SimpleValidator.java b/contracts/javascore/proto-lib/src/main/java/tendermint/types/SimpleValidator.java similarity index 87% rename from contracts/javascore/lib/src/main/java/icon/proto/clients/tendermint/SimpleValidator.java rename to contracts/javascore/proto-lib/src/main/java/tendermint/types/SimpleValidator.java index d832d5e02..3b3ace0fb 100644 --- a/contracts/javascore/lib/src/main/java/icon/proto/clients/tendermint/SimpleValidator.java +++ b/contracts/javascore/proto-lib/src/main/java/tendermint/types/SimpleValidator.java @@ -1,12 +1,13 @@ -package icon.proto.clients.tendermint; +package tendermint.types; import ibc.icon.score.util.ByteUtil; import ibc.icon.score.util.Proto; import ibc.icon.score.util.ProtoMessage; import java.math.BigInteger; +import tendermint.crypto.PublicKey; public class SimpleValidator extends ProtoMessage { - private PublicKey pubKey = new PublicKey(); + private PublicKey pubKey = new tendermint.crypto.PublicKey(); private BigInteger votingPower = BigInteger.ZERO; @@ -44,7 +45,7 @@ public static SimpleValidator decode(byte[] data) { case 1: { Proto.DecodeResponse resp = Proto.decodeBytes(data, index); index = resp.index; - obj.pubKey = PublicKey.decode(resp.res); + obj.pubKey = tendermint.crypto.PublicKey.decode(resp.res); break; } case 2: { diff --git a/contracts/javascore/proto-lib/src/main/java/tendermint/types/TxProof.java b/contracts/javascore/proto-lib/src/main/java/tendermint/types/TxProof.java new file mode 100644 index 000000000..49f66c343 --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/tendermint/types/TxProof.java @@ -0,0 +1,77 @@ +package tendermint.types; + +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ProtoMessage; +import tendermint.crypto.Proof; + +public class TxProof extends ProtoMessage { + private byte[] rootHash = new byte[0]; + + private byte[] data = new byte[0]; + + private Proof proof = new tendermint.crypto.Proof(); + + public byte[] getRootHash() { + return this.rootHash; + } + + public void setRootHash(byte[] rootHash) { + this.rootHash = rootHash; + } + + public byte[] getData() { + return this.data; + } + + public void setData(byte[] data) { + this.data = data; + } + + public Proof getProof() { + return this.proof; + } + + public void setProof(Proof proof) { + this.proof = proof; + } + + public byte[] encode() { + return ByteUtil.join( + Proto.encode(1, this.rootHash), + Proto.encode(2, this.data), + Proto.encode(3, this.proof)); + } + + public static TxProof decode(byte[] data) { + TxProof obj = new TxProof(); + int index = 0; + int order; + int length = data.length; + while (index < length) { + order = data[index] >> 3; + index++; + switch(order) { + case 1: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.rootHash = resp.res; + break; + } + case 2: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.data = resp.res; + break; + } + case 3: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.proof = tendermint.crypto.Proof.decode(resp.res); + break; + } + } + } + return obj; + } +} diff --git a/contracts/javascore/lib/src/main/java/icon/proto/clients/tendermint/Validator.java b/contracts/javascore/proto-lib/src/main/java/tendermint/types/Validator.java similarity index 91% rename from contracts/javascore/lib/src/main/java/icon/proto/clients/tendermint/Validator.java rename to contracts/javascore/proto-lib/src/main/java/tendermint/types/Validator.java index 8524099ae..26a7e1164 100644 --- a/contracts/javascore/lib/src/main/java/icon/proto/clients/tendermint/Validator.java +++ b/contracts/javascore/proto-lib/src/main/java/tendermint/types/Validator.java @@ -1,14 +1,15 @@ -package icon.proto.clients.tendermint; +package tendermint.types; import ibc.icon.score.util.ByteUtil; import ibc.icon.score.util.Proto; import ibc.icon.score.util.ProtoMessage; import java.math.BigInteger; +import tendermint.crypto.PublicKey; public class Validator extends ProtoMessage { private byte[] address = new byte[0]; - private PublicKey pubKey = new PublicKey(); + private PublicKey pubKey = new tendermint.crypto.PublicKey(); private BigInteger votingPower = BigInteger.ZERO; @@ -72,7 +73,7 @@ public static Validator decode(byte[] data) { case 2: { Proto.DecodeResponse resp = Proto.decodeBytes(data, index); index = resp.index; - obj.pubKey = PublicKey.decode(resp.res); + obj.pubKey = tendermint.crypto.PublicKey.decode(resp.res); break; } case 3: { diff --git a/contracts/javascore/proto-lib/src/main/java/tendermint/types/ValidatorParams.java b/contracts/javascore/proto-lib/src/main/java/tendermint/types/ValidatorParams.java new file mode 100644 index 000000000..c14421991 --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/tendermint/types/ValidatorParams.java @@ -0,0 +1,45 @@ +package tendermint.types; + +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ProtoMessage; +import java.lang.String; +import java.util.List; +import scorex.util.ArrayList; + +public class ValidatorParams extends ProtoMessage { + private List pubKeyTypes = new ArrayList<>(); + + public List getPubKeyTypes() { + return this.pubKeyTypes; + } + + public void setPubKeyTypes(List pubKeyTypes) { + this.pubKeyTypes = pubKeyTypes; + } + + public byte[] encode() { + return ByteUtil.join( + Proto.encodeStringArray(1, this.pubKeyTypes)); + } + + public static ValidatorParams decode(byte[] data) { + ValidatorParams obj = new ValidatorParams(); + int index = 0; + int order; + int length = data.length; + while (index < length) { + order = data[index] >> 3; + index++; + switch(order) { + case 1: { + Proto.DecodeResponse resp = Proto.decodeString(data, index); + index = resp.index; + obj.pubKeyTypes.add(resp.res); + break; + } + } + } + return obj; + } +} diff --git a/contracts/javascore/lib/src/main/java/icon/proto/clients/tendermint/ValidatorSet.java b/contracts/javascore/proto-lib/src/main/java/tendermint/types/ValidatorSet.java similarity index 98% rename from contracts/javascore/lib/src/main/java/icon/proto/clients/tendermint/ValidatorSet.java rename to contracts/javascore/proto-lib/src/main/java/tendermint/types/ValidatorSet.java index 323e57cda..0ddbb09a4 100644 --- a/contracts/javascore/lib/src/main/java/icon/proto/clients/tendermint/ValidatorSet.java +++ b/contracts/javascore/proto-lib/src/main/java/tendermint/types/ValidatorSet.java @@ -1,4 +1,4 @@ -package icon.proto.clients.tendermint; +package tendermint.types; import ibc.icon.score.util.ByteUtil; import ibc.icon.score.util.Proto; diff --git a/contracts/javascore/proto-lib/src/main/java/tendermint/types/VersionParams.java b/contracts/javascore/proto-lib/src/main/java/tendermint/types/VersionParams.java new file mode 100644 index 000000000..a35a0fc1b --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/tendermint/types/VersionParams.java @@ -0,0 +1,43 @@ +package tendermint.types; + +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ProtoMessage; +import java.math.BigInteger; + +public class VersionParams extends ProtoMessage { + private BigInteger app = BigInteger.ZERO; + + public BigInteger getApp() { + return this.app; + } + + public void setApp(BigInteger app) { + this.app = app; + } + + public byte[] encode() { + return ByteUtil.join( + Proto.encode(1, this.app)); + } + + public static VersionParams decode(byte[] data) { + VersionParams obj = new VersionParams(); + int index = 0; + int order; + int length = data.length; + while (index < length) { + order = data[index] >> 3; + index++; + switch(order) { + case 1: { + Proto.DecodeResponse resp = Proto.decodeVarInt(data, index); + index = resp.index; + obj.app = resp.res; + break; + } + } + } + return obj; + } +} diff --git a/contracts/javascore/lib/src/main/java/icon/proto/clients/tendermint/Vote.java b/contracts/javascore/proto-lib/src/main/java/tendermint/types/Vote.java similarity index 76% rename from contracts/javascore/lib/src/main/java/icon/proto/clients/tendermint/Vote.java rename to contracts/javascore/proto-lib/src/main/java/tendermint/types/Vote.java index 5894f89f2..10f48370d 100644 --- a/contracts/javascore/lib/src/main/java/icon/proto/clients/tendermint/Vote.java +++ b/contracts/javascore/proto-lib/src/main/java/tendermint/types/Vote.java @@ -1,5 +1,6 @@ -package icon.proto.clients.tendermint; +package tendermint.types; +import google.protobuf.Timestamp; import ibc.icon.score.util.ByteUtil; import ibc.icon.score.util.Proto; import ibc.icon.score.util.ProtoMessage; @@ -15,7 +16,7 @@ public class Vote extends ProtoMessage { private BlockID blockId = new BlockID(); - private Timestamp timestamp = new Timestamp(); + private Timestamp timestamp = new google.protobuf.Timestamp(); private byte[] validatorAddress = new byte[0]; @@ -23,6 +24,10 @@ public class Vote extends ProtoMessage { private byte[] signature = new byte[0]; + private byte[] extension = new byte[0]; + + private byte[] extensionSignature = new byte[0]; + public int getType() { return this.type; } @@ -87,6 +92,22 @@ public void setSignature(byte[] signature) { this.signature = signature; } + public byte[] getExtension() { + return this.extension; + } + + public void setExtension(byte[] extension) { + this.extension = extension; + } + + public byte[] getExtensionSignature() { + return this.extensionSignature; + } + + public void setExtensionSignature(byte[] extensionSignature) { + this.extensionSignature = extensionSignature; + } + public byte[] encode() { return ByteUtil.join( Proto.encode(1, this.type), @@ -96,7 +117,9 @@ public byte[] encode() { Proto.encode(5, this.timestamp), Proto.encode(6, this.validatorAddress), Proto.encode(7, this.validatorIndex), - Proto.encode(8, this.signature)); + Proto.encode(8, this.signature), + Proto.encode(9, this.extension), + Proto.encode(10, this.extensionSignature)); } public static Vote decode(byte[] data) { @@ -135,7 +158,7 @@ public static Vote decode(byte[] data) { case 5: { Proto.DecodeResponse resp = Proto.decodeBytes(data, index); index = resp.index; - obj.timestamp = Timestamp.decode(resp.res); + obj.timestamp = google.protobuf.Timestamp.decode(resp.res); break; } case 6: { @@ -156,6 +179,18 @@ public static Vote decode(byte[] data) { obj.signature = resp.res; break; } + case 9: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.extension = resp.res; + break; + } + case 10: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.extensionSignature = resp.res; + break; + } } } return obj; diff --git a/contracts/javascore/proto-lib/src/main/java/tendermint/version/App.java b/contracts/javascore/proto-lib/src/main/java/tendermint/version/App.java new file mode 100644 index 000000000..306cd3d2b --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/tendermint/version/App.java @@ -0,0 +1,61 @@ +package tendermint.version; + +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ProtoMessage; +import java.lang.String; +import java.math.BigInteger; + +public class App extends ProtoMessage { + private BigInteger protocol = BigInteger.ZERO; + + private String software = ""; + + public BigInteger getProtocol() { + return this.protocol; + } + + public void setProtocol(BigInteger protocol) { + this.protocol = protocol; + } + + public String getSoftware() { + return this.software; + } + + public void setSoftware(String software) { + this.software = software; + } + + public byte[] encode() { + return ByteUtil.join( + Proto.encode(1, this.protocol), + Proto.encode(2, this.software)); + } + + public static App decode(byte[] data) { + App obj = new App(); + int index = 0; + int order; + int length = data.length; + while (index < length) { + order = data[index] >> 3; + index++; + switch(order) { + case 1: { + Proto.DecodeResponse resp = Proto.decodeVarInt(data, index); + index = resp.index; + obj.protocol = resp.res; + break; + } + case 2: { + Proto.DecodeResponse resp = Proto.decodeString(data, index); + index = resp.index; + obj.software = resp.res; + break; + } + } + } + return obj; + } +} diff --git a/contracts/javascore/lib/src/main/java/icon/proto/clients/tendermint/Consensus.java b/contracts/javascore/proto-lib/src/main/java/tendermint/version/Consensus.java similarity index 97% rename from contracts/javascore/lib/src/main/java/icon/proto/clients/tendermint/Consensus.java rename to contracts/javascore/proto-lib/src/main/java/tendermint/version/Consensus.java index 86a7bc394..b870afb24 100644 --- a/contracts/javascore/lib/src/main/java/icon/proto/clients/tendermint/Consensus.java +++ b/contracts/javascore/proto-lib/src/main/java/tendermint/version/Consensus.java @@ -1,4 +1,4 @@ -package icon.proto.clients.tendermint; +package tendermint.version; import ibc.icon.score.util.ByteUtil; import ibc.icon.score.util.Proto; diff --git a/contracts/javascore/proto-util/src/main/java/icon/score/proto/ProtoGen.java b/contracts/javascore/proto-util/src/main/java/icon/score/proto/ProtoGen.java index 81fe7acaa..f02e15f54 100644 --- a/contracts/javascore/proto-util/src/main/java/icon/score/proto/ProtoGen.java +++ b/contracts/javascore/proto-util/src/main/java/icon/score/proto/ProtoGen.java @@ -35,11 +35,7 @@ import org.apache.commons.io.FileUtils; public class ProtoGen { - - private static final String basePackage = "icon.proto"; - - public static void main(String[] args) { - try { + public static void main(String[] args) throws Exception { String path = "../../../proto"; final Injector injector = Guice.createInjector(new ParserModule()); @@ -52,41 +48,57 @@ public static void main(String[] args) { Iterator it = FileUtils.iterateFiles(new File(path), new String[]{"proto"}, true); + while (it.hasNext()) { File file = it.next(); String filePath = file.getPath().replace(path + "/", ""); - final ProtoContext protoContext = importer.importFile(fileReader, filePath); - final Proto proto = protoContext.getProto(); - - String targetPath = "build/generated/sources"; - String relativePath = filePath.replace("/" + file.getName(), ""); - String targetPackage = basePackage + "." + relativePath.replace("/", "."); - targetPackage = targetPackage.replaceAll("[0-9]+-", ""); + if (!( + filePath.startsWith("ibc/lightclients/tendermint") || + filePath.startsWith("tendermint/types") || + filePath.startsWith("core") + )) { + continue; + } + try { + final ProtoContext protoContext = importer.importFile(fileReader, filePath); + generate(protoContext); + } catch (Exception e) { + System.out.println("Failed to generate proto: " + e); + } - final List enums = proto.getEnums(); - for (io.protostuff.compiler.model.Enum _enum : enums) { - JavaFile javaFile = JavaFile.builder(targetPackage, createEnum(_enum).build()) - .build(); + } + } - javaFile.writeTo(new File(targetPath)); - } + private static void generate(ProtoContext protoContext ) { + try { - final List messages = proto.getMessages(); - for (Message message : messages) { + final Proto proto = protoContext.getProto(); + for (ProtoContext ctx : protoContext.getImports()) { + generate(ctx); + } + String targetPath = "build/generated/sources"; + System.out.println(proto.getPackage().toString()); + System.out.println(proto.getCanonicalName()); + final List enums = proto.getEnums(); + for (io.protostuff.compiler.model.Enum _enum : enums) { + JavaFile javaFile = JavaFile.builder(proto.getPackage().toString(), createEnum(_enum).build()) + .build(); + + javaFile.writeTo(new File(targetPath)); + } - JavaFile javaFile = JavaFile.builder(targetPackage, createMessage(message).build()) - .build(); + final List messages = proto.getMessages(); + for (Message message : messages) { - javaFile.writeTo(new File(targetPath)); + JavaFile javaFile = JavaFile.builder(proto.getPackage().toString(), createMessage(message).build()) + .build(); - } + javaFile.writeTo(new File(targetPath)); } - } catch (Exception e) { System.out.println("Failed to generate proto: " + e); } } - private static TypeSpec.Builder createEnum(io.protostuff.compiler.model.Enum protoEnum) { TypeSpec.Builder enumSpec = TypeSpec.classBuilder(protoEnum.getName()) .addModifiers(Modifier.PUBLIC); @@ -253,6 +265,7 @@ private static FieldSpec generateFieldSpec(Field field) { } switch (field.getTypeName()) { + case "int": case "int32": case "int64": case "uint32": @@ -285,6 +298,7 @@ private static String getDecoder(Field field) { } switch (field.getTypeName()) { + case "int": case "int32": case "int64": case "uint32": @@ -319,6 +333,7 @@ private static String getEncoder(Field field) { } switch (field.getTypeName()) { + case "int": case "int32": case "int64": case "uint32": @@ -349,12 +364,14 @@ private static String getArrayEncoder(Field field) { } switch (field.getTypeName()) { + case "int": case "int32": case "int64": case "uint32": case "uint64": case "sint32": case "sint64": + case "ScalarType": return "encodeVarIntArray"; case "fixed32": case "sfixed32": @@ -375,14 +392,16 @@ private static String getArrayEncoder(Field field) { private static TypeName getTypeName(Field field) { if (field.getType().isMessage()) { + return ClassName.bestGuess(field.getTypeName()); } - if (field.getType().isEnum()) { + if (field.getType().isEnum() && !field.isRepeated()) { return TypeName.INT; } switch (field.getTypeName()) { + case "int": case "int32": case "int64": case "uint32": @@ -393,6 +412,7 @@ private static TypeName getTypeName(Field field) { case "fixed64": case "sfixed32": case "sfixed64": + case "ScalarType": return ClassName.get(BigInteger.class); case "bool": return TypeName.BOOLEAN; @@ -415,6 +435,7 @@ private static TypeName getDecoderResponseType(Field field) { } switch (field.getTypeName()) { + case "int": case "int32": case "int64": case "uint32": diff --git a/contracts/javascore/score-util/src/main/java/ibc/icon/score/util/Proto.java b/contracts/javascore/score-util/src/main/java/ibc/icon/score/util/Proto.java index 6d3014796..b1d0a96d4 100644 --- a/contracts/javascore/score-util/src/main/java/ibc/icon/score/util/Proto.java +++ b/contracts/javascore/score-util/src/main/java/ibc/icon/score/util/Proto.java @@ -179,7 +179,7 @@ public static byte[] encodeVarIntArray(int order, List items) { encodedItems[0] = new byte[]{(byte) (order << 3 | 2)}; int size = 0; for (int i = 0; i < length; i++) { - byte[] val = encodeVarInt(items.get(i)); + byte[] val = encodeVarIntRaw(items.get(i)); encodedItems[i + 2] = val; size = size + val.length; } @@ -188,6 +188,28 @@ public static byte[] encodeVarIntArray(int order, List items) { return ByteUtil.join(encodedItems); } + public static byte[] encodeVarIntRaw(BigInteger item) { + + int size = estimateVarIntSize(item); + + byte[] res = new byte[size]; + int index = 0; + long value = item.longValue(); + + while (true) { + if ((value & ~0x7FL) == 0) { + res[index] = (byte) value; + break; + } else { + res[index] = (byte) (((int) value & 0x7F) | 0x80); + value >>>= 7; + index++; + } + } + return res; + } + + public static DecodeResponse> decodeVarIntArray(byte[] data, int index) { DecodeResponse> response = new DecodeResponse<>(); response.res = new ArrayList<>(); diff --git a/contracts/javascore/settings.gradle b/contracts/javascore/settings.gradle index c3b35a630..d669e3543 100644 --- a/contracts/javascore/settings.gradle +++ b/contracts/javascore/settings.gradle @@ -2,6 +2,7 @@ rootProject.name = 'javascore' include( 'score-util', 'proto-util', + 'proto-lib', 'lib', 'test-lib', 'ibc', diff --git a/contracts/javascore/xcall-connection/build.gradle b/contracts/javascore/xcall-connection/build.gradle index ecd9347e3..9e8ce6466 100644 --- a/contracts/javascore/xcall-connection/build.gradle +++ b/contracts/javascore/xcall-connection/build.gradle @@ -3,6 +3,7 @@ version = '0.1.0' dependencies { implementation group: 'xyz.venture23', name: 'xcall-lib', version: '0.1.1' implementation project(':lib') + implementation project(':proto-lib') implementation project(':score-util') testImplementation project(':test-lib') } @@ -24,6 +25,7 @@ jacocoTestReport { optimizedJar { dependsOn(project(':lib').jar) + dependsOn(project(':proto-lib').jar) dependsOn(project(':score-util').jar) mainClassName = 'ibc.xcall.connection.IBCConnection' from { diff --git a/contracts/javascore/xcall-connection/src/main/java/ibc/xcall/connection/IBCConnection.java b/contracts/javascore/xcall-connection/src/main/java/ibc/xcall/connection/IBCConnection.java index baed21b2c..7deab166c 100644 --- a/contracts/javascore/xcall-connection/src/main/java/ibc/xcall/connection/IBCConnection.java +++ b/contracts/javascore/xcall-connection/src/main/java/ibc/xcall/connection/IBCConnection.java @@ -20,9 +20,9 @@ import java.math.BigInteger; import java.util.Map; +import icon.proto.core.channel.Packet; import icon.proto.core.channel.Channel.Counterparty; import icon.proto.core.channel.Channel.Order; -import icon.proto.core.channel.Packet; import icon.proto.core.client.Height; import score.Address; import score.BranchDB; diff --git a/contracts/javascore/xcall-connection/src/test/java/ibc/xcall/connection/IBCConnectionTest.java b/contracts/javascore/xcall-connection/src/test/java/ibc/xcall/connection/IBCConnectionTest.java index 740bd7a54..0b2930826 100644 --- a/contracts/javascore/xcall-connection/src/test/java/ibc/xcall/connection/IBCConnectionTest.java +++ b/contracts/javascore/xcall-connection/src/test/java/ibc/xcall/connection/IBCConnectionTest.java @@ -12,9 +12,9 @@ import com.iconloop.score.test.Account; import com.iconloop.score.test.ServiceManager; -import ibc.icon.score.util.StringUtil; import icon.proto.core.channel.Packet; import icon.proto.core.client.Height; +import ibc.icon.score.util.StringUtil; import java.math.BigInteger; import java.util.Map; diff --git a/contracts/javascore/xcall-connection/src/test/java/ibc/xcall/connection/IBCConnectionTestBase.java b/contracts/javascore/xcall-connection/src/test/java/ibc/xcall/connection/IBCConnectionTestBase.java index 27c785e40..e2fbb5050 100644 --- a/contracts/javascore/xcall-connection/src/test/java/ibc/xcall/connection/IBCConnectionTestBase.java +++ b/contracts/javascore/xcall-connection/src/test/java/ibc/xcall/connection/IBCConnectionTestBase.java @@ -9,10 +9,10 @@ import com.iconloop.score.test.ServiceManager; import com.iconloop.score.test.TestBase; -import ibc.icon.interfaces.IIBCHandler; -import ibc.icon.interfaces.IIBCHandlerScoreInterface; -import ibc.icon.test.MockContract; import icon.proto.core.channel.Channel; +import ibc.icon.test.MockContract; +import icon.ibc.interfaces.IIBCHandler; +import icon.ibc.interfaces.IIBCHandlerScoreInterface; public class IBCConnectionTestBase extends TestBase { diff --git a/proto/clients/tendermint/TendermintLight.proto b/proto/clients/tendermint/TendermintLight.proto deleted file mode 100644 index 1c802d95c..000000000 --- a/proto/clients/tendermint/TendermintLight.proto +++ /dev/null @@ -1,206 +0,0 @@ -syntax = "proto3"; -package tendermint.light; - -option go_package = "libraries/go/common/tendermint;tendermint"; -import "gogoproto/gogo.proto"; - -message Fraction { - uint64 numerator = 1; - uint64 denominator = 2; -} - -// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Timestamp -message Duration { - int64 seconds = 1; - int32 nanos = 2; -} - -message Consensus { - uint64 block = 1; - uint64 app = 2; -} - -message ClientState { - option (gogoproto.goproto_getters) = false; - - string chain_id = 1; - Fraction trust_level = 2; - - // duration of the period since the LastestTimestamp during which the - // submitted headers are valid for upgrade - Duration trusting_period = 3; - // duration of the staking unbonding period - Duration unbonding_period = 4; - // defines how much new (untrusted) header's Time can drift into the future. - Duration max_clock_drift = 5; - // Block height when the client was frozen due to a misbehaviour - //ibc.core.client.v1.Height frozen_height = 6; - int64 frozen_height = 6; - // Latest height the client was updated to - int64 latest_height = 7; - // This flag, when set to true, will allow governance to recover a client - // which has expired - bool allow_update_after_expiry = 8; - // This flag, when set to true, will allow governance to unfreeze a client - // whose chain has experienced a misbehaviour event - bool allow_update_after_misbehaviour = 9; -} - -// ConsensusState defines the consensus state from Tendermint. -message ConsensusState { - option (gogoproto.goproto_getters) = false; - // timestamp that corresponds to the block height in which the ConsensusState - // was stored. - Timestamp timestamp = 1; - - // commitment root (i.e app hash) - MerkleRoot root = 2; - bytes next_validators_hash = 3; -} - -// MerkleRoot defines a merkle root hash. -// In the Cosmos SDK, the AppHash of a block header becomes the root. -message MerkleRoot { - bytes hash = 1; -} - -enum BlockIDFlag { - BLOCK_ID_FLAG_UNKNOWN = 0; - BLOCK_ID_FLAG_ABSENT = 1; - BLOCK_ID_FLAG_COMMIT = 2; - BLOCK_ID_FLAG_NIL = 3; -} - -enum SignedMsgType { - SIGNED_MSG_TYPE_UNKNOWN = 0; - // Votes - SIGNED_MSG_TYPE_PREVOTE = 1; - SIGNED_MSG_TYPE_PRECOMMIT = 2; - - // Proposals - SIGNED_MSG_TYPE_PROPOSAL = 32; -} - -message CanonicalPartSetHeader { - uint32 total = 1; - bytes hash = 2; -} - -message CanonicalBlockID { - bytes hash = 1; - CanonicalPartSetHeader part_set_header = 2; -} - -message CanonicalVote { - SignedMsgType type = 1; - sfixed64 height = 2; - sfixed64 round = 3; - BlockID block_id = 4; - Timestamp timestamp = 5; - string chain_id = 6; -} - -message Vote { - SignedMsgType type = 1; - int64 height = 2; - int32 round = 3; - BlockID block_id = 4; - Timestamp timestamp = 5; - bytes validator_address = 6; - int32 validator_index = 7; - bytes signature = 8; -} - -message ValidatorSet { - repeated Validator validators = 1; - Validator proposer = 2; - int64 total_voting_power = 3; -} - -message Validator { - bytes address = 1; - PublicKey pub_key = 2; - int64 voting_power = 3; - int64 proposer_priority = 4; -} - -message SimpleValidator { - PublicKey pub_key = 1; - int64 voting_power = 2; -} - -message PublicKey { - oneof sum { - bytes ed25519 = 1; - bytes secp256k1 = 2; - bytes sr25519 = 3; - } -} - -message PartSetHeader { - uint32 total = 1; - bytes hash= 2; -} - -message BlockID { - bytes hash = 1; - PartSetHeader part_set_header = 2; -} - -message Commit { - int64 height = 1; - int32 round = 2; - BlockID block_id = 3; - repeated CommitSig signatures = 4; -} - -// CommitSig is a part of the Vote included in a Commit. -message CommitSig { - BlockIDFlag block_id_flag = 1; - bytes validator_address = 2; - Timestamp timestamp = 3; - bytes signature = 4; -} - -message Timestamp { - // Represents seconds of UTC time since Unix epoch - // 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - // 9999-12-31T23:59:59Z inclusive. - int64 seconds = 1; - - // Non-negative fractions of a second at nanosecond resolution. Negative - // second values with fractions must still have non-negative nanos values - // that count forward in time. Must be from 0 to 999,999,999 - // inclusive. - int32 nanos = 2; -} - -message LightHeader { - Consensus version = 1; - string chain_id = 2; - int64 height = 3; - Timestamp time = 4; - BlockID last_block_id = 5; - bytes last_commit_hash = 6; // commit from validators from the last block - bytes data_hash = 7; // transactions - bytes validators_hash = 8; // validators for the current block - bytes next_validators_hash = 9; // validators for the next block - bytes consensus_hash = 10; // consensus params for current block - bytes app_hash = 11; // state after txs from the previous block - bytes last_results_hash = 12; // root hash of all results from the txs from the previous block - bytes evidence_hash = 13; // evidence included in the block - bytes proposer_address = 14; // original proposer of the block -} - -message SignedHeader { - LightHeader header = 1; - Commit commit = 2; -} - -message TmHeader { - SignedHeader signed_header = 1; - ValidatorSet validator_set = 2; - - int64 trusted_height = 3; - ValidatorSet trusted_validators = 4; -} diff --git a/proto/core/03-connection/Connection.proto b/proto/core/03-connection/Connection.proto index b5167cf53..7b5efb214 100644 --- a/proto/core/03-connection/Connection.proto +++ b/proto/core/03-connection/Connection.proto @@ -1,10 +1,9 @@ syntax = "proto3"; package icon.proto.core.connection; - -import "core/23-commitment/commitment.proto"; - option go_package = "libraries/go/common/icon;icon"; +import "ibc/core/commitment/v1/commitment.proto"; + // ICS03 - Connection Data Structures as defined in // https://github.com/cosmos/ibc/blob/master/spec/core/ics-003-connection-semantics#data-structures @@ -55,7 +54,7 @@ message Counterparty { // given connection. string connection_id = 2; // commitment merkle prefix of the counterparty chain. - icon.proto.core.commitment.MerklePrefix prefix = 3; + ibc.core.commitment.v1.MerklePrefix prefix = 3; } diff --git a/proto/core/23-commitment/commitment.proto b/proto/core/23-commitment/commitment.proto deleted file mode 100644 index 0f38407af..000000000 --- a/proto/core/23-commitment/commitment.proto +++ /dev/null @@ -1,39 +0,0 @@ -syntax = "proto3"; - -package icon.proto.core.commitment; - -import "core/23-commitment/proofs.proto"; -import "gogoproto/gogo.proto"; - -option go_package = "libraries/go/common/icon;icon"; - -// MerkleRoot defines a merkle root hash. -// In the Cosmos SDK, the AppHash of a block header becomes the root. -message MerkleRoot { - option (gogoproto.goproto_getters) = false; - - bytes hash = 1; -} - -// MerklePrefix is merkle path prefixed to the key. -// The constructed key from the Path and the key will be append(Path.KeyPath, -// append(Path.KeyPrefix, key...)) -message MerklePrefix { - bytes key_prefix = 1; -} - -// MerklePath is the path used to verify commitment proofs, which can be an -// arbitrary structured object (defined by a commitment type). -// MerklePath is represented from root-to-leaf -message MerklePath { - repeated string key_path = 1; -} - -// MerkleProof is a wrapper type over a chain of CommitmentProofs. -// It demonstrates membership or non-membership for an element or set of -// elements, verifiable in conjunction with a known commitment root. Proofs -// should be succinct. -// MerkleProofs are ordered from leaf-to-root -message MerkleProof { - repeated icon.proto.core.commitment.CommitmentProof proofs = 1; -} \ No newline at end of file diff --git a/proto/core/23-commitment/proofs.proto b/proto/core/23-commitment/proofs.proto deleted file mode 100644 index 9f3ae6c2e..000000000 --- a/proto/core/23-commitment/proofs.proto +++ /dev/null @@ -1,237 +0,0 @@ -syntax = "proto3"; - -option go_package = "libraries/go/common/icon;icon"; -package icon.proto.core.commitment; - -enum HashOp { - // NO_HASH is the default if no data passed. Note this is an illegal argument some places. - NO_HASH = 0; - SHA256 = 1; - SHA512 = 2; - KECCAK = 3; - RIPEMD160 = 4; - BITCOIN = 5; // ripemd160(sha256(x)) - SHA512_256 = 6; -} - -/** -LengthOp defines how to process the key and value of the LeafOp -to include length information. After encoding the length with the given -algorithm, the length will be prepended to the key and value bytes. -(Each one with it's own encoded length) -*/ -enum LengthOp { - // NO_PREFIX don't include any length info - NO_PREFIX = 0; - // VAR_PROTO uses protobuf (and go-amino) varint encoding of the length - VAR_PROTO = 1; - // VAR_RLP uses rlp int encoding of the length - VAR_RLP = 2; - // FIXED32_BIG uses big-endian encoding of the length as a 32 bit integer - FIXED32_BIG = 3; - // FIXED32_LITTLE uses little-endian encoding of the length as a 32 bit integer - FIXED32_LITTLE = 4; - // FIXED64_BIG uses big-endian encoding of the length as a 64 bit integer - FIXED64_BIG = 5; - // FIXED64_LITTLE uses little-endian encoding of the length as a 64 bit integer - FIXED64_LITTLE = 6; - // REQUIRE_32_BYTES is like NONE, but will fail if the input is not exactly 32 bytes (sha256 output) - REQUIRE_32_BYTES = 7; - // REQUIRE_64_BYTES is like NONE, but will fail if the input is not exactly 64 bytes (sha512 output) - REQUIRE_64_BYTES = 8; -} - -/** -ExistenceProof takes a key and a value and a set of steps to perform on it. -The result of peforming all these steps will provide a "root hash", which can -be compared to the value in a header. - -Since it is computationally infeasible to produce a hash collission for any of the used -cryptographic hash functions, if someone can provide a series of operations to transform -a given key and value into a root hash that matches some trusted root, these key and values -must be in the referenced merkle tree. - -The only possible issue is maliablity in LeafOp, such as providing extra prefix data, -which should be controlled by a spec. Eg. with lengthOp as NONE, - prefix = FOO, key = BAR, value = CHOICE -and - prefix = F, key = OOBAR, value = CHOICE -would produce the same value. - -With LengthOp this is tricker but not impossible. Which is why the "leafPrefixEqual" field -in the ProofSpec is valuable to prevent this mutability. And why all trees should -length-prefix the data before hashing it. -*/ -message ExistenceProof { - bytes key = 1; - bytes value = 2; - LeafOp leaf = 3; - repeated InnerOp path = 4; -} - -/* -NonExistenceProof takes a proof of two neighbors, one left of the desired key, -one right of the desired key. If both proofs are valid AND they are neighbors, -then there is no valid proof for the given key. -*/ -message NonExistenceProof { - bytes key = 1; // TODO: remove this as unnecessary??? we prove a range - ExistenceProof left = 2; - ExistenceProof right = 3; -} - -/* -CommitmentProof is either an ExistenceProof or a NonExistenceProof, or a Batch of such messages -*/ -message CommitmentProof { - oneof proof { - ExistenceProof exist = 1; - NonExistenceProof nonexist = 2; - BatchProof batch = 3; - CompressedBatchProof compressed = 4; - } -} - -/** -LeafOp represents the raw key-value data we wish to prove, and -must be flexible to represent the internal transformation from -the original key-value pairs into the basis hash, for many existing -merkle trees. - -key and value are passed in. So that the signature of this operation is: - leafOp(key, value) -> output - -To process this, first prehash the keys and values if needed (ANY means no hash in this case): - hkey = prehashKey(key) - hvalue = prehashValue(value) - -Then combine the bytes, and hash it - output = hash(prefix || length(hkey) || hkey || length(hvalue) || hvalue) -*/ -message LeafOp { - HashOp hash = 1; - HashOp prehash_key = 2; - HashOp prehash_value = 3; - LengthOp length = 4; - // prefix is a fixed bytes that may optionally be included at the beginning to differentiate - // a leaf node from an inner node. - bytes prefix = 5; -} - -/** -InnerOp represents a merkle-proof step that is not a leaf. -It represents concatenating two children and hashing them to provide the next result. - -The result of the previous step is passed in, so the signature of this op is: - innerOp(child) -> output - -The result of applying InnerOp should be: - output = op.hash(op.prefix || child || op.suffix) - - where the || operator is concatenation of binary data, -and child is the result of hashing all the tree below this step. - -Any special data, like prepending child with the length, or prepending the entire operation with -some value to differentiate from leaf nodes, should be included in prefix and suffix. -If either of prefix or suffix is empty, we just treat it as an empty string -*/ -message InnerOp { - HashOp hash = 1; - bytes prefix = 2; - bytes suffix = 3; -} - -/** -ProofSpec defines what the expected parameters are for a given proof type. -This can be stored in the client and used to validate any incoming proofs. - - verify(ProofSpec, Proof) -> Proof | Error - -As demonstrated in tests, if we don't fix the algorithm used to calculate the -LeafHash for a given tree, there are many possible key-value pairs that can -generate a given hash (by interpretting the preimage differently). -We need this for proper security, requires client knows a priori what -tree format server uses. But not in code, rather a configuration object. -*/ -message ProofSpec { - // any field in the ExistenceProof must be the same as in this spec. - // except Prefix, which is just the first bytes of prefix (spec can be longer) - LeafOp leaf_spec = 1; - InnerSpec inner_spec = 2; - // max_depth (if > 0) is the maximum number of InnerOps allowed (mainly for fixed-depth tries) - int32 max_depth = 3; - // min_depth (if > 0) is the minimum number of InnerOps allowed (mainly for fixed-depth tries) - int32 min_depth = 4; - // prehash_key_before_comparison is a flag that indicates whether to use the - // prehash_key specified by LeafOp to compare lexical ordering of keys for - // non-existence proofs. - bool prehash_key_before_comparison = 5; -} - -/* -InnerSpec contains all store-specific structure info to determine if two proofs from a -given store are neighbors. - -This enables: - - isLeftMost(spec: InnerSpec, op: InnerOp) - isRightMost(spec: InnerSpec, op: InnerOp) - isLeftNeighbor(spec: InnerSpec, left: InnerOp, right: InnerOp) -*/ -message InnerSpec { - // Child order is the ordering of the children node, must count from 0 - // iavl tree is [0, 1] (left then right) - // merk is [0, 2, 1] (left, right, here) - repeated int32 child_order = 1; - int32 child_size = 2; - int32 min_prefix_length = 3; - int32 max_prefix_length = 4; - // empty child is the prehash image that is used when one child is nil (eg. 20 bytes of 0) - bytes empty_child = 5; - // hash is the algorithm that must be used for each InnerOp - HashOp hash = 6; -} - -/* -BatchProof is a group of multiple proof types than can be compressed -*/ -message BatchProof { - repeated BatchEntry entries = 1; -} - -// Use BatchEntry not CommitmentProof, to avoid recursion -message BatchEntry { - oneof proof { - ExistenceProof exist = 1; - NonExistenceProof nonexist = 2; - } -} - -/****** all items here are compressed forms *******/ - -message CompressedBatchProof { - repeated CompressedBatchEntry entries = 1; - repeated InnerOp lookup_inners = 2; -} - -// Use BatchEntry not CommitmentProof, to avoid recursion -message CompressedBatchEntry { - oneof proof { - CompressedExistenceProof exist = 1; - CompressedNonExistenceProof nonexist = 2; - } -} - -message CompressedExistenceProof { - bytes key = 1; - bytes value = 2; - LeafOp leaf = 3; - // these are indexes into the lookup_inners table in CompressedBatchProof - repeated int32 path = 4; -} - -message CompressedNonExistenceProof { - bytes key = 1; // TODO: remove this as unnecessary??? we prove a range - CompressedExistenceProof left = 2; - CompressedExistenceProof right = 3; -} diff --git a/scripts/generate_java_proto.sh b/scripts/generate_java_proto.sh new file mode 100755 index 000000000..462461419 --- /dev/null +++ b/scripts/generate_java_proto.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +cd proto +buf export buf.build/protocolbuffers/wellknowntypes -o ./ +buf export buf.build/cosmos/ibc -o ./ +buf export buf.build/cosmos/ics23:c7c728879896fb260fe76b208ea6a17c2b0132a3 -o ./ +buf export buf.build/tendermint/tendermint -o ./ +sed -i -e 's/ .tendermint/ tendermint/g' ibc/lightclients/tendermint/v1/tendermint.proto + +cd ../contracts/javascore +./gradlew proto-util:generate + +rm -r proto-lib/src/main/java/* +cp -r proto-util/build/generated/sources/cosmos proto-lib/src/main/java/ +cp -r proto-util/build/generated/sources/google proto-lib/src/main/java/ +cp -r proto-util/build/generated/sources/ibc proto-lib/src/main/java/ +cp -r proto-util/build/generated/sources/icon proto-lib/src/main/java/ +cp -r proto-util/build/generated/sources/tendermint proto-lib/src/main/java/ +rm proto-lib/src/main/java/google/protobuf/FileDescriptorSet.java + +cd ../../proto +rm -r amino +rm -r capability +rm -r cosmos_proto +rm -r google +rm -r cosmos_proto +rm -r gogoproto +rm -r ibc +rm -r tendermint From 6bed16594dd5af4e7bef5a9b79a9f387515d1238 Mon Sep 17 00:00:00 2001 From: AntonAndell Date: Wed, 17 Jan 2024 08:00:40 +0100 Subject: [PATCH 02/12] feat: Add revision number to light client heights (#822) Add revision number but for now do not add support for resseting chain height --- .../main/java/ibc/tendermint/TendermintHelper.java | 12 ++++++++++-- .../java/ibc/tendermint/TendermintLightClient.java | 10 ++++++---- .../test/java/ibc/tendermint/LightClientTest.java | 5 +++-- .../java/ibc/tendermint/LightClientTestBase.java | 6 ++++-- 4 files changed, 23 insertions(+), 10 deletions(-) diff --git a/contracts/javascore/lightclients/tendermint/src/main/java/ibc/tendermint/TendermintHelper.java b/contracts/javascore/lightclients/tendermint/src/main/java/ibc/tendermint/TendermintHelper.java index 1aa812492..d11c56d1c 100644 --- a/contracts/javascore/lightclients/tendermint/src/main/java/ibc/tendermint/TendermintHelper.java +++ b/contracts/javascore/lightclients/tendermint/src/main/java/ibc/tendermint/TendermintHelper.java @@ -57,6 +57,14 @@ public static BigInteger getTotalVotingPower(ValidatorSet validatorSet) { return validatorSet.getTotalVotingPower(); } + public static BigInteger getRevisionNumber(String chainId) { + int id = chainId.indexOf("-"); + if (id >= 0) { + return new BigInteger(chainId.substring(id+1)); + } + return BigInteger.ZERO; + } + public static int getByAddress(ValidatorSet validatorSet, byte[] addr) { int size = validatorSet.getValidators().size(); for (int idx = 0; idx < size; idx++) { @@ -68,10 +76,10 @@ public static int getByAddress(ValidatorSet validatorSet, byte[] addr) { return -1; } - public static Height newHeight(BigInteger blockHeight) { + public static Height newHeight(BigInteger blockHeight, BigInteger revision) { Height height = new Height(); height.setRevisionHeight(blockHeight); - height.setRevisionNumber(BigInteger.ZERO); + height.setRevisionNumber(revision); return height; } diff --git a/contracts/javascore/lightclients/tendermint/src/main/java/ibc/tendermint/TendermintLightClient.java b/contracts/javascore/lightclients/tendermint/src/main/java/ibc/tendermint/TendermintLightClient.java index 2012a1057..fbe9cc0c0 100644 --- a/contracts/javascore/lightclients/tendermint/src/main/java/ibc/tendermint/TendermintLightClient.java +++ b/contracts/javascore/lightclients/tendermint/src/main/java/ibc/tendermint/TendermintLightClient.java @@ -17,6 +17,7 @@ import score.Context; import score.DictDB; import score.annotation.External; +import score.annotation.Optional; import java.math.BigInteger; import java.util.Arrays; @@ -120,7 +121,6 @@ public Map updateClient(String clientId, byte[] clientMessageByt onlyHandler(); ibc.lightclients.tendermint.v1.Header tmHeader = ibc.lightclients.tendermint.v1.Header.decode(clientMessageBytes); boolean conflictingHeader = false; - // Check if the Client store already has a consensus state for the header's // height // If the consensus state exists, and it matches the header then we return early @@ -153,7 +153,8 @@ public Map updateClient(String clientId, byte[] clientMessageByt // Header is different from existing consensus state and also valid, so freeze // the client and return if (conflictingHeader) { - clientState.setFrozenHeight(newHeight(tmHeader.getSignedHeader().getHeader().getHeight())); + BigInteger revision = getRevisionNumber(tmHeader.getSignedHeader().getHeader().getChainId()); + clientState.setFrozenHeight(newHeight(tmHeader.getSignedHeader().getHeader().getHeight(), revision)); encodedClientState = clientState.encode(); clientStates.set(clientId, encodedClientState); @@ -168,12 +169,13 @@ public Map updateClient(String clientId, byte[] clientMessageByt "clientStateCommitment", IBCCommitment.keccak256(encodedClientState), "consensusStateCommitment", IBCCommitment.keccak256(encodedConsensusState), "height", - newHeight(tmHeader.getSignedHeader().getHeader().getHeight()).encode()); + newHeight(tmHeader.getSignedHeader().getHeader().getHeight(), revision).encode()); } // update the consensus state from a new header and set processed time metadata if (tmHeader.getSignedHeader().getHeader().getHeight().compareTo(clientState.getLatestHeight().getRevisionHeight()) > 0) { - clientState.setLatestHeight(newHeight(tmHeader.getSignedHeader().getHeader().getHeight())); + BigInteger revision = getRevisionNumber(tmHeader.getSignedHeader().getHeader().getChainId()); + clientState.setLatestHeight(newHeight(tmHeader.getSignedHeader().getHeader().getHeight(), revision)); encodedClientState = clientState.encode(); clientStates.set(clientId, encodedClientState); } diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/LightClientTest.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/LightClientTest.java index 0fa6b2bd0..d6e80de32 100644 --- a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/LightClientTest.java +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/LightClientTest.java @@ -280,8 +280,9 @@ void getLatestHeight() throws Exception { SignedHeader header1 = parseSignedHeader(1); SignedHeader header2 = parseSignedHeader(2); - Height height1 = Height.newBuilder().setRevisionHeight(header1.getHeader().getHeight()).build(); - Height height2 = Height.newBuilder().setRevisionHeight(header2.getHeader().getHeight()).build(); + BigInteger revision = TendermintHelper.getRevisionNumber(header1.getHeader().getChainId()); + Height height1 = Height.newBuilder().setRevisionHeight(header1.getHeader().getHeight()).setRevisionNumber(revision.intValue()).build(); + Height height2 = Height.newBuilder().setRevisionHeight(header2.getHeader().getHeight()).setRevisionNumber(revision.intValue()).build(); // Act initializeClient(1); diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/LightClientTestBase.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/LightClientTestBase.java index 612c5daac..547782b87 100644 --- a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/LightClientTestBase.java +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/LightClientTestBase.java @@ -144,13 +144,15 @@ protected void initializeClient(int blockOrder) throws Exception { Header header = Header.newBuilder() .setSignedHeader(parseSignedHeader(blockOrder)) .setValidatorSet(parseValidatorSet(blockOrder)).build(); - + BigInteger revisionNumber = TendermintHelper.getRevisionNumber(header.getSignedHeader().getHeader().getChainId()); ClientState clientState = ClientState.newBuilder() .setChainId(header.getSignedHeader().getHeader().getChainId()) .setTrustLevel(trustLevel) .setTrustingPeriod(trustingPeriod) .setMaxClockDrift(maxClockDrift) - .setLatestHeight(Height.newBuilder().setRevisionHeight(header.getSignedHeader().getHeader().getHeight())) + .setLatestHeight(Height.newBuilder() + .setRevisionHeight(header.getSignedHeader().getHeader().getHeight()) + .setRevisionNumber(revisionNumber.intValue())) .setAllowUpdateAfterExpiry(allowUpdateAfterExpiry) .setAllowUpdateAfterMisbehaviour(allowUpdateAfterMisbehaviour).build(); From a442d9522523e1777fa0a5dc7ae0c254371259ab Mon Sep 17 00:00:00 2001 From: AntonAndell Date: Mon, 12 Feb 2024 12:17:47 +0100 Subject: [PATCH 03/12] 807 add client specific hashing on ack and packet data (#825) * feat: hash depending on client type * feat: add IBC prefix for ics-08 clients and bugfixes (#826) * feat: Add revision number to light client heights Add revision number but for now do not add support for resseting chain height * revert to using two clients * feat: add IBC prefix for ics-08 clients and bugfixes * fix: hash ack value before sending to verify membership for ics8 client --------- Co-authored-by: izyak --------- Co-authored-by: izyak --- .../core/integration/IBCIntegrationTest.java | 2 +- .../main/java/ibc/ics02/client/IBCClient.java | 5 +- .../ibc/ics03/connection/IBCConnection.java | 18 +- .../java/ibc/ics04/channel/IBCPacket.java | 54 +- .../ibc/ics23/commitment/types/Merkle.java | 4 +- .../java/ibc/ics24/host/IBCCommitment.java | 9 +- .../src/main/java/ibc/ics24/host/IBCHost.java | 19 + .../main/java/ibc/ics24/host/IBCStore.java | 3 + .../java/ibc/ics25/handler/IBCHandler.java | 7 +- .../java/ibc/ics02/client/ClientTest.java | 6 +- .../java/ibc/ics04/channel/PacketTest.java | 8 +- .../ibc/ics25/handler/IBCHandlerTest.java | 2 +- .../ibc/ics25/handler/IBCHandlerTestBase.java | 2 +- .../java/icon/ibc/interfaces/IIBCClient.java | 4 +- .../ics-08-tendermint/build.gradle | 71 + .../ICS08TendermintLightClient.java | 335 + .../java/ibc/ics08/tendermint/Tendermint.java | 270 + .../ics08/tendermint/TendermintHelper.java | 162 + .../ibc/ics08/tendermint/LightClientTest.java | 330 + .../ics08/tendermint/LightClientTestBase.java | 334 + .../tendermint/data/adjacent/commit.1.json | 54 + .../tendermint/data/adjacent/commit.2.json | 54 + .../tendermint/data/adjacent/commit.3.json | 54 + .../data/adjacent/validators.1.json | 25 + .../data/adjacent/validators.2.json | 25 + .../data/adjacent/validators.3.json | 25 + .../tendermint/data/malicious/commit.1.json | 48 + .../tendermint/data/malicious/commit.2.json | 47 + .../tendermint/data/malicious/commit.3.json | 47 + .../data/malicious/validators.1.json | 16 + .../data/malicious/validators.2.json | 16 + .../data/malicious/validators.3.json | 16 + .../data/multi-validator/commit.1.json | 480 + .../data/multi-validator/commit.2.json | 480 + .../data/multi-validator/commit.3.json | 480 + .../data/multi-validator/validators.1.json | 664 + .../data/multi-validator/validators.2.json | 664 + .../data/multi-validator/validators.3.json | 664 + .../tendermint/data/simple/commit.1.json | 48 + .../tendermint/data/simple/commit.2.json | 47 + .../tendermint/data/simple/commit.3.json | 47 + .../tendermint/data/simple/validators.1.json | 16 + .../tendermint/data/simple/validators.2.json | 16 + .../tendermint/data/simple/validators.3.json | 16 + .../test/proto/amino/AminoProto.java | 0 .../proto/cosmos/ics23/v1/BatchEntry.java | 0 .../cosmos/ics23/v1/BatchEntryOrBuilder.java | 0 .../proto/cosmos/ics23/v1/BatchProof.java | 0 .../cosmos/ics23/v1/BatchProofOrBuilder.java | 0 .../cosmos/ics23/v1/CommitmentProof.java | 0 .../ics23/v1/CommitmentProofOrBuilder.java | 0 .../cosmos/ics23/v1/CompressedBatchEntry.java | 0 .../v1/CompressedBatchEntryOrBuilder.java | 0 .../cosmos/ics23/v1/CompressedBatchProof.java | 0 .../v1/CompressedBatchProofOrBuilder.java | 0 .../ics23/v1/CompressedExistenceProof.java | 0 .../v1/CompressedExistenceProofOrBuilder.java | 0 .../ics23/v1/CompressedNonExistenceProof.java | 0 .../CompressedNonExistenceProofOrBuilder.java | 0 .../proto/cosmos/ics23/v1/ExistenceProof.java | 0 .../ics23/v1/ExistenceProofOrBuilder.java | 0 .../test/proto/cosmos/ics23/v1/HashOp.java | 0 .../test/proto/cosmos/ics23/v1/InnerOp.java | 0 .../cosmos/ics23/v1/InnerOpOrBuilder.java | 0 .../test/proto/cosmos/ics23/v1/InnerSpec.java | 0 .../cosmos/ics23/v1/InnerSpecOrBuilder.java | 0 .../test/proto/cosmos/ics23/v1/LeafOp.java | 0 .../cosmos/ics23/v1/LeafOpOrBuilder.java | 0 .../test/proto/cosmos/ics23/v1/LengthOp.java | 0 .../cosmos/ics23/v1/NonExistenceProof.java | 0 .../ics23/v1/NonExistenceProofOrBuilder.java | 0 .../test/proto/cosmos/ics23/v1/ProofSpec.java | 0 .../cosmos/ics23/v1/ProofSpecOrBuilder.java | 0 .../proto/cosmos/ics23/v1/ProofsProto.java | 0 .../CancelSoftwareUpgradeProposal.java | 0 ...ancelSoftwareUpgradeProposalOrBuilder.java | 0 .../cosmos/upgrade/v1beta1/ModuleVersion.java | 0 .../v1beta1/ModuleVersionOrBuilder.java | 0 .../proto/cosmos/upgrade/v1beta1/Plan.java | 0 .../cosmos/upgrade/v1beta1/PlanOrBuilder.java | 0 .../v1beta1/SoftwareUpgradeProposal.java | 0 .../SoftwareUpgradeProposalOrBuilder.java | 0 .../cosmos/upgrade/v1beta1/UpgradeProto.java | 0 .../test/proto/cosmos_proto/CosmosProto.java | 0 .../cosmos_proto/InterfaceDescriptor.java | 0 .../InterfaceDescriptorOrBuilder.java | 0 .../proto/cosmos_proto/ScalarDescriptor.java | 0 .../ScalarDescriptorOrBuilder.java | 0 .../test/proto/cosmos_proto/ScalarType.java | 0 .../test/proto/gogoproto/GogoProto.java | 0 .../core/client/v1/ClientConsensusStates.java | 0 .../v1/ClientConsensusStatesOrBuilder.java | 0 .../proto/ibc/core/client/v1/ClientProto.java | 0 .../core/client/v1/ClientUpdateProposal.java | 0 .../v1/ClientUpdateProposalOrBuilder.java | 0 .../client/v1/ConsensusStateWithHeight.java | 0 .../v1/ConsensusStateWithHeightOrBuilder.java | 0 .../test/proto/ibc/core/client/v1/Height.java | 0 .../ibc/core/client/v1/HeightOrBuilder.java | 0 .../core/client/v1/IdentifiedClientState.java | 0 .../v1/IdentifiedClientStateOrBuilder.java | 0 .../test/proto/ibc/core/client/v1/Params.java | 0 .../ibc/core/client/v1/ParamsOrBuilder.java | 0 .../ibc/core/client/v1/UpgradeProposal.java | 0 .../client/v1/UpgradeProposalOrBuilder.java | 0 .../core/commitment/v1/CommitmentProto.java | 0 .../ibc/core/commitment/v1/MerklePath.java | 0 .../commitment/v1/MerklePathOrBuilder.java | 0 .../ibc/core/commitment/v1/MerklePrefix.java | 0 .../commitment/v1/MerklePrefixOrBuilder.java | 0 .../ibc/core/commitment/v1/MerkleProof.java | 0 .../commitment/v1/MerkleProofOrBuilder.java | 0 .../ibc/core/commitment/v1/MerkleRoot.java | 0 .../commitment/v1/MerkleRootOrBuilder.java | 0 .../tendermint/v1/ClientState.java | 0 .../tendermint/v1/ClientStateOrBuilder.java | 0 .../tendermint/v1/ConsensusState.java | 0 .../v1/ConsensusStateOrBuilder.java | 0 .../lightclients/tendermint/v1/Fraction.java | 0 .../tendermint/v1/FractionOrBuilder.java | 0 .../lightclients/tendermint/v1/Header.java | 0 .../tendermint/v1/HeaderOrBuilder.java | 0 .../tendermint/v1/Misbehaviour.java | 0 .../tendermint/v1/MisbehaviourOrBuilder.java | 0 .../tendermint/v1/TendermintLightProto.java | 0 .../icon/lightclient/v1/BlockUpdate.java | 0 .../lightclient/v1/BlockUpdateOrBuilder.java | 0 .../icon/lightclient/v1/ClientState.java | 0 .../lightclient/v1/ClientStateOrBuilder.java | 0 .../icon/lightclient/v1/ConsensusState.java | 0 .../v1/ConsensusStateOrBuilder.java | 0 .../proto/icon/lightclient/v1/LightProto.java | 0 .../icon/lightclient/v1/Misbehaviour.java | 0 .../lightclient/v1/MisbehaviourOrBuilder.java | 0 .../proto/icon/lightclient/v1/TrustLevel.java | 0 .../lightclient/v1/TrustLevelOrBuilder.java | 0 .../icon/proto/core/channel/Channel.java | 0 .../proto/core/channel/ChannelOrBuilder.java | 0 .../icon/proto/core/channel/ChannelProto.java | 0 .../proto/icon/proto/core/channel/Packet.java | 0 .../proto/core/channel/PacketOrBuilder.java | 0 .../icon/proto/core/channel/PacketState.java | 0 .../core/channel/PacketStateOrBuilder.java | 0 .../icon/proto/core/client/ClientProto.java | 0 .../proto/icon/proto/core/client/Height.java | 0 .../proto/core/client/HeightOrBuilder.java | 0 .../proto/core/commitment/BatchEntry.java | 0 .../core/commitment/BatchEntryOrBuilder.java | 0 .../proto/core/commitment/BatchProof.java | 0 .../core/commitment/BatchProofOrBuilder.java | 0 .../core/commitment/CommitmentProof.java | 0 .../commitment/CommitmentProofOrBuilder.java | 0 .../core/commitment/CommitmentProto.java | 0 .../core/commitment/CompressedBatchEntry.java | 0 .../CompressedBatchEntryOrBuilder.java | 0 .../core/commitment/CompressedBatchProof.java | 0 .../CompressedBatchProofOrBuilder.java | 0 .../commitment/CompressedExistenceProof.java | 0 .../CompressedExistenceProofOrBuilder.java | 0 .../CompressedNonExistenceProof.java | 0 .../CompressedNonExistenceProofOrBuilder.java | 0 .../proto/core/commitment/ExistenceProof.java | 0 .../commitment/ExistenceProofOrBuilder.java | 0 .../icon/proto/core/commitment/HashOp.java | 0 .../icon/proto/core/commitment/InnerOp.java | 0 .../core/commitment/InnerOpOrBuilder.java | 0 .../icon/proto/core/commitment/InnerSpec.java | 0 .../core/commitment/InnerSpecOrBuilder.java | 0 .../icon/proto/core/commitment/LeafOp.java | 0 .../core/commitment/LeafOpOrBuilder.java | 0 .../icon/proto/core/commitment/LengthOp.java | 0 .../proto/core/commitment/MerklePath.java | 0 .../core/commitment/MerklePathOrBuilder.java | 0 .../proto/core/commitment/MerklePrefix.java | 0 .../commitment/MerklePrefixOrBuilder.java | 0 .../proto/core/commitment/MerkleProof.java | 0 .../core/commitment/MerkleProofOrBuilder.java | 0 .../proto/core/commitment/MerkleRoot.java | 0 .../core/commitment/MerkleRootOrBuilder.java | 0 .../core/commitment/NonExistenceProof.java | 0 .../NonExistenceProofOrBuilder.java | 0 .../icon/proto/core/commitment/ProofSpec.java | 0 .../core/commitment/ProofSpecOrBuilder.java | 0 .../proto/core/commitment/ProofsProto.java | 0 .../proto/core/connection/ConnectionEnd.java | 0 .../connection/ConnectionEndOrBuilder.java | 0 .../core/connection/ConnectionProto.java | 0 .../proto/core/connection/Counterparty.java | 0 .../connection/CounterpartyOrBuilder.java | 0 .../icon/proto/core/connection/Version.java | 0 .../core/connection/VersionOrBuilder.java | 0 .../test/proto/icon/types/v1/BTPHeader.java | 0 .../icon/types/v1/BTPHeaderOrBuilder.java | 0 .../test/proto/icon/types/v1/BlockIDFlag.java | 0 .../test/proto/icon/types/v1/MerkleNode.java | 0 .../icon/types/v1/MerkleNodeOrBuilder.java | 0 .../proto/icon/types/v1/MerkleProofs.java | 0 .../icon/types/v1/MerkleProofsOrBuilder.java | 0 .../proto/icon/types/v1/SignedHeader.java | 0 .../icon/types/v1/SignedHeaderOrBuilder.java | 0 .../proto/icon/types/v1/SignedMsgType.java | 0 .../test/proto/icon/types/v1/TypesProto.java | 0 .../proto/tendermint/crypto/DominoOp.java | 0 .../tendermint/crypto/DominoOpOrBuilder.java | 0 .../proto/tendermint/crypto/KeysProto.java | 0 .../test/proto/tendermint/crypto/Proof.java | 0 .../test/proto/tendermint/crypto/ProofOp.java | 0 .../tendermint/crypto/ProofOpOrBuilder.java | 0 .../proto/tendermint/crypto/ProofOps.java | 0 .../tendermint/crypto/ProofOpsOrBuilder.java | 0 .../tendermint/crypto/ProofOrBuilder.java | 0 .../proto/tendermint/crypto/ProofProto.java | 0 .../proto/tendermint/crypto/PublicKey.java | 0 .../tendermint/crypto/PublicKeyOrBuilder.java | 0 .../test/proto/tendermint/crypto/ValueOp.java | 0 .../tendermint/crypto/ValueOpOrBuilder.java | 0 .../test/proto/tendermint/types/BlockID.java | 0 .../proto/tendermint/types/BlockIDFlag.java | 0 .../tendermint/types/BlockIDOrBuilder.java | 0 .../proto/tendermint/types/BlockMeta.java | 0 .../tendermint/types/BlockMetaOrBuilder.java | 0 .../test/proto/tendermint/types/Commit.java | 0 .../tendermint/types/CommitOrBuilder.java | 0 .../proto/tendermint/types/CommitSig.java | 0 .../tendermint/types/CommitSigOrBuilder.java | 0 .../test/proto/tendermint/types/Data.java | 0 .../proto/tendermint/types/DataOrBuilder.java | 0 .../test/proto/tendermint/types/Header.java | 0 .../tendermint/types/HeaderOrBuilder.java | 0 .../proto/tendermint/types/LightBlock.java | 0 .../tendermint/types/LightBlockOrBuilder.java | 0 .../test/proto/tendermint/types/Part.java | 0 .../proto/tendermint/types/PartOrBuilder.java | 0 .../proto/tendermint/types/PartSetHeader.java | 0 .../types/PartSetHeaderOrBuilder.java | 0 .../test/proto/tendermint/types/Proposal.java | 0 .../tendermint/types/ProposalOrBuilder.java | 0 .../proto/tendermint/types/SignedHeader.java | 0 .../types/SignedHeaderOrBuilder.java | 0 .../proto/tendermint/types/SignedMsgType.java | 0 .../tendermint/types/SimpleValidator.java | 0 .../types/SimpleValidatorOrBuilder.java | 0 .../test/proto/tendermint/types/TxProof.java | 0 .../tendermint/types/TxProofOrBuilder.java | 0 .../proto/tendermint/types/TypesProto.java | 0 .../proto/tendermint/types/Validator.java | 0 .../tendermint/types/ValidatorOrBuilder.java | 0 .../tendermint/types/ValidatorProto.java | 0 .../proto/tendermint/types/ValidatorSet.java | 0 .../types/ValidatorSetOrBuilder.java | 0 .../test/proto/tendermint/types/Vote.java | 0 .../proto/tendermint/types/VoteOrBuilder.java | 0 .../test/proto/tendermint/version/App.java | 0 .../tendermint/version/AppOrBuilder.java | 0 .../proto/tendermint/version/Consensus.java | 0 .../version/ConsensusOrBuilder.java | 0 .../proto/tendermint/version/TypesProto.java | 0 .../lightclients/tendermint/build.gradle | 5 +- .../main/java/ibc/tendermint/Tendermint.java | 6 +- .../java/ibc/tendermint/TendermintHelper.java | 62 +- .../ibc/tendermint/TendermintLightClient.java | 55 +- .../java/ibc/tendermint/LightClientTest.java | 84 +- .../ibc/tendermint/LightClientTestBase.java | 53 +- .../commit.1.json | 72 + .../commit.2.json | 72 + .../commit.3.json | 72 + .../validators.1.json | 52 + .../validators.2.json | 52 + .../validators.3.json | 52 + .../ibc/tendermint/light/TendermintLight.java | 11972 ++++++++++++++++ .../proto/clients/tendermint/BlockID.java | 59 + .../proto/clients/tendermint/BlockIDFlag.java | 11 + .../clients/tendermint/CanonicalBlockID.java | 59 + .../tendermint/CanonicalPartSetHeader.java | 60 + .../clients/tendermint/CanonicalVote.java | 130 + .../proto/clients/tendermint/ClientState.java | 181 + .../icon/proto/clients/tendermint/Commit.java | 96 + .../proto/clients/tendermint/CommitSig.java | 94 + .../proto/clients/tendermint/Consensus.java | 60 + .../clients/tendermint/ConsensusState.java | 77 + .../proto/clients/tendermint/Duration.java | 60 + .../proto/clients/tendermint/Fraction.java | 60 + .../proto/clients/tendermint/LightHeader.java | 265 + .../clients/tendermint/PartSetHeader.java | 60 + .../proto/clients/tendermint/PublicKey.java | 76 + .../clients/tendermint/SignedHeader.java | 59 + .../clients/tendermint/SignedMsgType.java | 11 + .../clients/tendermint/SimpleValidator.java | 60 + .../proto/clients/tendermint/Timestamp.java | 60 + .../proto/clients/tendermint/TmHeader.java | 94 + .../proto/clients/tendermint/Validator.java | 94 + .../clients/tendermint/ValidatorSet.java | 79 + .../icon/proto/clients/tendermint/Vote.java | 163 + .../proto/core/commitment/BatchEntry.java | 59 + .../proto/core/commitment/BatchProof.java | 44 + .../core/commitment/CommitmentProof.java | 93 + .../core/commitment/CompressedBatchEntry.java | 59 + .../core/commitment/CompressedBatchProof.java | 61 + .../commitment/CompressedExistenceProof.java | 96 + .../CompressedNonExistenceProof.java | 76 + .../proto/core/commitment/ExistenceProof.java | 95 + .../icon/proto/core/commitment/HashOp.java | 17 + .../icon/proto/core/commitment/InnerOp.java | 77 + .../icon/proto/core/commitment/InnerSpec.java | 131 + .../icon/proto/core/commitment/LeafOp.java | 111 + .../icon/proto/core/commitment/LengthOp.java | 21 + .../proto/core/commitment/MerklePath.java | 45 + .../proto/core/commitment/MerklePrefix.java | 42 + .../proto/core/commitment/MerkleProof.java | 44 + .../proto/core/commitment/MerkleRoot.java | 42 + .../core/commitment/NonExistenceProof.java | 76 + .../icon/proto/core/commitment/ProofSpec.java | 112 + .../main/java/ibc/icon/score/util/Proto.java | 16 +- contracts/javascore/settings.gradle | 4 + .../clients/tendermint/TendermintLight.proto | 206 + 315 files changed, 21630 insertions(+), 168 deletions(-) create mode 100644 contracts/javascore/lightclients/ics-08-tendermint/build.gradle create mode 100644 contracts/javascore/lightclients/ics-08-tendermint/src/main/java/ibc/ics08/tendermint/ICS08TendermintLightClient.java create mode 100644 contracts/javascore/lightclients/ics-08-tendermint/src/main/java/ibc/ics08/tendermint/Tendermint.java create mode 100644 contracts/javascore/lightclients/ics-08-tendermint/src/main/java/ibc/ics08/tendermint/TendermintHelper.java create mode 100644 contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/LightClientTest.java create mode 100644 contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/LightClientTestBase.java create mode 100644 contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/adjacent/commit.1.json create mode 100644 contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/adjacent/commit.2.json create mode 100644 contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/adjacent/commit.3.json create mode 100644 contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/adjacent/validators.1.json create mode 100644 contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/adjacent/validators.2.json create mode 100644 contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/adjacent/validators.3.json create mode 100644 contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/malicious/commit.1.json create mode 100644 contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/malicious/commit.2.json create mode 100644 contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/malicious/commit.3.json create mode 100644 contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/malicious/validators.1.json create mode 100644 contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/malicious/validators.2.json create mode 100644 contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/malicious/validators.3.json create mode 100644 contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/multi-validator/commit.1.json create mode 100644 contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/multi-validator/commit.2.json create mode 100644 contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/multi-validator/commit.3.json create mode 100644 contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/multi-validator/validators.1.json create mode 100644 contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/multi-validator/validators.2.json create mode 100644 contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/multi-validator/validators.3.json create mode 100644 contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/simple/commit.1.json create mode 100644 contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/simple/commit.2.json create mode 100644 contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/simple/commit.3.json create mode 100644 contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/simple/validators.1.json create mode 100644 contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/simple/validators.2.json create mode 100644 contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/simple/validators.3.json rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/amino/AminoProto.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/cosmos/ics23/v1/BatchEntry.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/cosmos/ics23/v1/BatchEntryOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/cosmos/ics23/v1/BatchProof.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/cosmos/ics23/v1/BatchProofOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/cosmos/ics23/v1/CommitmentProof.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/cosmos/ics23/v1/CommitmentProofOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/cosmos/ics23/v1/CompressedBatchEntry.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/cosmos/ics23/v1/CompressedBatchEntryOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/cosmos/ics23/v1/CompressedBatchProof.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/cosmos/ics23/v1/CompressedBatchProofOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/cosmos/ics23/v1/CompressedExistenceProof.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/cosmos/ics23/v1/CompressedExistenceProofOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/cosmos/ics23/v1/CompressedNonExistenceProof.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/cosmos/ics23/v1/CompressedNonExistenceProofOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/cosmos/ics23/v1/ExistenceProof.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/cosmos/ics23/v1/ExistenceProofOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/cosmos/ics23/v1/HashOp.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/cosmos/ics23/v1/InnerOp.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/cosmos/ics23/v1/InnerOpOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/cosmos/ics23/v1/InnerSpec.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/cosmos/ics23/v1/InnerSpecOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/cosmos/ics23/v1/LeafOp.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/cosmos/ics23/v1/LeafOpOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/cosmos/ics23/v1/LengthOp.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/cosmos/ics23/v1/NonExistenceProof.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/cosmos/ics23/v1/NonExistenceProofOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/cosmos/ics23/v1/ProofSpec.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/cosmos/ics23/v1/ProofSpecOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/cosmos/ics23/v1/ProofsProto.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/cosmos/upgrade/v1beta1/CancelSoftwareUpgradeProposal.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/cosmos/upgrade/v1beta1/CancelSoftwareUpgradeProposalOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/cosmos/upgrade/v1beta1/ModuleVersion.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/cosmos/upgrade/v1beta1/ModuleVersionOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/cosmos/upgrade/v1beta1/Plan.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/cosmos/upgrade/v1beta1/PlanOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/cosmos/upgrade/v1beta1/SoftwareUpgradeProposal.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/cosmos/upgrade/v1beta1/SoftwareUpgradeProposalOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/cosmos/upgrade/v1beta1/UpgradeProto.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/cosmos_proto/CosmosProto.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/cosmos_proto/InterfaceDescriptor.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/cosmos_proto/InterfaceDescriptorOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/cosmos_proto/ScalarDescriptor.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/cosmos_proto/ScalarDescriptorOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/cosmos_proto/ScalarType.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/gogoproto/GogoProto.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/ibc/core/client/v1/ClientConsensusStates.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/ibc/core/client/v1/ClientConsensusStatesOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/ibc/core/client/v1/ClientProto.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/ibc/core/client/v1/ClientUpdateProposal.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/ibc/core/client/v1/ClientUpdateProposalOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/ibc/core/client/v1/ConsensusStateWithHeight.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/ibc/core/client/v1/ConsensusStateWithHeightOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/ibc/core/client/v1/Height.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/ibc/core/client/v1/HeightOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/ibc/core/client/v1/IdentifiedClientState.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/ibc/core/client/v1/IdentifiedClientStateOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/ibc/core/client/v1/Params.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/ibc/core/client/v1/ParamsOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/ibc/core/client/v1/UpgradeProposal.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/ibc/core/client/v1/UpgradeProposalOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/ibc/core/commitment/v1/CommitmentProto.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/ibc/core/commitment/v1/MerklePath.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/ibc/core/commitment/v1/MerklePathOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/ibc/core/commitment/v1/MerklePrefix.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/ibc/core/commitment/v1/MerklePrefixOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/ibc/core/commitment/v1/MerkleProof.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/ibc/core/commitment/v1/MerkleProofOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/ibc/core/commitment/v1/MerkleRoot.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/ibc/core/commitment/v1/MerkleRootOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/ibc/lightclients/tendermint/v1/ClientState.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/ibc/lightclients/tendermint/v1/ClientStateOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/ibc/lightclients/tendermint/v1/ConsensusState.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/ibc/lightclients/tendermint/v1/ConsensusStateOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/ibc/lightclients/tendermint/v1/Fraction.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/ibc/lightclients/tendermint/v1/FractionOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/ibc/lightclients/tendermint/v1/Header.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/ibc/lightclients/tendermint/v1/HeaderOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/ibc/lightclients/tendermint/v1/Misbehaviour.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/ibc/lightclients/tendermint/v1/MisbehaviourOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/ibc/lightclients/tendermint/v1/TendermintLightProto.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/lightclient/v1/BlockUpdate.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/lightclient/v1/BlockUpdateOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/lightclient/v1/ClientState.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/lightclient/v1/ClientStateOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/lightclient/v1/ConsensusState.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/lightclient/v1/ConsensusStateOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/lightclient/v1/LightProto.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/lightclient/v1/Misbehaviour.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/lightclient/v1/MisbehaviourOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/lightclient/v1/TrustLevel.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/lightclient/v1/TrustLevelOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/proto/core/channel/Channel.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/proto/core/channel/ChannelOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/proto/core/channel/ChannelProto.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/proto/core/channel/Packet.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/proto/core/channel/PacketOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/proto/core/channel/PacketState.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/proto/core/channel/PacketStateOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/proto/core/client/ClientProto.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/proto/core/client/Height.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/proto/core/client/HeightOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/proto/core/commitment/BatchEntry.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/proto/core/commitment/BatchEntryOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/proto/core/commitment/BatchProof.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/proto/core/commitment/BatchProofOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/proto/core/commitment/CommitmentProof.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/proto/core/commitment/CommitmentProofOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/proto/core/commitment/CommitmentProto.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/proto/core/commitment/CompressedBatchEntry.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/proto/core/commitment/CompressedBatchEntryOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/proto/core/commitment/CompressedBatchProof.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/proto/core/commitment/CompressedBatchProofOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/proto/core/commitment/CompressedExistenceProof.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/proto/core/commitment/CompressedExistenceProofOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/proto/core/commitment/CompressedNonExistenceProof.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/proto/core/commitment/CompressedNonExistenceProofOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/proto/core/commitment/ExistenceProof.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/proto/core/commitment/ExistenceProofOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/proto/core/commitment/HashOp.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/proto/core/commitment/InnerOp.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/proto/core/commitment/InnerOpOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/proto/core/commitment/InnerSpec.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/proto/core/commitment/InnerSpecOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/proto/core/commitment/LeafOp.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/proto/core/commitment/LeafOpOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/proto/core/commitment/LengthOp.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/proto/core/commitment/MerklePath.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/proto/core/commitment/MerklePathOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/proto/core/commitment/MerklePrefix.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/proto/core/commitment/MerklePrefixOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/proto/core/commitment/MerkleProof.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/proto/core/commitment/MerkleProofOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/proto/core/commitment/MerkleRoot.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/proto/core/commitment/MerkleRootOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/proto/core/commitment/NonExistenceProof.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/proto/core/commitment/NonExistenceProofOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/proto/core/commitment/ProofSpec.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/proto/core/commitment/ProofSpecOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/proto/core/commitment/ProofsProto.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/proto/core/connection/ConnectionEnd.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/proto/core/connection/ConnectionEndOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/proto/core/connection/ConnectionProto.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/proto/core/connection/Counterparty.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/proto/core/connection/CounterpartyOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/proto/core/connection/Version.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/proto/core/connection/VersionOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/types/v1/BTPHeader.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/types/v1/BTPHeaderOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/types/v1/BlockIDFlag.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/types/v1/MerkleNode.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/types/v1/MerkleNodeOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/types/v1/MerkleProofs.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/types/v1/MerkleProofsOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/types/v1/SignedHeader.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/types/v1/SignedHeaderOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/types/v1/SignedMsgType.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/icon/types/v1/TypesProto.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/tendermint/crypto/DominoOp.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/tendermint/crypto/DominoOpOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/tendermint/crypto/KeysProto.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/tendermint/crypto/Proof.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/tendermint/crypto/ProofOp.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/tendermint/crypto/ProofOpOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/tendermint/crypto/ProofOps.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/tendermint/crypto/ProofOpsOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/tendermint/crypto/ProofOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/tendermint/crypto/ProofProto.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/tendermint/crypto/PublicKey.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/tendermint/crypto/PublicKeyOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/tendermint/crypto/ValueOp.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/tendermint/crypto/ValueOpOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/tendermint/types/BlockID.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/tendermint/types/BlockIDFlag.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/tendermint/types/BlockIDOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/tendermint/types/BlockMeta.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/tendermint/types/BlockMetaOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/tendermint/types/Commit.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/tendermint/types/CommitOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/tendermint/types/CommitSig.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/tendermint/types/CommitSigOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/tendermint/types/Data.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/tendermint/types/DataOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/tendermint/types/Header.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/tendermint/types/HeaderOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/tendermint/types/LightBlock.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/tendermint/types/LightBlockOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/tendermint/types/Part.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/tendermint/types/PartOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/tendermint/types/PartSetHeader.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/tendermint/types/PartSetHeaderOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/tendermint/types/Proposal.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/tendermint/types/ProposalOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/tendermint/types/SignedHeader.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/tendermint/types/SignedHeaderOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/tendermint/types/SignedMsgType.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/tendermint/types/SimpleValidator.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/tendermint/types/SimpleValidatorOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/tendermint/types/TxProof.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/tendermint/types/TxProofOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/tendermint/types/TypesProto.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/tendermint/types/Validator.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/tendermint/types/ValidatorOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/tendermint/types/ValidatorProto.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/tendermint/types/ValidatorSet.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/tendermint/types/ValidatorSetOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/tendermint/types/Vote.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/tendermint/types/VoteOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/tendermint/version/App.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/tendermint/version/AppOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/tendermint/version/Consensus.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/tendermint/version/ConsensusOrBuilder.java (100%) rename contracts/javascore/lightclients/{tendermint/src/test/java/ibc => ics-08-tendermint/src/test/java/ibc/ics08}/tendermint/test/proto/tendermint/version/TypesProto.java (100%) create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/data/validator-with-long-voting-power/commit.1.json create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/data/validator-with-long-voting-power/commit.2.json create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/data/validator-with-long-voting-power/commit.3.json create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/data/validator-with-long-voting-power/validators.1.json create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/data/validator-with-long-voting-power/validators.2.json create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/data/validator-with-long-voting-power/validators.3.json create mode 100644 contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/light/TendermintLight.java create mode 100644 contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/BlockID.java create mode 100644 contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/BlockIDFlag.java create mode 100644 contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/CanonicalBlockID.java create mode 100644 contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/CanonicalPartSetHeader.java create mode 100644 contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/CanonicalVote.java create mode 100644 contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/ClientState.java create mode 100644 contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/Commit.java create mode 100644 contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/CommitSig.java create mode 100644 contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/Consensus.java create mode 100644 contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/ConsensusState.java create mode 100644 contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/Duration.java create mode 100644 contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/Fraction.java create mode 100644 contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/LightHeader.java create mode 100644 contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/PartSetHeader.java create mode 100644 contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/PublicKey.java create mode 100644 contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/SignedHeader.java create mode 100644 contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/SignedMsgType.java create mode 100644 contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/SimpleValidator.java create mode 100644 contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/Timestamp.java create mode 100644 contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/TmHeader.java create mode 100644 contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/Validator.java create mode 100644 contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/ValidatorSet.java create mode 100644 contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/Vote.java create mode 100644 contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/BatchEntry.java create mode 100644 contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/BatchProof.java create mode 100644 contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/CommitmentProof.java create mode 100644 contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/CompressedBatchEntry.java create mode 100644 contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/CompressedBatchProof.java create mode 100644 contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/CompressedExistenceProof.java create mode 100644 contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/CompressedNonExistenceProof.java create mode 100644 contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/ExistenceProof.java create mode 100644 contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/HashOp.java create mode 100644 contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/InnerOp.java create mode 100644 contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/InnerSpec.java create mode 100644 contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/LeafOp.java create mode 100644 contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/LengthOp.java create mode 100644 contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/MerklePath.java create mode 100644 contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/MerklePrefix.java create mode 100644 contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/MerkleProof.java create mode 100644 contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/MerkleRoot.java create mode 100644 contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/NonExistenceProof.java create mode 100644 contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/ProofSpec.java create mode 100644 proto/clients/tendermint/TendermintLight.proto diff --git a/contracts/javascore/ibc/src/intTest/java/ibc/core/integration/IBCIntegrationTest.java b/contracts/javascore/ibc/src/intTest/java/ibc/core/integration/IBCIntegrationTest.java index 40836db6c..0dba5f8b8 100644 --- a/contracts/javascore/ibc/src/intTest/java/ibc/core/integration/IBCIntegrationTest.java +++ b/contracts/javascore/ibc/src/intTest/java/ibc/core/integration/IBCIntegrationTest.java @@ -64,7 +64,7 @@ static void setup() throws Exception { @Test @Order(0) void registerClient() { - getClientInterface(owner).registerClient(clientType, mockLightClient._address()); + getClientInterface(owner).registerClient(clientType, mockLightClient._address(), 0); } @Test diff --git a/contracts/javascore/ibc/src/main/java/ibc/ics02/client/IBCClient.java b/contracts/javascore/ibc/src/main/java/ibc/ics02/client/IBCClient.java index f014a5c96..a22700d38 100644 --- a/contracts/javascore/ibc/src/main/java/ibc/ics02/client/IBCClient.java +++ b/contracts/javascore/ibc/src/main/java/ibc/ics02/client/IBCClient.java @@ -3,6 +3,7 @@ import ibc.icon.score.util.Logger; import ibc.icon.score.util.NullChecker; import ibc.ics24.host.IBCHost; +import ibc.ics24.host.IBCStore; import icon.ibc.interfaces.ILightClient; import icon.ibc.structs.messages.MsgCreateClient; import icon.ibc.structs.messages.MsgUpdateClient; @@ -16,9 +17,10 @@ public class IBCClient extends IBCHost { static Logger logger = new Logger("ibc-core"); - public void registerClient(String clientType, Address lightClient) { + public void registerClient(String clientType, Address lightClient, int hashType) { Context.require(clientRegistry.get(clientType) == null, "Already registered."); clientRegistry.set(clientType, lightClient); + IBCStore.hashType.set(clientType, hashType); } public String _createClient(MsgCreateClient msg) { @@ -32,6 +34,7 @@ public String _createClient(MsgCreateClient msg) { clientTypes.set(clientId, msg.getClientType()); clientImplementations.set(clientId, lightClientAddr); btpNetworkId.set(clientId, msg.getBtpNetworkId()); + // hashMethod.set(clientId, msg.getHashMethod()); ILightClient client = getClient(clientId); client.createClient(clientId, msg.getClientState(), msg.getConsensusState()); diff --git a/contracts/javascore/ibc/src/main/java/ibc/ics03/connection/IBCConnection.java b/contracts/javascore/ibc/src/main/java/ibc/ics03/connection/IBCConnection.java index 147917c5e..211e75585 100644 --- a/contracts/javascore/ibc/src/main/java/ibc/ics03/connection/IBCConnection.java +++ b/contracts/javascore/ibc/src/main/java/ibc/ics03/connection/IBCConnection.java @@ -1,17 +1,18 @@ package ibc.ics03.connection; import java.math.BigInteger; -import java.util.Arrays; import java.util.List; import icon.proto.core.client.Height; import icon.proto.core.connection.ConnectionEnd; import icon.proto.core.connection.Counterparty; import icon.proto.core.connection.Version; +import ibc.core.commitment.v1.MerklePrefix; import ibc.icon.score.util.ByteUtil; import ibc.icon.score.util.Logger; import ibc.ics02.client.IBCClient; import ibc.ics24.host.IBCCommitment; +import ibc.ics24.host.IBCHost; import icon.ibc.interfaces.ILightClient; import icon.ibc.structs.messages.MsgConnectionOpenAck; import icon.ibc.structs.messages.MsgConnectionOpenConfirm; @@ -24,6 +25,12 @@ public class IBCConnection extends IBCClient { public static final String v1Identifier = "1"; public static final List supportedV1Features = List.of("ORDER_ORDERED", "ORDER_UNORDERED"); + public static final MerklePrefix ICS08PREFIX = new MerklePrefix(); + static { + ICS08PREFIX.setKeyPrefix("ibc".getBytes()); + + } + Logger logger = new Logger("ibc-core"); public String _connectionOpenInit(MsgConnectionOpenInit msg) { @@ -67,6 +74,9 @@ public String _connectionOpenTry(MsgConnectionOpenTry msg) { Counterparty expectedCounterparty = new Counterparty(); expectedCounterparty.setClientId(msg.getClientId()); expectedCounterparty.setConnectionId(""); + if (IBCCommitment.getHashType(msg.getClientId()) == IBCHost.HashType.ICS08.type) { + expectedCounterparty.setPrefix(ICS08PREFIX); + } ConnectionEnd expectedConnection = new ConnectionEnd(); expectedConnection.setClientId(counterparty.getClientId()); @@ -108,6 +118,9 @@ public byte[] _connectionOpenAck(MsgConnectionOpenAck msg) { Counterparty expectedCounterparty = new Counterparty(); expectedCounterparty.setClientId(connection.getClientId()); expectedCounterparty.setConnectionId(msg.getConnectionId()); + if (IBCCommitment.getHashType(connection.getClientId()) == IBCHost.HashType.ICS08.type) { + expectedCounterparty.setPrefix(ICS08PREFIX); + } ConnectionEnd expectedConnection = new ConnectionEnd(); expectedConnection.setClientId(connection.getCounterparty().getClientId()); @@ -150,6 +163,9 @@ public byte[] _connectionOpenConfirm(MsgConnectionOpenConfirm msg) { Counterparty expectedCounterparty = new Counterparty(); expectedCounterparty.setClientId(connection.getClientId()); expectedCounterparty.setConnectionId(msg.getConnectionId()); + if (IBCCommitment.getHashType(connection.getClientId()) == IBCHost.HashType.ICS08.type) { + expectedCounterparty.setPrefix(ICS08PREFIX); + } ConnectionEnd expectedConnection = new ConnectionEnd(); expectedConnection.setClientId(connection.getCounterparty().getClientId()); diff --git a/contracts/javascore/ibc/src/main/java/ibc/ics04/channel/IBCPacket.java b/contracts/javascore/ibc/src/main/java/ibc/ics04/channel/IBCPacket.java index 4cca5cedb..08812678e 100644 --- a/contracts/javascore/ibc/src/main/java/ibc/ics04/channel/IBCPacket.java +++ b/contracts/javascore/ibc/src/main/java/ibc/ics04/channel/IBCPacket.java @@ -3,6 +3,7 @@ import ibc.icon.score.util.ByteUtil; import ibc.icon.score.util.Proto; import ibc.ics24.host.IBCCommitment; +import ibc.ics24.host.IBCHost; import icon.ibc.interfaces.ILightClient; import icon.ibc.structs.messages.MsgRequestTimeoutPacket; import score.Context; @@ -58,7 +59,7 @@ public void _sendPacket(Packet packet) { packet.getSourceChannel(), packet.getSequence()); - byte[] packetCommitment = createPacketCommitment(packet); + byte[] packetCommitment = createPacketCommitment(connection.getClientId(), packet); commitments.set(packetCommitmentKey, packetCommitment); packetHeights.at(packet.getSourcePort()).at(packet.getSourceChannel()).set(packet.getSequence(), Context.getBlockHeight()); @@ -99,7 +100,7 @@ public void _recvPacket(Packet packet, byte[] proof, byte[] proofHeight) { byte[] commitmentPath = IBCCommitment.packetCommitmentPath(packet.getSourcePort(), packet.getSourceChannel(), packet.getSequence()); - byte[] commitmentBytes = createPacketCommitmentBytes(packet); + byte[] commitmentBytes = createPacketCommitmentBytes(connection.getClientId(), packet); verifyPacketCommitment( connection, @@ -145,7 +146,7 @@ public void _writeAcknowledgement(String destinationPortId, String destinationCh byte[] ackCommitmentKey = IBCCommitment.packetAcknowledgementCommitmentKey(destinationPortId, destinationChannel, sequence); Context.require(commitments.get(ackCommitmentKey) == null, "acknowledgement for packet already exists"); - byte[] ackCommitment = IBCCommitment.keccak256(acknowledgement); + byte[] ackCommitment = createAcknowledgmentCommitment(connection.getClientId(), acknowledgement); commitments.set(ackCommitmentKey, ackCommitment); ackHeights.at(destinationPortId).at(destinationChannel).set(sequence, Context.getBlockHeight()); @@ -174,18 +175,19 @@ public void _acknowledgePacket(Packet packet, byte[] acknowledgement, byte[] pro packet.getSourceChannel(), packet.getSequence()); byte[] packetCommitment = commitments.get(packetCommitmentKey); Context.require(packetCommitment != null, "packet commitment not found"); - byte[] commitment = createPacketCommitment(packet); + byte[] commitment = createPacketCommitment(connection.getClientId(), packet); Context.require(Arrays.equals(packetCommitment, commitment), "commitment byte[] are not equal"); byte[] packetAckPath = IBCCommitment.packetAcknowledgementCommitmentPath(packet.getDestinationPort(), packet.getDestinationChannel(), packet.getSequence()); + byte[] commitmentBytes = createAcknowledgmentCommitmentBytes(connection.getClientId(), acknowledgement); verifyPacketAcknowledgement( connection, proofHeight, proof, packetAckPath, - acknowledgement); + commitmentBytes); if (channel.getOrdering() == Channel.Order.ORDER_ORDERED) { DictDB nextSequenceAckSourcePort = nextSequenceAcknowledgements @@ -236,7 +238,7 @@ public void _requestTimeout(MsgRequestTimeoutPacket msg) { byte[] commitmentPath = IBCCommitment.packetCommitmentPath(packet.getSourcePort(), packet.getSourceChannel(), packet.getSequence()); - byte[] commitmentBytes = createPacketCommitmentBytes(packet); + byte[] commitmentBytes = createPacketCommitmentBytes(connection.getClientId(), packet); verifyPacketCommitment( connection, proofHeight, @@ -300,7 +302,7 @@ public void _timeoutPacket(Packet packet, byte[] proofHeight, byte[] proof, BigI packet.getSourceChannel(), packet.getSequence()); byte[] packetCommitment = commitments.get(packetCommitmentKey); Context.require(packetCommitment != null, "packet commitment not found"); - byte[] commitment = createPacketCommitment(packet); + byte[] commitment = createPacketCommitment(connection.getClientId(), packet); Context.require(Arrays.equals(packetCommitment, commitment), "commitment byte[] are not equal"); @@ -432,11 +434,20 @@ private BigInteger calcBlockDelay(BigInteger timeDelay) { return blockDelay; } - private byte[] createPacketCommitment(Packet packet) { - return IBCCommitment.keccak256(createPacketCommitmentBytes(packet)); + private byte[] createPacketCommitment(String clientId, Packet packet) { + return IBCCommitment.keccak256(createPacketCommitmentBytes(clientId, packet)); + } + + private byte[] createPacketCommitmentBytes(String clientId, Packet packet) { + int hashType = IBCCommitment.getHashType(clientId); + if (hashType == IBCHost.HashType.ICS08.type) { + return createIBCPacketCommitmentBytes(packet); + } + + return createWasmPacketCommitmentBytes(packet); } - public static byte[] createPacketCommitmentBytes(Packet packet) { + public static byte[] createWasmPacketCommitmentBytes(Packet packet) { return ByteUtil.join( Proto.encodeFixed64(packet.getTimeoutTimestamp(), false), Proto.encodeFixed64(packet.getTimeoutHeight().getRevisionNumber(), @@ -446,6 +457,29 @@ public static byte[] createPacketCommitmentBytes(Packet packet) { IBCCommitment.keccak256(packet.getData())); } + public static byte[] createIBCPacketCommitmentBytes(Packet packet) { + return IBCCommitment.sha256(ByteUtil.join( + Proto.encodeFixed64(packet.getTimeoutTimestamp(), false), + Proto.encodeFixed64(packet.getTimeoutHeight().getRevisionNumber(), + false), + Proto.encodeFixed64(packet.getTimeoutHeight().getRevisionHeight(), + false), + IBCCommitment.sha256(packet.getData()))); + } + + private byte[] createAcknowledgmentCommitment(String clientId, byte[] ack) { + return IBCCommitment.keccak256(createAcknowledgmentCommitmentBytes(clientId, ack)); + } + + public static byte[] createAcknowledgmentCommitmentBytes(String clientId, byte[] ack) { + int hashType = IBCCommitment.getHashType(clientId); + if (hashType == IBCHost.HashType.ICS08.type) { + return IBCCommitment.sha256(ack); + } + + return ack; + } + private boolean lt(Height h1, Height h2) { return h1.getRevisionNumber().compareTo(h2.getRevisionNumber()) < 0 || (h1.getRevisionNumber().equals(h2.getRevisionNumber()) diff --git a/contracts/javascore/ibc/src/main/java/ibc/ics23/commitment/types/Merkle.java b/contracts/javascore/ibc/src/main/java/ibc/ics23/commitment/types/Merkle.java index 802ba75af..8efd8d4a0 100644 --- a/contracts/javascore/ibc/src/main/java/ibc/ics23/commitment/types/Merkle.java +++ b/contracts/javascore/ibc/src/main/java/ibc/ics23/commitment/types/Merkle.java @@ -20,10 +20,10 @@ public class Merkle { Proof.getTendermintSpec() ); - public static MerklePath applyPrefix(String path) { + public static MerklePath applyPrefix(String prefix, String path) { var mpath = new MerklePath(); List keyPath = new ArrayList<>(); - keyPath.add(StringUtil.bytesToHex("wasm".getBytes())); + keyPath.add(prefix); keyPath.add(path); mpath.setKeyPath(keyPath); return mpath; diff --git a/contracts/javascore/ibc/src/main/java/ibc/ics24/host/IBCCommitment.java b/contracts/javascore/ibc/src/main/java/ibc/ics24/host/IBCCommitment.java index c36785c28..3ffbc18ad 100644 --- a/contracts/javascore/ibc/src/main/java/ibc/ics24/host/IBCCommitment.java +++ b/contracts/javascore/ibc/src/main/java/ibc/ics24/host/IBCCommitment.java @@ -11,8 +11,8 @@ * "https://github.com/cosmos/ibc/tree/main/spec/core/ics-024-host-requirements#path-space">path-space */ public class IBCCommitment { - private static final String KECCAK256 = "keccak-256"; - private static final String SHA256 = "sha-256"; + public static final String KECCAK256 = "keccak-256"; + public static final String SHA256 = "sha-256"; public static byte[] keccak256(byte[] msg) { return Context.hash(KECCAK256, msg); @@ -22,6 +22,11 @@ public static byte[] sha256(byte[] msg) { return Context.hash(SHA256, msg); } + public static int getHashType(String clientId) { + String clientType = IBCStore.clientTypes.get(clientId); + return IBCStore.hashType.getOrDefault(clientType, IBCHost.HashType.WASM.type); + } + public static byte[] clientStatePath(String clientId) { return StringUtil.encodePacked("clients/", clientId, "/clientState"); } diff --git a/contracts/javascore/ibc/src/main/java/ibc/ics24/host/IBCHost.java b/contracts/javascore/ibc/src/main/java/ibc/ics24/host/IBCHost.java index c6c15c421..a5237ba09 100644 --- a/contracts/javascore/ibc/src/main/java/ibc/ics24/host/IBCHost.java +++ b/contracts/javascore/ibc/src/main/java/ibc/ics24/host/IBCHost.java @@ -11,6 +11,25 @@ public class IBCHost extends IBCStore { private static final String TAG = "IBCHOST: "; private static final Address chainScore = Address.fromString("cx0000000000000000000000000000000000000000"); + public enum HashType { + WASM(0), + ICS08(1); + + public final int type; + HashType(int type){ this.type = type; } + + public int type() { return type; } + + static public HashType of(int type) { + for(HashType t : values()) { + if (t.type == type) { + return t; + } + } + throw new IllegalArgumentException(); + } + } + /*** * claimCapability allows the IBC app module to claim a capability that core IBC * passes to it diff --git a/contracts/javascore/ibc/src/main/java/ibc/ics24/host/IBCStore.java b/contracts/javascore/ibc/src/main/java/ibc/ics24/host/IBCStore.java index d641338ff..318f63e12 100644 --- a/contracts/javascore/ibc/src/main/java/ibc/ics24/host/IBCStore.java +++ b/contracts/javascore/ibc/src/main/java/ibc/ics24/host/IBCStore.java @@ -35,6 +35,7 @@ public abstract class IBCStore extends ModuleManager implements IIBCHost { private static final String BTP_NETWORK_ID = "btpNetworkId"; private static final String TIMEOUT_REQUESTS = "timeout_requests"; private static final String ACK_HEIGHTS = "ackHeights"; + private static final String HASH_METHOD = "hashMethod"; // DB Variables // Commitments @@ -81,6 +82,8 @@ public abstract class IBCStore extends ModuleManager implements IIBCHost { public static final DictDB btpNetworkId = Context.newDictDB(BTP_NETWORK_ID, Integer.class); public static final DictDB timeoutRequests = Context.newDictDB(TIMEOUT_REQUESTS, Boolean.class); + public static final DictDB hashType = Context.newDictDB(HASH_METHOD, Integer.class); + @External(readonly = true) public byte[] getCommitment(byte[] key) { return commitments.get(key); diff --git a/contracts/javascore/ibc/src/main/java/ibc/ics25/handler/IBCHandler.java b/contracts/javascore/ibc/src/main/java/ibc/ics25/handler/IBCHandler.java index 0036e25c6..9f1e82de0 100644 --- a/contracts/javascore/ibc/src/main/java/ibc/ics25/handler/IBCHandler.java +++ b/contracts/javascore/ibc/src/main/java/ibc/ics25/handler/IBCHandler.java @@ -3,9 +3,11 @@ import score.Address; import score.Context; import score.annotation.External; +import score.annotation.Optional; import java.math.BigInteger; +import ibc.ics24.host.IBCHost; import icon.ibc.structs.messages.MsgCreateClient; public class IBCHandler extends IBCHandlerPacket { @@ -24,9 +26,10 @@ public String name() { * registerClient registers a new client type into the client registry */ @External - public void registerClient(String clientType, Address client) { + public void registerClient(String clientType, Address client, @Optional int hashType) { onlyOwner(); - super.registerClient(clientType, client); + IBCHost.HashType.of(hashType); + super.registerClient(clientType, client, hashType); } @External diff --git a/contracts/javascore/ibc/src/test/java/ibc/ics02/client/ClientTest.java b/contracts/javascore/ibc/src/test/java/ibc/ics02/client/ClientTest.java index 5bd18f389..06fb9fa8a 100644 --- a/contracts/javascore/ibc/src/test/java/ibc/ics02/client/ClientTest.java +++ b/contracts/javascore/ibc/src/test/java/ibc/ics02/client/ClientTest.java @@ -44,13 +44,13 @@ public void setup() throws Exception { void registerClient_alreadyRegistered() { // Arrange String clientType = "clientType"; - client.invoke(owner, "registerClient", clientType, lightClient.getAddress()); + client.invoke(owner, "registerClient", clientType, lightClient.getAddress(), 0); // Act & Assert String expectedErrorMessage = "Already registered"; Executable registerWithSameType = () -> { client.invoke(owner, "registerClient", clientType, - lightClient.getAddress()); + lightClient.getAddress(), 0); }; AssertionError e = assertThrows(AssertionError.class, registerWithSameType); assertTrue(e.getMessage().contains(expectedErrorMessage)); @@ -85,7 +85,7 @@ void createClient() { String expectedClientId = msg.getClientType() + "-0"; // Act - client.invoke(owner, "registerClient", msg.getClientType(), lightClient.getAddress()); + client.invoke(owner, "registerClient", msg.getClientType(), lightClient.getAddress(), 0); client.invoke(owner, "_createClient", msg); // Assert diff --git a/contracts/javascore/ibc/src/test/java/ibc/ics04/channel/PacketTest.java b/contracts/javascore/ibc/src/test/java/ibc/ics04/channel/PacketTest.java index d1715036f..a40a30f11 100644 --- a/contracts/javascore/ibc/src/test/java/ibc/ics04/channel/PacketTest.java +++ b/contracts/javascore/ibc/src/test/java/ibc/ics04/channel/PacketTest.java @@ -1,6 +1,6 @@ package ibc.ics04.channel; -import static ibc.ics04.channel.IBCPacket.createPacketCommitmentBytes; +import static ibc.ics04.channel.IBCPacket.createWasmPacketCommitmentBytes; import static org.junit.jupiter.api.Assertions.assertArrayEquals; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; @@ -405,7 +405,7 @@ void recvPacket_outOfOrder_UnOrdered() { basePacket.getSourceChannel(), basePacket.getSequence()); byte[] commitmentPath2 = IBCCommitment.packetCommitmentPath(basePacket.getSourcePort(), basePacket.getSourceChannel(), basePacket.getSequence().add(BigInteger.ONE)); - byte[] commitmentBytes = createPacketCommitmentBytes(basePacket); + byte[] commitmentBytes = createWasmPacketCommitmentBytes(basePacket); // Act basePacket.setSequence(BigInteger.TWO); @@ -450,7 +450,7 @@ void recvPacket_UnOrdered() { byte[] commitmentPath = IBCCommitment.packetCommitmentPath(basePacket.getSourcePort(), basePacket.getSourceChannel(), basePacket.getSequence()); - byte[] commitmentBytes = createPacketCommitmentBytes(basePacket); + byte[] commitmentBytes = createWasmPacketCommitmentBytes(basePacket); // Act packet.invoke(owner, "_recvPacket", basePacket, proof, proofHeight.encode()); @@ -470,7 +470,7 @@ void recvPacket_Ordered() { byte[] commitmentPath = IBCCommitment.packetCommitmentPath(basePacket.getSourcePort(), basePacket.getSourceChannel(), basePacket.getSequence()); - byte[] commitmentBytes = createPacketCommitmentBytes(basePacket); + byte[] commitmentBytes = createWasmPacketCommitmentBytes(basePacket); // Act packet.invoke(owner, "_recvPacket", basePacket, proof, proofHeight.encode()); diff --git a/contracts/javascore/ibc/src/test/java/ibc/ics25/handler/IBCHandlerTest.java b/contracts/javascore/ibc/src/test/java/ibc/ics25/handler/IBCHandlerTest.java index b14c93804..85b697bc7 100644 --- a/contracts/javascore/ibc/src/test/java/ibc/ics25/handler/IBCHandlerTest.java +++ b/contracts/javascore/ibc/src/test/java/ibc/ics25/handler/IBCHandlerTest.java @@ -252,7 +252,7 @@ void setExpectedTimePerBlock() throws Exception { void handlerAdminPermissions() { // TODO: should be a admin and not a owner. assertOnlyCallableBy(owner, "bindPort", portId); - assertOnlyCallableBy(owner, "registerClient", clientType, lightClient.getAddress()); + assertOnlyCallableBy(owner, "registerClient", clientType, lightClient.getAddress(), 0); assertOnlyCallableBy(owner, "setExpectedTimePerBlock", BigInteger.TWO); } diff --git a/contracts/javascore/ibc/src/test/java/ibc/ics25/handler/IBCHandlerTestBase.java b/contracts/javascore/ibc/src/test/java/ibc/ics25/handler/IBCHandlerTestBase.java index 83bf08808..3c07930f8 100644 --- a/contracts/javascore/ibc/src/test/java/ibc/ics25/handler/IBCHandlerTestBase.java +++ b/contracts/javascore/ibc/src/test/java/ibc/ics25/handler/IBCHandlerTestBase.java @@ -95,7 +95,7 @@ protected void setup() throws Exception { void createClient() { // Arrange - handler.invoke(owner, "registerClient", clientType, lightClient.getAddress()); + handler.invoke(owner, "registerClient", clientType, lightClient.getAddress(), 0); MsgCreateClient msg = new MsgCreateClient(); msg.setClientState(new byte[0]); msg.setConsensusState(new byte[0]); diff --git a/contracts/javascore/lib/src/main/java/icon/ibc/interfaces/IIBCClient.java b/contracts/javascore/lib/src/main/java/icon/ibc/interfaces/IIBCClient.java index a9bebbd3a..8322ef664 100644 --- a/contracts/javascore/lib/src/main/java/icon/ibc/interfaces/IIBCClient.java +++ b/contracts/javascore/lib/src/main/java/icon/ibc/interfaces/IIBCClient.java @@ -5,6 +5,7 @@ import icon.ibc.structs.messages.MsgUpdateClient; import score.Address; import score.annotation.EventLog; +import score.annotation.Optional; @ScoreClient public interface IIBCClient { @@ -19,8 +20,9 @@ public interface IIBCClient { * {@code @dev} registerClient registers a new client type into the client registry * @param clientType Type of client * @param lightClient Light client contract address + * @param hashType Optional hashType (WASM or ICS08) default WASM */ - void registerClient(String clientType, Address client); + void registerClient(String clientType, Address client, @Optional int hashType); /** * {@code @dev} createClient creates a new client state and populates it with a given diff --git a/contracts/javascore/lightclients/ics-08-tendermint/build.gradle b/contracts/javascore/lightclients/ics-08-tendermint/build.gradle new file mode 100644 index 000000000..9428377b7 --- /dev/null +++ b/contracts/javascore/lightclients/ics-08-tendermint/build.gradle @@ -0,0 +1,71 @@ +version = '0.1.0' + +dependencies { + compileOnly("foundation.icon:javaee-api:$javaeeVersion") + implementation("foundation.icon:javaee-scorex:$scorexVersion") + implementation project(':lib') + implementation project(':score-util') + implementation project(':ibc') + implementation project(':proto-lib') + + testImplementation 'com.google.protobuf:protobuf-javalite:3.16.3' + testImplementation 'com.google.protobuf:protobuf-java-util:3.16.3' + testImplementation 'foundation.icon:javaee-rt:0.9.3' + testImplementation("org.mockito:mockito-core:$mockitoCoreVersion") + testImplementation("org.mockito:mockito-inline:$mockitoCoreVersion") + testImplementation("foundation.icon:javaee-unittest:$javaeeUnittestVersion") + testAnnotationProcessor("foundation.icon:javaee-score-client:$scoreClientVersion") + testImplementation project(':test-lib') + testImplementation("foundation.icon:javaee-score-client:$scoreClientVersion") + testImplementation("com.fasterxml.jackson.core:jackson-databind:$jacksonVersion") + testImplementation("foundation.icon:icon-sdk:$iconsdkVersion") + testImplementation("org.junit.jupiter:junit-jupiter-api:$jupiterApiVersion") + testImplementation("org.junit.jupiter:junit-jupiter-params:$jupiterParamsVersion") + testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:$jupiterEngineVersion") +} + +test { + useJUnitPlatform() +} + +tasks.named('compileJava') { + dependsOn(':ibc:optimizedJar') + dependsOn(':score-util:jar') + dependsOn(':lib:jar') +} + +optimizedJar { + mainClassName = 'ibc.ics08.tendermint.ICS08TendermintLightClient' + duplicatesStrategy = DuplicatesStrategy.EXCLUDE + from { + configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } + } +} + +deployJar { + endpoints { + berlin { + uri = 'https://berlin.net.solidwallet.io/api/v3' + nid = 0x7 + } + lisbon { + uri = 'https://lisbon.net.solidwallet.io/api/v3' + nid = 0x2 + } + local { + uri = 'http://localhost:9082/api/v3' + nid = 0x3 + } + uat { + uri = project.findProperty('uat.host') as String + nid = property('uat.nid') as Integer + to = "$tendermint"?:null + } + } + keystore = rootProject.hasProperty('keystoreName') ? "$keystoreName" : '' + password = rootProject.hasProperty('keystorePass') ? "$keystorePass" : '' + + parameters { + arg('ibcHandler', "$ibcCore") + } +} \ No newline at end of file diff --git a/contracts/javascore/lightclients/ics-08-tendermint/src/main/java/ibc/ics08/tendermint/ICS08TendermintLightClient.java b/contracts/javascore/lightclients/ics-08-tendermint/src/main/java/ibc/ics08/tendermint/ICS08TendermintLightClient.java new file mode 100644 index 000000000..4e9b4664c --- /dev/null +++ b/contracts/javascore/lightclients/ics-08-tendermint/src/main/java/ibc/ics08/tendermint/ICS08TendermintLightClient.java @@ -0,0 +1,335 @@ +package ibc.ics08.tendermint; + +import icon.ibc.interfaces.ILightClient; +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.NullChecker; +import ibc.icon.score.util.StringUtil; +import ibc.ics23.commitment.types.Merkle; +import ibc.ics24.host.IBCCommitment; +import cosmos.ics23.v1.*; +import google.protobuf.*; +import tendermint.types.*; +import ibc.core.commitment.v1.*; +import ibc.lightclients.tendermint.v1.*; +import ibc.core.client.v1.Height; +import score.Address; +import score.BranchDB; +import score.Context; +import score.DictDB; +import score.annotation.External; +import score.annotation.Optional; + +import java.math.BigInteger; +import java.util.Arrays; +import java.util.Map; + +import static ibc.ics08.tendermint.TendermintHelper.*; +import static ibc.ics23.commitment.types.Merkle.applyPrefix; +import static score.Context.require; + +public class ICS08TendermintLightClient extends Tendermint implements ILightClient { + public final Address ibcHandler; + + public static final String CLIENT_STATES = "CLIENT_STATES"; + public static final String CONSENSUS_STATES = "CONSENSUS_STATES"; + public static final String PROCESSED_TIMES = "PROCESSED_TIMES"; + public static final String PROCESSED_HEIGHTS = "PROCESSED_HEIGHTS"; + + public static final DictDB clientStates = Context.newDictDB(CLIENT_STATES, byte[].class); + public static final BranchDB> consensusStates = Context.newBranchDB( + CONSENSUS_STATES, byte[].class); + public static final BranchDB> processedTimes = Context.newBranchDB( + PROCESSED_TIMES, BigInteger.class); + public static final BranchDB> processedHeights = Context.newBranchDB( + PROCESSED_HEIGHTS, BigInteger.class); + + public ICS08TendermintLightClient(Address ibcHandler) { + this.ibcHandler = ibcHandler; + } + + private void onlyHandler() { + Address caller = Context.getCaller(); + Context.require(caller.equals(ibcHandler), "Only the IBC handler: " + ibcHandler + " is allowed"); + } + + /** + * @dev getTimestampAtHeight returns the timestamp of the consensus state at the + * given height. + */ + @External(readonly = true) + public BigInteger getTimestampAtHeight( + String clientId, + byte[] height) { + Height decodedHeight = Height.decode(height); + byte[] encodedConsensusState = consensusStates.at(clientId).get(decodedHeight.getRevisionHeight()); + NullChecker.requireNotNull(encodedConsensusState, + "height: " + decodedHeight.getRevisionHeight() + " does not have a consensus state"); + ConsensusState consensusState = ConsensusState.decode(encodedConsensusState); + return consensusState.getTimestamp().getSeconds(); + } + + /** + * @dev getLatestHeight returs latest height stored in the given client state + */ + @External(readonly = true) + public byte[] getLatestHeight(String clientId) { + byte[] encodedClientState = clientStates.get(clientId); + NullChecker.requireNotNull(encodedClientState, "Client does not exist"); + ClientState clientState = ClientState.decode(encodedClientState); + return clientState.getLatestHeight().encode(); + } + + @External(readonly = true) + public byte[] getConsensusState( + String clientId, + byte[] height) { + Height decodedHeight = Height.decode(height); + return consensusStates.at(clientId).get(decodedHeight.getRevisionHeight()); + } + + @External(readonly = true) + public byte[] getClientState(String clientId) { + return clientStates.get(clientId); + } + + /** + * @dev createClient creates a new client with the given state + */ + @External + public Map createClient(String clientId, byte[] clientStateBytes, byte[] consensusStateBytes) { + onlyHandler(); + Context.require(clientStates.get(clientId) == null, "Client already exists"); + ClientState clientState = ClientState.decode(clientStateBytes); + + Context.require(!clientState.getTrustLevel().getDenominator().equals(BigInteger.ZERO), + "trustLevel has zero Denominator"); + + clientStates.set(clientId, clientStateBytes); + consensusStates.at(clientId).set(clientState.getLatestHeight().getRevisionHeight(), consensusStateBytes); + + return Map.of( + "clientStateCommitment", IBCCommitment.keccak256(clientStateBytes), + "consensusStateCommitment", IBCCommitment.keccak256(consensusStateBytes), + "height", clientState.getLatestHeight().encode()); + } + + /** + * @dev checkHeaderAndUpdateState validates the header + */ + @External + public Map updateClient(String clientId, byte[] clientMessageBytes) { + onlyHandler(); + ibc.lightclients.tendermint.v1.Header tmHeader = ibc.lightclients.tendermint.v1.Header.decode(clientMessageBytes); + boolean conflictingHeader = false; + // Check if the Client store already has a consensus state for the header's + // height + // If the consensus state exists, and it matches the header then we return early + // since header has already been submitted in a previous UpdateClient. + byte[] prevConsState = consensusStates.at(clientId) + .get(tmHeader.getSignedHeader().getHeader().getHeight()); + if (prevConsState != null) { + // This header has already been submitted and the necessary state is already + // stored + Context.require(!Arrays.equals(prevConsState, toConsensusState(tmHeader).encode()), + "LC: This header has already been submitted"); + + // A consensus state already exists for this height, but it does not match the + // provided header. + // Thus, we must check that this header is valid, and if so we will freeze the + // client. + conflictingHeader = true; + } + + byte[] encodedClientState = clientStates.get(clientId); + require(encodedClientState != null, "LC: client state is invalid"); + ClientState clientState = ClientState.decode(encodedClientState); + byte[] encodedTrustedonsensusState = consensusStates.at(clientId).get(tmHeader.getTrustedHeight().getRevisionHeight()); + require(encodedTrustedonsensusState != null, "LC: consensusState not found at trusted height"); + ConsensusState trustedConsensusState = ConsensusState.decode(encodedTrustedonsensusState); + + Timestamp currentTime = getCurrentTime(); + checkValidity(clientState, trustedConsensusState, tmHeader, currentTime); + + // Header is different from existing consensus state and also valid, so freeze + // the client and return + if (conflictingHeader) { + BigInteger revision = getRevisionNumber(tmHeader.getSignedHeader().getHeader().getChainId()); + clientState.setFrozenHeight(newHeight(tmHeader.getSignedHeader().getHeader().getHeight(), revision)); + encodedClientState = clientState.encode(); + clientStates.set(clientId, encodedClientState); + + byte[] encodedConsensusState = toConsensusState(tmHeader).encode(); + consensusStates.at(clientId).set(clientState.getLatestHeight().getRevisionHeight(), encodedConsensusState); + processedHeights.at(clientId).set(tmHeader.getSignedHeader().getHeader().getHeight(), + BigInteger.valueOf(Context.getBlockHeight())); + processedTimes.at(clientId).set(tmHeader.getSignedHeader().getHeader().getHeight(), + BigInteger.valueOf(Context.getBlockTimestamp())); + + return Map.of( + "clientStateCommitment", IBCCommitment.keccak256(encodedClientState), + "consensusStateCommitment", IBCCommitment.keccak256(encodedConsensusState), + "height", + newHeight(tmHeader.getSignedHeader().getHeader().getHeight(), revision).encode()); + } + + // update the consensus state from a new header and set processed time metadata + if (tmHeader.getSignedHeader().getHeader().getHeight().compareTo(clientState.getLatestHeight().getRevisionHeight()) > 0) { + BigInteger revision = getRevisionNumber(tmHeader.getSignedHeader().getHeader().getChainId()); + clientState.setLatestHeight(newHeight(tmHeader.getSignedHeader().getHeader().getHeight(), revision)); + encodedClientState = clientState.encode(); + clientStates.set(clientId, encodedClientState); + } + + byte[] encodedConsensusState = toConsensusState(tmHeader).encode(); + consensusStates.at(clientId).set(tmHeader.getSignedHeader().getHeader().getHeight(), + encodedConsensusState); + processedHeights.at(clientId).set(tmHeader.getSignedHeader().getHeader().getHeight(), + BigInteger.valueOf(Context.getBlockHeight())); + processedTimes.at(clientId).set(tmHeader.getSignedHeader().getHeader().getHeight(), + BigInteger.valueOf(Context.getBlockTimestamp())); + + return Map.of( + "clientStateCommitment", IBCCommitment.keccak256(encodedClientState), + "consensusStateCommitment", IBCCommitment.keccak256(encodedConsensusState), + "height", clientState.getLatestHeight().encode()); + } + + @External(readonly = true) + public void verifyMembership( + String clientId, + byte[] heightBytes, + BigInteger delayTimePeriod, + BigInteger delayBlockPeriod, + byte[] proof, + byte[] prefix, + byte[] path, + byte[] value) { + Height height = Height.decode(heightBytes); + ClientState clientState = ClientState.decode(mustGetClientState(clientId)); + validateArgs(clientState, height.getRevisionHeight(), prefix, proof); + validateDelayPeriod(clientId, height, delayTimePeriod, delayBlockPeriod); + + ConsensusState consensusState = ConsensusState + .decode(mustGetConsensusState(clientId, height.getRevisionHeight())); + + var root = consensusState.getRoot(); + var merkleProof = MerkleProof.decode(proof); + var merklePath = applyPrefix(StringUtil.bytesToHex(prefix), StringUtil.bytesToHex(path)); + + Merkle.verifyMembership(merkleProof, Merkle.SDK_SPEC, root, merklePath, value); + } + + @External(readonly = true) + public void verifyNonMembership( + String clientId, + byte[] heightBytes, + BigInteger delayTimePeriod, + BigInteger delayBlockPeriod, + byte[] proof, + byte[] prefix, + byte[] path) { + Height height = Height.decode(heightBytes); + ClientState clientState = ClientState.decode(mustGetClientState(clientId)); + validateArgs(clientState, height.getRevisionHeight(), prefix, proof); + validateDelayPeriod(clientId, height, delayTimePeriod, delayBlockPeriod); + + ConsensusState consensusState = ConsensusState + .decode(mustGetConsensusState(clientId, height.getRevisionHeight())); + + var root = consensusState.getRoot(); + var merkleProof = MerkleProof.decode(proof); + var merklePath = applyPrefix(StringUtil.bytesToHex(prefix), StringUtil.bytesToHex(path)); + + Merkle.verifyNonMembership(merkleProof, Merkle.SDK_SPEC, root, merklePath); + } + + // checkValidity checks if the Tendermint header is valid. + public void checkValidity( + ClientState clientState, + ConsensusState trustedConsensusState, + ibc.lightclients.tendermint.v1.Header tmHeader, + Timestamp currentTime) { + // assert header height is newer than consensus state + require( + tmHeader.getSignedHeader().getHeader().getHeight() + .compareTo(tmHeader.getTrustedHeight().getRevisionHeight()) > 0, + "LC: Trusted height is higher than untrusted header height"); + + tendermint.types.Header lc = new tendermint.types.Header(); + lc.setChainId(clientState.getChainId()); + lc.setHeight(tmHeader.getTrustedHeight().getRevisionHeight()); + lc.setTime(trustedConsensusState.getTimestamp()); + lc.setNextValidatorsHash(trustedConsensusState.getNextValidatorsHash()); + + ValidatorSet trustedVals = tmHeader.getTrustedValidators(); + SignedHeader trustedHeader = new SignedHeader(); + trustedHeader.setHeader(lc); + + SignedHeader untrustedHeader = tmHeader.getSignedHeader(); + ValidatorSet untrustedVals = tmHeader.getValidatorSet(); + + Context.require(!isExpired(trustedHeader, clientState.getTrustingPeriod(), currentTime), + "header can't be expired"); + + boolean ok = verify( + clientState.getTrustingPeriod(), + clientState.getMaxClockDrift(), + clientState.getTrustLevel(), + trustedHeader, + trustedVals, + untrustedHeader, + untrustedVals, + currentTime); + + require(ok, "LC: failed to verify header"); + } + + private void validateArgs(ClientState cs, BigInteger height, byte[] prefix, byte[] proof) { + Context.require(cs.getLatestHeight().getRevisionHeight().compareTo(height) >= 0, + "Latest height must be greater or equal to proof height"); + Context.require(cs.getFrozenHeight().getRevisionHeight().equals(BigInteger.ZERO) || + cs.getFrozenHeight().getRevisionHeight().compareTo(height) >= 0, + "Client is Frozen"); + Context.require(prefix.length > 0, "Prefix cant be empty"); + Context.require(proof.length > 0, "Proof cant be empty"); + } + + private void validateDelayPeriod(String clientId, Height height, + BigInteger delayPeriodTime, + BigInteger delayPeriodBlocks) { + BigInteger currentTime = BigInteger.valueOf(Context.getBlockTimestamp()); + BigInteger validTime = mustGetProcessedTime(clientId, + height.getRevisionHeight()).add(delayPeriodTime); + + BigInteger currentHeight = BigInteger.valueOf(Context.getBlockHeight()); + BigInteger validHeight = mustGetProcessedHeight(clientId, + height.getRevisionHeight()).add(delayPeriodBlocks); + + Context.require(currentTime.compareTo(validTime) >= 0, "Delay Time period has not yet passed"); + Context.require(currentHeight.compareTo(validHeight) >= 0, "Delay Height has not yet passed"); + } + + private byte[] mustGetClientState(String clientId) { + byte[] clientState = clientStates.get(clientId); + require(clientState != null, "LC: client state not found"); + return clientState; + } + + private byte[] mustGetConsensusState(String clientId, BigInteger height) { + byte[] consensusState = consensusStates.at(clientId).get(height); + require(consensusState != null, "LC: consensus state not found"); + return consensusState; + } + + private BigInteger mustGetProcessedTime(String clientId, BigInteger height) { + BigInteger processedTime = processedTimes.at(clientId).get(height); + require(processedTime != null, "LC: processed time not found"); + return processedTime; + } + + private BigInteger mustGetProcessedHeight(String clientId, BigInteger height) { + BigInteger processedHeight = processedHeights.at(clientId).get(height); + require(processedHeight != null, "LC: processed height not found"); + return processedHeight; + } +} diff --git a/contracts/javascore/lightclients/ics-08-tendermint/src/main/java/ibc/ics08/tendermint/Tendermint.java b/contracts/javascore/lightclients/ics-08-tendermint/src/main/java/ibc/ics08/tendermint/Tendermint.java new file mode 100644 index 000000000..70b35251f --- /dev/null +++ b/contracts/javascore/lightclients/ics-08-tendermint/src/main/java/ibc/ics08/tendermint/Tendermint.java @@ -0,0 +1,270 @@ +package ibc.ics08.tendermint; + +import static ibc.ics08.tendermint.TendermintHelper.*; + +import java.math.BigInteger; +import java.util.Arrays; + +import ibc.icon.score.util.Proto; +import tendermint.types.*; +import google.protobuf.*; +import ibc.lightclients.tendermint.v1.*; +import score.Context; + +public abstract class Tendermint { + protected boolean verify( + Duration trustingPeriod, + Duration maxClockDrift, + Fraction trustLevel, + SignedHeader trustedHeader, + ValidatorSet trustedVals, + SignedHeader untrustedHeader, + ValidatorSet untrustedVals, + Timestamp currentTime) { + verifyNewHeaderAndVals(untrustedHeader, untrustedVals, trustedHeader, currentTime, maxClockDrift); + + boolean isAdjacent = untrustedHeader.getHeader().getHeight() + .equals(trustedHeader.getHeader().getHeight().add(BigInteger.ONE)); + if (isAdjacent) { + return verifyAdjacent(trustedHeader, untrustedHeader, untrustedVals, trustingPeriod, currentTime, + maxClockDrift); + } + + return verifyNonAdjacent( + trustedHeader, + trustedVals, + untrustedHeader, + untrustedVals, + trustingPeriod, + currentTime, + maxClockDrift, + trustLevel); + + } + + protected boolean verifyAdjacent( + SignedHeader trustedHeader, + SignedHeader untrustedHeader, + ValidatorSet untrustedVals, + Duration trustingPeriod, + Timestamp currentTime, + Duration maxClockDrift) { + + // Check the validator hashes are the same + Context.require( + Arrays.equals(untrustedHeader.getHeader().getValidatorsHash(), + trustedHeader.getHeader().getNextValidatorsHash()), + "expected old header next validators to match those from new header"); + + // Ensure that +2/3 of new validators signed correctly. + return verifyCommitLight( + untrustedVals, + trustedHeader.getHeader().getChainId(), + untrustedHeader.getCommit().getBlockId(), + untrustedHeader.getHeader().getHeight(), + untrustedHeader.getCommit()); + + } + + protected boolean verifyNonAdjacent( + SignedHeader trustedHeader, + ValidatorSet trustedVals, + SignedHeader untrustedHeader, + ValidatorSet untrustedVals, + Duration trustingPeriod, + Timestamp currentTime, + Duration maxClockDrift, + Fraction trustLevel) { + + // assert that trustedVals is NextValidators of last trusted header + // to do this, we check that trustedVals.Hash() == consState.NextValidatorsHash + Context.require(Arrays.equals(hash(trustedVals), trustedHeader.getHeader().getNextValidatorsHash()), + "LC: headers trusted validators does not hash to latest trusted validators"); + + // Ensure that +`trustLevel` (default 1/3) or more of last trusted validators + // signed correctly. + verifyCommitLightTrusting(trustedVals, trustedHeader.getHeader().getChainId(), untrustedHeader.getCommit(), + trustLevel); + + // Ensure that +2/3 of new validators signed correctly. + return verifyCommitLight( + untrustedVals, + trustedHeader.getHeader().getChainId(), + untrustedHeader.getCommit().getBlockId(), + untrustedHeader.getHeader().getHeight(), + untrustedHeader.getCommit()); + + } + + protected void verifyNewHeaderAndVals( + SignedHeader untrustedHeader, + ValidatorSet untrustedVals, + SignedHeader trustedHeader, + Timestamp currentTime, + Duration maxClockDrift) { + // SignedHeader validate basic + Context.require(untrustedHeader.getHeader().getChainId().equals(trustedHeader.getHeader().getChainId()), + "header belongs to another chain"); + Context.require(untrustedHeader.getCommit().getHeight().equals(untrustedHeader.getHeader().getHeight()), + "header and commit height mismatch"); + + byte[] untrustedHeaderBlockHash = hash(untrustedHeader.getHeader()); + Context.require(Arrays.equals(untrustedHeaderBlockHash, untrustedHeader.getCommit().getBlockId().getHash()), + "commit signs signs block failed"); + + Context.require(untrustedHeader.getHeader().getHeight().compareTo(trustedHeader.getHeader().getHeight()) > 0, + "expected new header height to be greater than one of old header"); + Context.require( + gt(untrustedHeader.getHeader().getTime(), trustedHeader.getHeader().getTime()), + "expected new header time to be after old header time"); + + Timestamp curentTimestamp = new Timestamp(); + curentTimestamp.setSeconds(currentTime.getSeconds().add(maxClockDrift.getSeconds())); + curentTimestamp.setNanos(currentTime.getNanos().add(maxClockDrift.getNanos())); + Context.require(gt(curentTimestamp, untrustedHeader.getHeader().getTime()), + "new header has time from the future"); + + byte[] validatorsHash = hash(untrustedVals); + Context.require(Arrays.equals(untrustedHeader.getHeader().getValidatorsHash(), validatorsHash), + "expected new header validators to match those that were supplied at height XX"); + } + + protected boolean verifyCommitLightTrusting( + ValidatorSet trustedVals, + String chainID, + Commit commit, + Fraction trustLevel) { + BigInteger talliedVotingPower = BigInteger.ZERO; + boolean[] seenVals = new boolean[trustedVals.getValidators().size()]; + + CommitSig commitSig; + BigInteger totalVotingPowerMulByNumerator = getTotalVotingPower(trustedVals) + .multiply(trustLevel.getNumerator()); + BigInteger votingPowerNeeded = totalVotingPowerMulByNumerator.divide(trustLevel.getDenominator()); + + int signaturesLength = commit.getSignatures().size(); + for (int idx = 0; idx < signaturesLength; idx++) { + commitSig = commit.getSignatures().get(idx); + + // no need to verify absent or nil votes. + if (commitSig.getBlockIdFlag() != BlockIDFlag.BLOCK_ID_FLAG_COMMIT) { + continue; + } + + // We don't know the validators that committed this block, so we have to + // check for each vote if its validator is already known. + int valIdx = getByAddress(trustedVals, commitSig.getValidatorAddress()); + if (valIdx == -1) { + continue; + } + + // check for double vote of validator on the same commit + Context.require(!seenVals[valIdx], "double vote of validator on the same commit"); + seenVals[valIdx] = true; + + Validator val = trustedVals.getValidators().get(valIdx); + + // validate signature + byte[] message = voteSignBytesDelim(commit, chainID, idx); + byte[] sig = commitSig.getSignature(); + + if (!verifySig(val, message, sig)) { + return false; + } + + talliedVotingPower = talliedVotingPower.add(val.getVotingPower()); + + if (talliedVotingPower.compareTo(votingPowerNeeded) > 0) { + return true; + } + + } + + return false; + } + + // VerifyCommitLight verifies +2/3 of the set had signed the given commit. + // + // This method is primarily used by the light client and does not check all the + // signatures. + protected boolean verifyCommitLight( + ValidatorSet validators, + String chainID, + BlockID blockID, + BigInteger height, + Commit commit) { + Context.require(validators.getValidators().size() == commit.getSignatures().size(), + "invalid commmit signatures"); + + Context.require(height.equals(commit.getHeight()), "invalid commit height"); + + Context.require(commit.getBlockId().equals(blockID), "invalid commit -- wrong block ID"); + Validator val; + CommitSig commitSig; + + BigInteger talliedVotingPower = BigInteger.ZERO; + BigInteger votingPowerNeeded = getTotalVotingPower(validators).multiply(BigInteger.TWO) + .divide(BigInteger.valueOf(3)); + + int signaturesLength = commit.getSignatures().size(); + for (int i = 0; i < signaturesLength; i++) { + commitSig = commit.getSignatures().get(i); + + // no need to verify absent or nil votes. + if (commitSig.getBlockIdFlag() != BlockIDFlag.BLOCK_ID_FLAG_COMMIT) { + continue; + } + + val = validators.getValidators().get(i); + + byte[] message = voteSignBytesDelim(commit, chainID, i); + byte[] sig = commitSig.getSignature(); + + if (!verifySig(val, message, sig)) { + return false; + } + + talliedVotingPower = talliedVotingPower.add(val.getVotingPower()); + + if (talliedVotingPower.compareTo(votingPowerNeeded) > 0) { + return true; + } + } + + return false; + } + + public boolean verifySig( + Validator val, + byte[] message, + byte[] sig) { + if (val.getPubKey().getEd25519() != null) { + return verifySig("ed25519", message, sig, val.getPubKey().getEd25519()); + } else { + return verifySig("ecdsa-secp256k1", message, sig, val.getPubKey().getSecp256k1()); + } + } + + public boolean verifySig( + String alg, + byte[] message, + byte[] sig, + byte[] pubKey) { + return Context.verifySignature(alg, message, sig, pubKey); + } + + protected byte[] voteSignBytes( + Commit commit, + String chainID, + int idx) { + + return toCanonicalVote(commit, idx, chainID); + } + + protected byte[] voteSignBytesDelim( + Commit commit, + String chainID, + int idx) { + return Proto.encodeDelim(voteSignBytes(commit, chainID, idx)); + } +} diff --git a/contracts/javascore/lightclients/ics-08-tendermint/src/main/java/ibc/ics08/tendermint/TendermintHelper.java b/contracts/javascore/lightclients/ics-08-tendermint/src/main/java/ibc/ics08/tendermint/TendermintHelper.java new file mode 100644 index 000000000..ce8c4a809 --- /dev/null +++ b/contracts/javascore/lightclients/ics-08-tendermint/src/main/java/ibc/ics08/tendermint/TendermintHelper.java @@ -0,0 +1,162 @@ +package ibc.ics08.tendermint; + +import java.math.BigInteger; +import java.util.Arrays; + +import ibc.icon.score.util.MerkleTree; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ByteUtil; +import tendermint.types.Commit; +import tendermint.types.CommitSig; +import ibc.lightclients.tendermint.v1.ConsensusState; +import tendermint.types.Header; +import ibc.core.commitment.v1.MerkleRoot; +import tendermint.types.SignedHeader; +import tendermint.types.SignedMsgType; +import tendermint.types.SimpleValidator; +import tendermint.types.Validator; +import tendermint.types.ValidatorSet; +import ibc.core.client.v1.Height; + +import google.protobuf.Timestamp; +import google.protobuf.Duration; +import score.Context; + +public class TendermintHelper { + public static final BigInteger MICRO_SECONDS_IN_A_SECOND = BigInteger.valueOf(1_000_000); + + public static byte[] toCanonicalVote(Commit commit, int valIdx, String chainId) { + CommitSig commitSig = commit.getSignatures().get(valIdx); + return ByteUtil.join( + Proto.encode(1, SignedMsgType.SIGNED_MSG_TYPE_PRECOMMIT), + Proto.encodeFixed64(2, commit.getHeight()), + Proto.encodeFixed64(3, commit.getRound()), + Proto.encode(4, commit.getBlockId()), + Proto.encode(5, commitSig.getTimestamp()), + Proto.encode(6, chainId)); + } + + public static ConsensusState toConsensusState(ibc.lightclients.tendermint.v1.Header header) { + ConsensusState state = new ConsensusState(); + state.setNextValidatorsHash(header.getSignedHeader().getHeader().getNextValidatorsHash()); + state.setTimestamp(header.getSignedHeader().getHeader().getTime()); + MerkleRoot merkleRoot = new MerkleRoot(); + merkleRoot.setHash(header.getSignedHeader().getHeader().getAppHash()); + state.setRoot(merkleRoot); + + return state; + } + + public static BigInteger getTotalVotingPower(ValidatorSet validatorSet) { + BigInteger sum = BigInteger.ZERO; + for (Validator validator : validatorSet.getValidators()) { + sum = sum.add(validator.getVotingPower()); + } + + validatorSet.setTotalVotingPower(sum); + return validatorSet.getTotalVotingPower(); + } + + public static BigInteger getRevisionNumber(String chainId) { + int id = chainId.lastIndexOf("-"); + if (id >= 0) { + return new BigInteger(chainId.substring(id+1)); + } + return BigInteger.ZERO; + } + + public static int getByAddress(ValidatorSet validatorSet, byte[] addr) { + int size = validatorSet.getValidators().size(); + for (int idx = 0; idx < size; idx++) { + if (Arrays.equals(validatorSet.getValidators().get(idx).getAddress(), addr)) { + return idx; + } + } + + return -1; + } + + public static Height newHeight(BigInteger blockHeight, BigInteger revision) { + Height height = new Height(); + height.setRevisionHeight(blockHeight); + height.setRevisionNumber(revision); + + return height; + } + + public static SimpleValidator toSimpleValidator(Validator validator) { + SimpleValidator simpleValidator = new SimpleValidator(); + simpleValidator.setPubKey(validator.getPubKey()); + simpleValidator.setVotingPower(validator.getVotingPower()); + + return simpleValidator; + } + + public static boolean gt(Timestamp t1, Timestamp t2) { + if (t1.getSeconds().compareTo(t2.getSeconds()) > 0) { + return true; + } + + if (t1.getSeconds().equals(t2.getSeconds()) && t1.getNanos().compareTo(t2.getNanos()) > 0) { + return true; + } + + return false; + } + + public static boolean isExpired(SignedHeader header, Duration trustingPeriod, Timestamp currentTime) { + Timestamp expirationTime = new Timestamp(); + expirationTime.setSeconds(header.getHeader().getTime().getSeconds().add(trustingPeriod.getSeconds())); + expirationTime.setNanos(header.getHeader().getTime().getNanos()); + + return gt(currentTime, expirationTime); + } + + public static Timestamp getCurrentTime() { + BigInteger timeInMicro = BigInteger.valueOf(Context.getBlockTimestamp()); + BigInteger seconds = timeInMicro.divide(MICRO_SECONDS_IN_A_SECOND); + BigInteger microSeconds = timeInMicro.remainder(MICRO_SECONDS_IN_A_SECOND); + BigInteger nanoSeconds = microSeconds.multiply(BigInteger.valueOf(1000)); + + Timestamp currentTime = new Timestamp(); + currentTime.setSeconds(seconds); + currentTime.setNanos(nanoSeconds); + + return currentTime; + } + + public static byte[] hash(ValidatorSet validatorSet) { + int size = validatorSet.getValidators().size(); + byte[][] data = new byte[size][]; + for (int i = 0; i < size; i++) { + data[i] = toSimpleValidator(validatorSet.getValidators().get(i)).encode(); + } + + return MerkleTree.merkleRootHash(data, 0, size); + } + + public static byte[] hash(Header header) { + byte[] hbz = Proto.encode(1, header.getVersion().getBlock()); + byte[] pbt = header.getTime().encode(); + byte[] bzbi = header.getLastBlockId().encode(); + + byte[][] all = new byte[][] { + hbz, + Proto.encode(1, header.getChainId()), + Proto.encode(1, header.getHeight()), + pbt, + bzbi, + Proto.encode(1, header.getLastCommitHash()), + Proto.encode(1, header.getDataHash()), + Proto.encode(1, header.getValidatorsHash()), + Proto.encode(1, header.getNextValidatorsHash()), + Proto.encode(1, header.getConsensusHash()), + Proto.encode(1, header.getAppHash()), + Proto.encode(1, header.getLastResultsHash()), + Proto.encode(1, header.getEvidenceHash()), + Proto.encode(1, header.getProposerAddress()) + }; + + return MerkleTree.merkleRootHash(all, 0, all.length); + } +} diff --git a/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/LightClientTest.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/LightClientTest.java new file mode 100644 index 000000000..0f934fa91 --- /dev/null +++ b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/LightClientTest.java @@ -0,0 +1,330 @@ +package ibc.ics08.tendermint; + +import static org.junit.jupiter.api.Assertions.assertArrayEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.doNothing; + +import java.math.BigInteger; + + +import com.google.protobuf.Timestamp; +import com.google.protobuf.Duration; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import com.ibc.core.client.v1.Height; + +import score.Address; + +import com.ibc.lightclients.tendermint.v1.*; +import com.tendermint.types.*; + +public class LightClientTest extends LightClientTestBase { + + @BeforeEach + protected void setup() throws Exception { + super.setup(); + } + + @Test + void createClient() throws Exception { + // Arrange + SignedHeader initialHeader = parseSignedHeader(1); + + // Act + initializeClient(1); + + // Assert + ClientState clientState = getClientState(); + assertEquals(clientState.getLatestHeight().getRevisionHeight(), initialHeader.getHeader().getHeight()); + assertEquals(clientState.getAllowUpdateAfterExpiry(), allowUpdateAfterExpiry); + assertEquals(clientState.getAllowUpdateAfterMisbehaviour(), allowUpdateAfterMisbehaviour); + assertEquals(clientState.getChainId(), initialHeader.getHeader().getChainId()); + assertEquals(clientState.getFrozenHeight(), Height.newBuilder().build()); + assertEquals(clientState.getMaxClockDrift(), maxClockDrift); + assertEquals(clientState.getTrustLevel(), trustLevel); + assertEquals(clientState.getTrustingPeriod(), trustingPeriod); + assertEquals(clientState.getUnbondingPeriod(), Duration.getDefaultInstance()); + } + + @Test + void createClient_withZeroDenomTrustLevel() throws Exception { + // Arrange + // Default is zero denominator + trustLevel = Fraction.getDefaultInstance(); + String expectedErrorMessage = "trustLevel has zero Denominator"; + + // Act & Assert + AssertionError e = assertThrows(AssertionError.class, () -> initializeClient(1)); + assertTrue(e.getMessage().contains(expectedErrorMessage)); + } + + @Test + void update_NonAdjacentInOrder() throws Exception { + // Arrange + SignedHeader lastHeader = parseSignedHeader(3); + + // Act + initializeClient(1); + updateClient(2, 1); + updateClient(3, 2); + + // Assert + ClientState clientState = getClientState(); + assertEquals(clientState.getLatestHeight().getRevisionHeight(), lastHeader.getHeader().getHeight()); + assertConsensusState(parseSignedHeader(1)); + assertConsensusState(parseSignedHeader(2)); + assertConsensusState(lastHeader); + } + + @Test + void update_NonAdjacentOutOfOrder() throws Exception { + // Arrange + SignedHeader lastHeader = parseSignedHeader(3); + + // Act + initializeClient(1); + updateClient(3, 1); + updateClient(2, 1); + + // Assert + ClientState clientState = getClientState(); + assertEquals(clientState.getLatestHeight().getRevisionHeight(), lastHeader.getHeader().getHeight()); + assertConsensusState(parseSignedHeader(1)); + assertConsensusState(parseSignedHeader(2)); + assertConsensusState(lastHeader); + } + + @Test + void updateMultiValidator() throws Exception { + // Arrange + blockSetPath = BLOCK_SET_MUTILPLE_VALIDATORS; + SignedHeader lastHeader = parseSignedHeader(3); + + // Act + initializeClient(1); + updateClient(2, 1); + updateClient(3, 2); + + // Assert + ClientState clientState = getClientState(); + assertEquals(clientState.getLatestHeight().getRevisionHeight(), lastHeader.getHeader().getHeight()); + assertConsensusState(parseSignedHeader(1)); + assertConsensusState(parseSignedHeader(2)); + assertConsensusState(lastHeader); + } + + @Test + void updateAdjacentBlocks() throws Exception { + // Arrange + blockSetPath = BLOCK_SET_ADJACENT; + SignedHeader lastHeader = parseSignedHeader(3); + + // Act + initializeClient(1); + updateClient(2, 1); + updateClient(3, 2); + + // Assert + ClientState clientState = getClientState(); + assertEquals(clientState.getLatestHeight().getRevisionHeight(), lastHeader.getHeader().getHeight()); + assertConsensusState(parseSignedHeader(1)); + assertConsensusState(parseSignedHeader(2)); + assertConsensusState(lastHeader); + } + + @Test + void updateConflictingHeader() throws Exception { + // Arrange + blockSetPath = BLOCK_SET_MALICIOUS; + SignedHeader duplicatedHeader = parseSignedHeader(3); + initializeClient(1); + updateClient(2, 1); + doNothing().when(clientSpy).checkValidity( + any(ibc.lightclients.tendermint.v1.ClientState.class), + any(ibc.lightclients.tendermint.v1.ConsensusState.class), + any(ibc.lightclients.tendermint.v1.Header.class), + any()); + + // Act + updateClient(3, 1); + + // Assert + ClientState clientState = getClientState(); + assertEquals(clientState.getFrozenHeight().getRevisionHeight(), duplicatedHeader.getHeader().getHeight()); + } + + @Test + void update_withNonTrustedHeight() throws Exception { + // Arrange + initializeClient(1); + String expectedErrorMessage = "LC: consensusState not found at trusted height"; + + // Act & Assert + AssertionError e = assertThrows(AssertionError.class, () -> updateClient(3, 2)); + assertTrue(e.getMessage().contains(expectedErrorMessage)); + } + + @Test + void update_withTrustOnFutureBlock() throws Exception { + // Arrange + initializeClient(1); + updateClient(3, 1); + String expectedErrorMessage = "LC: Trusted height is higher than untrusted header height"; + + // Act & Assert + AssertionError e = assertThrows(AssertionError.class, () -> updateClient(2, 3)); + assertTrue(e.getMessage().contains(expectedErrorMessage)); + } + + @Test + void update_withoutInit() throws Exception { + // Arrange + String expectedErrorMessage = "LC: client state is invalid"; + + // Act & Assert + AssertionError e = assertThrows(AssertionError.class, () -> updateClient(3, 2)); + assertTrue(e.getMessage().contains(expectedErrorMessage)); + } + + @Test + void doubleUpdate() throws Exception { + // Arrange + initializeClient(1); + updateClient(3, 1); + String expectedErrorMessage = "LC: This header has already been submitted"; + + // Act & Assert + AssertionError e = assertThrows(AssertionError.class, () -> updateClient(3, 1)); + assertTrue(e.getMessage().contains(expectedErrorMessage)); + } + + @Test + void initOnlyByIBCHandler() { + // Arrange + Address handlerAddress = ibcHandler.getAddress(); + ibcHandler = sm.createAccount(); + String expectedErrorMessage = "Only the IBC handler: " + handlerAddress + " is allowed"; + + // Act & Assert + AssertionError e = assertThrows(AssertionError.class, () -> initializeClient(1)); + assertTrue(e.getMessage().contains(expectedErrorMessage)); + } + + @Test + void updateOnlyByIBCHandler() throws Exception { + // Arrange + initializeClient(1); + Address handlerAddress = ibcHandler.getAddress(); + ibcHandler = sm.createAccount(); + String expectedErrorMessage = "Only the IBC handler: " + handlerAddress + " is allowed"; + + // Act & Assert + AssertionError e = assertThrows(AssertionError.class, () -> updateClient(2, 1)); + assertTrue(e.getMessage().contains(expectedErrorMessage)); + } + + @Test + void alreadyInitialized() throws Exception { + // Arrange + initializeClient(1); + String expectedErrorMessage = "Client already exists"; + + // Act & Assert + AssertionError e = assertThrows(AssertionError.class, () -> initializeClient(2)); + assertTrue(e.getMessage().contains(expectedErrorMessage)); + } + + @Test + void getTimestampAtHeight() throws Exception { + // Arrange + initializeClient(1); + updateClient(2, 1); + SignedHeader header1 = parseSignedHeader(1); + SignedHeader header2 = parseSignedHeader(2); + + Height height1 = Height.newBuilder().setRevisionHeight(header1.getHeader().getHeight()).build(); + Height height2 = Height.newBuilder().setRevisionHeight(header2.getHeader().getHeight()).build(); + long expectedTime1 = header1.getHeader().getTime().getSeconds(); + long expectedTime2 = header2.getHeader().getTime().getSeconds(); + + // Act + BigInteger t1 = (BigInteger) client.call("getTimestampAtHeight", clientId, height1.toByteArray()); + BigInteger t2 = (BigInteger) client.call("getTimestampAtHeight", clientId, height2.toByteArray()); + + // Assert + assertEquals(expectedTime1, t1.longValue()); + assertEquals(expectedTime2, t2.longValue()); + } + + @Test + void getTimestampAtHeight_noConsensusState() throws Exception { + // Arrange + Height height = Height.newBuilder().setRevisionHeight(1).build(); + String expectedErrorMessage = "height: " + height.getRevisionHeight() + + " does not have a consensus state"; + + // Act & Assert + AssertionError e = assertThrows(AssertionError.class, + () -> client.call("getTimestampAtHeight", clientId, height.toByteArray())); + assertTrue(e.getMessage().contains(expectedErrorMessage)); + } + + @Test + void getLatestHeight() throws Exception { + // Arrange + SignedHeader header1 = parseSignedHeader(1); + SignedHeader header2 = parseSignedHeader(2); + + BigInteger revision = TendermintHelper.getRevisionNumber(header1.getHeader().getChainId()); + Height height1 = Height.newBuilder().setRevisionHeight(header1.getHeader().getHeight()).setRevisionNumber(revision.intValue()).build(); + Height height2 = Height.newBuilder().setRevisionHeight(header2.getHeader().getHeight()).setRevisionNumber(revision.intValue()).build(); + + // Act + initializeClient(1); + + // Assert + assertArrayEquals(height1.toByteArray(), (byte[]) client.call("getLatestHeight", clientId)); + + // Act + updateClient(2, 1); + + // Assert + assertArrayEquals(height2.toByteArray(), (byte[]) client.call("getLatestHeight", clientId)); + } + + @Test + void getLatestHeight_noClientState() throws Exception { + // Arrange + String expectedErrorMessage = "Client does not exist"; + + // Act & Assert + AssertionError e = assertThrows(AssertionError.class, + () -> client.call("getLatestHeight", clientId)); + assertTrue(e.getMessage().contains(expectedErrorMessage)); + } + + @Test + void updateExpired() throws Exception { + // Arrange + SignedHeader header = parseSignedHeader(1); + + long time = header.getHeader().getTime().getSeconds() * 1000 * 1000; + long currentTime = System.currentTimeMillis() * 1000 + (sm.getBlock().getHeight() * 2_000_000); + long period = currentTime - time; + trustingPeriod = Duration.newBuilder() + .setSeconds((period / (1000 * 1000)) - 3).build(); + initializeClient(1); + + String expectedErrorMessage = "header can't be expired"; + + // Act & Assert + AssertionError e = assertThrows(AssertionError.class, + () -> updateClient(3, 1)); + assertTrue(e.getMessage().contains(expectedErrorMessage)); + } +} \ No newline at end of file diff --git a/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/LightClientTestBase.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/LightClientTestBase.java new file mode 100644 index 000000000..8256adcd8 --- /dev/null +++ b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/LightClientTestBase.java @@ -0,0 +1,334 @@ +package ibc.ics08.tendermint; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.google.protobuf.ByteString; +import com.iconloop.score.test.Account; +import com.iconloop.score.test.Score; +import com.iconloop.score.test.ServiceManager; +import com.iconloop.score.test.TestBase; +import foundation.icon.ee.util.Crypto; +import ibc.lightclients.tendermint.v1.*; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.mockito.MockedStatic; +import org.mockito.Mockito; +import org.mockito.stubbing.Answer; +import score.Context; + +import java.io.File; +import java.math.BigInteger; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.time.Instant; +import java.time.format.DateTimeFormatter; +import java.util.ArrayList; +import java.util.Base64; +import java.util.List; + +import org.junit.jupiter.api.AfterEach; +import org.mockito.MockedStatic; +import org.mockito.Mockito; +import org.mockito.stubbing.Answer; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.google.protobuf.ByteString; +import com.iconloop.score.test.Account; +import com.iconloop.score.test.Score; +import com.iconloop.score.test.ServiceManager; +import com.iconloop.score.test.TestBase; + +import com.google.protobuf.Timestamp; +import com.google.protobuf.Duration; +import score.Context; +import foundation.icon.ee.util.Crypto; + +import com.ibc.lightclients.tendermint.v1.*; +import com.ibc.lightclients.tendermint.v1.ConsensusState; +import com.ibc.lightclients.tendermint.v1.ClientState; +import com.ibc.lightclients.tendermint.v1.Header; +import com.tendermint.types.*; +import com.tendermint.crypto.*; +import com.ibc.lightclients.tendermint.v1.Fraction; +import com.ibc.core.client.v1.Height; +import com.ibc.core.commitment.v1.MerkleRoot; +import com.tendermint.version.Consensus; + +import static org.mockito.Mockito.spy; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.mockito.Mockito.any; +import static org.mockito.Mockito.spy; + +public class LightClientTestBase extends TestBase { + protected final ServiceManager sm = getServiceManager(); + protected final Account owner = sm.createAccount(); + protected Account ibcHandler = sm.createAccount(); + protected Score client; + protected ICS08TendermintLightClient clientSpy; + protected String clientId = "client-1"; + protected static final DateTimeFormatter INSTANT_FORMAT = DateTimeFormatter.ISO_INSTANT; + protected static final BigInteger day = BigInteger.valueOf(86400); + + protected static Fraction trustLevel; + protected static Duration trustingPeriod; + protected static Duration maxClockDrift; + protected static boolean allowUpdateAfterExpiry = false; + protected static boolean allowUpdateAfterMisbehaviour = false; + protected final MockedStatic contextMock = Mockito.mockStatic(Context.class, Mockito.CALLS_REAL_METHODS); + protected static final String BLOCK_SET_BASE_PATH = "src/test/java/ibc/ics08/tendermint/data/"; + protected static final String BLOCK_SET_SIMPLE = BLOCK_SET_BASE_PATH + "simple/"; + protected static final String BLOCK_SET_MUTILPLE_VALIDATORS = BLOCK_SET_BASE_PATH + "multi-validator/"; + protected static final String BLOCK_SET_ADJACENT = BLOCK_SET_BASE_PATH + "adjacent/"; + protected static final String BLOCK_SET_MALICIOUS = BLOCK_SET_BASE_PATH + "malicious/"; + protected String blockSetPath = BLOCK_SET_SIMPLE; + + static { + trustLevel = Fraction.newBuilder() + .setNumerator(BigInteger.TWO.longValue()) + .setDenominator(BigInteger.valueOf(3).longValue()).build(); + + trustingPeriod = Duration.newBuilder() + .setSeconds(day.multiply(BigInteger.valueOf(10000)).longValue()) + .setNanos(0).build(); + + maxClockDrift = Duration.newBuilder() + .setSeconds(10) + .setNanos(0).build(); + + } + + private String getCommitPath(int order) { + return blockSetPath + "commit." + order + ".json"; + + } + + private String getValidatorPath(int order) { + return blockSetPath + "validators." + order + ".json"; + } + + protected void setup() throws Exception { + contextMock.when(() -> Context.getBlockTimestamp()) + .thenReturn(System.currentTimeMillis() * 1000 + (sm.getBlock().getHeight() * 2_000_000)); + + client = sm.deploy(owner, ICS08TendermintLightClient.class, ibcHandler.getAddress()); + + clientSpy = (ICS08TendermintLightClient) spy(client.getInstance()); + client.setInstance(clientSpy); + + Mockito.doAnswer((Answer) invocation -> { + final Object[] args = invocation.getArguments(); + return Crypto.verifySignature((String) args[0], (byte[]) args[1], (byte[]) args[2], (byte[]) args[3]); + }).when(clientSpy).verifySig(any(String.class), any(byte[].class), any(byte[].class), any(byte[].class)); + + trustLevel = Fraction.newBuilder() + .setNumerator(BigInteger.TWO.longValue()) + .setDenominator(BigInteger.valueOf(3).longValue()).build(); + + trustingPeriod = Duration.newBuilder() + .setSeconds(day.multiply(BigInteger.valueOf(10000)).longValue()) + .setNanos(0).build(); + + maxClockDrift = Duration.newBuilder() + .setSeconds(10) + .setNanos(0).build(); + } + + @AfterEach + protected void teardown() { + contextMock.close(); + } + + protected void initializeClient(int blockOrder) throws Exception { + Header header = Header.newBuilder() + .setSignedHeader(parseSignedHeader(blockOrder)) + .setValidatorSet(parseValidatorSet(blockOrder)).build(); + BigInteger revisionNumber = TendermintHelper.getRevisionNumber(header.getSignedHeader().getHeader().getChainId()); + ClientState clientState = ClientState.newBuilder() + .setChainId(header.getSignedHeader().getHeader().getChainId()) + .setTrustLevel(trustLevel) + .setTrustingPeriod(trustingPeriod) + .setMaxClockDrift(maxClockDrift) + .setLatestHeight(Height.newBuilder() + .setRevisionHeight(header.getSignedHeader().getHeader().getHeight()) + .setRevisionNumber(revisionNumber.intValue())) + .setAllowUpdateAfterExpiry(allowUpdateAfterExpiry) + .setAllowUpdateAfterMisbehaviour(allowUpdateAfterMisbehaviour).build(); + + MerkleRoot root = MerkleRoot.newBuilder() + .setHash(header.getSignedHeader().getHeader().getAppHash()).build(); + + ConsensusState consensusState = ConsensusState.newBuilder() + .setTimestamp(header.getSignedHeader().getHeader().getTime()) + .setRoot(root) + .setNextValidatorsHash(header.getSignedHeader().getHeader().getNextValidatorsHash()).build(); + + client.invoke(ibcHandler, "createClient", clientId, clientState.toByteArray(), + consensusState.toByteArray(), new byte[0]); + } + + protected void updateClient(int blockOrder, int referenceBlock) throws Exception { + Header header = createHeader(blockOrder, referenceBlock); + client.invoke(ibcHandler, "updateClient", clientId, header.toByteArray()); + } + + protected ConsensusState getConsensusState(Height height) throws Exception { + return ConsensusState.parseFrom((byte[]) client.call("getConsensusState", clientId, height.toByteArray())); + } + + protected ClientState getClientState() throws Exception { + return ClientState.parseFrom((byte[]) client.call("getClientState", clientId)); + } + + protected void assertConsensusState(SignedHeader header) throws Exception { + Height height = Height.newBuilder().setRevisionHeight(header.getHeader().getHeight()).build(); + ConsensusState consensusState = getConsensusState(height); + assertEquals(header.getHeader().getNextValidatorsHash(), consensusState.getNextValidatorsHash()); + assertEquals(header.getHeader().getAppHash(), consensusState.getRoot().getHash()); + assertEquals(header.getHeader().getTime(), consensusState.getTimestamp()); + } + + protected Header createHeader(int blockOrder, int referenceBlock) throws Exception { + Header header = Header.newBuilder() + .setSignedHeader(parseSignedHeader(blockOrder)) + .setValidatorSet(parseValidatorSet(blockOrder)) + .setTrustedHeight(Height.newBuilder().setRevisionHeight(parseSignedHeader(referenceBlock).getHeader().getHeight())) + .setTrustedValidators(parseValidatorSet(referenceBlock)).build(); + return header; + } + + protected SignedHeader parseSignedHeader(int blockOrder) throws Exception { + + ObjectMapper mapper = new ObjectMapper(); + String loc = getCommitPath(blockOrder); + File file = new File(loc); + String content = new String(Files.readAllBytes(Paths.get(file.toURI()))); + JsonNode json = mapper.readTree(content); + + JsonNode jsonHeader = json.get("signed_header").get("header"); + Consensus version = Consensus.newBuilder() + .setBlock(jsonHeader.get("version").get("block").asInt()).build(); + + com.tendermint.types.Header lightHeader = com.tendermint.types.Header.newBuilder() + .setVersion(version) + .setChainId(jsonHeader.get("chain_id").asText()) + .setHeight(jsonHeader.get("height").asInt()) + .setTime(jsonToTimestamp(jsonHeader.get("time"))) + .setLastBlockId(parseBlockId(jsonHeader.get("last_block_id"))) + .setLastCommitHash(jsonToBytes(jsonHeader.get("last_commit_hash"))) + .setDataHash(jsonToBytes(jsonHeader.get("data_hash"))) + .setValidatorsHash(jsonToBytes(jsonHeader.get("validators_hash"))) + .setNextValidatorsHash(jsonToBytes(jsonHeader.get("next_validators_hash"))) + .setConsensusHash(jsonToBytes(jsonHeader.get("consensus_hash"))) + .setAppHash(jsonToBytes(jsonHeader.get("app_hash"))) + .setLastResultsHash(jsonToBytes(jsonHeader.get("last_results_hash"))) + .setEvidenceHash(jsonToBytes(jsonHeader.get("evidence_hash"))) + .setProposerAddress(jsonToBytes(jsonHeader.get("proposer_address"))).build(); + + JsonNode jsonCommit = json.get("signed_header").get("commit"); + + Commit commit = Commit.newBuilder() + .setHeight(jsonCommit.get("height").asInt()) + .setRound(jsonCommit.get("round").asInt()) + .setBlockId(parseBlockId(jsonCommit.get("block_id"))) + .addAllSignatures(parseCommitSig(jsonCommit.get("signatures"))).build(); + + SignedHeader signedHeader = SignedHeader.newBuilder() + .setHeader(lightHeader) + .setCommit(commit).build(); + + return signedHeader; + } + + protected ValidatorSet parseValidatorSet(int blockOrder) throws Exception { + ObjectMapper mapper = new ObjectMapper(); + String loc = getValidatorPath(blockOrder); + File file = new File(loc); + String content = new String(Files.readAllBytes(Paths.get(file.toURI()))); + JsonNode json = mapper.readTree(content); + ValidatorSet.Builder validatorSet = ValidatorSet.newBuilder(); + List validators = new ArrayList<>(); + json.get("validators").elements().forEachRemaining((node) -> { + PublicKey publicKey = PublicKey.newBuilder() + .setEd25519( + ByteString.copyFrom(Base64.getDecoder().decode(node.get("pub_key").get("value").asText()))) + .build(); + + Validator validator = Validator.newBuilder() + .setAddress(jsonToBytes(node.get("address"))) + .setPubKey(publicKey) + .setVotingPower(node.get("voting_power").asLong()) + .setProposerPriority(node.get("proposer_priority").asLong()).build(); + + validators.add(validator); + }); + validatorSet.addAllValidators(validators); + + return validatorSet.build(); + } + + protected BlockID parseBlockId(JsonNode json) { + PartSetHeader partSetHeader = PartSetHeader.newBuilder() + .setHash(jsonToBytes(json.get("parts").get("hash"))) + .setTotal(json.get("parts").get("total").asInt()).build(); + BlockID blockID = BlockID.newBuilder() + .setHash(jsonToBytes(json.get("hash"))) + .setPartSetHeader(partSetHeader).build(); + return blockID; + } + + protected List parseCommitSig(JsonNode json) { + List commitSigs = new ArrayList(); + + json.elements().forEachRemaining((node) -> { + CommitSig commitSig = CommitSig.newBuilder() + .setBlockIdFlagValue(node.get("block_id_flag").asInt()) + .setValidatorAddress(jsonToBytes(node.get("validator_address"))) + .setTimestamp(jsonToTimestamp(node.get("timestamp"))) + .setSignature(ByteString.copyFrom(Base64.getDecoder().decode(node.get("signature").asText()))) + .build(); + + commitSigs.add(commitSig); + }); + + return commitSigs; + } + + protected ByteString jsonToBytes(JsonNode val) { + return ByteString.copyFrom(hexStringToByteArray(val.asText())); + } + + private Timestamp jsonToTimestamp(JsonNode val) { + Instant time = Instant.from(INSTANT_FORMAT.parse(val.asText())); + Timestamp timestamp = Timestamp.newBuilder() + .setSeconds(time.getEpochSecond()) + .setNanos(time.getNano()).build(); + + return timestamp; + } + + public static byte[] hexStringToByteArray(String s) { + int len = s.length(); + byte[] data = new byte[len / 2]; + for (int i = 0; i < len; i += 2) { + data[i / 2] = (byte) ((Character.digit(s.charAt(i), 16) << 4) + + Character.digit(s.charAt(i + 1), 16)); + } + return data; + } + + public static void printBytes(byte[] bytes) { + for (int j = 0; j < bytes.length; j++) { + System.out.format("%02X ", bytes[j]); + } + System.out.println(); + } + + public static void printBytesToDec(byte[] bytes) { + for (int j = 0; j < bytes.length; j++) { + System.out.format("%d, ", bytes[j]); + } + System.out.println(); + } +} \ No newline at end of file diff --git a/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/adjacent/commit.1.json b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/adjacent/commit.1.json new file mode 100644 index 000000000..38e0fb710 --- /dev/null +++ b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/adjacent/commit.1.json @@ -0,0 +1,54 @@ +{ + "signed_header": { + "header": { + "version": { + "block": "11" + }, + "chain_id": "constantine-1", + "height": "700000", + "time": "2023-03-05T06:03:13.892949502Z", + "last_block_id": { + "hash": "FF2CF8143C8B2F8871E573DE146C4E0E79B8D030A22D9AF28282E5307E4380C1", + "parts": { + "total": 1, + "hash": "29DADA6DCA2DF74F16CCAA85FCCBEA29F0B550705827E9A6D7E7D174A076E4B4" + } + }, + "last_commit_hash": "2B9B336257F94C70E0BCD7E2FAB928822F935F1997EB21F711D6DD8EB01EDE70", + "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "validators_hash": "8709E9FA0E08639B827795D4164091605857D99BF4A9DD98541B3282706F2D0C", + "next_validators_hash": "8709E9FA0E08639B827795D4164091605857D99BF4A9DD98541B3282706F2D0C", + "consensus_hash": "3AB4B0648EC46497FE810009B6AB29A5E18983B0A615BE174305F94968486602", + "app_hash": "BB6B04BE515CDAB7994923F45DFD45AEFB73A912616BF9AC714BC9519112262E", + "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "proposer_address": "227950C1373382B7B12B2A1A12FFD9FC2C4A60FD" + }, + "commit": { + "height": "700000", + "round": 0, + "block_id": { + "hash": "D41BE7EE3CBC48C6CB05F7E07DCF05D66CA0B8EE3FCD04FF9722FDB60BF8C587", + "parts": { + "total": 1, + "hash": "43D423A73CE62FC554B6189CF8812D010799C11D6468F7D5A138CB756C242E0B" + } + }, + "signatures": [ + { + "block_id_flag": 2, + "validator_address": "227950C1373382B7B12B2A1A12FFD9FC2C4A60FD", + "timestamp": "2023-03-05T06:03:18.927225911Z", + "signature": "Ykvm8lXUSREvG6wqf9AQnWXMJviae3pEYhCcVPBdLACqK9tC8xb/9p0HjbQnfbZf+/eMCDkWFHvsxHUyIRyEBg==" + }, + { + "block_id_flag": 3, + "validator_address": "CFA65AE4EA6A81DC44F45C017E3F108CE1EF578E", + "timestamp": "2023-03-05T06:03:19.274263383Z", + "signature": "OcBXko1m0YylyAgy7Y1NkfZqUg1x72fc4JBCIADlUUTmwVHFlraDxrlLQlRwW75CfTWktlACz3J5Lx7F863OAw==" + } + ] + } + }, + "canonical": true +} \ No newline at end of file diff --git a/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/adjacent/commit.2.json b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/adjacent/commit.2.json new file mode 100644 index 000000000..5391b90da --- /dev/null +++ b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/adjacent/commit.2.json @@ -0,0 +1,54 @@ +{ + "signed_header": { + "header": { + "version": { + "block": "11" + }, + "chain_id": "constantine-1", + "height": "700001", + "time": "2023-03-05T06:03:18.927225911Z", + "last_block_id": { + "hash": "D41BE7EE3CBC48C6CB05F7E07DCF05D66CA0B8EE3FCD04FF9722FDB60BF8C587", + "parts": { + "total": 1, + "hash": "43D423A73CE62FC554B6189CF8812D010799C11D6468F7D5A138CB756C242E0B" + } + }, + "last_commit_hash": "9CE92CDDA78247889406A81677804B2A15DF1F597B4DD81D161D9CFF3E57F498", + "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "validators_hash": "8709E9FA0E08639B827795D4164091605857D99BF4A9DD98541B3282706F2D0C", + "next_validators_hash": "8709E9FA0E08639B827795D4164091605857D99BF4A9DD98541B3282706F2D0C", + "consensus_hash": "3AB4B0648EC46497FE810009B6AB29A5E18983B0A615BE174305F94968486602", + "app_hash": "1055313708B0720BAD42846A80AF1B67E3C2FA9879610FF1BBAA4386CE17C127", + "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "proposer_address": "227950C1373382B7B12B2A1A12FFD9FC2C4A60FD" + }, + "commit": { + "height": "700001", + "round": 0, + "block_id": { + "hash": "9F77C6DC6B8C7DD7397507F3221200C49E4EE4EFB7BE28F5A1C143DB98456E1E", + "parts": { + "total": 1, + "hash": "F97ED07A2C6262A9DC51F1016D40C281E7370A7A2961FE51E6F990950DF6EC20" + } + }, + "signatures": [ + { + "block_id_flag": 2, + "validator_address": "227950C1373382B7B12B2A1A12FFD9FC2C4A60FD", + "timestamp": "2023-03-05T06:03:23.967317529Z", + "signature": "XwAkmN9ZimTDslQKpT16zjt13rOdwtDD1eqaU1aoo/trrBJr7qI2Y9VeBb7OyJh6c5fcrNBWiTpY6dfHFBCTAQ==" + }, + { + "block_id_flag": 3, + "validator_address": "CFA65AE4EA6A81DC44F45C017E3F108CE1EF578E", + "timestamp": "2023-03-05T06:03:24.244164307Z", + "signature": "6wG4Gx66+gWI5cfhPm+BV69GYM/7TDR1n3b1qurBWqXdFQc1mLPa4rHZnYnYQm9tRGE9VXy8Z93+F6lTkLsVCg==" + } + ] + } + }, + "canonical": true +} \ No newline at end of file diff --git a/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/adjacent/commit.3.json b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/adjacent/commit.3.json new file mode 100644 index 000000000..d05a23d92 --- /dev/null +++ b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/adjacent/commit.3.json @@ -0,0 +1,54 @@ +{ + "signed_header": { + "header": { + "version": { + "block": "11" + }, + "chain_id": "constantine-1", + "height": "700002", + "time": "2023-03-05T06:03:23.967317529Z", + "last_block_id": { + "hash": "9F77C6DC6B8C7DD7397507F3221200C49E4EE4EFB7BE28F5A1C143DB98456E1E", + "parts": { + "total": 1, + "hash": "F97ED07A2C6262A9DC51F1016D40C281E7370A7A2961FE51E6F990950DF6EC20" + } + }, + "last_commit_hash": "2E11B6346778738DF365BE0D9CEC29197D862AFF682329946DEE4FD569DA8EE9", + "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "validators_hash": "8709E9FA0E08639B827795D4164091605857D99BF4A9DD98541B3282706F2D0C", + "next_validators_hash": "8709E9FA0E08639B827795D4164091605857D99BF4A9DD98541B3282706F2D0C", + "consensus_hash": "3AB4B0648EC46497FE810009B6AB29A5E18983B0A615BE174305F94968486602", + "app_hash": "62F1E8CE658C9AD5FBFC5815E52E3ED703B21A52C710E5DCA99E5CF320476651", + "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "proposer_address": "227950C1373382B7B12B2A1A12FFD9FC2C4A60FD" + }, + "commit": { + "height": "700002", + "round": 0, + "block_id": { + "hash": "BCD9E1FB37E917F4CA049407F655D31173E297AE1F03B7ED701639162B1C6441", + "parts": { + "total": 1, + "hash": "8FD53C91CCFC179E351589F5A07679375D3A1485E88BC4739987A5474FB4EC8D" + } + }, + "signatures": [ + { + "block_id_flag": 2, + "validator_address": "227950C1373382B7B12B2A1A12FFD9FC2C4A60FD", + "timestamp": "2023-03-05T06:03:29.001051558Z", + "signature": "EFvLaDeu39wkOOTgIzlC/9zUN/7jRXTbJ+zhTdToeXhqAG1EAZSzwQa3wymOEqDFMCNh/r64NcEZa5ywVmhRDg==" + }, + { + "block_id_flag": 3, + "validator_address": "CFA65AE4EA6A81DC44F45C017E3F108CE1EF578E", + "timestamp": "2023-03-05T06:03:29.245998033Z", + "signature": "iUWnXkUclfP7NykNtrV1EmM+AVyfnf3WuG3oaEASvE1JVua+bz7iNa64HJAcMmMETR3gsfFbMTfyMgORqTkgBQ==" + } + ] + } + }, + "canonical": true +} \ No newline at end of file diff --git a/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/adjacent/validators.1.json b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/adjacent/validators.1.json new file mode 100644 index 000000000..0ba7fffb7 --- /dev/null +++ b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/adjacent/validators.1.json @@ -0,0 +1,25 @@ +{ + "block_height": "700000", + "validators": [ + { + "address": "227950C1373382B7B12B2A1A12FFD9FC2C4A60FD", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "aaUuEVdox13TAVptDii1sThWwRz7EkEGrXAx0polEpo=" + }, + "voting_power": "100000057", + "proposer_priority": "56089014" + }, + { + "address": "CFA65AE4EA6A81DC44F45C017E3F108CE1EF578E", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "hQzxEzbHaEmKfAAim9q6U3l2coKCXBTpmOOtsmKLPh8=" + }, + "voting_power": "3", + "proposer_priority": "-56089014" + } + ], + "count": "2", + "total": "2" +} \ No newline at end of file diff --git a/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/adjacent/validators.2.json b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/adjacent/validators.2.json new file mode 100644 index 000000000..55473d6e1 --- /dev/null +++ b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/adjacent/validators.2.json @@ -0,0 +1,25 @@ +{ + "block_height": "700001", + "validators": [ + { + "address": "227950C1373382B7B12B2A1A12FFD9FC2C4A60FD", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "aaUuEVdox13TAVptDii1sThWwRz7EkEGrXAx0polEpo=" + }, + "voting_power": "100000057", + "proposer_priority": "56089011" + }, + { + "address": "CFA65AE4EA6A81DC44F45C017E3F108CE1EF578E", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "hQzxEzbHaEmKfAAim9q6U3l2coKCXBTpmOOtsmKLPh8=" + }, + "voting_power": "3", + "proposer_priority": "-56089011" + } + ], + "count": "2", + "total": "2" +} \ No newline at end of file diff --git a/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/adjacent/validators.3.json b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/adjacent/validators.3.json new file mode 100644 index 000000000..4f2115ae0 --- /dev/null +++ b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/adjacent/validators.3.json @@ -0,0 +1,25 @@ +{ + "block_height": "700002", + "validators": [ + { + "address": "227950C1373382B7B12B2A1A12FFD9FC2C4A60FD", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "aaUuEVdox13TAVptDii1sThWwRz7EkEGrXAx0polEpo=" + }, + "voting_power": "100000057", + "proposer_priority": "56089008" + }, + { + "address": "CFA65AE4EA6A81DC44F45C017E3F108CE1EF578E", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "hQzxEzbHaEmKfAAim9q6U3l2coKCXBTpmOOtsmKLPh8=" + }, + "voting_power": "3", + "proposer_priority": "-56089008" + } + ], + "count": "2", + "total": "2" +} \ No newline at end of file diff --git a/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/malicious/commit.1.json b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/malicious/commit.1.json new file mode 100644 index 000000000..96ea29c2a --- /dev/null +++ b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/malicious/commit.1.json @@ -0,0 +1,48 @@ +{ + "signed_header": { + "header": { + "version": { + "block": "11" + }, + "chain_id": "constantine-1", + "height": "600000", + "time": "2023-02-27T10:17:56.252368746Z", + "last_block_id": { + "hash": "A5103ECD1C6655398B63C8DC05171D828174572EDDF2B3C73E5BD4C5D47A31FE", + "parts": { + "total": 1, + "hash": "97EF30567AA0FA6254AA9CA68172DEA9FC68A6D3DA81D5AA47D2FE990C21472E" + } + }, + "last_commit_hash": "DBE402AD7A9530D58B30E4A394713F77567A5CEE9023FE1819FC3EF902BF587C", + "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "validators_hash": "E9C656841119D33056056DFE6FCC1F833BD55AF231C27326432579E9AFAE9DA8", + "next_validators_hash": "E9C656841119D33056056DFE6FCC1F833BD55AF231C27326432579E9AFAE9DA8", + "consensus_hash": "3AB4B0648EC46497FE810009B6AB29A5E18983B0A615BE174305F94968486602", + "app_hash": "27BA3C0678BF7F5C1567405E4511FE44B4131468FFF97EE7C4F895ABD4EEB76D", + "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "proposer_address": "227950C1373382B7B12B2A1A12FFD9FC2C4A60FD" + }, + "commit": { + "height": "600000", + "round": 0, + "block_id": { + "hash": "D85FAAEE1D9F90220B2E968B6DF69DC13B25F1E999554436DB3396F3A26BE626", + "parts": { + "total": 1, + "hash": "C33D4BFA5C6C61098F0AF84BC77D45DC324D776AAD92AB095D0D68DDC1F38BDB" + } + }, + "signatures": [ + { + "block_id_flag": 2, + "validator_address": "227950C1373382B7B12B2A1A12FFD9FC2C4A60FD", + "timestamp": "2023-02-27T10:18:01.280744845Z", + "signature": "pU32m1HxXePffgQp6Vfb92oNIiuSmSTWF08zgFou6ixNQyKA4MgdkKcKRqSaBLZWIyaJL3+y9XpYQF/47T/1DQ==" + } + ] + } + }, + "canonical": true +} \ No newline at end of file diff --git a/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/malicious/commit.2.json b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/malicious/commit.2.json new file mode 100644 index 000000000..e512e3298 --- /dev/null +++ b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/malicious/commit.2.json @@ -0,0 +1,47 @@ +{ + "signed_header": { + "header": { + "version": { + "block": "11" + }, + "chain_id": "constantine-1", + "height": "600050", + "time": "2023-02-27T10:22:07.868871373Z", + "last_block_id": { + "hash": "E3430B303BD920B672C06AD0B85FD0A6E1DD1265195F569141AA1ADC9474A79A", + "parts": { + "total": 1, + "hash": "E6C2B9E50E197EBCEB681BC8694F0C0D777D1F8C0F19CA1297AB153C35CAA66D" + } + }, + "last_commit_hash": "7B5BB01ECB16A9A1D0B88AC162E9053CE719DB159E5AB94844F71AFB43C7305E", + "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "validators_hash": "E9C656841119D33056056DFE6FCC1F833BD55AF231C27326432579E9AFAE9DA8", + "next_validators_hash": "E9C656841119D33056056DFE6FCC1F833BD55AF231C27326432579E9AFAE9DA8", + "consensus_hash": "3AB4B0648EC46497FE810009B6AB29A5E18983B0A615BE174305F94968486602", + "app_hash": "26A5F36E17C8F3E755214539FB367063C8D11C9064D6A0EBDBF3892EA6EFCD4C", + "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "proposer_address": "227950C1373382B7B12B2A1A12FFD9FC2C4A60FD" + }, + "commit": { + "height": "600050", + "round": 0, + "block_id": { + "hash": "FDFD129A34954000DF019F2EC84AE2748F0552A6C1D970A25D2998F3A4DA16D2", + "parts": { + "total": 1, + "hash": "B54FD2705B47AF15CBE31F6124209CC1E5C92C26FEF160A5A113C2FDA88231B2" + } + }, + "signatures": [ + { + "block_id_flag": 2, + "validator_address": "227950C1373382B7B12B2A1A12FFD9FC2C4A60FD", + "timestamp": "2023-02-27T10:22:12.898442942Z", + "signature": "XEBf5ACNZPLDDhbeGINBxOlNcjXN+R3jFD0pqAR4DCWprjd8mCQ7ZwBKWrnH7Yml/z0RUTocWgoDlXbrCkyeCg==" + } + ] + } + } +} \ No newline at end of file diff --git a/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/malicious/commit.3.json b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/malicious/commit.3.json new file mode 100644 index 000000000..910f84082 --- /dev/null +++ b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/malicious/commit.3.json @@ -0,0 +1,47 @@ +{ + "signed_header": { + "header": { + "version": { + "block": "11" + }, + "chain_id": "constantine-1", + "height": "600050", + "time": "2023-02-27T10:22:07.868871373Z", + "last_block_id": { + "hash": "E3430B303BD920B672C06AD0B85FD0A6E1DD1265195F569141AA1ADC9474A79A", + "parts": { + "total": 1, + "hash": "E6C2B9E50E197EBCEB681BC8694F0C0D777D1F8C0F19CA1297AB153C35CAA66D" + } + }, + "last_commit_hash": "7B5BB01ECB16A9A1D0B88AC162E9053CE719DB159E5AB94844F71AFB43C7305E", + "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "validators_hash": "E9C656841119D33056056DFE6FCC1F833BD55AF231C27326432579E9AFAE9DA8", + "next_validators_hash": "E9C656841119D33056056DFE6FCC1F833BD55AF231C27326432579E9AFAE9DA8", + "consensus_hash": "3AB4B0648EC46497FE810009B6AB29A5E18983B0A615BE174305F94968486602", + "app_hash": "26A5F36F17C8F3E755214539FB367063C8D11C9064D6A0EBDBF3892EA6EFCD4C", + "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "proposer_address": "227950C1373382B7B12B2A1A12FFD9FC2C4A60FD" + }, + "commit": { + "height": "600050", + "round": 0, + "block_id": { + "hash": "FDFD129A34954000DF019F2EC84AE2748F0552A6C1D970A25D2998F3A4DA16D2", + "parts": { + "total": 1, + "hash": "B54FD2705B47AF15CBE31F6124209CC1E5C92C26FEF160A5A113C2FDA88231B2" + } + }, + "signatures": [ + { + "block_id_flag": 2, + "validator_address": "227950C1373382B7B12B2A1A12FFD9FC2C4A60FD", + "timestamp": "2023-02-27T10:22:12.898442942Z", + "signature": "XEBf5ACNZPLDDhbeGINBxOlNcjXN+R3jFD0pqAR4DCWprjd8mCQ7ZwBKWrnH7Yml/z0RUTocWgoDlXbrCkyeCg==" + } + ] + } + } +} \ No newline at end of file diff --git a/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/malicious/validators.1.json b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/malicious/validators.1.json new file mode 100644 index 000000000..b381c35f0 --- /dev/null +++ b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/malicious/validators.1.json @@ -0,0 +1,16 @@ +{ + "block_height": "600000", + "validators": [ + { + "address": "227950C1373382B7B12B2A1A12FFD9FC2C4A60FD", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "aaUuEVdox13TAVptDii1sThWwRz7EkEGrXAx0polEpo=" + }, + "voting_power": "100000049", + "proposer_priority": "0" + } + ], + "count": "1", + "total": "1" +} \ No newline at end of file diff --git a/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/malicious/validators.2.json b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/malicious/validators.2.json new file mode 100644 index 000000000..cc2a95b6b --- /dev/null +++ b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/malicious/validators.2.json @@ -0,0 +1,16 @@ +{ + "block_height": "600050", + "validators": [ + { + "address": "227950C1373382B7B12B2A1A12FFD9FC2C4A60FD", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "aaUuEVdox13TAVptDii1sThWwRz7EkEGrXAx0polEpo=" + }, + "voting_power": "100000049", + "proposer_priority": "0" + } + ], + "count": "1", + "total": "1" +} \ No newline at end of file diff --git a/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/malicious/validators.3.json b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/malicious/validators.3.json new file mode 100644 index 000000000..cc2a95b6b --- /dev/null +++ b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/malicious/validators.3.json @@ -0,0 +1,16 @@ +{ + "block_height": "600050", + "validators": [ + { + "address": "227950C1373382B7B12B2A1A12FFD9FC2C4A60FD", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "aaUuEVdox13TAVptDii1sThWwRz7EkEGrXAx0polEpo=" + }, + "voting_power": "100000049", + "proposer_priority": "0" + } + ], + "count": "1", + "total": "1" +} \ No newline at end of file diff --git a/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/multi-validator/commit.1.json b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/multi-validator/commit.1.json new file mode 100644 index 000000000..4d5abbbc2 --- /dev/null +++ b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/multi-validator/commit.1.json @@ -0,0 +1,480 @@ +{ + "signed_header": { + "header": { + "version": { + "block": "11" + }, + "chain_id": "torii-1", + "height": "700000", + "time": "2022-06-03T13:35:50.101488944Z", + "last_block_id": { + "hash": "7612A4E50A7C3963234C12926CD6D1BDE6976B48C86FCBA234A39B9E1013F8F5", + "parts": { + "total": 1, + "hash": "8412E2BE244468C9EAEFDF9EDCB786E87B493F0128A2D52E659EB621A2714434" + } + }, + "last_commit_hash": "5A16B046C7BE949D8D94ED67C68C3D2B403A0FDFA755978E0E44CF510BD849D5", + "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "validators_hash": "D7FD67B64A7E4A554C6F99CA3A5B0D622CA8655C106EAB15B8BF06B1824EB6A4", + "next_validators_hash": "D7FD67B64A7E4A554C6F99CA3A5B0D622CA8655C106EAB15B8BF06B1824EB6A4", + "consensus_hash": "F67860470DBFE423526B3C6771B18C1235E1FA658076F5E256552FB1F3501A14", + "app_hash": "930CD3CE7EB375564DB7E90EE390B3744DA9367AB0540BF780543EA4791B9139", + "last_results_hash": "3B90F715776DAA933D619E771D22076BA1F6FD1D035E8429E12F330F0F51D9B0", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "proposer_address": "C97C186A87209EA864B432E03EF0441E18D709BB" + }, + "commit": { + "height": "700000", + "round": 0, + "block_id": { + "hash": "54ABC987C2F0A0996FA210CAC5ACE9CC647BCC092F94DAB8389E9BB0A7D34257", + "parts": { + "total": 1, + "hash": "9C2528D6B338A136EAFE3E72E80BE1C8477AE27A9F909B8473E95741F79FEBB4" + } + }, + "signatures": [ + { + "block_id_flag": 2, + "validator_address": "C97C186A87209EA864B432E03EF0441E18D709BB", + "timestamp": "2022-06-03T13:35:55.754818219Z", + "signature": "BVy+N8t9DE/DtRLJe03RxX7AMuMaTtX9vyOnclgQyVWnpl78W3WgnSQFTBZzOk0i2mUM5Y4grkIfMQzX7tlkAg==" + }, + { + "block_id_flag": 2, + "validator_address": "DA694585BB239BD51FF6FBF61C10B1E85B2DB707", + "timestamp": "2022-06-03T13:35:55.75223464Z", + "signature": "e9/EMCtD6u/K1IvevPaLLDJyZBz+AQJygWI3i+1fIofKFrGCRgyll9X3hwVSXdHAmeJA5klNocjmg0d840mcBg==" + }, + { + "block_id_flag": 2, + "validator_address": "9FBFE65AD18294A346B540F7396D92DF32880966", + "timestamp": "2022-06-03T13:35:55.754420668Z", + "signature": "9F+1dYNW/pfy4/nA6eyJ8/LG6ZQCakwzfX5vSU/ohVqvtjMG/OKtULRxLhNC3D1XGbPwCnAuk92DR+HLCaqSAA==" + }, + { + "block_id_flag": 2, + "validator_address": "BC9D4BD4F1F544FC1E136A92A368CBFC28D0BBEF", + "timestamp": "2022-06-03T13:35:55.785195996Z", + "signature": "wJotiqVAVNqpAm3BdcRgASK4BrwWvYKX28W8q/OPqkpGhGw4FOSq+NDCy4InCiaTs4H09hd9N2xU90hBTqGNDg==" + }, + { + "block_id_flag": 2, + "validator_address": "9FB1318DC46AB8E9D25263DF34C568FE4177FAED", + "timestamp": "2022-06-03T13:35:55.910403509Z", + "signature": "c1lIgbTpaXbF57pZngUKlRHhFYMmvNVojX1KpNgQPi5ThQuYnah21Kbyhlqw2btVfRsuCLVPmaEcq9FTHpG3CA==" + }, + { + "block_id_flag": 2, + "validator_address": "1E4E9FBC795E5C3F1BE3507F6008F40257A8E09D", + "timestamp": "2022-06-03T13:35:55.728438697Z", + "signature": "THvG/fKjSxbbSg7weuACNc9f3Ln15FWQvXHDeSVQSJSGLr1WvMUBTGBBrIrZpPLJ2PqsOdzpu0IkBADkSItxCQ==" + }, + { + "block_id_flag": 2, + "validator_address": "1ECCEB94F3459F9921B0C1D398A3E46283A35285", + "timestamp": "2022-06-03T13:35:55.796899744Z", + "signature": "E5YaDcZ2fy5T/3yNI9nYbKQR9D09ep2k/H3F0bCu7vGl+RBO1CXi4WvFVYy0gbxhjzgfYAr4HSFV4EmeJYusAg==" + }, + { + "block_id_flag": 2, + "validator_address": "8971B56A1262D888E76DDF6C78339135122B9FD5", + "timestamp": "2022-06-03T13:35:55.685746913Z", + "signature": "3981SsDA5WgkFeM0oSzMwN/N4TA2iMU7IxfiTK9hhnxh+XULnZDDcdBPlIY0TBetH35htbv1iX+hNScalg1JDA==" + }, + { + "block_id_flag": 2, + "validator_address": "44A774BBD9B1621C7A752F4BF4FC97ECD19C9339", + "timestamp": "2022-06-03T13:35:55.75118462Z", + "signature": "wF/psfoMtC3wMMGT4udfZ9nmZg251Af7a5lvHu7m+OvFe9cczQSu8d4q960aPhYWGMEuku5yTrZ4uf2YFbjkCA==" + }, + { + "block_id_flag": 2, + "validator_address": "1FB705E4792863FDC9FB000C11D0725656A9D641", + "timestamp": "2022-06-03T13:35:55.810490301Z", + "signature": "+2Cvci+81E/UDmnu69TyWC6B37GflOVho+iVy20FCGTdjz5UFVy55cTxrv7vbZMZ3KlOyax+RnQQHGi6uLItAQ==" + }, + { + "block_id_flag": 2, + "validator_address": "7C7DA4D5C5C9846F9D02BCA0FCC8BF30FC0039A0", + "timestamp": "2022-06-03T13:35:55.768851934Z", + "signature": "Ry9mBF+vhls/JhdYo/CD2Y3x2To/guPvF5Yeg+bOWMfjHkD0+GXSoDtZJAkzf3EXFAd9Kft7r/t9MhU4B/84CQ==" + }, + { + "block_id_flag": 2, + "validator_address": "B310BA4A7B39A9D38A67E93E798CE9549F8407F7", + "timestamp": "2022-06-03T13:35:55.790483426Z", + "signature": "M8VUvw12QEBmfZq0oxOrZSGIoO2R1hTJ7vxWC+U3TYX86wJ0iLJTyHiOCIVsi3kSqZgzMRxN9GcyeN5wvORZDA==" + }, + { + "block_id_flag": 2, + "validator_address": "305EEF06E09EB104BF1564DAF31F4277C31AD984", + "timestamp": "2022-06-03T13:35:55.860597728Z", + "signature": "SUEwxiPwI6gpV2u5ZP7PHUqT1aHewUnAjYvbsLxhn8rcpi+IQL4z8IC5BDEu6lIEtRTBAf3kbUG+HIOpZxvmAw==" + }, + { + "block_id_flag": 2, + "validator_address": "CF4B8BCC61E1B2207107F986283ABDD61B0E874F", + "timestamp": "2022-06-03T13:35:55.745476141Z", + "signature": "IRqS7GT27OugkGGikGmRyo8BPmjmvADOkovSEhuXt3NLGZDoZpEtjTQ0hrsHgCxNxAloi/D5basgQf2wwNPhDQ==" + }, + { + "block_id_flag": 2, + "validator_address": "0323A66E6E48A50BDBAB3832B082B3F2614A433E", + "timestamp": "2022-06-03T13:35:55.777095648Z", + "signature": "ONtbwtqyk3WdUGLeYupQvzENadEPsfzAfmgI10HTwJnwt4cn12/0gJNazc+n8GPM6jSA+c5SPxYJFKRc/RVBDg==" + }, + { + "block_id_flag": 2, + "validator_address": "E0D23AE41C8F2A204F652CE826E08668DE9A07B8", + "timestamp": "2022-06-03T13:35:55.742895232Z", + "signature": "FKlfP1k10dI2USy71wVazRriA4p80AFu0YFfT0R29+VXY/b/gufSyUgnwcQAIBXEJ8R7C5Ff2IcUXt5YXe0yDw==" + }, + { + "block_id_flag": 2, + "validator_address": "3439FB7806A3661A7A53D6B28B6771ACD7B00411", + "timestamp": "2022-06-03T13:35:55.779446564Z", + "signature": "0vFj5Cqsr0PjKr8h99cOoR7670AGAwaDABY6ZoHHMpQCGIcQQ/ztQGBGc/bQlybfEfgD4td4c3zwGnU6UmmEAA==" + }, + { + "block_id_flag": 2, + "validator_address": "76EA8281CC939495A4A54656C59B9075E9257FC4", + "timestamp": "2022-06-03T13:35:55.768029463Z", + "signature": "5u2fzs8vf9rh0XLRokWqMHTq2t0FPf9OEZGvzzc66OBeYtWbPkqjd8QoWcNtZZSeLadO0ZmxUKH9dI1XsCihCA==" + }, + { + "block_id_flag": 2, + "validator_address": "684616FF14EAE8BE5613DA40864EA85812469308", + "timestamp": "2022-06-03T13:35:55.790533474Z", + "signature": "eAwmuFm1DhTKwVv9176ud7g3VNCD5Ffx7eQ5XO7QDc1zRCk5ZBW37MXSTGJSDwK2nE6fVCpgz8uGiY+Px2MbBg==" + }, + { + "block_id_flag": 2, + "validator_address": "43790BA2E57D02A8944B670B46D62ACBBDDE73FE", + "timestamp": "2022-06-03T13:35:55.873837389Z", + "signature": "x2FWJ35Cl5Ro/3PX95PQ7zcium2/ew8O4ciAtH434R03qObjF4dxGbiYIK8jGfcLZSYzbHfEqg9W/w+hjaArCg==" + }, + { + "block_id_flag": 2, + "validator_address": "A35A6E459554E336C2A07CE78BA4EC1250AC3338", + "timestamp": "2022-06-03T13:35:55.830037041Z", + "signature": "EGjgmsPWjHkuF2F61YUYZdF3yrj3fwok/npkzDXdbMakjNjtwrGGDwk8ha8Nd+vEBXEsjrwoTKcuTtOTGBSHBQ==" + }, + { + "block_id_flag": 2, + "validator_address": "5802A80D39D378A6218E52F4EB50ECCF4583264B", + "timestamp": "2022-06-03T13:35:55.766111922Z", + "signature": "33CqE0IaCa8LH5xl3TEF9DQM6CUixON/zGLwf6zagOMwouduY/fjvKPnJKFHKjcw8HH+06WHW8Eh/uCdc9ZYDA==" + }, + { + "block_id_flag": 2, + "validator_address": "8047FA49FCE5E85107E88AE0152E079D9CBD320F", + "timestamp": "2022-06-03T13:35:55.859595385Z", + "signature": "y9Z8fI8yzvPwYL/7xJZK2IHtxu6w9YN9xYyR//aCC4VV6H6e9twBiE4lbmOdfCvbBY2sIVGWJgPdHaAQ0PHfDg==" + }, + { + "block_id_flag": 2, + "validator_address": "B4A950629CC31E385E6269F7B62314ED57650EE8", + "timestamp": "2022-06-03T13:35:55.760842355Z", + "signature": "yoVJt9bZHhYBM4UUXbq7uN++sKjZdJaIWomvT+kY4l6V13/Q6FfZ7p/Gz0RQ4M984YWRfE6Uys759x9eJtTyCQ==" + }, + { + "block_id_flag": 2, + "validator_address": "B95ECC721FCDD6893107699AED4A0FAA62E97D11", + "timestamp": "2022-06-03T13:35:55.776082641Z", + "signature": "IYpJue6Vhq2LgAf3gXoyrMqQzWVKIyA/NXSflzJ10QXilAXEk4xtRLNETU5ktHTCaLua1HQEH0jWncl75SOmDQ==" + }, + { + "block_id_flag": 2, + "validator_address": "ED61B1DEE5F79C521F521B78DB93559FEB2E3B82", + "timestamp": "2022-06-03T13:35:55.799543959Z", + "signature": "F16w+GqPJKvObo4CpmrRKWU4ImYQR+/dQ6BOro4BWtoAyzT6djzIeBiecqfpngw5k2Dk1ay+oex1yK/v0wO2Cw==" + }, + { + "block_id_flag": 2, + "validator_address": "A92A1DE1BB768A065F87DF5811FC0F32FA7CD57E", + "timestamp": "2022-06-03T13:35:55.755220017Z", + "signature": "4Gfral3cIln592UWDp6icF0/3X1Yu71ytQnEVC06nbHm5d+rDVdhZoTcVuXt5RwPj1pdwMm/2nLgEuzGdeuwAQ==" + }, + { + "block_id_flag": 2, + "validator_address": "83F719426E00721A9208DBFE2B30D6DC75FE6645", + "timestamp": "2022-06-03T13:35:55.775647373Z", + "signature": "AeDmWszwyqOYG1f0O4BJxzqHMUmXHGbTQyTysMtcJ/B+kWbPYvJwAOFB3eViYb6luRbPav0OZK5cX1t53iPpAQ==" + }, + { + "block_id_flag": 2, + "validator_address": "710FEF6FF4693C657CB24AADF1623E861A5AF906", + "timestamp": "2022-06-03T13:35:55.665776737Z", + "signature": "xmDL2gCKMZcMqUXKgFMpHT2ZTyU+nVWUVwA2NsWOieZQt1wbm1lAkUGpBPTsGQ0QXeVlPMpdFH9a4qRG2XszCg==" + }, + { + "block_id_flag": 2, + "validator_address": "C8BB72DD64C161F5A23874F480DCD12BD2C2647D", + "timestamp": "2022-06-03T13:35:55.811286326Z", + "signature": "+uy8y9ipaHvoI3f/X3JAZtyAK5BJFy+v6z6hxgzwRpqYjq4UD6dk3x79z4TOQty06FFkzviCPq0C+xOZZLGnCw==" + }, + { + "block_id_flag": 2, + "validator_address": "17E4639B5116509EC04C4AABFA69506317801783", + "timestamp": "2022-06-03T13:35:55.744985013Z", + "signature": "GWhE4+6rTGQVT15kEQfw1XT+tFmFHOKJw7uhkDhiXYLj2GMV122trNt5Jg+XuqtQRRnQrmYPVGOAsTs+t4rjBg==" + }, + { + "block_id_flag": 2, + "validator_address": "1CDD0EF99F36CC3028237886FA00CE45AABD60E5", + "timestamp": "2022-06-03T13:35:55.813779723Z", + "signature": "Q41vMZ++2SVAwE3GJJ90w+kLaPeQ5UAn4BRSvLaGrt22YveyWzT5Rb8/4KZ9qdIQtUG996pSppm9q7qoP5LNDA==" + }, + { + "block_id_flag": 2, + "validator_address": "80DA42EB9A25BD341A18B2D989BB86DFD4413A05", + "timestamp": "2022-06-03T13:35:55.773983092Z", + "signature": "Ce+RmOkY72p3lq0XInZlGrrsMtn35NBOFn71q1tYbE3kuaR2EG4vZTEHG8qvEho0S1QNiWzhq1MNo+fqtwSPDA==" + }, + { + "block_id_flag": 2, + "validator_address": "916D131FCDC899B83D0C3B56DDD6614B339C997E", + "timestamp": "2022-06-03T13:35:55.752739285Z", + "signature": "VkWR14Y2ZExLk6gZt7a4pf1ykVpQQTqxtz2ddLHyub7WPsQ9J32KLi6hGFGbwY3fbXILip/hRsRIZk5ChfMoDw==" + }, + { + "block_id_flag": 2, + "validator_address": "903EED41E608EFD3E2DBA2C561F7331C1AE0D82D", + "timestamp": "2022-06-03T13:35:55.869777308Z", + "signature": "VW1iO9UYqCKarcV/sEN5vALfIEZURl2MMx6AxXjEWniJl2a+isGecizI+AGsN02TL9bW1UIegG921lidzyYpAw==" + }, + { + "block_id_flag": 2, + "validator_address": "A262DDACC4F532340A2B389CF3EAA29B6846D142", + "timestamp": "2022-06-03T13:35:55.716423476Z", + "signature": "jEqEnnr0KmsfDWeD9CxzjH590wy7Ql1z1UatDMnaEsGBrjYKeiyG0JN/Jrqclul8CugTzGYxduB0dGBuOJmEAw==" + }, + { + "block_id_flag": 2, + "validator_address": "9F579C855F835F1CB71ABF2960A244FC0AF671EA", + "timestamp": "2022-06-03T13:35:55.738115459Z", + "signature": "xSwvQCb7FpRNAJqhL3MlpKw2iRUypqJts5Ud8pF6Smv03rz8G5tr7iB4ytTrd/s7n2QtfjMnesNEgjHdtviBCA==" + }, + { + "block_id_flag": 2, + "validator_address": "2026B424B984B681F91C88874820CE927965C492", + "timestamp": "2022-06-03T13:35:55.669136279Z", + "signature": "uGoBYoeTKXOAWkRfI9knL0+9DDQvftPcUXsrFBfErMT1bDE5AqHlu3D4FUGud3GwviBMd5pvJqzrFV9BPsTYAg==" + }, + { + "block_id_flag": 2, + "validator_address": "92C70850FA51E11384826C5F574F5B13B5706554", + "timestamp": "2022-06-03T13:35:55.895362026Z", + "signature": "KkQJQ/GQuZIweb4MrWTPc2CjkJUvYtpIxxKdR176EiceMFhK/4ruoT9mFJUU6wWCPzMZUHz8/sUJW/mnx5DgAg==" + }, + { + "block_id_flag": 2, + "validator_address": "1A30424D3A05B7E61B1936477C338E316E5D7D66", + "timestamp": "2022-06-03T13:35:55.767390164Z", + "signature": "e9E+s5tQMq6y3kA2jbG8rWJWf+Fg14ZNOsppXYni3ClKqSCIGZDB+QUlelsiaVkXGiuImVm4Y4Ss0CV+SWjaCA==" + }, + { + "block_id_flag": 2, + "validator_address": "CB1814F7CDAFE24C0A836B627082710636562B98", + "timestamp": "2022-06-03T13:35:55.773529664Z", + "signature": "8HPhU4+lD4acMsPtHe3/VrsgJHDjHelrTPhwX6J7e9Lw6bwAVxdTQLbgi+qk7fTe31JnsmfhThurzOamU/9CAw==" + }, + { + "block_id_flag": 2, + "validator_address": "DC9424AFE6C83F68813337B5FB4EC62C2330C9E6", + "timestamp": "2022-06-03T13:35:55.809448815Z", + "signature": "u6rWOcha6qmKRCEu49MWdZjWEM9F7rkveRGT/7wjzcHG6EdoJXzlPavA78azeRzxZdYOD+eeG0dMC4JjcW5rAQ==" + }, + { + "block_id_flag": 2, + "validator_address": "91938313E6AC32D56F07B39ACC580B1E7E5A29E8", + "timestamp": "2022-06-03T13:35:55.748101444Z", + "signature": "EFGTLt7jppITaEanwWgwjHWVmLxnkzsx+MlbSXxM/o0k6MiZYxhVHnqKlQ8VEx4rVXf5ciiRkngkOHLBImfhAA==" + }, + { + "block_id_flag": 2, + "validator_address": "6A24190F2C8C0878BB134D146FE9333094171256", + "timestamp": "2022-06-03T13:35:55.746294523Z", + "signature": "yD16Gj6HBagT1mdcmWBf80QFrcm4OuotZAlrgPATBv7ESIQrvfsbpfg77qFZUyFppUlvRx/w5Jo3Xv+EAyIaDQ==" + }, + { + "block_id_flag": 2, + "validator_address": "60A7F8F9EE0BE23DAC5183B36BEB14AEF2D3A879", + "timestamp": "2022-06-03T13:35:55.761892792Z", + "signature": "xdg1qq4wwjN+lXkIpqIJPW2gLyqbo6wPIjBD1q+7J/Yp7dAAc6Ft68dhaUqpVNZHX7Edb4EuXaVvcE264BdYCg==" + }, + { + "block_id_flag": 2, + "validator_address": "43FC3AB6FE3D33C41842553EAFC8393A7FD00C23", + "timestamp": "2022-06-03T13:35:55.7528551Z", + "signature": "8zqsWGoP/7Qu2di8rYmiz2kB8EG8Uapve8MktvBxBoPkVPpzT7bvGLm4P47NmaHHTbkov7gPUxTrudjBl6CDDw==" + }, + { + "block_id_flag": 2, + "validator_address": "B684A0D2CB2D1AC7F9AC890B4678006A1D5B09E0", + "timestamp": "2022-06-03T13:35:55.7990176Z", + "signature": "wVocHbMEKuSLdFR6GRbud0u3JmRzdvhHM2bDmzkSU1JqANJ8bEZ+OyLEWWrYHIGBo2INVcoyC3uxh2Z0FfvxDQ==" + }, + { + "block_id_flag": 2, + "validator_address": "19DD6B3CA0DEB5F6FE0E1A78AD53D408EA0CA8F0", + "timestamp": "2022-06-03T13:35:55.753414473Z", + "signature": "zeto2mpKNT+2Hs6A0BrYCjaz5QHFKsoBxc/XjynnrjUcoZbsM4LayFIY13KHCyjMKTahvPyYuOF+qiKo/x+QCw==" + }, + { + "block_id_flag": 2, + "validator_address": "987AF576DFCAE3B71C38FC729174739811C6626A", + "timestamp": "2022-06-03T13:35:55.814725263Z", + "signature": "LmbWjHS6aWSx6KxA5PG2Zv52bIX1OdK2MXvdDApdnRFu0k6z/CB9aeG9d9rvr19n1Lwt4ceg5k7yN9Qb1mgLDg==" + }, + { + "block_id_flag": 2, + "validator_address": "BAFE51BA7636EFAA64E59649321EAFC4E1D0F03B", + "timestamp": "2022-06-03T13:35:55.893201756Z", + "signature": "Bk9lyPDvcC5+k8JeIjf40dRunkKtx4hpauJTvw/fzcE9+ZFr47JTLcDoz/jF7b/XYXdA5+BfCPVW8EtzjpxqDw==" + }, + { + "block_id_flag": 2, + "validator_address": "AB135B41694E5EC24367110CC9DB1DC7852D6E82", + "timestamp": "2022-06-03T13:35:55.819771973Z", + "signature": "vbXJixBGjbPelJQJD7i4KyF8bvp+k2SzCAgT4irWMLaoYeDRpSLJAfUEp8rxwuAfhHSCi50acH/TuK2+iDtdAg==" + }, + { + "block_id_flag": 2, + "validator_address": "5C950EA844C3F38BB3BB51C6634FFAE18DBE8811", + "timestamp": "2022-06-03T13:35:55.760226369Z", + "signature": "f8pOjAyXuz+7MXnQ2y5uPlFvETJpYqGXekdqgiWGY3BP1b6+AfBudYYCFGzgszD5MTwX0c9O+S2zuhzLb8wEBw==" + }, + { + "block_id_flag": 2, + "validator_address": "B4BB763F2BCDF710991355B1FE4FDCE83C0874A2", + "timestamp": "2022-06-03T13:35:55.769735137Z", + "signature": "EHYV8c/iiW8eT1I0aLcjorj/USCHIvh7Q09XV+32JE0UOFpVZcN0zhYOEt9P94lhSwFLygjMuVEEMn5oxUryBA==" + }, + { + "block_id_flag": 1, + "validator_address": "", + "timestamp": "0001-01-01T00:00:00Z", + "signature": null + }, + { + "block_id_flag": 2, + "validator_address": "94D21453B366ADA7F50F12CA907CDA7A4AB7F214", + "timestamp": "2022-06-03T13:35:55.762781843Z", + "signature": "NYzmnPGtR+X2aUOUX93xZGOQUXj1lgy+Sc35TXcntqo+PgS9K1NvP9syjrpExJtj6DoYyxZLxVWILV7+kx8+AA==" + }, + { + "block_id_flag": 2, + "validator_address": "B699C4799E8F6C7D038682C0441AD28E6E43E677", + "timestamp": "2022-06-03T13:35:55.755470675Z", + "signature": "j2iBtQWfvRwrRr8YL9D2YM1M+wWqJoYVb0Angdirt8MIwiP9JFvdmk0AUYDWWqKQtSCPsirU5sS54vyAZr8PDA==" + }, + { + "block_id_flag": 2, + "validator_address": "246C9C9846C2899D0DA109BCFADAA6260685B4C3", + "timestamp": "2022-06-03T13:35:55.859719292Z", + "signature": "KdnjmWDQbHpckLgA8zuoOkBmOp5ZVIC2MyNPmeQwXqkIjFPszPYGvBK8Gex/MGYnEUqdodCtCdSRqXR83dZ+Ag==" + }, + { + "block_id_flag": 2, + "validator_address": "E3DF8B64C6EE018BE7EC6BB9BC3ABFB67D99A630", + "timestamp": "2022-06-03T13:35:55.772229442Z", + "signature": "phMqXYq0qT6Ogl8YGyELC5bJEradkPuaKmbSmG13O9w4E9HUr958SKj4OY1VC/CtCXXdTwsyGx51jUZsUs1cCA==" + }, + { + "block_id_flag": 2, + "validator_address": "CF941683BB7851E824695E7ABA86D57C6E32F5D3", + "timestamp": "2022-06-03T13:35:55.769108465Z", + "signature": "mDws8j1MgraCC7RW/Kdro63b2qmnRcmgbZ7b9BOuXhh4bMDsUoOWzVm4DzHlRhvDIsY87ciliiBdNoLD6V2mCQ==" + }, + { + "block_id_flag": 2, + "validator_address": "7219BF2BF60498F19DC51B33588DEB9F9D30B392", + "timestamp": "2022-06-03T13:35:55.771974892Z", + "signature": "gfMlUmOBRwUFT0/85gnTgTLcOcORgMikuYS15HN0Zxwj3Hr/nyYuNDziUd2UoKmt4w2nl10d1G3+9ioGmh3yDA==" + }, + { + "block_id_flag": 2, + "validator_address": "75B513290765236B2F1C3FCAACF35A7FBAFBFB6F", + "timestamp": "2022-06-03T13:35:55.743666929Z", + "signature": "dbs5C8CJXT0iRM6rwC1yujrTXbah6p3HWYzlepseolt0zh35sdQxR+qLTTW9l9fFJVakbABZc3HmnkxEH2XhDw==" + }, + { + "block_id_flag": 2, + "validator_address": "3C672A568D8B4D3261132A92CC572F21D4F85C1C", + "timestamp": "2022-06-03T13:35:55.771239891Z", + "signature": "8g80O96VGJjCohwm1LC5g+IA4TFfktGKQqwvO8oSVmURXwRKvEz0uiOgE60mFEDZF1Z5c29HBUvAjtZtJ2YJCw==" + }, + { + "block_id_flag": 2, + "validator_address": "208FF031498FA42FFED6829C8A4884CDC72BE06A", + "timestamp": "2022-06-03T13:35:55.76864075Z", + "signature": "YkQ+8taohQ2wnV/9shwTzAYtYjY7lSznvGjVThjsajaTB+Ygb9uotwqYyJ5hmFlx4tKNg0XM8XTMIYi0w2gCAA==" + }, + { + "block_id_flag": 2, + "validator_address": "CA572745CF6C1437547BB3961D3D04EE8C88DA30", + "timestamp": "2022-06-03T13:35:55.847332906Z", + "signature": "abDhhCedT6svmsLQ30CABCWGZbKOLReGjnG/wrZYFUjd2/XVTzj+Vnwz3syLI68RGssfzj5cwpUM1bRRSEbUDA==" + }, + { + "block_id_flag": 2, + "validator_address": "164A8F8019C8B800A8BEB03CA04428B881812E04", + "timestamp": "2022-06-03T13:35:56.11786174Z", + "signature": "j1hI/hqoqijeLpWUfQ7Jjj+9iriEYaYa1WtXAbFPGx2R5xuUqzbnC9B/tv8oWM7BSippguUNYdqbPxQ7cwy6AQ==" + }, + { + "block_id_flag": 2, + "validator_address": "206DC4AC92A0CF215D8C8AF98B7A84966CE43E45", + "timestamp": "2022-06-03T13:35:55.805981767Z", + "signature": "zIRmZzaRbwhCYEyolXsMOQbmXN7zs0DdmyPJtWgoEMQwMHz0NJCIYeauzMt3HiiXLBKGEPGVbqrdVKbmm9KaAQ==" + }, + { + "block_id_flag": 2, + "validator_address": "3655C2522526E342E1BAE250B7E01C728E97BF61", + "timestamp": "2022-06-03T13:35:55.781612808Z", + "signature": "HkUYBdlNVEL25jXeU7p3dkXAjdrM49XamERN9StVW2ViUaFAV0jIkECXobaQu8Y4gywAzA3e/WEYsB8fv/+XDg==" + }, + { + "block_id_flag": 2, + "validator_address": "50A7130BA74D071391EF45678BE2444955FA4AD4", + "timestamp": "2022-06-03T13:35:55.795000483Z", + "signature": "N8GWyQ6YF34GlL++V2T7I85NHO670TuiLGfkyxy74hckDX1OdY914/Bh3AX9u52Whe4elSwFKh5KShO9ixtXBA==" + }, + { + "block_id_flag": 2, + "validator_address": "556EA605A9374CE54C157DD42395B4047E327914", + "timestamp": "2022-06-03T13:35:55.819703961Z", + "signature": "MY6y4L94ADzfqjwRZbapzqL7AGfmjoKJO5xHnSsFsFWHJqzgSuYszAgi8f13cOutrx+nzC6C3LcMjs9dIXlnAw==" + }, + { + "block_id_flag": 2, + "validator_address": "64BBCDCC1BA3D6CB934A5BBC9F45121A40EF81B2", + "timestamp": "2022-06-03T13:35:55.739332116Z", + "signature": "NYKv8DZvtKFKvkbS8Fy/UoT6Yw81H5EGYtr3iPys6xv64dvTf0zIE9m89HlV+iFtIouVfDRoc+XOTRITMEkKAg==" + }, + { + "block_id_flag": 2, + "validator_address": "6B00AA4C9E824A9E042AA49A5CF40591FDFF2021", + "timestamp": "2022-06-03T13:35:55.757298351Z", + "signature": "6D6PaGs9rieb/Pldq34y1Ntq6/uag1dXJTBaHUHXxvgxAUwL36H5/ljPzuohj1g5TGO5ysIaDEs2UR8Q/C8nBA==" + }, + { + "block_id_flag": 2, + "validator_address": "A2E2A0CC28C652A9EA47D666B2CDE5122DE5A8E1", + "timestamp": "2022-06-03T13:35:55.791807553Z", + "signature": "IDmAMZWai3hZGkMJYLVtw3DD+auIuGIh2Yh7N1W/lARTf4/3a7Rp+/m+Igv5NrxnlMpRJJRswWyUcSKs6/aLBQ==" + }, + { + "block_id_flag": 2, + "validator_address": "E314D1F70E07277B21E80FBF4BCA6AFBDB07C367", + "timestamp": "2022-06-03T13:35:55.818566881Z", + "signature": "SkDwwDcUDr1bhlc03OBzeJ27Ave5GLUI+xeBpjrgOeMAxVtQsV1v9rr5IfAlludPaSrROabMCkQbsCS4/k5rBw==" + } + ] + } + }, + "canonical": true +} \ No newline at end of file diff --git a/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/multi-validator/commit.2.json b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/multi-validator/commit.2.json new file mode 100644 index 000000000..5c29f6c77 --- /dev/null +++ b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/multi-validator/commit.2.json @@ -0,0 +1,480 @@ +{ + "signed_header": { + "header": { + "version": { + "block": "11" + }, + "chain_id": "torii-1", + "height": "700022", + "time": "2022-06-03T13:37:56.855963583Z", + "last_block_id": { + "hash": "13FC028F5E88096C6D5DE366ECC1B33E55149CBDCB37FEAC3959F5EF35A9F156", + "parts": { + "total": 1, + "hash": "A3D5C359E9CB8FECA59924AF960CEED6F2AFBC28E65280102D346BB112EA4745" + } + }, + "last_commit_hash": "06946149C9054EBA16ED34D67CC64F926C1DC2AB24F1F1A2D6499DE369C9A4D1", + "data_hash": "02BFA4EA112B5D1CCA5486659B12710E46DA0357DEAA6CEB19B9424A16ACC9F3", + "validators_hash": "C942BF2E377FB1EB6FC1E484519F3130A4EA8307D45EBD988DB0D5EF9C8974E9", + "next_validators_hash": "C942BF2E377FB1EB6FC1E484519F3130A4EA8307D45EBD988DB0D5EF9C8974E9", + "consensus_hash": "F67860470DBFE423526B3C6771B18C1235E1FA658076F5E256552FB1F3501A14", + "app_hash": "111B00FB2733AAD28ADD1373B41A20091A532C4AF1803BEDA9F4CA8C6A93A724", + "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "proposer_address": "9FB1318DC46AB8E9D25263DF34C568FE4177FAED" + }, + "commit": { + "height": "700022", + "round": 0, + "block_id": { + "hash": "6E81D1F70AA3EA0EE9E6DD9F19DEB9D7B865F116030F20D78544633323FB6663", + "parts": { + "total": 1, + "hash": "0F25EB0305205F993628F61C5CE9587FC2E8E031DA0E06B3E4FB8A500FD5C673" + } + }, + "signatures": [ + { + "block_id_flag": 2, + "validator_address": "C97C186A87209EA864B432E03EF0441E18D709BB", + "timestamp": "2022-06-03T13:38:02.956824996Z", + "signature": "xDcPIbqXxiH2LX5fddAvSsbW7OhIekWsGcMrJXRKf8lU/TsGSWzYn2vo/YQZRpVJlnRm1sjFYN595Ru7PiJxBQ==" + }, + { + "block_id_flag": 2, + "validator_address": "DA694585BB239BD51FF6FBF61C10B1E85B2DB707", + "timestamp": "2022-06-03T13:38:03.088835659Z", + "signature": "Ig30X5IENoC+Uc1JuA8GEoARBAmcNj5JfsGZ1r98VWFx0XZEp5VZWOs49qreLzdEkm++liRYTvIOmqI2wFXgDA==" + }, + { + "block_id_flag": 2, + "validator_address": "9FBFE65AD18294A346B540F7396D92DF32880966", + "timestamp": "2022-06-03T13:38:02.950662014Z", + "signature": "YMUnvB3NyTMhzf6+nPZ4CPjyp13EyerLDKsSd2Rti/5wCSho36Lq1jI2NLyE2t1JUyW7MwxadEl7z10SHqWwDQ==" + }, + { + "block_id_flag": 2, + "validator_address": "BC9D4BD4F1F544FC1E136A92A368CBFC28D0BBEF", + "timestamp": "2022-06-03T13:38:03.001798725Z", + "signature": "MOEBfDjUdsaMHCEAQ4byykts6Qq0IG5jFNTgPFSZS5iBCw2j+voZEKtv+4u5hSID7gR5YW47PsGGgLOJlDZNCg==" + }, + { + "block_id_flag": 2, + "validator_address": "9FB1318DC46AB8E9D25263DF34C568FE4177FAED", + "timestamp": "2022-06-03T13:38:03.138793884Z", + "signature": "XeGS9qrz29gyPpKyVQ02BiOmb71ZN8rbKsj4tPbxx0nRrcosSshHhf/iGEJ7hVsAZOVsbT/vENrSOYI6zciYCQ==" + }, + { + "block_id_flag": 2, + "validator_address": "1E4E9FBC795E5C3F1BE3507F6008F40257A8E09D", + "timestamp": "2022-06-03T13:38:03.056039744Z", + "signature": "Ktr+MVLNsyNzS+r2d1bpMQ7ouFW93vQditYFcaazzJRWhGBvBH6ncJ/FHOaEwSko7XPWntkLUdmXao7IB350BQ==" + }, + { + "block_id_flag": 2, + "validator_address": "1ECCEB94F3459F9921B0C1D398A3E46283A35285", + "timestamp": "2022-06-03T13:38:02.984209124Z", + "signature": "K+LIzwnkHwEJSy54d+8I2sAW9dA7cRDh4zReLB4IxIaHumVgV3isAGI8T7oQnq8IPdTjSkB1ofX6+s1/oOSfDA==" + }, + { + "block_id_flag": 2, + "validator_address": "8971B56A1262D888E76DDF6C78339135122B9FD5", + "timestamp": "2022-06-03T13:38:03.033300601Z", + "signature": "AvwjtbuYh3inOr0J4Lohnpmy5R8RLRCfO/2s9+mjwvxxiyocxsf1XmUYhyZ+iJfEkCXSMXKZZyKTO2kX27oMCQ==" + }, + { + "block_id_flag": 2, + "validator_address": "44A774BBD9B1621C7A752F4BF4FC97ECD19C9339", + "timestamp": "2022-06-03T13:38:02.909225961Z", + "signature": "mfuPliLAzVcNzO6bFjHZEPtV9BlMINJIxcpLCpYpwgHSJ453LtIGfO7fU6C/JZKri6LXBLeHCsmPkxJhgiEjAw==" + }, + { + "block_id_flag": 2, + "validator_address": "1FB705E4792863FDC9FB000C11D0725656A9D641", + "timestamp": "2022-06-03T13:38:03.051358887Z", + "signature": "Pd9dAEMjw6VSnrMiBBdDjiTjTCRXXO2r7BFqDMrMdgjBYYVbRu4xSwLdd1h1tghjwsHNgMrDyE7JuKUT1tVhAw==" + }, + { + "block_id_flag": 2, + "validator_address": "7C7DA4D5C5C9846F9D02BCA0FCC8BF30FC0039A0", + "timestamp": "2022-06-03T13:38:02.962081829Z", + "signature": "Y39mFnBQiig8pIN9xqSSTKFIjVP/mJSWahUMLh8zkGdurAJw20+WsyQK9vGlX9ZlPzBAbPLCnVxErtCJHByPCQ==" + }, + { + "block_id_flag": 2, + "validator_address": "B310BA4A7B39A9D38A67E93E798CE9549F8407F7", + "timestamp": "2022-06-03T13:38:02.945785906Z", + "signature": "8kz2ewH10CNAmT1TmQmFKIemWt03HjKvuGVguY1f9jb//ojy856w+ZhV1ECk6nEB0RLXndcObBTEyJL1GiPuCA==" + }, + { + "block_id_flag": 2, + "validator_address": "305EEF06E09EB104BF1564DAF31F4277C31AD984", + "timestamp": "2022-06-03T13:38:03.001858145Z", + "signature": "RZ4nin/Cp66K/9CllBxIGir7fkp+eA336zwd8DXo3CyZBy2X2AX7fqvoQRTR3NafTEURqvpzvDkB4D8i6aGeDw==" + }, + { + "block_id_flag": 2, + "validator_address": "CF4B8BCC61E1B2207107F986283ABDD61B0E874F", + "timestamp": "2022-06-03T13:38:02.983308052Z", + "signature": "7IkwCDKoGQYXiMjEZlmATiGa2UeqyGoUjvHJPGH+4sM8qc1/4vj7nmSLB34OvLqt2YHFNkQawHAyBDLNSERCCQ==" + }, + { + "block_id_flag": 2, + "validator_address": "0323A66E6E48A50BDBAB3832B082B3F2614A433E", + "timestamp": "2022-06-03T13:38:03.016498984Z", + "signature": "NwMUi819SAqCZcLUuBsGGhJpg8c6XM9nuVtw4ToW+c5pBd0hyO5SUPLqXa/CS1EfH3z/SeljilB/TBkYCmdnDQ==" + }, + { + "block_id_flag": 2, + "validator_address": "E0D23AE41C8F2A204F652CE826E08668DE9A07B8", + "timestamp": "2022-06-03T13:38:02.958353086Z", + "signature": "NnYCFLWVrnuA2Hr6rE1pAab6Ltfzw8shNY8sRtc7P3MWhlBv7k685RM8amx4QLJoBUxSCdYfvHBmL2hnVxTxDg==" + }, + { + "block_id_flag": 2, + "validator_address": "3439FB7806A3661A7A53D6B28B6771ACD7B00411", + "timestamp": "2022-06-03T13:38:03.027510509Z", + "signature": "VDYARQ1mvlu0safaoXkndW+2utDkEM0wpHem5fAyN+tNUO5YqRQ2Bnw47iiTtcBlnCCRnXuEbHqXKKI72LY7Cg==" + }, + { + "block_id_flag": 2, + "validator_address": "76EA8281CC939495A4A54656C59B9075E9257FC4", + "timestamp": "2022-06-03T13:38:03.067270857Z", + "signature": "MXDluhyGEXYhzSzyZpIU//qX/4osHMzYGcPAdVhmmqE4hf6kZgDwP09mMS/9j01qSfDRj4y//ckV7u7qvfWrAQ==" + }, + { + "block_id_flag": 2, + "validator_address": "684616FF14EAE8BE5613DA40864EA85812469308", + "timestamp": "2022-06-03T13:38:02.990256234Z", + "signature": "PTQpraeXawjRf7zVRuXS+/VMUivvUlptxmIyziOHoDwmLOFski3HxDPV9xu5O1J5ShEERt3AEFbdTMNmoKSeCQ==" + }, + { + "block_id_flag": 2, + "validator_address": "43790BA2E57D02A8944B670B46D62ACBBDDE73FE", + "timestamp": "2022-06-03T13:38:03.110264474Z", + "signature": "fvnp1RhwHFtYpYceSEkk8kH2WX6KWF0wYMbOMXjRbKkJ0iYb2TEsXRSmp1+aGsQ1aLHQ9WOLabc460aF6hzgDw==" + }, + { + "block_id_flag": 2, + "validator_address": "A35A6E459554E336C2A07CE78BA4EC1250AC3338", + "timestamp": "2022-06-03T13:38:03.011358112Z", + "signature": "s3JPMtrVZ6Lh+UNKBDkHbaFD4jlUYOT/Fjv3BnMoTfJF7C5pp4eiKId7kbqTz3lS9xzlOP7f4T0DyCGJ71+6CA==" + }, + { + "block_id_flag": 2, + "validator_address": "5802A80D39D378A6218E52F4EB50ECCF4583264B", + "timestamp": "2022-06-03T13:38:03.058702561Z", + "signature": "bCgDZXY1zWYMHrHvAPFMcStpmJecjAZKRjO/mCVKzZYVAE3gDYRKfSVelBXr1XtdcGBB6B68cTESlVre12H6Ag==" + }, + { + "block_id_flag": 2, + "validator_address": "8047FA49FCE5E85107E88AE0152E079D9CBD320F", + "timestamp": "2022-06-03T13:38:03.167988259Z", + "signature": "aae7X4gP62OlyiIw+oZAb6BvzRe97T+lh/e/0hlJCAioDb+4eGo/p4ZCldS2kVUmAppRhQXOAuVjbIvRsuivBg==" + }, + { + "block_id_flag": 2, + "validator_address": "B4A950629CC31E385E6269F7B62314ED57650EE8", + "timestamp": "2022-06-03T13:38:02.928081393Z", + "signature": "l417hQXGbMPcGuB+RlQRBIrkmFZXFV+dk9ulqjXxRz8PKjqA4dhptxf+IAyOiEG3mdyMuyJUj9YCcQwwqX5ZCw==" + }, + { + "block_id_flag": 2, + "validator_address": "B95ECC721FCDD6893107699AED4A0FAA62E97D11", + "timestamp": "2022-06-03T13:38:03.01923997Z", + "signature": "O5C9Vtn941852vJHafdu92mr+Q4SvVFpf1i4aFm1TeKE0w9I/CKm9qFi3A+SUKEDpR4s1sbLMMh+sNivR2yJAw==" + }, + { + "block_id_flag": 2, + "validator_address": "ED61B1DEE5F79C521F521B78DB93559FEB2E3B82", + "timestamp": "2022-06-03T13:38:03.028598724Z", + "signature": "dY4BImgnMpOWylAQHFj5kFIHZIzsUHVXtJW4D8Zs/sgxTMp1aaTlYishnkbo1I/AYioSrFnkP9/CY863rRl/Dw==" + }, + { + "block_id_flag": 2, + "validator_address": "A92A1DE1BB768A065F87DF5811FC0F32FA7CD57E", + "timestamp": "2022-06-03T13:38:03.065424145Z", + "signature": "67a3V6DLYiEVd+KVQb6eOcV/mkvG7OvVvZ0V3BxvPYDLAU8HmNJtaV2/h7+8EvPMOyI6u7LkyKYoATpIlEbTBQ==" + }, + { + "block_id_flag": 2, + "validator_address": "83F719426E00721A9208DBFE2B30D6DC75FE6645", + "timestamp": "2022-06-03T13:38:03.068686365Z", + "signature": "CgV8TcScse+qobOsTDreFSR0ww+58XcXRi9tdWrn9fp8NdlUo9/fwIf7zbZ92toNI/6pN2t7WVyXlDGXuEMKBA==" + }, + { + "block_id_flag": 2, + "validator_address": "710FEF6FF4693C657CB24AADF1623E861A5AF906", + "timestamp": "2022-06-03T13:38:02.931758724Z", + "signature": "iFOOqO8gSWpSR1RTnInHK1po6ow0ScLERFrB/aNC/UDHErbC//HX5G/oERQfefnZupJtJ4puE25LdvAo3aGEAQ==" + }, + { + "block_id_flag": 2, + "validator_address": "C8BB72DD64C161F5A23874F480DCD12BD2C2647D", + "timestamp": "2022-06-03T13:38:03.020556302Z", + "signature": "+DtTuvHADID1W75mfkh/0cHzVpH/AZ0wtIbMRaOrWvTkB4l/OL2M5+ak+MPZbtQrZojWY7tWeAhcJDxUSCJDAQ==" + }, + { + "block_id_flag": 2, + "validator_address": "17E4639B5116509EC04C4AABFA69506317801783", + "timestamp": "2022-06-03T13:38:02.94263653Z", + "signature": "9WyH8lYvvXearUkrDYRT0bWobfzET02/gLaKk091371xGyQ0U6Hd7/k58GPvqG2j7N/o+FbmJP4VNcUndFzaAw==" + }, + { + "block_id_flag": 2, + "validator_address": "1CDD0EF99F36CC3028237886FA00CE45AABD60E5", + "timestamp": "2022-06-03T13:38:03.095935902Z", + "signature": "W1KTHl9dkehqVUxnVctuju5umGwdkH2KBmdsBM/HRb6adL+AyfeHhLldwQ8h4P5xF4UdFe1hcNr1KyfZiU9KCw==" + }, + { + "block_id_flag": 2, + "validator_address": "80DA42EB9A25BD341A18B2D989BB86DFD4413A05", + "timestamp": "2022-06-03T13:38:02.969882219Z", + "signature": "DZSUL5Ud0VKFD5P3L47ihNAlLHzMjcTLZo4T1f9G9s5qxqk97mveoqM7pf5Qon7IMYgylJxtZkKdkV/n+9RKCg==" + }, + { + "block_id_flag": 2, + "validator_address": "916D131FCDC899B83D0C3B56DDD6614B339C997E", + "timestamp": "2022-06-03T13:38:03.065066305Z", + "signature": "ETmgl1gUyQ+q+FT4EziKgwTR3TILQ/2GsJro43BTCb/Ssesg9c58SSVYpCXQIsjTFOsAB58YWyQO+2fVKMTmDw==" + }, + { + "block_id_flag": 2, + "validator_address": "903EED41E608EFD3E2DBA2C561F7331C1AE0D82D", + "timestamp": "2022-06-03T13:38:03.311749545Z", + "signature": "GdrUXYbWhGIUhAaUF0Ok+eQwbkWMdZQ2XEc6CRbViiV0xv1iz/FmLzbrbsOVSpGGFOtmhx1p5rjR/TI0J7maBQ==" + }, + { + "block_id_flag": 2, + "validator_address": "A262DDACC4F532340A2B389CF3EAA29B6846D142", + "timestamp": "2022-06-03T13:38:03.017832244Z", + "signature": "Um14t+cPdqxzCGbY7xSKkJLhOvsfDkM8iumV7C9Vg+Wr/9SXLZG4tqV5zusRXYwxqmPisPYgJlNt5TH97UWSBg==" + }, + { + "block_id_flag": 2, + "validator_address": "9F579C855F835F1CB71ABF2960A244FC0AF671EA", + "timestamp": "2022-06-03T13:38:03.001519348Z", + "signature": "NCoDQgWOd4rJyQY0PZa96bNuf6pIt6sDADCKGIjVxBD8QWJBkTXTJo4CL0DhKpIgQRMV/zQ3+aLaYvCQppPmCw==" + }, + { + "block_id_flag": 2, + "validator_address": "2026B424B984B681F91C88874820CE927965C492", + "timestamp": "2022-06-03T13:38:02.958156705Z", + "signature": "5+4pjgD9kjtSKVu6aM+rhvuLu9pOBa8s+eZYV9NcprB8S8RS538T41NgZvawN6w07kQzl0876vV33O316vT6AQ==" + }, + { + "block_id_flag": 2, + "validator_address": "92C70850FA51E11384826C5F574F5B13B5706554", + "timestamp": "2022-06-03T13:38:03.137892928Z", + "signature": "ghnpxhWyfuIlaVWZd8PUx7OdkoPlEz+iTs0JB76y/DWFnl+Hv7nDGF7kjtp3K7aSKLZespMWqOX/i3YdMHKCBw==" + }, + { + "block_id_flag": 2, + "validator_address": "1A30424D3A05B7E61B1936477C338E316E5D7D66", + "timestamp": "2022-06-03T13:38:03.125967169Z", + "signature": "ez4e+pfmXxDSseZsPv8Wbj8ZBSCT6py/rR4giYwSG0WAMQNlRly2ojPSRd5s+gjAHyJYqLxOImVNQh4qh5CmDQ==" + }, + { + "block_id_flag": 2, + "validator_address": "CB1814F7CDAFE24C0A836B627082710636562B98", + "timestamp": "2022-06-03T13:38:02.965440388Z", + "signature": "7OEA3wiEfMsIwldABsvzaLGc48AJXn2kc+3/bP3rJqLQ8X94odS2q4h8xZilmMQpYlurf8dB7VdK04gl/9mcCA==" + }, + { + "block_id_flag": 2, + "validator_address": "DC9424AFE6C83F68813337B5FB4EC62C2330C9E6", + "timestamp": "2022-06-03T13:38:03.11437383Z", + "signature": "cyAmuJKVRiYmocrZ3PnkJ/nRJmW9b8k2mBo4kDt5V21h2ae93xLwLgZWj8VkBwf69gBuLpGp3WjKKG5B6CKtCQ==" + }, + { + "block_id_flag": 2, + "validator_address": "91938313E6AC32D56F07B39ACC580B1E7E5A29E8", + "timestamp": "2022-06-03T13:38:03.046352358Z", + "signature": "puNqnB7joZWalKXvQ42kyIeaBtV4pJ7IAH+LYSqVJqh2hmgpQVlobTCVBcJ7VP4CtXyd6mal7gc9D6Ma09dQBA==" + }, + { + "block_id_flag": 2, + "validator_address": "6A24190F2C8C0878BB134D146FE9333094171256", + "timestamp": "2022-06-03T13:38:02.946114607Z", + "signature": "HYuCkDcCvotie6zQ7Npdhj36F8gzu3LscWbREI+rWxtyK5L+SEQ2gr5kx1USAKov3/E8gOo+23Htl9hUenYbBA==" + }, + { + "block_id_flag": 2, + "validator_address": "60A7F8F9EE0BE23DAC5183B36BEB14AEF2D3A879", + "timestamp": "2022-06-03T13:38:03.019878047Z", + "signature": "hUPAPG0mQLERUoLH2MxYWajoanv+/035hFcj3VzrOguLs4la346g76wW/oc3XbpW4EiVSMVxMtc7+YicBeLLBg==" + }, + { + "block_id_flag": 2, + "validator_address": "43FC3AB6FE3D33C41842553EAFC8393A7FD00C23", + "timestamp": "2022-06-03T13:38:02.950006102Z", + "signature": "QR1DIalaiMOe4MRkd//GMkZdjUZhXPl9EyXVe9wlZF2lY3urYsnVIKaKt4/u0F0531KHrLJCo6cIwqBMWIsfBw==" + }, + { + "block_id_flag": 2, + "validator_address": "B684A0D2CB2D1AC7F9AC890B4678006A1D5B09E0", + "timestamp": "2022-06-03T13:38:03.041763338Z", + "signature": "ceK1P6lTZrp9IGpFwJqREOZtV8qCJdig6HhfUcWsBDX2Ie4IJq1MSNi3/YPhpE5BfbEHgbsQmnm83/lcRgQkDg==" + }, + { + "block_id_flag": 2, + "validator_address": "19DD6B3CA0DEB5F6FE0E1A78AD53D408EA0CA8F0", + "timestamp": "2022-06-03T13:38:02.916768934Z", + "signature": "8euE6qAE6kPWYYpHm3sbtm+CJX/1CovV2f4HV36MVpyZGJ0EX85ngJ2doROh5Sulg0Sjom/Nvx+tnsfyXbwhDg==" + }, + { + "block_id_flag": 2, + "validator_address": "987AF576DFCAE3B71C38FC729174739811C6626A", + "timestamp": "2022-06-03T13:38:03.014693056Z", + "signature": "Le07NkZQIqv+QdG0vXdMuN9GsFoSiVRWFJI0a831Dy4A82nUnbFF3LfyOZwXGbXekmCjCXzydH/+Hp7wyofOAg==" + }, + { + "block_id_flag": 2, + "validator_address": "BAFE51BA7636EFAA64E59649321EAFC4E1D0F03B", + "timestamp": "2022-06-03T13:38:03.089060857Z", + "signature": "SuVtCwBkihOtcM3y0lYy3SO1ILmUvcYTUToly+IBFkbzHlMV9SNwY9BoQlYdPD5mfEo6p8a22TFg5PegTwf1Cg==" + }, + { + "block_id_flag": 2, + "validator_address": "AB135B41694E5EC24367110CC9DB1DC7852D6E82", + "timestamp": "2022-06-03T13:38:03.001258023Z", + "signature": "b/LsBL9aZEm23xDcS4gEIJJEM/E+S5BdUZVWPj4oYjMTdwk727DX42P3sWfpVywS83jeRAFKoZnMT+X6O7miCw==" + }, + { + "block_id_flag": 2, + "validator_address": "5C950EA844C3F38BB3BB51C6634FFAE18DBE8811", + "timestamp": "2022-06-03T13:38:02.947289588Z", + "signature": "uyJNosJYNTuawzaL9sY83/ygVHCEKU4o1Xx1Fx4dxeg+BfGDJMEHI0fhpimocNGqOG9Mfa6Eu906GeS1R2zpCQ==" + }, + { + "block_id_flag": 2, + "validator_address": "B4BB763F2BCDF710991355B1FE4FDCE83C0874A2", + "timestamp": "2022-06-03T13:38:02.961062019Z", + "signature": "7nX5+V1o1I8AiUbxbs+EU0U1wN/9Tj0v6k4mJNAV7ZoBc32LxR/VUikLeikSNIhxFVsgHhiIpEvh89BS+Gy+BQ==" + }, + { + "block_id_flag": 2, + "validator_address": "63C90F79BA2F2248628BC76D5C038492674EEB91", + "timestamp": "2022-06-03T13:38:03.123749839Z", + "signature": "99SuKjvAZHOXfo/GfqYy53vbbpmopsIuRy53aNcphXSJ/QosO3JW2IkNV6catLg34SLSTyhy4wzj6QRUS+GvCA==" + }, + { + "block_id_flag": 2, + "validator_address": "94D21453B366ADA7F50F12CA907CDA7A4AB7F214", + "timestamp": "2022-06-03T13:38:03.039958614Z", + "signature": "TvcjZjkMNYTegpazA2b2tP9VySHGUdwg9+iimtofytr8vhXQzhU46KMaNIC6EKAhJVX2tk6U6fkpGErNKXXBBw==" + }, + { + "block_id_flag": 2, + "validator_address": "B699C4799E8F6C7D038682C0441AD28E6E43E677", + "timestamp": "2022-06-03T13:38:02.962794666Z", + "signature": "2cyd/YoaQVCk2xQCtOfW/OWFGe/dumgiTaJKjYnChi4D3i/FFJZa8T762wcqyEfvNxDwpQSuzPDsfgFNnBx8AQ==" + }, + { + "block_id_flag": 2, + "validator_address": "246C9C9846C2899D0DA109BCFADAA6260685B4C3", + "timestamp": "2022-06-03T13:38:03.156099089Z", + "signature": "dzGrI1Feicyo6wBLhvM8e7fXVFo7Ei088n5l7ush0tvG5sG3fXgd5wl+k5WD5MwgR7M2G49KE84NI5nemG1WCQ==" + }, + { + "block_id_flag": 2, + "validator_address": "E3DF8B64C6EE018BE7EC6BB9BC3ABFB67D99A630", + "timestamp": "2022-06-03T13:38:03.010914961Z", + "signature": "G1KYKGUwMUPfPO1QWXi11kX1oQ28bdC3pvhOlXZPyXXw1mshnPL7mcYRrg10Fz9ouWa5ArMVefEoI/PuYPiQCQ==" + }, + { + "block_id_flag": 2, + "validator_address": "CF941683BB7851E824695E7ABA86D57C6E32F5D3", + "timestamp": "2022-06-03T13:38:03.043383504Z", + "signature": "gz9vNaQ5ytFjAGizGFH4FJGCLWQAcr+G1mO/lCa0DpZ9Oa7IvybMibnQEH81R/+4Vgaky/EFnlO1ZPFGRdrNBw==" + }, + { + "block_id_flag": 2, + "validator_address": "7219BF2BF60498F19DC51B33588DEB9F9D30B392", + "timestamp": "2022-06-03T13:38:03.091449853Z", + "signature": "HiCFt7e5hcsBL/88PwKCxkRmn76GZyB3t1QVYHKmF4aDuMg/KYiV1W5OrrhSS2GlU7Fu6BCSIByuX+hWM9N9Dg==" + }, + { + "block_id_flag": 2, + "validator_address": "75B513290765236B2F1C3FCAACF35A7FBAFBFB6F", + "timestamp": "2022-06-03T13:38:03.066850435Z", + "signature": "lY5vlf0yluUmBybhMWXmrbwUtDN3C8/k/kXdJO+wW4XeN2vyf93McsdxFAG3h3fGztcru6xN/IHpVYQaUfBdAA==" + }, + { + "block_id_flag": 2, + "validator_address": "3C672A568D8B4D3261132A92CC572F21D4F85C1C", + "timestamp": "2022-06-03T13:38:03.074922401Z", + "signature": "bjqmWbiaZHbOic92OJvm6LZQzARTlKIcYMSpAG0gdtWRfyTN/mFC1F5YULgKpUu7mCqC9yjzfgxQxG5yMUVcCQ==" + }, + { + "block_id_flag": 2, + "validator_address": "208FF031498FA42FFED6829C8A4884CDC72BE06A", + "timestamp": "2022-06-03T13:38:02.961749644Z", + "signature": "toCmbVAyEngaxzZNUqEfjuSMSpcbrjbqhSaXugWOT3+V8toAzCXw3t/p7sJLN1AMrP+vblFbPuZuk7WZa7SZDA==" + }, + { + "block_id_flag": 2, + "validator_address": "CA572745CF6C1437547BB3961D3D04EE8C88DA30", + "timestamp": "2022-06-03T13:38:03.006634075Z", + "signature": "8T42mFxlD/mc7iZbhUq0LGCeguAs4HTafj5VdbZvdL1KOb5Yu5pIivqNCJ+1GF9Ww1ID2Omu1WKY68IhyvNHBA==" + }, + { + "block_id_flag": 2, + "validator_address": "164A8F8019C8B800A8BEB03CA04428B881812E04", + "timestamp": "2022-06-03T13:38:03.090838593Z", + "signature": "wl+Ey0J2Vxsv7r6M+rmfpspsTzAE4zqr64nS/RVe6gLYpMVHqvUB3TOEG0gXqk19oavfJyIqwYKByfHk0gQQBw==" + }, + { + "block_id_flag": 2, + "validator_address": "206DC4AC92A0CF215D8C8AF98B7A84966CE43E45", + "timestamp": "2022-06-03T13:38:03.052438862Z", + "signature": "AoeA/Me32F9BKFqBPWNLGcnfJDBwRQz5biM+bPPzHqqmvTFIUE0xRcSDI890PDyN6lNW3sIa4tZQqzZ21z3cAQ==" + }, + { + "block_id_flag": 2, + "validator_address": "3655C2522526E342E1BAE250B7E01C728E97BF61", + "timestamp": "2022-06-03T13:38:03.065935511Z", + "signature": "KYENAyXIZpNjv+zDSCUeXco0I3ddWKlQx3y6eXv3xuBVPsueMEffcmZlBLG/FxJUtaPFrwZQHr8ccw90Z81wCQ==" + }, + { + "block_id_flag": 2, + "validator_address": "50A7130BA74D071391EF45678BE2444955FA4AD4", + "timestamp": "2022-06-03T13:38:02.968245257Z", + "signature": "0gbDd9KXtF/YWGMXU/5u5PAXiHTIiyBh4GezCy+ytN/1gReChkz7HIxV/DyOi5oPaS2CzsYZyAZwF+Lv9Dj2AQ==" + }, + { + "block_id_flag": 2, + "validator_address": "556EA605A9374CE54C157DD42395B4047E327914", + "timestamp": "2022-06-03T13:38:03.040029273Z", + "signature": "+RRBkhnowjS9NBAJOoxqoQYOJbP7s6wnX9ClXVO0v5oDUJYV0DZJQOruWrHpiE3pXoS/UjEoz+hgcwdhkGJUBA==" + }, + { + "block_id_flag": 2, + "validator_address": "64BBCDCC1BA3D6CB934A5BBC9F45121A40EF81B2", + "timestamp": "2022-06-03T13:38:04.101758284Z", + "signature": "HnNbIdHPPISXTA6eutTsp/zqmRb51QEdPk9q9in9is3RqY8Vyth+18nZTvY6FsyHGGDIdPIp5c6aoUY/2KNUBA==" + }, + { + "block_id_flag": 2, + "validator_address": "6B00AA4C9E824A9E042AA49A5CF40591FDFF2021", + "timestamp": "2022-06-03T13:38:02.958687495Z", + "signature": "1Y/bTP+rdDfCqWB5/C/MXgXQgmbnhLWuZHdE76TE5iiCLqOJDxJ9nBoZ5eHw2F7dNKUxAWn7wOlVQV1oJj+mCQ==" + }, + { + "block_id_flag": 2, + "validator_address": "A2E2A0CC28C652A9EA47D666B2CDE5122DE5A8E1", + "timestamp": "2022-06-03T13:38:03.058769132Z", + "signature": "s7LY6ySo+PWaz75tnO1sYcXA/TRIEbLpecH0r4JRsZL1R2EbcNUNw3NxSYaTkCEeRv1iBnuLjlxXqFoMnkNaBw==" + }, + { + "block_id_flag": 2, + "validator_address": "E314D1F70E07277B21E80FBF4BCA6AFBDB07C367", + "timestamp": "2022-06-03T13:38:03.057248993Z", + "signature": "HuQotD9HC7GDcUyHqvaVshVcqX9k4Zt9Qw4i/xHxtAXTu8FO/dk3ce9U2U9xf0ehDmQyqnE9NUfyxuyc/zmqAA==" + } + ] + } + }, + "canonical": true +} \ No newline at end of file diff --git a/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/multi-validator/commit.3.json b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/multi-validator/commit.3.json new file mode 100644 index 000000000..1c3ef99ed --- /dev/null +++ b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/multi-validator/commit.3.json @@ -0,0 +1,480 @@ +{ + "signed_header": { + "header": { + "version": { + "block": "11" + }, + "chain_id": "torii-1", + "height": "700083", + "time": "2022-06-03T13:43:47.910205576Z", + "last_block_id": { + "hash": "742C55C56DA4FBFFE77E935130AAC1744691F76B06130390E077B50551E04726", + "parts": { + "total": 1, + "hash": "D724BEF014D630D6B78AEDDEF7DBE83494A1273BE0F0491D3E383B32D393E65F" + } + }, + "last_commit_hash": "B0B6B67B6605829FAAE820886DE6BF9B22CAD781237C3986E418776DBEE555AF", + "data_hash": "E0D3E61B78566411E9BF9675CD81B3F932832626FFB656500694690F153B3E3D", + "validators_hash": "3015ED820597B37B47EA7D360FF912679A64FAD61AEBBAE674F7F2453AC1D670", + "next_validators_hash": "9F4EB337A5882472EE2F380061725D6971A6FDAFEFA823B3942A9F888152F74A", + "consensus_hash": "F67860470DBFE423526B3C6771B18C1235E1FA658076F5E256552FB1F3501A14", + "app_hash": "22BC65F268BBEFE681D0EC020A42982F806E85A681584931371E8616641F9937", + "last_results_hash": "B20AD298C96B5BEA5B5AB00572B183612D1C837D50356DE644A6E21524F18C29", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "proposer_address": "43790BA2E57D02A8944B670B46D62ACBBDDE73FE" + }, + "commit": { + "height": "700083", + "round": 0, + "block_id": { + "hash": "F62D4C193A0A701D8B57444B1BEB8A141D1B4CD3290CC72AC1254517FCE0D3B3", + "parts": { + "total": 1, + "hash": "FB326EF9FBF58F590F895EE70AA274BBA84235E4F5E0E9E572AED14E1B00F0B7" + } + }, + "signatures": [ + { + "block_id_flag": 2, + "validator_address": "C97C186A87209EA864B432E03EF0441E18D709BB", + "timestamp": "2022-06-03T13:43:54.013257597Z", + "signature": "+ExG8BGqVmcxbJC3gsZ0lyaqwEdwgcHIOtpchyryFmPbwMe/ytjoHAPWOK0FQLgzCKbL24VOMlhFBu5s0OCCDw==" + }, + { + "block_id_flag": 2, + "validator_address": "DA694585BB239BD51FF6FBF61C10B1E85B2DB707", + "timestamp": "2022-06-03T13:43:54.005853513Z", + "signature": "pz0b1bz1J934RtDoJv7AwAcnUrb7K5TF574yhtXmMP8RalQB9BD1dYV88ie2kBEDLRSEoOrnh7+ZvKhipBpnAA==" + }, + { + "block_id_flag": 2, + "validator_address": "9FBFE65AD18294A346B540F7396D92DF32880966", + "timestamp": "2022-06-03T13:43:54.007388993Z", + "signature": "lnN0U2PvG/XXcGg6rc9BJQUMW1DBNu1edi7vWYLVEDOV2oAZJnaPcn4J91oswOrIxfHqxQDn1GEPkV4xS7zWCA==" + }, + { + "block_id_flag": 2, + "validator_address": "BC9D4BD4F1F544FC1E136A92A368CBFC28D0BBEF", + "timestamp": "2022-06-03T13:43:54.014781453Z", + "signature": "zP4qgvrEUxgCNoyK/9BhSaakGHxQQ872o9ejCB0leGL027RXPwTM185OFUHvQYxYqXrQCwi5c9kc4xsOBnhpBQ==" + }, + { + "block_id_flag": 2, + "validator_address": "9FB1318DC46AB8E9D25263DF34C568FE4177FAED", + "timestamp": "2022-06-03T13:43:54.097314751Z", + "signature": "2WR7sF/M7qhhRrZR3cJ/rlOIILI8tuVJBHEz2aABJE6+AYdCQ0Sy58+eeeRBiLx8LRk6eREnx1kf73LQKJVRDw==" + }, + { + "block_id_flag": 2, + "validator_address": "1E4E9FBC795E5C3F1BE3507F6008F40257A8E09D", + "timestamp": "2022-06-03T13:43:54.031837194Z", + "signature": "HYXt97EZ0khRzyrG3FcLxY73G1Q9Z1wmWYXcpTiLZm8e1+r4NyzNo0H6Jsj78NBrESv7ePM7/tk0SyF/KJAgAw==" + }, + { + "block_id_flag": 2, + "validator_address": "1ECCEB94F3459F9921B0C1D398A3E46283A35285", + "timestamp": "2022-06-03T13:43:54.050466111Z", + "signature": "oWzA+sfvwzaEGgmQxOaMjFxodTwSrXzDlWHX9b5KDOXqE14ujprTj7l89DUzySHw79JNdSym7ljIlc6g4xnHBQ==" + }, + { + "block_id_flag": 2, + "validator_address": "8971B56A1262D888E76DDF6C78339135122B9FD5", + "timestamp": "2022-06-03T13:43:54.042738107Z", + "signature": "EJ64jGpXvdKUADLsyJ2wotklOJ/mD8gg58BnOG60GYyNQKrrCq6H43TLhHZIP+l76pzyk6v6vjeNCnkcEudeDA==" + }, + { + "block_id_flag": 2, + "validator_address": "44A774BBD9B1621C7A752F4BF4FC97ECD19C9339", + "timestamp": "2022-06-03T13:43:53.90467898Z", + "signature": "3EwjbFvm9kXaHe2JKZ6pwtxTtKEofQK0A2Bsu8U6xIFhjuHAiXKUlIETHEg8oR0aCRrzP63eRo/1ZBvnxeKzAA==" + }, + { + "block_id_flag": 2, + "validator_address": "1FB705E4792863FDC9FB000C11D0725656A9D641", + "timestamp": "2022-06-03T13:43:54.077553129Z", + "signature": "hDMlAKOraANRqf9FwTI9r3GMX+0VJVcNnf58ZI52nN+yZHZx1EG3CJHh8mEWNR/OiW+x2eAoftkadZwcecRHAw==" + }, + { + "block_id_flag": 2, + "validator_address": "7C7DA4D5C5C9846F9D02BCA0FCC8BF30FC0039A0", + "timestamp": "2022-06-03T13:43:54.045081451Z", + "signature": "jvDElefXVXFHgMU6yfbFzw8S2C/WOUdMZlqzxxkqyd/ekXDnLrj1J2ZETjGwcRBXr3NZjEW2F07IhxrPxJK8Bw==" + }, + { + "block_id_flag": 2, + "validator_address": "B310BA4A7B39A9D38A67E93E798CE9549F8407F7", + "timestamp": "2022-06-03T13:43:53.937947079Z", + "signature": "nSu72jZyyI4pO6M+1k973VMh1XLOkLIZTkEJ+oteCXMGSAktwkapSavZU/35mDFKvqxTboWdC0T7GJB+FKbaAQ==" + }, + { + "block_id_flag": 2, + "validator_address": "305EEF06E09EB104BF1564DAF31F4277C31AD984", + "timestamp": "2022-06-03T13:43:54.124778322Z", + "signature": "KgxGESlNwIzymmt7E38gbNBoOj4QHWMAkKALIuDU5s8JTSLVtY6Cu38msLo3ACNC8T2zQ6kTCR62z2x1f6WbBg==" + }, + { + "block_id_flag": 2, + "validator_address": "CF4B8BCC61E1B2207107F986283ABDD61B0E874F", + "timestamp": "2022-06-03T13:43:54.000786312Z", + "signature": "PZbP9NY0bnGnuMLlX5pVDdblGkJpmtXPAo3JNewHyY/3CgO6jn33mDPvQKe2XYqI0aax6qzXV9YV3WzlAouuAA==" + }, + { + "block_id_flag": 2, + "validator_address": "0323A66E6E48A50BDBAB3832B082B3F2614A433E", + "timestamp": "2022-06-03T13:43:54.042837906Z", + "signature": "A3KxAFXzo3tW9pJlwhSXU25OAIgJTULZoDrqnERGe67J+VvChif0AxSj3X/5HUp7AjqX8qtzrJbiHqE6Z+D+Cw==" + }, + { + "block_id_flag": 2, + "validator_address": "E0D23AE41C8F2A204F652CE826E08668DE9A07B8", + "timestamp": "2022-06-03T13:43:53.998450826Z", + "signature": "5LxAxSc3AIVj5607BP5BarJ7e2FRoULwUMgl+ZzmaY/VgU8DD9atj32hAiNZ7rdoCyr4RdgnfgK2LuPepsD1Aw==" + }, + { + "block_id_flag": 2, + "validator_address": "3439FB7806A3661A7A53D6B28B6771ACD7B00411", + "timestamp": "2022-06-03T13:43:54.062567714Z", + "signature": "jNc6U3z/n2b5sOyoq4CzhEPMyJgQeVWNSBiZlTFhtqKT4qIuWhLb6ZB8ZSoSzaSwnRUniOkjr65JEEwsRAphDw==" + }, + { + "block_id_flag": 2, + "validator_address": "76EA8281CC939495A4A54656C59B9075E9257FC4", + "timestamp": "2022-06-03T13:43:54.073230099Z", + "signature": "N5Iz7iKsLEMKzo3DdCsbiNIRGNojy6hOmdM/3r/lbL6FsVpgWwO9fJyp3WOwhGWdd6xPPKWgTy+RzVVmbb2rBg==" + }, + { + "block_id_flag": 2, + "validator_address": "684616FF14EAE8BE5613DA40864EA85812469308", + "timestamp": "2022-06-03T13:43:54.033996913Z", + "signature": "eEehPKy3Hqzp6b91rzbQWiA/QuMVRV3MJAKBtllCbTWqsdBC9J3zbEIi30EPYwtvwi0xNXR0dcIqSGQurRBSDw==" + }, + { + "block_id_flag": 2, + "validator_address": "43790BA2E57D02A8944B670B46D62ACBBDDE73FE", + "timestamp": "2022-06-03T13:43:54.142915662Z", + "signature": "ZRxkHr/1nFeAnIVNNUmD82NLXOzC+Yy5t9lT+WyD8fYDnYwfepCGi1SZnbaT25imz8O8lUk9PkX8G5H8NdDjDA==" + }, + { + "block_id_flag": 2, + "validator_address": "A35A6E459554E336C2A07CE78BA4EC1250AC3338", + "timestamp": "2022-06-03T13:43:54.007486987Z", + "signature": "hn3PH3KqKW9f3d+Y4j4SfsAq4HFeqcrcCZu6Cb2RzId7awlrcW9lkUYg1szPRqVb77Mmnk+JOiLljtu2/wWRAw==" + }, + { + "block_id_flag": 2, + "validator_address": "5802A80D39D378A6218E52F4EB50ECCF4583264B", + "timestamp": "2022-06-03T13:43:54.039849228Z", + "signature": "F6mfv6HrbR0OR0Yey0cPAzco457UK29D63wl9naB9r0QznpjSeu/oMMz69gEF9DwU8lToJlKNPnGer8AJwuMAw==" + }, + { + "block_id_flag": 2, + "validator_address": "8047FA49FCE5E85107E88AE0152E079D9CBD320F", + "timestamp": "2022-06-03T13:43:54.077365761Z", + "signature": "3eadIsoxtnA6mCWzDpRXTVdYTGzCpo15MAkmud4nGi5ZD6HPat0UEdL2lbm1T/k36Vwwxf/9CWlvMK5sgt+JCg==" + }, + { + "block_id_flag": 2, + "validator_address": "B4A950629CC31E385E6269F7B62314ED57650EE8", + "timestamp": "2022-06-03T13:43:53.944710298Z", + "signature": "Z858bd20eFJmVDMF6ryYxKZ+F6TPFkvsTfmtOMqCVxEJ7FpuIvfBgLAgnMLBA4l9V/7Uscd7tRwMGbCjrO44DQ==" + }, + { + "block_id_flag": 2, + "validator_address": "B95ECC721FCDD6893107699AED4A0FAA62E97D11", + "timestamp": "2022-06-03T13:43:54.028636559Z", + "signature": "WBgQp9J+3YLCP4FF7Uc/H1af3tufUWX6hey3hhuivsxamroz1jD12YSIQPpoZRTwOerO1pvMalEBEbthA2dADQ==" + }, + { + "block_id_flag": 2, + "validator_address": "ED61B1DEE5F79C521F521B78DB93559FEB2E3B82", + "timestamp": "2022-06-03T13:43:54.023510675Z", + "signature": "OOvQOy3yMJ3PM3iUTF7LT7TFC/neYMp/Fj2AkNPaKuBKFb2GruPHGDXbhyV7i1kpwsPIFQhCIa1o+E12evV1Cg==" + }, + { + "block_id_flag": 2, + "validator_address": "A92A1DE1BB768A065F87DF5811FC0F32FA7CD57E", + "timestamp": "2022-06-03T13:43:54.01793139Z", + "signature": "H5W51KUe4rOUpBtHVUc0cFmp7COSfj0MxZL/XZlBUq80/e+WIYlY+kV6tUdW81tsmjj3fyZsDjaKAW4QDo0oBw==" + }, + { + "block_id_flag": 2, + "validator_address": "83F719426E00721A9208DBFE2B30D6DC75FE6645", + "timestamp": "2022-06-03T13:43:54.039848895Z", + "signature": "ocEayNJZQ3l/jRlfv973Yh0v11I/+FbOOm9SJ4rMTuZ7Yl9sKy7pTFCwrBAypLpH7AqGUQIs8ezSCnW+st8eAg==" + }, + { + "block_id_flag": 2, + "validator_address": "710FEF6FF4693C657CB24AADF1623E861A5AF906", + "timestamp": "2022-06-03T13:43:53.919869664Z", + "signature": "iu9SVQdvlUXFoHuj94Om5z4VwPMZftxI/pMhNWtuAk7Cs6NGe9TF2YlPCSr4I8dFnRLzjo6fSXRrVsDHkaTpAg==" + }, + { + "block_id_flag": 2, + "validator_address": "C8BB72DD64C161F5A23874F480DCD12BD2C2647D", + "timestamp": "2022-06-03T13:43:54.089263046Z", + "signature": "ILXrAwE/iQZtsvDklBamvtVw179Qp/MZw+j36brg9NT4VlXzzdmvQuAaJD4imYAgGSKvC27K4nMAd13r2Xg0Dg==" + }, + { + "block_id_flag": 2, + "validator_address": "17E4639B5116509EC04C4AABFA69506317801783", + "timestamp": "2022-06-03T13:43:53.999165312Z", + "signature": "QxPgJ8BZ0yAJe2jyd/pUqBL8B907mIx89NAi3Qsw11ZDfdDamm2nVF4pW78U2G6+JePQFSoVdqHTqmHpuex9Cw==" + }, + { + "block_id_flag": 2, + "validator_address": "1CDD0EF99F36CC3028237886FA00CE45AABD60E5", + "timestamp": "2022-06-03T13:43:54.094099035Z", + "signature": "o3WtRU1swRvPlHITZKfCV0kflT1h1xUz3la4CtQFSp6V75UWRTKCMlKGtR7JBHyfl7DrFwskQEut5OuDi04VDQ==" + }, + { + "block_id_flag": 2, + "validator_address": "80DA42EB9A25BD341A18B2D989BB86DFD4413A05", + "timestamp": "2022-06-03T13:43:53.993600066Z", + "signature": "XIPW0r0i8ibtBFzF9R7IWJYLdLerZUJrv7MHqAfx2YJpO6XQiwUPSrDcxcE95tNbbLDZl7CzafYf12nRnTGuBw==" + }, + { + "block_id_flag": 2, + "validator_address": "916D131FCDC899B83D0C3B56DDD6614B339C997E", + "timestamp": "2022-06-03T13:43:54.021858547Z", + "signature": "dO1ty5T6lMDv+f+WLIILyYaHCyEj0kT05zNQKY08735KatmfBTZQqqBSUPXEC1mTy7RbaWDtGIAeeYUZPgAbBg==" + }, + { + "block_id_flag": 2, + "validator_address": "903EED41E608EFD3E2DBA2C561F7331C1AE0D82D", + "timestamp": "2022-06-03T13:43:54.191548529Z", + "signature": "4LrTyFLFKnjV9sJBgNvJFwVPOTP9KPqXFCeb/M8khwjKNiNWEaBxloFaTtrbiZ4eToT+glQ1kY9pk2qmrohpBA==" + }, + { + "block_id_flag": 2, + "validator_address": "A262DDACC4F532340A2B389CF3EAA29B6846D142", + "timestamp": "2022-06-03T13:43:54.062674317Z", + "signature": "MzJ95iYXgZS8L6018CARu/YF0mOmz4ivO1f62TdLlltwFDO1bp0GWKjAkALjzfpGUY4P8MNKzvy+CeMvulZ4Bg==" + }, + { + "block_id_flag": 2, + "validator_address": "9F579C855F835F1CB71ABF2960A244FC0AF671EA", + "timestamp": "2022-06-03T13:43:54.017425847Z", + "signature": "nyrrzvOY7nMudwrsg1JnPcTTJKpBOLaO5K2L8qjxwVJNkCybMjcxAe9C0qAYmztCe4nQBUAPuX5f723JDZi+CA==" + }, + { + "block_id_flag": 2, + "validator_address": "2026B424B984B681F91C88874820CE927965C492", + "timestamp": "2022-06-03T13:43:53.92948719Z", + "signature": "o2oj/K6r3Fpy3lM/MeWypl8zvJqRiiK519DEGd+tO4OtqCqbxYMrFXljpfqE1MNgfdPKpa026LUbXhSi9+1SAw==" + }, + { + "block_id_flag": 2, + "validator_address": "92C70850FA51E11384826C5F574F5B13B5706554", + "timestamp": "2022-06-03T13:43:54.049835043Z", + "signature": "HI/UvmdbxmxpxDdDMmMqMr+Wv+PvNXsetQ968JpKCJwyvSf1ciNgdMjY+0ZW9E1YizKF3nEXzYnFttokm8AjCA==" + }, + { + "block_id_flag": 2, + "validator_address": "1A30424D3A05B7E61B1936477C338E316E5D7D66", + "timestamp": "2022-06-03T13:43:54.084885464Z", + "signature": "14ctFXvDbsN2bH6YtMTs/n3nRxnTrVoPgIyPBlKYayEmtbS0dIyE/qndcnHB1e6zabEEXJ3yAgopXXTDkoKjBg==" + }, + { + "block_id_flag": 2, + "validator_address": "CB1814F7CDAFE24C0A836B627082710636562B98", + "timestamp": "2022-06-03T13:43:53.97793137Z", + "signature": "N3mttoY9r+wzPbZwVbfGxKkHaO1XyRZ0DUuVal2OsZWFUSqYk2DjGgSN1mGnP/pIEwOJIeVHmpHFc/qoKqq0Cw==" + }, + { + "block_id_flag": 2, + "validator_address": "DC9424AFE6C83F68813337B5FB4EC62C2330C9E6", + "timestamp": "2022-06-03T13:43:54.083856267Z", + "signature": "Sj3Wheqv/IWX5SC3hd5Z4lZ6mgT7SL+ObDcTUi+PNa9y2tinqxOkZxR6SNrzAv9yocBmMflUMu/D64zPT4YZAQ==" + }, + { + "block_id_flag": 2, + "validator_address": "91938313E6AC32D56F07B39ACC580B1E7E5A29E8", + "timestamp": "2022-06-03T13:43:54.00629042Z", + "signature": "JWbLnE2aTEoKajR6AubCoAF06htJZzdXyborES1BsSajHeOzmFhdgsUIjj3W8Eu50lfVWxqW6nPu6jhvaXHCBg==" + }, + { + "block_id_flag": 2, + "validator_address": "6A24190F2C8C0878BB134D146FE9333094171256", + "timestamp": "2022-06-03T13:43:54.001464622Z", + "signature": "9x4xfGFUOo/R+RiO4XC5m4JkNQ4QolPGT60S2BbG7k5riLZmELX5oCPZPE57Emb/Ic44D7V7KX4ffCqUnFOvAw==" + }, + { + "block_id_flag": 2, + "validator_address": "60A7F8F9EE0BE23DAC5183B36BEB14AEF2D3A879", + "timestamp": "2022-06-03T13:43:54.134335294Z", + "signature": "UpSOYTXXzIwOX7b04ShQX3CY4riblIZfSB1CWgyYbEAN0Dy7L7VIHrLy9V6NW6oh2boWOOKglA7EbtZrNODeCg==" + }, + { + "block_id_flag": 2, + "validator_address": "43FC3AB6FE3D33C41842553EAFC8393A7FD00C23", + "timestamp": "2022-06-03T13:43:54.014731263Z", + "signature": "tJHiSf/VKKRZXRpq/HpKSRXIBZugwbEPyL/cdY6iRiL+U571ZExgFAAAQp83e/2EXNTwC5yq+8guQJyna1DXAQ==" + }, + { + "block_id_flag": 2, + "validator_address": "B684A0D2CB2D1AC7F9AC890B4678006A1D5B09E0", + "timestamp": "2022-06-03T13:43:54.01869283Z", + "signature": "V2gSpwKiYfjj+cuZiLHlz5wqhb+Sk47VMthnHOWIz1rrgUXwtybstlCRsTbIhQQSx8oKG5E83k/FCc8Lhdd9CQ==" + }, + { + "block_id_flag": 2, + "validator_address": "19DD6B3CA0DEB5F6FE0E1A78AD53D408EA0CA8F0", + "timestamp": "2022-06-03T13:43:53.91225904Z", + "signature": "TI1e1dLu9VjTiUm4Brf01EYnKHtMXq++E8HKgmJSIN6fVEYA34TevN7Ks7J6jfEGOKM+0udB8Lrzt8l5K2DFAg==" + }, + { + "block_id_flag": 2, + "validator_address": "987AF576DFCAE3B71C38FC729174739811C6626A", + "timestamp": "2022-06-03T13:43:54.024068244Z", + "signature": "BzUuhHJpcpk0kWRmAf2lK8BzZbIxWg0LFrI/bKFQ8/kRuXPfgktDi5F+uQHRK/BZPtwsrCopBeP6g0f0MUBnBQ==" + }, + { + "block_id_flag": 2, + "validator_address": "BAFE51BA7636EFAA64E59649321EAFC4E1D0F03B", + "timestamp": "2022-06-03T13:43:54.138849218Z", + "signature": "B0q1sXzekCXUAmPaCDZJDI5pOVZjh0pUZgfM2RQpzyKC0X22DDXu1vsVpUut6FKtZy+vqMbdL9/DK79AazBGDA==" + }, + { + "block_id_flag": 2, + "validator_address": "AB135B41694E5EC24367110CC9DB1DC7852D6E82", + "timestamp": "2022-06-03T13:43:54.077068715Z", + "signature": "8GdXLG1POCHs/ETuagBjcK3FYsOtbXliALsgNgWm3Mksn3/Fk843LiLmWoIw2gU784dCPsC50AZSZpS+nQP4Dg==" + }, + { + "block_id_flag": 2, + "validator_address": "5C950EA844C3F38BB3BB51C6634FFAE18DBE8811", + "timestamp": "2022-06-03T13:43:54.027466467Z", + "signature": "q0gQ62HPl9UTorJczU3oobfwVtFBp9dTeuYJkWhC9QdnpCnFExQmmPLBI1wYzexzzhuy+kJhxPBDC1ubx5tVDw==" + }, + { + "block_id_flag": 2, + "validator_address": "B4BB763F2BCDF710991355B1FE4FDCE83C0874A2", + "timestamp": "2022-06-03T13:43:54.032115683Z", + "signature": "OJkHZ3IwLaygYy7rmvF5h/QRRQCvvpkuz1XcYkkVDCiOyLNksx9jn4DQVhtSkizcWrbAecyWp91JdKyrriNCAg==" + }, + { + "block_id_flag": 2, + "validator_address": "63C90F79BA2F2248628BC76D5C038492674EEB91", + "timestamp": "2022-06-03T13:43:54.042168996Z", + "signature": "2iUaNslyv5G5AC4s+t01uufMPqBoNn0Xcq0LlaGZnQpWkMxgKbXOfmIewDQqW2sokMi/TVYwEBxssxYu7buKBA==" + }, + { + "block_id_flag": 2, + "validator_address": "94D21453B366ADA7F50F12CA907CDA7A4AB7F214", + "timestamp": "2022-06-03T13:43:54.016274664Z", + "signature": "QNR2Nzm6tpuYcvP2JkqxuNuSWlBhAdLr1ythBADEhK5fPIpL4DHNgpAk4YrVYcrftRXDQv8SqaWlQe+53V+0AA==" + }, + { + "block_id_flag": 2, + "validator_address": "B699C4799E8F6C7D038682C0441AD28E6E43E677", + "timestamp": "2022-06-03T13:43:54.01188666Z", + "signature": "xu6RrdMwquZXLFcRWOTdnIgeadlAvc2jSTeOO2gLuiT0UvWyp3P5qi0mHnq6PSW24p+IWS3t2d5EApJ6hEqUDg==" + }, + { + "block_id_flag": 2, + "validator_address": "246C9C9846C2899D0DA109BCFADAA6260685B4C3", + "timestamp": "2022-06-03T13:43:54.1380479Z", + "signature": "d7NfblLj40Qu8vjpbVZb4Gu3pjRVGZy/D7jEn01dMml9KE4FgWrBaNRYOIqewKDaEoicEbcLaxAQwnhpJXLMCA==" + }, + { + "block_id_flag": 2, + "validator_address": "E3DF8B64C6EE018BE7EC6BB9BC3ABFB67D99A630", + "timestamp": "2022-06-03T13:43:54.034244232Z", + "signature": "46jl8p+2FxWJmi0Z7jRHXsiWqDKaGczwEEWlZFXFqsqIffxAS5QXSqgbEO0QG3b+XJHbfyY0V+FnDznfF3gGAQ==" + }, + { + "block_id_flag": 2, + "validator_address": "CF941683BB7851E824695E7ABA86D57C6E32F5D3", + "timestamp": "2022-06-03T13:43:54.059640978Z", + "signature": "xIT+QBtjsEjC4SgQDzrevavcyUL4+PmHU8aDbW/IvDRejQoXImazczcXUrLHOr4y4eJogz4yVQCW/7JiIH8UDA==" + }, + { + "block_id_flag": 2, + "validator_address": "7219BF2BF60498F19DC51B33588DEB9F9D30B392", + "timestamp": "2022-06-03T13:43:54.054858041Z", + "signature": "lnXf8TMfmp1FGHjS8UBw2HPgLf7x8Zgzyox+MlHNrMfauWf4dpnEhNekWenfwaoagNYkAAQYso2AEJvXxa3PAg==" + }, + { + "block_id_flag": 2, + "validator_address": "75B513290765236B2F1C3FCAACF35A7FBAFBFB6F", + "timestamp": "2022-06-03T13:43:53.998183482Z", + "signature": "i9cYFQqQYxIXdLXocBb+qCjYq6++FHNLJ+Ne1U8+sJjj29cnzoQThn1Vy80/sruvDfdDkKeXu7Fd6UcPlTFtCA==" + }, + { + "block_id_flag": 2, + "validator_address": "3C672A568D8B4D3261132A92CC572F21D4F85C1C", + "timestamp": "2022-06-03T13:43:54.129675854Z", + "signature": "feQ94W/EOado2qjtJ6yIaG6UzaWPa+9ZdaCzVuWDvftMoS23i45cIdNyxGnksBX8Xh6D9Z7qRQcl5MtzTmGWDw==" + }, + { + "block_id_flag": 2, + "validator_address": "208FF031498FA42FFED6829C8A4884CDC72BE06A", + "timestamp": "2022-06-03T13:43:54.019528989Z", + "signature": "skVAluHzMCk7kW8iqQ9C2/FlqBoM8dqp8R4w+m7WndSN/+yCdWHMgBLFt/3H7KjmUXUrJG97BNI9lVNm/yUYDA==" + }, + { + "block_id_flag": 2, + "validator_address": "CA572745CF6C1437547BB3961D3D04EE8C88DA30", + "timestamp": "2022-06-03T13:43:54.035487377Z", + "signature": "zG755GFUDhN+o4Otkubc1FFuJQhLkzblkgPtCzC7bIH9dTZQDvwtJg3kp7Hxnvyhn+irf+fa0wKWPwAqMlk6DA==" + }, + { + "block_id_flag": 2, + "validator_address": "164A8F8019C8B800A8BEB03CA04428B881812E04", + "timestamp": "2022-06-03T13:43:54.100719203Z", + "signature": "wivmzAd9kToHFE6hBMflFqOdg6VV1Couhd3Ic2VLtgb64+FIQtEjas/MCerBHVewwcayvU/T+wus9W505nypDA==" + }, + { + "block_id_flag": 2, + "validator_address": "206DC4AC92A0CF215D8C8AF98B7A84966CE43E45", + "timestamp": "2022-06-03T13:43:54.081832881Z", + "signature": "87+LVtFHPlgZacS6HoZwA3czTuuZZwdmdYI6gE4cSDBqVz8U9Dezk75L3DcTvZOYxfEw3hqcaYanE+gxvuUOAw==" + }, + { + "block_id_flag": 2, + "validator_address": "3655C2522526E342E1BAE250B7E01C728E97BF61", + "timestamp": "2022-06-03T13:43:54.038044867Z", + "signature": "iaU9wTju6XEi/CHQzrtlMWq5gwazNcg4Hgnw1BRZ+P4nR+GGouvsbB4bZ6lIpadQjr+uWy1+WXcyDefMkaxpCA==" + }, + { + "block_id_flag": 2, + "validator_address": "50A7130BA74D071391EF45678BE2444955FA4AD4", + "timestamp": "2022-06-03T13:43:54.044789051Z", + "signature": "Cb74E/zZjPIA8UDX69PebdZBWStwAUrKVxvBKwi1L5QT3iBeGzy0qIsWz/A3A4pN2FYJpdvTQn0s+2epflLuDA==" + }, + { + "block_id_flag": 2, + "validator_address": "556EA605A9374CE54C157DD42395B4047E327914", + "timestamp": "2022-06-03T13:43:53.942523851Z", + "signature": "LVLNgF7RcIi5BtN5jXCXOp4r/9w1caus0ouETSsSfentVT4avRbplQE2FAOgfj+51kxm2Bc2mGCZwKdIjlYtCw==" + }, + { + "block_id_flag": 2, + "validator_address": "64BBCDCC1BA3D6CB934A5BBC9F45121A40EF81B2", + "timestamp": "2022-06-03T13:43:54.015091358Z", + "signature": "+u2HX/9bG/pxi3SUNU15xEj5aeUkqPs5/ZzQNefqadMyoT2SidM13jLXO1cQINsBtKj/p5UgtMJNbGVZ/l7JCQ==" + }, + { + "block_id_flag": 2, + "validator_address": "6B00AA4C9E824A9E042AA49A5CF40591FDFF2021", + "timestamp": "2022-06-03T13:43:54.015486703Z", + "signature": "rkOt5ClHfjmgqwyA6cn6McTj+bmJLto8Iv3FECRp8ONjljxmeSh6eGClk/MhdDEKloE5nBKpajNoOcR7TuIzBA==" + }, + { + "block_id_flag": 2, + "validator_address": "A2E2A0CC28C652A9EA47D666B2CDE5122DE5A8E1", + "timestamp": "2022-06-03T13:43:54.042376185Z", + "signature": "AmFdiMyx0v74QnV9TdnJU3Aq4p0tjFCV9L/TLO33ygliPpRe6SX2iJGSdX1QKr2w4/Q0tmtSSfE3qXJTLVMEDg==" + }, + { + "block_id_flag": 2, + "validator_address": "E314D1F70E07277B21E80FBF4BCA6AFBDB07C367", + "timestamp": "2022-06-03T13:43:54.026908204Z", + "signature": "PXLk8mTXnB6ZoATIYf3oMnBkrzV8wL4ndVtQ9d2heoJmA94a9lNcTscC+QZK992YPDlLF8KSxeHT6uBdZ8S0Ag==" + } + ] + } + }, + "canonical": true +} \ No newline at end of file diff --git a/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/multi-validator/validators.1.json b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/multi-validator/validators.1.json new file mode 100644 index 000000000..e832b9678 --- /dev/null +++ b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/multi-validator/validators.1.json @@ -0,0 +1,664 @@ +{ + "block_height": "700000", + "validators": [ + { + "address": "C97C186A87209EA864B432E03EF0441E18D709BB", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "lza6STYGfbGrRwY0ZDzORG4SQndP5N6po8HpWqpTy6o=" + }, + "voting_power": "4328337", + "proposer_priority": "-3384799" + }, + { + "address": "DA694585BB239BD51FF6FBF61C10B1E85B2DB707", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "HzbDQiRY7ipSe2hnwAzLlhOk62GfZrPbm4ynmUt+UGo=" + }, + "voting_power": "1486788", + "proposer_priority": "5710546" + }, + { + "address": "9FBFE65AD18294A346B540F7396D92DF32880966", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "pegoDiza/5FHqom5PVN/Py7zse3AAsfkrvR5VLxY9/U=" + }, + "voting_power": "849651", + "proposer_priority": "12373" + }, + { + "address": "BC9D4BD4F1F544FC1E136A92A368CBFC28D0BBEF", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "Zt55IFQv3/zym4XKEeEPJof5+GNbXBvRK9zkTQDZwbw=" + }, + "voting_power": "622173", + "proposer_priority": "-188385" + }, + { + "address": "9FB1318DC46AB8E9D25263DF34C568FE4177FAED", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "Df1HPuRmaik3+1vACZc2BIq+L/gemwYiQFLSt06nxtk=" + }, + "voting_power": "616461", + "proposer_priority": "2927975" + }, + { + "address": "1E4E9FBC795E5C3F1BE3507F6008F40257A8E09D", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "UxwWa4MRF+C8c4QqL25f2CrrMoMndhYpGNPr9xLRl5I=" + }, + "voting_power": "223130", + "proposer_priority": "1171500" + }, + { + "address": "1ECCEB94F3459F9921B0C1D398A3E46283A35285", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "QEzqbvrFJea3J0E8yLWaFm2OzYN6PCLsm/2DSR8opQo=" + }, + "voting_power": "199954", + "proposer_priority": "-1182420" + }, + { + "address": "8971B56A1262D888E76DDF6C78339135122B9FD5", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "iL5CyXR7zFZTKXFdmA3PyP2so9xiv7+gk2FhaXFoQf0=" + }, + "voting_power": "154591", + "proposer_priority": "4044461" + }, + { + "address": "44A774BBD9B1621C7A752F4BF4FC97ECD19C9339", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "Cb+cOsx/PlVOkTVuZHG3TpBJa6/Jx/ga8OC6NF0zFbw=" + }, + "voting_power": "137054", + "proposer_priority": "2197754" + }, + { + "address": "1FB705E4792863FDC9FB000C11D0725656A9D641", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "nx5bgE1JpLsvc8q4qasyZVfKIW0Y7S0Jxvl0CmGq1/0=" + }, + "voting_power": "94887", + "proposer_priority": "4873269" + }, + { + "address": "7C7DA4D5C5C9846F9D02BCA0FCC8BF30FC0039A0", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "whbBV62VgpIL+8oKL8n9x0B431q1+G5HRjKghhFrtKM=" + }, + "voting_power": "86384", + "proposer_priority": "-2463306" + }, + { + "address": "B310BA4A7B39A9D38A67E93E798CE9549F8407F7", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "g45a/itQexKr3sQkobDVQYmYmQOvqxDiG3+ZLJZfh7E=" + }, + "voting_power": "64061", + "proposer_priority": "2763144" + }, + { + "address": "305EEF06E09EB104BF1564DAF31F4277C31AD984", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "bI8u/sIAMqfRCRwnFJ6I2Vu5/b8ruSX8NDyzFXuH2GA=" + }, + "voting_power": "61523", + "proposer_priority": "-3091710" + }, + { + "address": "CF4B8BCC61E1B2207107F986283ABDD61B0E874F", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "DhMjl7CRfWwvj+2iMwlEAYLsu0zs/Zua0VTC+bjE1jc=" + }, + "voting_power": "61478", + "proposer_priority": "-977234" + }, + { + "address": "0323A66E6E48A50BDBAB3832B082B3F2614A433E", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "cqPrCh1D4F5a7z+Aj4TV8mmJlf8UhBQnfURauXTWIKE=" + }, + "voting_power": "59103", + "proposer_priority": "1747144" + }, + { + "address": "E0D23AE41C8F2A204F652CE826E08668DE9A07B8", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "nAAVvH/GwCkdSNlRt2/WtdUvl0AsUtnclxRn8aAFAO4=" + }, + "voting_power": "54286", + "proposer_priority": "3597281" + }, + { + "address": "3439FB7806A3661A7A53D6B28B6771ACD7B00411", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "BgVheyq/M9uPX8vbtgdrauoCH1k0wBqFSmL31/bN+RM=" + }, + "voting_power": "47689", + "proposer_priority": "3520713" + }, + { + "address": "76EA8281CC939495A4A54656C59B9075E9257FC4", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "Lrk3ZO4JlCvfwge8yEO3GK7/SJS7ImXhRZdZE/8rseo=" + }, + "voting_power": "46724", + "proposer_priority": "-4188706" + }, + { + "address": "684616FF14EAE8BE5613DA40864EA85812469308", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "T+dMEZ+Ds5YT2lVx58IMjsmQciIHKif7UYscvdFGyVE=" + }, + "voting_power": "43315", + "proposer_priority": "3140041" + }, + { + "address": "43790BA2E57D02A8944B670B46D62ACBBDDE73FE", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "2Clqam9MlYsZsl7rpXWFRoEC4STewM85Z+8cdob6gJI=" + }, + "voting_power": "41030", + "proposer_priority": "2082123" + }, + { + "address": "A35A6E459554E336C2A07CE78BA4EC1250AC3338", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "FCDoXNkWW6h5yB5h9F46R7gVVdgvqB2adObXkjhLCv4=" + }, + "voting_power": "40323", + "proposer_priority": "-254844" + }, + { + "address": "5802A80D39D378A6218E52F4EB50ECCF4583264B", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "VOdf1YQsfdhng0PZIXqLk+OCNoIGUTbBbYmkN9v+QEQ=" + }, + "voting_power": "33633", + "proposer_priority": "3875013" + }, + { + "address": "8047FA49FCE5E85107E88AE0152E079D9CBD320F", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "9B4gQOiZX+DVSx+A/p9ROkfK6y6o6X7F7H1/x76BrZY=" + }, + "voting_power": "30871", + "proposer_priority": "-2088692" + }, + { + "address": "B4A950629CC31E385E6269F7B62314ED57650EE8", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "vQrkpE1LBhE8kTSmxymCuI8cBA2eOov9sU8gOG8phLw=" + }, + "voting_power": "30550", + "proposer_priority": "-1739427" + }, + { + "address": "B95ECC721FCDD6893107699AED4A0FAA62E97D11", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "L7hWjbX+9e8vVMNeAu6dC0CBg6YBaF/zQjSNyWku/bA=" + }, + "voting_power": "29867", + "proposer_priority": "-4240953" + }, + { + "address": "ED61B1DEE5F79C521F521B78DB93559FEB2E3B82", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "IG6iu/PKcapnSl58DsH6y1JlIv99KjSrZM14+eUILas=" + }, + "voting_power": "28549", + "proposer_priority": "755324" + }, + { + "address": "A92A1DE1BB768A065F87DF5811FC0F32FA7CD57E", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "mk/qPAbVkTjNjHYnAsWlCxmWVzKKt/ojzq8l56rGo0w=" + }, + "voting_power": "26769", + "proposer_priority": "-4055486" + }, + { + "address": "83F719426E00721A9208DBFE2B30D6DC75FE6645", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "zbv8shGha/SDouyB2sOK1AovTo9XhejHU27j+2D+CZE=" + }, + "voting_power": "26480", + "proposer_priority": "5275149" + }, + { + "address": "710FEF6FF4693C657CB24AADF1623E861A5AF906", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "8IY9X+l01DxmGMoR6K6uprK/Sy/kwvlkx85X8b0uP24=" + }, + "voting_power": "25357", + "proposer_priority": "919829" + }, + { + "address": "C8BB72DD64C161F5A23874F480DCD12BD2C2647D", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "BMtmwph1ZwZzhktwUKNe4+SlfmGfvI4JyRRxLodd6VU=" + }, + "voting_power": "23128", + "proposer_priority": "-4317416" + }, + { + "address": "17E4639B5116509EC04C4AABFA69506317801783", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "y+utsHn6QYiX6CCBdYAAam2KRNoRvAGDBUam/oQ6xUw=" + }, + "voting_power": "22210", + "proposer_priority": "3744804" + }, + { + "address": "1CDD0EF99F36CC3028237886FA00CE45AABD60E5", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "MaLV6YmPBWD9VB07GWq1+CQEkK36XtFOKteoMbYFcDo=" + }, + "voting_power": "21248", + "proposer_priority": "93062" + }, + { + "address": "80DA42EB9A25BD341A18B2D989BB86DFD4413A05", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "Q0Ip8MkXMP65UcG3XQ08h0CZ8D3pSmQwPXCZsuHgBBY=" + }, + "voting_power": "18327", + "proposer_priority": "1154385" + }, + { + "address": "916D131FCDC899B83D0C3B56DDD6614B339C997E", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "/qEmmvQH3sm6lccuFbWi3WQ7Zix8lYanRpJIbaUzyig=" + }, + "voting_power": "16040", + "proposer_priority": "3450504" + }, + { + "address": "903EED41E608EFD3E2DBA2C561F7331C1AE0D82D", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "S2T1ECtywD912SDZ04fknyPtgp0QnrkSoFcbawOqnyQ=" + }, + "voting_power": "15878", + "proposer_priority": "784850" + }, + { + "address": "A262DDACC4F532340A2B389CF3EAA29B6846D142", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "2vkzUgR+NY6/2b870xJ8tTZaXGmdKU7z7RZsVvqs6qI=" + }, + "voting_power": "15809", + "proposer_priority": "-3635208" + }, + { + "address": "9F579C855F835F1CB71ABF2960A244FC0AF671EA", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "StBLaUcTsB0WP52rMHlR4vVG1+h/GdHVv/PsRosE0KA=" + }, + "voting_power": "9907", + "proposer_priority": "1143521" + }, + { + "address": "2026B424B984B681F91C88874820CE927965C492", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "gc/zmjETfR/5k8y99qdYnrCi3r2xpG2fvA0xqw0ypgQ=" + }, + "voting_power": "9211", + "proposer_priority": "4211686" + }, + { + "address": "92C70850FA51E11384826C5F574F5B13B5706554", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "fc/uPJqGQVezA4dP9QQGIW+9pKI3ZbNRLnjfAxST6Wk=" + }, + "voting_power": "9071", + "proposer_priority": "-3964336" + }, + { + "address": "1A30424D3A05B7E61B1936477C338E316E5D7D66", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "kv7kHkUuMK26OsQaCFijOxUgyUUSjZGzJx4uo0AQ8nI=" + }, + "voting_power": "8476", + "proposer_priority": "-3707057" + }, + { + "address": "CB1814F7CDAFE24C0A836B627082710636562B98", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "mrO3rLYqtzjKqQ8jG5yad5d4/0y3nuGC7vdwHYrq+ok=" + }, + "voting_power": "6169", + "proposer_priority": "-4784520" + }, + { + "address": "DC9424AFE6C83F68813337B5FB4EC62C2330C9E6", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "q/L9gc2ZIdsdsHo553UwGIamlLfwhBRQy6dhchS8WTc=" + }, + "voting_power": "5887", + "proposer_priority": "524877" + }, + { + "address": "91938313E6AC32D56F07B39ACC580B1E7E5A29E8", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "P5+60QYJ00LqnNqfzMzIA0Z7u1mIAxIFCkujt+3imgM=" + }, + "voting_power": "5740", + "proposer_priority": "-4297155" + }, + { + "address": "6A24190F2C8C0878BB134D146FE9333094171256", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "K89oBGiO66xsdgY3BMwMF6nYQlB0BNnw/dBLeFK52Oc=" + }, + "voting_power": "1846", + "proposer_priority": "-2639529" + }, + { + "address": "60A7F8F9EE0BE23DAC5183B36BEB14AEF2D3A879", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "aGn1HF9e4nIZ1CjwhHZSWekijRO7bq/ZKV384/zmHzY=" + }, + "voting_power": "1000", + "proposer_priority": "1872869" + }, + { + "address": "43FC3AB6FE3D33C41842553EAFC8393A7FD00C23", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "701IrRX2fUrkoMUtdmTr5JiIZqdgHpcga1WKoV7PSMU=" + }, + "voting_power": "730", + "proposer_priority": "-677425" + }, + { + "address": "B684A0D2CB2D1AC7F9AC890B4678006A1D5B09E0", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "ZX0ywGqfB+Mi5B5QzKx0dLzDo6ua2eqcufdzDPUB5p4=" + }, + "voting_power": "384", + "proposer_priority": "-5687902" + }, + { + "address": "19DD6B3CA0DEB5F6FE0E1A78AD53D408EA0CA8F0", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "ifW74P0qYAclokjCrd4+RKHMnQAI/7HqGJZ9bg77dc4=" + }, + "voting_power": "261", + "proposer_priority": "1814208" + }, + { + "address": "987AF576DFCAE3B71C38FC729174739811C6626A", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "ZN84hF2H+G8s5/Uw3pFwcYGdmmGobdsxVPistm+vzZQ=" + }, + "voting_power": "225", + "proposer_priority": "1634098" + }, + { + "address": "BAFE51BA7636EFAA64E59649321EAFC4E1D0F03B", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "9fHwtNKyrmNMxsCIssQXqobIr917hNJuDo333IIyyGM=" + }, + "voting_power": "150", + "proposer_priority": "-5105653" + }, + { + "address": "AB135B41694E5EC24367110CC9DB1DC7852D6E82", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "ZTUVskeDW2DxxHSViecAFSHRamNHGoGoEQEPRt58tuY=" + }, + "voting_power": "89", + "proposer_priority": "-4562402" + }, + { + "address": "5C950EA844C3F38BB3BB51C6634FFAE18DBE8811", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "w/n2tngzQcP5viXuhxa5bCEDlll+qVpLZkuN0MfmWZU=" + }, + "voting_power": "81", + "proposer_priority": "-5960112" + }, + { + "address": "B4BB763F2BCDF710991355B1FE4FDCE83C0874A2", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "iBTM2Vpl0CML5bD3vQ+dnglrSypX/Hpr9p4pwlVeHxY=" + }, + "voting_power": "69", + "proposer_priority": "2640719" + }, + { + "address": "63C90F79BA2F2248628BC76D5C038492674EEB91", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "/Cp3v8ADUev/rWKMC+gLrdi3m+526vy4JJT/ebJE3U0=" + }, + "voting_power": "57", + "proposer_priority": "-2518174" + }, + { + "address": "94D21453B366ADA7F50F12CA907CDA7A4AB7F214", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "LGUlm/88HsFcGoonV9h4LePeWrzHdOgRl0qZE0WICec=" + }, + "voting_power": "52", + "proposer_priority": "2283021" + }, + { + "address": "B699C4799E8F6C7D038682C0441AD28E6E43E677", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "GOg/7baoMkm6MO9kmIkv/xtMarRZ5uc/mz9i3BO3hZw=" + }, + "voting_power": "42", + "proposer_priority": "1405122" + }, + { + "address": "246C9C9846C2899D0DA109BCFADAA6260685B4C3", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "6AhtT5V0/eu3BIve9qKpTPcULe6wYrcPuhcpeRnMSyw=" + }, + "voting_power": "14", + "proposer_priority": "1775896" + }, + { + "address": "E3DF8B64C6EE018BE7EC6BB9BC3ABFB67D99A630", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "wbNefAPhut94zca74ZCGHmboBqrA464/EyHlEekMcow=" + }, + "voting_power": "10", + "proposer_priority": "-4262001" + }, + { + "address": "CF941683BB7851E824695E7ABA86D57C6E32F5D3", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "f+wg6V3z8g55vgzneEjhH6gJmgi1P/P7SDbbGh3scVQ=" + }, + "voting_power": "7", + "proposer_priority": "1152698" + }, + { + "address": "7219BF2BF60498F19DC51B33588DEB9F9D30B392", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "ZCc3n6I7Q5ruFFHwv//XECvdo+COsQ3Dqv6TYlcz0IQ=" + }, + "voting_power": "6", + "proposer_priority": "880714" + }, + { + "address": "75B513290765236B2F1C3FCAACF35A7FBAFBFB6F", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "A4w47f3apgLgG7raSzYedv3zc1Kan2UD+QQdPWPmYbI=" + }, + "voting_power": "6", + "proposer_priority": "1161653" + }, + { + "address": "3C672A568D8B4D3261132A92CC572F21D4F85C1C", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "rfWvXM+dxHvTgRSwkghWozA2+OTMUsD3RmYT66sZ8qs=" + }, + "voting_power": "5", + "proposer_priority": "1087076" + }, + { + "address": "208FF031498FA42FFED6829C8A4884CDC72BE06A", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "XT5lav9vOFVUo6FCh1sHr0S1TirnUKpHkj8UOevzmBM=" + }, + "voting_power": "2", + "proposer_priority": "768659" + }, + { + "address": "CA572745CF6C1437547BB3961D3D04EE8C88DA30", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "pe5spRJgTVbEStc6eRp1Blx6ZKA/nTmP/UveU5hLS70=" + }, + "voting_power": "2", + "proposer_priority": "607316" + }, + { + "address": "164A8F8019C8B800A8BEB03CA04428B881812E04", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "168Mb6oUPPq8g+8e0PsuiBx8bBzbgr1fVeiqn8E2uEg=" + }, + "voting_power": "1", + "proposer_priority": "34001" + }, + { + "address": "206DC4AC92A0CF215D8C8AF98B7A84966CE43E45", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "Mm9lw9+Fb4iTg/HkSnR4/ob7VLVwsVM8Ncumtn8z180=" + }, + "voting_power": "1", + "proposer_priority": "478964" + }, + { + "address": "3655C2522526E342E1BAE250B7E01C728E97BF61", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "8C8ObB/ueQs9fK4voPVLmW5MoMWXigTezprUdsOVLuQ=" + }, + "voting_power": "1", + "proposer_priority": "462092" + }, + { + "address": "50A7130BA74D071391EF45678BE2444955FA4AD4", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "mE2ULx0G812VEr8mqvKXMHKEF4tL0k5NKjgFHbMlKtw=" + }, + "voting_power": "1", + "proposer_priority": "102099" + }, + { + "address": "556EA605A9374CE54C157DD42395B4047E327914", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "hxjD2336gspNuI5EZw+HPrN0wyLj22HNFj5NnBRHCyY=" + }, + "voting_power": "1", + "proposer_priority": "469071" + }, + { + "address": "64BBCDCC1BA3D6CB934A5BBC9F45121A40EF81B2", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "HkAl1eQI+xYKK7CfEz2CfBhN+1t62p2uEtRN04GrpSk=" + }, + "voting_power": "1", + "proposer_priority": "51591" + }, + { + "address": "6B00AA4C9E824A9E042AA49A5CF40591FDFF2021", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "VusjapHUOkaqArduuT7dxw50KHYGs+rlTgh8yYNqBrw=" + }, + "voting_power": "1", + "proposer_priority": "42652" + }, + { + "address": "A2E2A0CC28C652A9EA47D666B2CDE5122DE5A8E1", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "vm9wtXNrD25uUp+0jd/+tFKHwLavQ9aKMx3G6ORpzoY=" + }, + "voting_power": "1", + "proposer_priority": "-588686" + }, + { + "address": "E314D1F70E07277B21E80FBF4BCA6AFBDB07C367", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "+B7kI0VIsl1OEnGKsRFLdNRtUsG54fGBvT9ic5H+46Y=" + }, + "voting_power": "1", + "proposer_priority": "117747" + } + ], + "count": "73", + "total": "73" +} \ No newline at end of file diff --git a/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/multi-validator/validators.2.json b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/multi-validator/validators.2.json new file mode 100644 index 000000000..407b6727e --- /dev/null +++ b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/multi-validator/validators.2.json @@ -0,0 +1,664 @@ +{ + "block_height": "700022", + "validators": [ + { + "address": "C97C186A87209EA864B432E03EF0441E18D709BB", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "lza6STYGfbGrRwY0ZDzORG4SQndP5N6po8HpWqpTy6o=" + }, + "voting_power": "4328337", + "proposer_priority": "4149463" + }, + { + "address": "DA694585BB239BD51FF6FBF61C10B1E85B2DB707", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "HzbDQiRY7ipSe2hnwAzLlhOk62GfZrPbm4ynmUt+UGo=" + }, + "voting_power": "1486788", + "proposer_priority": "-553043" + }, + { + "address": "9FBFE65AD18294A346B540F7396D92DF32880966", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "pegoDiza/5FHqom5PVN/Py7zse3AAsfkrvR5VLxY9/U=" + }, + "voting_power": "849651", + "proposer_priority": "-781793" + }, + { + "address": "BC9D4BD4F1F544FC1E136A92A368CBFC28D0BBEF", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "Zt55IFQv3/zym4XKEeEPJof5+GNbXBvRK9zkTQDZwbw=" + }, + "voting_power": "622208", + "proposer_priority": "3756737" + }, + { + "address": "9FB1318DC46AB8E9D25263DF34C568FE4177FAED", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "Df1HPuRmaik3+1vACZc2BIq+L/gemwYiQFLSt06nxtk=" + }, + "voting_power": "616477", + "proposer_priority": "-2996166" + }, + { + "address": "1E4E9FBC795E5C3F1BE3507F6008F40257A8E09D", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "UxwWa4MRF+C8c4QqL25f2CrrMoMndhYpGNPr9xLRl5I=" + }, + "voting_power": "223130", + "proposer_priority": "-3662913" + }, + { + "address": "1ECCEB94F3459F9921B0C1D398A3E46283A35285", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "QEzqbvrFJea3J0E8yLWaFm2OzYN6PCLsm/2DSR8opQo=" + }, + "voting_power": "199954", + "proposer_priority": "3216568" + }, + { + "address": "8971B56A1262D888E76DDF6C78339135122B9FD5", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "iL5CyXR7zFZTKXFdmA3PyP2so9xiv7+gk2FhaXFoQf0=" + }, + "voting_power": "154591", + "proposer_priority": "-2297808" + }, + { + "address": "44A774BBD9B1621C7A752F4BF4FC97ECD19C9339", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "Cb+cOsx/PlVOkTVuZHG3TpBJa6/Jx/ga8OC6NF0zFbw=" + }, + "voting_power": "137054", + "proposer_priority": "5212942" + }, + { + "address": "1FB705E4792863FDC9FB000C11D0725656A9D641", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "nx5bgE1JpLsvc8q4qasyZVfKIW0Y7S0Jxvl0CmGq1/0=" + }, + "voting_power": "94887", + "proposer_priority": "-2782419" + }, + { + "address": "7C7DA4D5C5C9846F9D02BCA0FCC8BF30FC0039A0", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "whbBV62VgpIL+8oKL8n9x0B431q1+G5HRjKghhFrtKM=" + }, + "voting_power": "86384", + "proposer_priority": "-562858" + }, + { + "address": "B310BA4A7B39A9D38A67E93E798CE9549F8407F7", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "g45a/itQexKr3sQkobDVQYmYmQOvqxDiG3+ZLJZfh7E=" + }, + "voting_power": "64068", + "proposer_priority": "4172585" + }, + { + "address": "305EEF06E09EB104BF1564DAF31F4277C31AD984", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "bI8u/sIAMqfRCRwnFJ6I2Vu5/b8ruSX8NDyzFXuH2GA=" + }, + "voting_power": "61523", + "proposer_priority": "-1738204" + }, + { + "address": "CF4B8BCC61E1B2207107F986283ABDD61B0E874F", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "DhMjl7CRfWwvj+2iMwlEAYLsu0zs/Zua0VTC+bjE1jc=" + }, + "voting_power": "61478", + "proposer_priority": "375282" + }, + { + "address": "0323A66E6E48A50BDBAB3832B082B3F2614A433E", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "cqPrCh1D4F5a7z+Aj4TV8mmJlf8UhBQnfURauXTWIKE=" + }, + "voting_power": "59103", + "proposer_priority": "3047410" + }, + { + "address": "E0D23AE41C8F2A204F652CE826E08668DE9A07B8", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "nAAVvH/GwCkdSNlRt2/WtdUvl0AsUtnclxRn8aAFAO4=" + }, + "voting_power": "54286", + "proposer_priority": "4791573" + }, + { + "address": "3439FB7806A3661A7A53D6B28B6771ACD7B00411", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "BgVheyq/M9uPX8vbtgdrauoCH1k0wBqFSmL31/bN+RM=" + }, + "voting_power": "47694", + "proposer_priority": "4569953" + }, + { + "address": "76EA8281CC939495A4A54656C59B9075E9257FC4", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "Lrk3ZO4JlCvfwge8yEO3GK7/SJS7ImXhRZdZE/8rseo=" + }, + "voting_power": "46727", + "proposer_priority": "-3160747" + }, + { + "address": "684616FF14EAE8BE5613DA40864EA85812469308", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "T+dMEZ+Ds5YT2lVx58IMjsmQciIHKif7UYscvdFGyVE=" + }, + "voting_power": "43363", + "proposer_priority": "4093499" + }, + { + "address": "43790BA2E57D02A8944B670B46D62ACBBDDE73FE", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "2Clqam9MlYsZsl7rpXWFRoEC4STewM85Z+8cdob6gJI=" + }, + "voting_power": "41030", + "proposer_priority": "2984783" + }, + { + "address": "A35A6E459554E336C2A07CE78BA4EC1250AC3338", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "FCDoXNkWW6h5yB5h9F46R7gVVdgvqB2adObXkjhLCv4=" + }, + "voting_power": "40324", + "proposer_priority": "632282" + }, + { + "address": "5802A80D39D378A6218E52F4EB50ECCF4583264B", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "VOdf1YQsfdhng0PZIXqLk+OCNoIGUTbBbYmkN9v+QEQ=" + }, + "voting_power": "33633", + "proposer_priority": "4614939" + }, + { + "address": "8047FA49FCE5E85107E88AE0152E079D9CBD320F", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "9B4gQOiZX+DVSx+A/p9ROkfK6y6o6X7F7H1/x76BrZY=" + }, + "voting_power": "30871", + "proposer_priority": "-1409530" + }, + { + "address": "B4A950629CC31E385E6269F7B62314ED57650EE8", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "vQrkpE1LBhE8kTSmxymCuI8cBA2eOov9sU8gOG8phLw=" + }, + "voting_power": "30550", + "proposer_priority": "-1067327" + }, + { + "address": "B95ECC721FCDD6893107699AED4A0FAA62E97D11", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "L7hWjbX+9e8vVMNeAu6dC0CBg6YBaF/zQjSNyWku/bA=" + }, + "voting_power": "29867", + "proposer_priority": "-3583879" + }, + { + "address": "ED61B1DEE5F79C521F521B78DB93559FEB2E3B82", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "IG6iu/PKcapnSl58DsH6y1JlIv99KjSrZM14+eUILas=" + }, + "voting_power": "28549", + "proposer_priority": "1383402" + }, + { + "address": "A92A1DE1BB768A065F87DF5811FC0F32FA7CD57E", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "mk/qPAbVkTjNjHYnAsWlCxmWVzKKt/ojzq8l56rGo0w=" + }, + "voting_power": "26769", + "proposer_priority": "-3466568" + }, + { + "address": "83F719426E00721A9208DBFE2B30D6DC75FE6645", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "zbv8shGha/SDouyB2sOK1AovTo9XhejHU27j+2D+CZE=" + }, + "voting_power": "26485", + "proposer_priority": "-3885437" + }, + { + "address": "710FEF6FF4693C657CB24AADF1623E861A5AF906", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "8IY9X+l01DxmGMoR6K6uprK/Sy/kwvlkx85X8b0uP24=" + }, + "voting_power": "25357", + "proposer_priority": "1477683" + }, + { + "address": "C8BB72DD64C161F5A23874F480DCD12BD2C2647D", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "BMtmwph1ZwZzhktwUKNe4+SlfmGfvI4JyRRxLodd6VU=" + }, + "voting_power": "23128", + "proposer_priority": "-3808600" + }, + { + "address": "17E4639B5116509EC04C4AABFA69506317801783", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "y+utsHn6QYiX6CCBdYAAam2KRNoRvAGDBUam/oQ6xUw=" + }, + "voting_power": "22213", + "proposer_priority": "4233436" + }, + { + "address": "1CDD0EF99F36CC3028237886FA00CE45AABD60E5", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "MaLV6YmPBWD9VB07GWq1+CQEkK36XtFOKteoMbYFcDo=" + }, + "voting_power": "21248", + "proposer_priority": "560518" + }, + { + "address": "80DA42EB9A25BD341A18B2D989BB86DFD4413A05", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "Q0Ip8MkXMP65UcG3XQ08h0CZ8D3pSmQwPXCZsuHgBBY=" + }, + "voting_power": "18327", + "proposer_priority": "1557579" + }, + { + "address": "916D131FCDC899B83D0C3B56DDD6614B339C997E", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "/qEmmvQH3sm6lccuFbWi3WQ7Zix8lYanRpJIbaUzyig=" + }, + "voting_power": "16040", + "proposer_priority": "3803384" + }, + { + "address": "903EED41E608EFD3E2DBA2C561F7331C1AE0D82D", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "S2T1ECtywD912SDZ04fknyPtgp0QnrkSoFcbawOqnyQ=" + }, + "voting_power": "15878", + "proposer_priority": "1134166" + }, + { + "address": "A262DDACC4F532340A2B389CF3EAA29B6846D142", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "2vkzUgR+NY6/2b870xJ8tTZaXGmdKU7z7RZsVvqs6qI=" + }, + "voting_power": "15809", + "proposer_priority": "-3287410" + }, + { + "address": "9F579C855F835F1CB71ABF2960A244FC0AF671EA", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "StBLaUcTsB0WP52rMHlR4vVG1+h/GdHVv/PsRosE0KA=" + }, + "voting_power": "9907", + "proposer_priority": "1361475" + }, + { + "address": "2026B424B984B681F91C88874820CE927965C492", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "gc/zmjETfR/5k8y99qdYnrCi3r2xpG2fvA0xqw0ypgQ=" + }, + "voting_power": "9211", + "proposer_priority": "4414328" + }, + { + "address": "92C70850FA51E11384826C5F574F5B13B5706554", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "fc/uPJqGQVezA4dP9QQGIW+9pKI3ZbNRLnjfAxST6Wk=" + }, + "voting_power": "9071", + "proposer_priority": "-3764774" + }, + { + "address": "1A30424D3A05B7E61B1936477C338E316E5D7D66", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "kv7kHkUuMK26OsQaCFijOxUgyUUSjZGzJx4uo0AQ8nI=" + }, + "voting_power": "8476", + "proposer_priority": "-3520585" + }, + { + "address": "CB1814F7CDAFE24C0A836B627082710636562B98", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "mrO3rLYqtzjKqQ8jG5yad5d4/0y3nuGC7vdwHYrq+ok=" + }, + "voting_power": "6169", + "proposer_priority": "-4648802" + }, + { + "address": "DC9424AFE6C83F68813337B5FB4EC62C2330C9E6", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "q/L9gc2ZIdsdsHo553UwGIamlLfwhBRQy6dhchS8WTc=" + }, + "voting_power": "5887", + "proposer_priority": "654391" + }, + { + "address": "91938313E6AC32D56F07B39ACC580B1E7E5A29E8", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "P5+60QYJ00LqnNqfzMzIA0Z7u1mIAxIFCkujt+3imgM=" + }, + "voting_power": "5740", + "proposer_priority": "-4170875" + }, + { + "address": "6A24190F2C8C0878BB134D146FE9333094171256", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "K89oBGiO66xsdgY3BMwMF6nYQlB0BNnw/dBLeFK52Oc=" + }, + "voting_power": "1846", + "proposer_priority": "-2598917" + }, + { + "address": "60A7F8F9EE0BE23DAC5183B36BEB14AEF2D3A879", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "aGn1HF9e4nIZ1CjwhHZSWekijRO7bq/ZKV384/zmHzY=" + }, + "voting_power": "1000", + "proposer_priority": "1894869" + }, + { + "address": "43FC3AB6FE3D33C41842553EAFC8393A7FD00C23", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "701IrRX2fUrkoMUtdmTr5JiIZqdgHpcga1WKoV7PSMU=" + }, + "voting_power": "730", + "proposer_priority": "-661365" + }, + { + "address": "B684A0D2CB2D1AC7F9AC890B4678006A1D5B09E0", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "ZX0ywGqfB+Mi5B5QzKx0dLzDo6ua2eqcufdzDPUB5p4=" + }, + "voting_power": "384", + "proposer_priority": "-5679454" + }, + { + "address": "19DD6B3CA0DEB5F6FE0E1A78AD53D408EA0CA8F0", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "ifW74P0qYAclokjCrd4+RKHMnQAI/7HqGJZ9bg77dc4=" + }, + "voting_power": "261", + "proposer_priority": "1819950" + }, + { + "address": "987AF576DFCAE3B71C38FC729174739811C6626A", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "ZN84hF2H+G8s5/Uw3pFwcYGdmmGobdsxVPistm+vzZQ=" + }, + "voting_power": "225", + "proposer_priority": "1639048" + }, + { + "address": "BAFE51BA7636EFAA64E59649321EAFC4E1D0F03B", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "9fHwtNKyrmNMxsCIssQXqobIr917hNJuDo333IIyyGM=" + }, + "voting_power": "150", + "proposer_priority": "-5102353" + }, + { + "address": "AB135B41694E5EC24367110CC9DB1DC7852D6E82", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "ZTUVskeDW2DxxHSViecAFSHRamNHGoGoEQEPRt58tuY=" + }, + "voting_power": "89", + "proposer_priority": "-4560444" + }, + { + "address": "5C950EA844C3F38BB3BB51C6634FFAE18DBE8811", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "w/n2tngzQcP5viXuhxa5bCEDlll+qVpLZkuN0MfmWZU=" + }, + "voting_power": "81", + "proposer_priority": "-5958330" + }, + { + "address": "B4BB763F2BCDF710991355B1FE4FDCE83C0874A2", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "iBTM2Vpl0CML5bD3vQ+dnglrSypX/Hpr9p4pwlVeHxY=" + }, + "voting_power": "69", + "proposer_priority": "2642237" + }, + { + "address": "63C90F79BA2F2248628BC76D5C038492674EEB91", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "/Cp3v8ADUev/rWKMC+gLrdi3m+526vy4JJT/ebJE3U0=" + }, + "voting_power": "57", + "proposer_priority": "-2516920" + }, + { + "address": "94D21453B366ADA7F50F12CA907CDA7A4AB7F214", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "LGUlm/88HsFcGoonV9h4LePeWrzHdOgRl0qZE0WICec=" + }, + "voting_power": "52", + "proposer_priority": "2284165" + }, + { + "address": "B699C4799E8F6C7D038682C0441AD28E6E43E677", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "GOg/7baoMkm6MO9kmIkv/xtMarRZ5uc/mz9i3BO3hZw=" + }, + "voting_power": "42", + "proposer_priority": "1406046" + }, + { + "address": "246C9C9846C2899D0DA109BCFADAA6260685B4C3", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "6AhtT5V0/eu3BIve9qKpTPcULe6wYrcPuhcpeRnMSyw=" + }, + "voting_power": "14", + "proposer_priority": "1776204" + }, + { + "address": "E3DF8B64C6EE018BE7EC6BB9BC3ABFB67D99A630", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "wbNefAPhut94zca74ZCGHmboBqrA464/EyHlEekMcow=" + }, + "voting_power": "10", + "proposer_priority": "-4261781" + }, + { + "address": "CF941683BB7851E824695E7ABA86D57C6E32F5D3", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "f+wg6V3z8g55vgzneEjhH6gJmgi1P/P7SDbbGh3scVQ=" + }, + "voting_power": "7", + "proposer_priority": "1152852" + }, + { + "address": "7219BF2BF60498F19DC51B33588DEB9F9D30B392", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "ZCc3n6I7Q5ruFFHwv//XECvdo+COsQ3Dqv6TYlcz0IQ=" + }, + "voting_power": "6", + "proposer_priority": "880846" + }, + { + "address": "75B513290765236B2F1C3FCAACF35A7FBAFBFB6F", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "A4w47f3apgLgG7raSzYedv3zc1Kan2UD+QQdPWPmYbI=" + }, + "voting_power": "6", + "proposer_priority": "1161785" + }, + { + "address": "3C672A568D8B4D3261132A92CC572F21D4F85C1C", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "rfWvXM+dxHvTgRSwkghWozA2+OTMUsD3RmYT66sZ8qs=" + }, + "voting_power": "5", + "proposer_priority": "1087186" + }, + { + "address": "208FF031498FA42FFED6829C8A4884CDC72BE06A", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "XT5lav9vOFVUo6FCh1sHr0S1TirnUKpHkj8UOevzmBM=" + }, + "voting_power": "2", + "proposer_priority": "768703" + }, + { + "address": "CA572745CF6C1437547BB3961D3D04EE8C88DA30", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "pe5spRJgTVbEStc6eRp1Blx6ZKA/nTmP/UveU5hLS70=" + }, + "voting_power": "2", + "proposer_priority": "607360" + }, + { + "address": "164A8F8019C8B800A8BEB03CA04428B881812E04", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "168Mb6oUPPq8g+8e0PsuiBx8bBzbgr1fVeiqn8E2uEg=" + }, + "voting_power": "1", + "proposer_priority": "34023" + }, + { + "address": "206DC4AC92A0CF215D8C8AF98B7A84966CE43E45", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "Mm9lw9+Fb4iTg/HkSnR4/ob7VLVwsVM8Ncumtn8z180=" + }, + "voting_power": "1", + "proposer_priority": "478986" + }, + { + "address": "3655C2522526E342E1BAE250B7E01C728E97BF61", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "8C8ObB/ueQs9fK4voPVLmW5MoMWXigTezprUdsOVLuQ=" + }, + "voting_power": "1", + "proposer_priority": "462114" + }, + { + "address": "50A7130BA74D071391EF45678BE2444955FA4AD4", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "mE2ULx0G812VEr8mqvKXMHKEF4tL0k5NKjgFHbMlKtw=" + }, + "voting_power": "1", + "proposer_priority": "102121" + }, + { + "address": "556EA605A9374CE54C157DD42395B4047E327914", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "hxjD2336gspNuI5EZw+HPrN0wyLj22HNFj5NnBRHCyY=" + }, + "voting_power": "1", + "proposer_priority": "469093" + }, + { + "address": "64BBCDCC1BA3D6CB934A5BBC9F45121A40EF81B2", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "HkAl1eQI+xYKK7CfEz2CfBhN+1t62p2uEtRN04GrpSk=" + }, + "voting_power": "1", + "proposer_priority": "51613" + }, + { + "address": "6B00AA4C9E824A9E042AA49A5CF40591FDFF2021", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "VusjapHUOkaqArduuT7dxw50KHYGs+rlTgh8yYNqBrw=" + }, + "voting_power": "1", + "proposer_priority": "42674" + }, + { + "address": "A2E2A0CC28C652A9EA47D666B2CDE5122DE5A8E1", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "vm9wtXNrD25uUp+0jd/+tFKHwLavQ9aKMx3G6ORpzoY=" + }, + "voting_power": "1", + "proposer_priority": "-588664" + }, + { + "address": "E314D1F70E07277B21E80FBF4BCA6AFBDB07C367", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "+B7kI0VIsl1OEnGKsRFLdNRtUsG54fGBvT9ic5H+46Y=" + }, + "voting_power": "1", + "proposer_priority": "117769" + } + ], + "count": "73", + "total": "73" +} \ No newline at end of file diff --git a/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/multi-validator/validators.3.json b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/multi-validator/validators.3.json new file mode 100644 index 000000000..db1793c70 --- /dev/null +++ b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/multi-validator/validators.3.json @@ -0,0 +1,664 @@ +{ + "block_height": "700083", + "validators": [ + { + "address": "C97C186A87209EA864B432E03EF0441E18D709BB", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "lza6STYGfbGrRwY0ZDzORG4SQndP5N6po8HpWqpTy6o=" + }, + "voting_power": "4328337", + "proposer_priority": "5104383" + }, + { + "address": "DA694585BB239BD51FF6FBF61C10B1E85B2DB707", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "HzbDQiRY7ipSe2hnwAzLlhOk62GfZrPbm4ynmUt+UGo=" + }, + "voting_power": "1486788", + "proposer_priority": "2449820" + }, + { + "address": "9FBFE65AD18294A346B540F7396D92DF32880966", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "pegoDiza/5FHqom5PVN/Py7zse3AAsfkrvR5VLxY9/U=" + }, + "voting_power": "849800", + "proposer_priority": "2335478" + }, + { + "address": "BC9D4BD4F1F544FC1E136A92A368CBFC28D0BBEF", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "Zt55IFQv3/zym4XKEeEPJof5+GNbXBvRK9zkTQDZwbw=" + }, + "voting_power": "622274", + "proposer_priority": "2739647" + }, + { + "address": "9FB1318DC46AB8E9D25263DF34C568FE4177FAED", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "Df1HPuRmaik3+1vACZc2BIq+L/gemwYiQFLSt06nxtk=" + }, + "voting_power": "616511", + "proposer_priority": "5379549" + }, + { + "address": "1E4E9FBC795E5C3F1BE3507F6008F40257A8E09D", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "UxwWa4MRF+C8c4QqL25f2CrrMoMndhYpGNPr9xLRl5I=" + }, + "voting_power": "223130", + "proposer_priority": "204513" + }, + { + "address": "1ECCEB94F3459F9921B0C1D398A3E46283A35285", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "QEzqbvrFJea3J0E8yLWaFm2OzYN6PCLsm/2DSR8opQo=" + }, + "voting_power": "199954", + "proposer_priority": "-4073244" + }, + { + "address": "8971B56A1262D888E76DDF6C78339135122B9FD5", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "iL5CyXR7zFZTKXFdmA3PyP2so9xiv7+gk2FhaXFoQf0=" + }, + "voting_power": "154591", + "proposer_priority": "-2611371" + }, + { + "address": "44A774BBD9B1621C7A752F4BF4FC97ECD19C9339", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "Cb+cOsx/PlVOkTVuZHG3TpBJa6/Jx/ga8OC6NF0zFbw=" + }, + "voting_power": "137076", + "proposer_priority": "3830224" + }, + { + "address": "1FB705E4792863FDC9FB000C11D0725656A9D641", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "nx5bgE1JpLsvc8q4qasyZVfKIW0Y7S0Jxvl0CmGq1/0=" + }, + "voting_power": "94906", + "proposer_priority": "3006308" + }, + { + "address": "7C7DA4D5C5C9846F9D02BCA0FCC8BF30FC0039A0", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "whbBV62VgpIL+8oKL8n9x0B431q1+G5HRjKghhFrtKM=" + }, + "voting_power": "86384", + "proposer_priority": "4706566" + }, + { + "address": "B310BA4A7B39A9D38A67E93E798CE9549F8407F7", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "g45a/itQexKr3sQkobDVQYmYmQOvqxDiG3+ZLJZfh7E=" + }, + "voting_power": "64068", + "proposer_priority": "-1662694" + }, + { + "address": "305EEF06E09EB104BF1564DAF31F4277C31AD984", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "bI8u/sIAMqfRCRwnFJ6I2Vu5/b8ruSX8NDyzFXuH2GA=" + }, + "voting_power": "61523", + "proposer_priority": "2014699" + }, + { + "address": "CF4B8BCC61E1B2207107F986283ABDD61B0E874F", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "DhMjl7CRfWwvj+2iMwlEAYLsu0zs/Zua0VTC+bjE1jc=" + }, + "voting_power": "61478", + "proposer_priority": "4125440" + }, + { + "address": "0323A66E6E48A50BDBAB3832B082B3F2614A433E", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "cqPrCh1D4F5a7z+Aj4TV8mmJlf8UhBQnfURauXTWIKE=" + }, + "voting_power": "59103", + "proposer_priority": "-3090811" + }, + { + "address": "E0D23AE41C8F2A204F652CE826E08668DE9A07B8", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "nAAVvH/GwCkdSNlRt2/WtdUvl0AsUtnclxRn8aAFAO4=" + }, + "voting_power": "54297", + "proposer_priority": "-1640085" + }, + { + "address": "3439FB7806A3661A7A53D6B28B6771ACD7B00411", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "BgVheyq/M9uPX8vbtgdrauoCH1k0wBqFSmL31/bN+RM=" + }, + "voting_power": "47696", + "proposer_priority": "-2264022" + }, + { + "address": "76EA8281CC939495A4A54656C59B9075E9257FC4", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "Lrk3ZO4JlCvfwge8yEO3GK7/SJS7ImXhRZdZE/8rseo=" + }, + "voting_power": "46733", + "proposer_priority": "-310182" + }, + { + "address": "684616FF14EAE8BE5613DA40864EA85812469308", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "T+dMEZ+Ds5YT2lVx58IMjsmQciIHKif7UYscvdFGyVE=" + }, + "voting_power": "43363", + "proposer_priority": "-3004842" + }, + { + "address": "43790BA2E57D02A8944B670B46D62ACBBDDE73FE", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "2Clqam9MlYsZsl7rpXWFRoEC4STewM85Z+8cdob6gJI=" + }, + "voting_power": "41030", + "proposer_priority": "-4256004" + }, + { + "address": "A35A6E459554E336C2A07CE78BA4EC1250AC3338", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "FCDoXNkWW6h5yB5h9F46R7gVVdgvqB2adObXkjhLCv4=" + }, + "voting_power": "40330", + "proposer_priority": "3092238" + }, + { + "address": "5802A80D39D378A6218E52F4EB50ECCF4583264B", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "VOdf1YQsfdhng0PZIXqLk+OCNoIGUTbBbYmkN9v+QEQ=" + }, + "voting_power": "33633", + "proposer_priority": "-3076932" + }, + { + "address": "8047FA49FCE5E85107E88AE0152E079D9CBD320F", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "9B4gQOiZX+DVSx+A/p9ROkfK6y6o6X7F7H1/x76BrZY=" + }, + "voting_power": "30871", + "proposer_priority": "473601" + }, + { + "address": "B4A950629CC31E385E6269F7B62314ED57650EE8", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "vQrkpE1LBhE8kTSmxymCuI8cBA2eOov9sU8gOG8phLw=" + }, + "voting_power": "30550", + "proposer_priority": "796223" + }, + { + "address": "B95ECC721FCDD6893107699AED4A0FAA62E97D11", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "L7hWjbX+9e8vVMNeAu6dC0CBg6YBaF/zQjSNyWku/bA=" + }, + "voting_power": "29867", + "proposer_priority": "-1761992" + }, + { + "address": "ED61B1DEE5F79C521F521B78DB93559FEB2E3B82", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "IG6iu/PKcapnSl58DsH6y1JlIv99KjSrZM14+eUILas=" + }, + "voting_power": "28549", + "proposer_priority": "3124891" + }, + { + "address": "A92A1DE1BB768A065F87DF5811FC0F32FA7CD57E", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "mk/qPAbVkTjNjHYnAsWlCxmWVzKKt/ojzq8l56rGo0w=" + }, + "voting_power": "26769", + "proposer_priority": "-1833659" + }, + { + "address": "83F719426E00721A9208DBFE2B30D6DC75FE6645", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "zbv8shGha/SDouyB2sOK1AovTo9XhejHU27j+2D+CZE=" + }, + "voting_power": "26485", + "proposer_priority": "-2269852" + }, + { + "address": "710FEF6FF4693C657CB24AADF1623E861A5AF906", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "8IY9X+l01DxmGMoR6K6uprK/Sy/kwvlkx85X8b0uP24=" + }, + "voting_power": "25357", + "proposer_priority": "3024460" + }, + { + "address": "C8BB72DD64C161F5A23874F480DCD12BD2C2647D", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "BMtmwph1ZwZzhktwUKNe4+SlfmGfvI4JyRRxLodd6VU=" + }, + "voting_power": "23132", + "proposer_priority": "-2397648" + }, + { + "address": "17E4639B5116509EC04C4AABFA69506317801783", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "y+utsHn6QYiX6CCBdYAAam2KRNoRvAGDBUam/oQ6xUw=" + }, + "voting_power": "22215", + "proposer_priority": "-4155051" + }, + { + "address": "1CDD0EF99F36CC3028237886FA00CE45AABD60E5", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "MaLV6YmPBWD9VB07GWq1+CQEkK36XtFOKteoMbYFcDo=" + }, + "voting_power": "21251", + "proposer_priority": "1856754" + }, + { + "address": "80DA42EB9A25BD341A18B2D989BB86DFD4413A05", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "Q0Ip8MkXMP65UcG3XQ08h0CZ8D3pSmQwPXCZsuHgBBY=" + }, + "voting_power": "18327", + "proposer_priority": "2675526" + }, + { + "address": "916D131FCDC899B83D0C3B56DDD6614B339C997E", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "/qEmmvQH3sm6lccuFbWi3WQ7Zix8lYanRpJIbaUzyig=" + }, + "voting_power": "16040", + "proposer_priority": "4781824" + }, + { + "address": "903EED41E608EFD3E2DBA2C561F7331C1AE0D82D", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "S2T1ECtywD912SDZ04fknyPtgp0QnrkSoFcbawOqnyQ=" + }, + "voting_power": "15878", + "proposer_priority": "2102724" + }, + { + "address": "A262DDACC4F532340A2B389CF3EAA29B6846D142", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "2vkzUgR+NY6/2b870xJ8tTZaXGmdKU7z7RZsVvqs6qI=" + }, + "voting_power": "15809", + "proposer_priority": "-2323061" + }, + { + "address": "9F579C855F835F1CB71ABF2960A244FC0AF671EA", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "StBLaUcTsB0WP52rMHlR4vVG1+h/GdHVv/PsRosE0KA=" + }, + "voting_power": "9907", + "proposer_priority": "1965802" + }, + { + "address": "2026B424B984B681F91C88874820CE927965C492", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "gc/zmjETfR/5k8y99qdYnrCi3r2xpG2fvA0xqw0ypgQ=" + }, + "voting_power": "9211", + "proposer_priority": "4976199" + }, + { + "address": "92C70850FA51E11384826C5F574F5B13B5706554", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "fc/uPJqGQVezA4dP9QQGIW+9pKI3ZbNRLnjfAxST6Wk=" + }, + "voting_power": "9071", + "proposer_priority": "-3211443" + }, + { + "address": "1A30424D3A05B7E61B1936477C338E316E5D7D66", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "kv7kHkUuMK26OsQaCFijOxUgyUUSjZGzJx4uo0AQ8nI=" + }, + "voting_power": "8479", + "proposer_priority": "-3003495" + }, + { + "address": "CB1814F7CDAFE24C0A836B627082710636562B98", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "mrO3rLYqtzjKqQ8jG5yad5d4/0y3nuGC7vdwHYrq+ok=" + }, + "voting_power": "6169", + "proposer_priority": "-4272493" + }, + { + "address": "DC9424AFE6C83F68813337B5FB4EC62C2330C9E6", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "q/L9gc2ZIdsdsHo553UwGIamlLfwhBRQy6dhchS8WTc=" + }, + "voting_power": "5887", + "proposer_priority": "1013498" + }, + { + "address": "91938313E6AC32D56F07B39ACC580B1E7E5A29E8", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "P5+60QYJ00LqnNqfzMzIA0Z7u1mIAxIFCkujt+3imgM=" + }, + "voting_power": "5740", + "proposer_priority": "-3820735" + }, + { + "address": "6A24190F2C8C0878BB134D146FE9333094171256", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "K89oBGiO66xsdgY3BMwMF6nYQlB0BNnw/dBLeFK52Oc=" + }, + "voting_power": "1846", + "proposer_priority": "-2486311" + }, + { + "address": "60A7F8F9EE0BE23DAC5183B36BEB14AEF2D3A879", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "aGn1HF9e4nIZ1CjwhHZSWekijRO7bq/ZKV384/zmHzY=" + }, + "voting_power": "1000", + "proposer_priority": "1955869" + }, + { + "address": "43FC3AB6FE3D33C41842553EAFC8393A7FD00C23", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "701IrRX2fUrkoMUtdmTr5JiIZqdgHpcga1WKoV7PSMU=" + }, + "voting_power": "730", + "proposer_priority": "-616835" + }, + { + "address": "B684A0D2CB2D1AC7F9AC890B4678006A1D5B09E0", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "ZX0ywGqfB+Mi5B5QzKx0dLzDo6ua2eqcufdzDPUB5p4=" + }, + "voting_power": "384", + "proposer_priority": "-5656030" + }, + { + "address": "19DD6B3CA0DEB5F6FE0E1A78AD53D408EA0CA8F0", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "ifW74P0qYAclokjCrd4+RKHMnQAI/7HqGJZ9bg77dc4=" + }, + "voting_power": "261", + "proposer_priority": "1835871" + }, + { + "address": "987AF576DFCAE3B71C38FC729174739811C6626A", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "ZN84hF2H+G8s5/Uw3pFwcYGdmmGobdsxVPistm+vzZQ=" + }, + "voting_power": "225", + "proposer_priority": "1652773" + }, + { + "address": "BAFE51BA7636EFAA64E59649321EAFC4E1D0F03B", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "9fHwtNKyrmNMxsCIssQXqobIr917hNJuDo333IIyyGM=" + }, + "voting_power": "150", + "proposer_priority": "-5093203" + }, + { + "address": "AB135B41694E5EC24367110CC9DB1DC7852D6E82", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "ZTUVskeDW2DxxHSViecAFSHRamNHGoGoEQEPRt58tuY=" + }, + "voting_power": "90", + "proposer_priority": "-4554993" + }, + { + "address": "5C950EA844C3F38BB3BB51C6634FFAE18DBE8811", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "w/n2tngzQcP5viXuhxa5bCEDlll+qVpLZkuN0MfmWZU=" + }, + "voting_power": "81", + "proposer_priority": "-5953389" + }, + { + "address": "B4BB763F2BCDF710991355B1FE4FDCE83C0874A2", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "iBTM2Vpl0CML5bD3vQ+dnglrSypX/Hpr9p4pwlVeHxY=" + }, + "voting_power": "69", + "proposer_priority": "2646446" + }, + { + "address": "63C90F79BA2F2248628BC76D5C038492674EEB91", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "/Cp3v8ADUev/rWKMC+gLrdi3m+526vy4JJT/ebJE3U0=" + }, + "voting_power": "57", + "proposer_priority": "-2513443" + }, + { + "address": "94D21453B366ADA7F50F12CA907CDA7A4AB7F214", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "LGUlm/88HsFcGoonV9h4LePeWrzHdOgRl0qZE0WICec=" + }, + "voting_power": "52", + "proposer_priority": "2287337" + }, + { + "address": "B699C4799E8F6C7D038682C0441AD28E6E43E677", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "GOg/7baoMkm6MO9kmIkv/xtMarRZ5uc/mz9i3BO3hZw=" + }, + "voting_power": "42", + "proposer_priority": "1408608" + }, + { + "address": "246C9C9846C2899D0DA109BCFADAA6260685B4C3", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "6AhtT5V0/eu3BIve9qKpTPcULe6wYrcPuhcpeRnMSyw=" + }, + "voting_power": "14", + "proposer_priority": "1777058" + }, + { + "address": "E3DF8B64C6EE018BE7EC6BB9BC3ABFB67D99A630", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "wbNefAPhut94zca74ZCGHmboBqrA464/EyHlEekMcow=" + }, + "voting_power": "10", + "proposer_priority": "-4261171" + }, + { + "address": "CF941683BB7851E824695E7ABA86D57C6E32F5D3", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "f+wg6V3z8g55vgzneEjhH6gJmgi1P/P7SDbbGh3scVQ=" + }, + "voting_power": "7", + "proposer_priority": "1153279" + }, + { + "address": "7219BF2BF60498F19DC51B33588DEB9F9D30B392", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "ZCc3n6I7Q5ruFFHwv//XECvdo+COsQ3Dqv6TYlcz0IQ=" + }, + "voting_power": "6", + "proposer_priority": "881212" + }, + { + "address": "75B513290765236B2F1C3FCAACF35A7FBAFBFB6F", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "A4w47f3apgLgG7raSzYedv3zc1Kan2UD+QQdPWPmYbI=" + }, + "voting_power": "6", + "proposer_priority": "1162151" + }, + { + "address": "3C672A568D8B4D3261132A92CC572F21D4F85C1C", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "rfWvXM+dxHvTgRSwkghWozA2+OTMUsD3RmYT66sZ8qs=" + }, + "voting_power": "5", + "proposer_priority": "1087491" + }, + { + "address": "208FF031498FA42FFED6829C8A4884CDC72BE06A", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "XT5lav9vOFVUo6FCh1sHr0S1TirnUKpHkj8UOevzmBM=" + }, + "voting_power": "2", + "proposer_priority": "768825" + }, + { + "address": "CA572745CF6C1437547BB3961D3D04EE8C88DA30", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "pe5spRJgTVbEStc6eRp1Blx6ZKA/nTmP/UveU5hLS70=" + }, + "voting_power": "2", + "proposer_priority": "607482" + }, + { + "address": "164A8F8019C8B800A8BEB03CA04428B881812E04", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "168Mb6oUPPq8g+8e0PsuiBx8bBzbgr1fVeiqn8E2uEg=" + }, + "voting_power": "1", + "proposer_priority": "34084" + }, + { + "address": "206DC4AC92A0CF215D8C8AF98B7A84966CE43E45", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "Mm9lw9+Fb4iTg/HkSnR4/ob7VLVwsVM8Ncumtn8z180=" + }, + "voting_power": "1", + "proposer_priority": "479047" + }, + { + "address": "3655C2522526E342E1BAE250B7E01C728E97BF61", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "8C8ObB/ueQs9fK4voPVLmW5MoMWXigTezprUdsOVLuQ=" + }, + "voting_power": "1", + "proposer_priority": "462175" + }, + { + "address": "50A7130BA74D071391EF45678BE2444955FA4AD4", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "mE2ULx0G812VEr8mqvKXMHKEF4tL0k5NKjgFHbMlKtw=" + }, + "voting_power": "1", + "proposer_priority": "102182" + }, + { + "address": "556EA605A9374CE54C157DD42395B4047E327914", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "hxjD2336gspNuI5EZw+HPrN0wyLj22HNFj5NnBRHCyY=" + }, + "voting_power": "1", + "proposer_priority": "469154" + }, + { + "address": "64BBCDCC1BA3D6CB934A5BBC9F45121A40EF81B2", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "HkAl1eQI+xYKK7CfEz2CfBhN+1t62p2uEtRN04GrpSk=" + }, + "voting_power": "1", + "proposer_priority": "51674" + }, + { + "address": "6B00AA4C9E824A9E042AA49A5CF40591FDFF2021", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "VusjapHUOkaqArduuT7dxw50KHYGs+rlTgh8yYNqBrw=" + }, + "voting_power": "1", + "proposer_priority": "42735" + }, + { + "address": "A2E2A0CC28C652A9EA47D666B2CDE5122DE5A8E1", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "vm9wtXNrD25uUp+0jd/+tFKHwLavQ9aKMx3G6ORpzoY=" + }, + "voting_power": "1", + "proposer_priority": "-588603" + }, + { + "address": "E314D1F70E07277B21E80FBF4BCA6AFBDB07C367", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "+B7kI0VIsl1OEnGKsRFLdNRtUsG54fGBvT9ic5H+46Y=" + }, + "voting_power": "1", + "proposer_priority": "117830" + } + ], + "count": "73", + "total": "73" +} \ No newline at end of file diff --git a/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/simple/commit.1.json b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/simple/commit.1.json new file mode 100644 index 000000000..c81accb69 --- /dev/null +++ b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/simple/commit.1.json @@ -0,0 +1,48 @@ +{ + "signed_header": { + "header": { + "version": { + "block": "11" + }, + "chain_id": "constantine-1", + "height": "600000", + "time": "2023-02-27T10:17:56.252368746Z", + "last_block_id": { + "hash": "A5103ECD1C6655398B63C8DC05171D828174572EDDF2B3C73E5BD4C5D47A31FE", + "parts": { + "total": 1, + "hash": "97EF30567AA0FA6254AA9CA68172DEA9FC68A6D3DA81D5AA47D2FE990C21472E" + } + }, + "last_commit_hash": "DBE402AD7A9530D58B30E4A394713F77567A5CEE9023FE1819FC3EF902BF587C", + "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "validators_hash": "E9C656841119D33056056DFE6FCC1F833BD55AF231C27326432579E9AFAE9DA8", + "next_validators_hash": "E9C656841119D33056056DFE6FCC1F833BD55AF231C27326432579E9AFAE9DA8", + "consensus_hash": "3AB4B0648EC46497FE810009B6AB29A5E18983B0A615BE174305F94968486602", + "app_hash": "27BA3C0678BF7F5C1567405E4511FE44B4131468FFF97EE7C4F895ABD4EEB76D", + "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "proposer_address": "227950C1373382B7B12B2A1A12FFD9FC2C4A60FD" + }, + "commit": { + "height": "600000", + "round": 0, + "block_id": { + "hash": "D85FAAEE1D9F90220B2E968B6DF69DC13B25F1E999554436DB3396F3A26BE626", + "parts": { + "total": 1, + "hash": "C33D4BFA5C6C61098F0AF84BC77D45DC324D776AAD92AB095D0D68DDC1F38BDB" + } + }, + "signatures": [ + { + "block_id_flag": 2, + "validator_address": "227950C1373382B7B12B2A1A12FFD9FC2C4A60FD", + "timestamp": "2023-02-27T10:18:01.280744845Z", + "signature": "pU32m1HxXePffgQp6Vfb92oNIiuSmSTWF08zgFou6ixNQyKA4MgdkKcKRqSaBLZWIyaJL3+y9XpYQF/47T/1DQ==" + } + ] + } + }, + "canonical": true +} \ No newline at end of file diff --git a/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/simple/commit.2.json b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/simple/commit.2.json new file mode 100644 index 000000000..d25b0e504 --- /dev/null +++ b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/simple/commit.2.json @@ -0,0 +1,47 @@ +{ + "signed_header": { + "header": { + "version": { + "block": "11" + }, + "chain_id": "constantine-1", + "height": "600050", + "time": "2023-02-27T10:22:07.868871373Z", + "last_block_id": { + "hash": "E3430B303BD920B672C06AD0B85FD0A6E1DD1265195F569141AA1ADC9474A79A", + "parts": { + "total": 1, + "hash": "E6C2B9E50E197EBCEB681BC8694F0C0D777D1F8C0F19CA1297AB153C35CAA66D" + } + }, + "last_commit_hash": "7B5BB01ECB16A9A1D0B88AC162E9053CE719DB159E5AB94844F71AFB43C7305E", + "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "validators_hash": "E9C656841119D33056056DFE6FCC1F833BD55AF231C27326432579E9AFAE9DA8", + "next_validators_hash": "E9C656841119D33056056DFE6FCC1F833BD55AF231C27326432579E9AFAE9DA8", + "consensus_hash": "3AB4B0648EC46497FE810009B6AB29A5E18983B0A615BE174305F94968486602", + "app_hash": "26A5F36E17C8F3E755214539FB367063C8D11C9064D6A0EBDBF3892EA6EFCD4C", + "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "proposer_address": "227950C1373382B7B12B2A1A12FFD9FC2C4A60FD" + }, + "commit": { + "height": "600050", + "round": 0, + "block_id": { + "hash": "FDFD129A34954000DF019F2EC84AE2748F0552A6C1D970A25D2998F3A4DA16D2", + "parts": { + "total": 1, + "hash": "B54FD2705B47AF15CBE31F6124209CC1E5C92C26FEF160A5A113C2FDA88231B2" + } + }, + "signatures": [ + { + "block_id_flag": 2, + "validator_address": "227950C1373382B7B12B2A1A12FFD9FC2C4A60FD", + "timestamp": "2023-02-27T10:22:12.898442942Z", + "signature": "XEBf5ACNZPLDDhbeGINBxOlNcjXN+R3jFD0pqAR4DCWprjd8mCQ7ZwBKWrnH7Yml/z0RUTocWgoDlXbrCkyeCg==" + } + ] + } + } +} \ No newline at end of file diff --git a/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/simple/commit.3.json b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/simple/commit.3.json new file mode 100644 index 000000000..cfd7cb1f7 --- /dev/null +++ b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/simple/commit.3.json @@ -0,0 +1,47 @@ +{ + "signed_header": { + "header": { + "version": { + "block": "11" + }, + "chain_id": "constantine-1", + "height": "600150", + "time": "2023-02-27T10:30:30.883073319Z", + "last_block_id": { + "hash": "705ADB526F8C3FE310FED0AB7BB3BD42BB6C7D89F5B76418AD7E1AFAC4341626", + "parts": { + "total": 1, + "hash": "DFBFC3779F20B3262FC0872DDFC5613C49BB163D343E974944C0E8A6F5BC7B18" + } + }, + "last_commit_hash": "C3D3AFE06B44A4B7F3D685CF48ADA835A4ADE47D352A49D95A4CD419067A7243", + "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "validators_hash": "E9C656841119D33056056DFE6FCC1F833BD55AF231C27326432579E9AFAE9DA8", + "next_validators_hash": "E9C656841119D33056056DFE6FCC1F833BD55AF231C27326432579E9AFAE9DA8", + "consensus_hash": "3AB4B0648EC46497FE810009B6AB29A5E18983B0A615BE174305F94968486602", + "app_hash": "2B0114371B2B33F0C46AAFCC7E17438F5A8EC75C750E59E17C7E340747947E40", + "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "proposer_address": "227950C1373382B7B12B2A1A12FFD9FC2C4A60FD" + }, + "commit": { + "height": "600150", + "round": 0, + "block_id": { + "hash": "7AA9D57C1BA0CDDD56B12604EB8B04ED3F69DB4651603EFEE29C1065B7923632", + "parts": { + "total": 1, + "hash": "818818B976E21D30E9A3EF119408383BA39934363B63AE1D4EC6889615DCAFFE" + } + }, + "signatures": [ + { + "block_id_flag": 2, + "validator_address": "227950C1373382B7B12B2A1A12FFD9FC2C4A60FD", + "timestamp": "2023-02-27T10:30:35.914861058Z", + "signature": "y26e+j5jkuzd3RRTKMLfgLLCa42En01xOCkqBfVErzJ5sB3oBh7/OR29uXc4a656HImFN+nkCQsmNOuKB2KfCg==" + } + ] + } + } +} \ No newline at end of file diff --git a/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/simple/validators.1.json b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/simple/validators.1.json new file mode 100644 index 000000000..1925dc51d --- /dev/null +++ b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/simple/validators.1.json @@ -0,0 +1,16 @@ +{ + "block_height": "600000", + "validators": [ + { + "address": "227950C1373382B7B12B2A1A12FFD9FC2C4A60FD", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "aaUuEVdox13TAVptDii1sThWwRz7EkEGrXAx0polEpo=" + }, + "voting_power": "100000049", + "proposer_priority": "0" + } + ], + "count": "1", + "total": "1" +} \ No newline at end of file diff --git a/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/simple/validators.2.json b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/simple/validators.2.json new file mode 100644 index 000000000..eb02cdd6b --- /dev/null +++ b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/simple/validators.2.json @@ -0,0 +1,16 @@ +{ + "block_height": "600050", + "validators": [ + { + "address": "227950C1373382B7B12B2A1A12FFD9FC2C4A60FD", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "aaUuEVdox13TAVptDii1sThWwRz7EkEGrXAx0polEpo=" + }, + "voting_power": "100000049", + "proposer_priority": "0" + } + ], + "count": "1", + "total": "1" +} \ No newline at end of file diff --git a/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/simple/validators.3.json b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/simple/validators.3.json new file mode 100644 index 000000000..d4ef50946 --- /dev/null +++ b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/data/simple/validators.3.json @@ -0,0 +1,16 @@ +{ + "block_height": "600150", + "validators": [ + { + "address": "227950C1373382B7B12B2A1A12FFD9FC2C4A60FD", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "aaUuEVdox13TAVptDii1sThWwRz7EkEGrXAx0polEpo=" + }, + "voting_power": "100000049", + "proposer_priority": "0" + } + ], + "count": "1", + "total": "1" +} \ No newline at end of file diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/amino/AminoProto.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/amino/AminoProto.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/amino/AminoProto.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/amino/AminoProto.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/BatchEntry.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/ics23/v1/BatchEntry.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/BatchEntry.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/ics23/v1/BatchEntry.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/BatchEntryOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/ics23/v1/BatchEntryOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/BatchEntryOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/ics23/v1/BatchEntryOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/BatchProof.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/ics23/v1/BatchProof.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/BatchProof.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/ics23/v1/BatchProof.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/BatchProofOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/ics23/v1/BatchProofOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/BatchProofOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/ics23/v1/BatchProofOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/CommitmentProof.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/ics23/v1/CommitmentProof.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/CommitmentProof.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/ics23/v1/CommitmentProof.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/CommitmentProofOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/ics23/v1/CommitmentProofOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/CommitmentProofOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/ics23/v1/CommitmentProofOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/CompressedBatchEntry.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/ics23/v1/CompressedBatchEntry.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/CompressedBatchEntry.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/ics23/v1/CompressedBatchEntry.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/CompressedBatchEntryOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/ics23/v1/CompressedBatchEntryOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/CompressedBatchEntryOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/ics23/v1/CompressedBatchEntryOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/CompressedBatchProof.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/ics23/v1/CompressedBatchProof.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/CompressedBatchProof.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/ics23/v1/CompressedBatchProof.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/CompressedBatchProofOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/ics23/v1/CompressedBatchProofOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/CompressedBatchProofOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/ics23/v1/CompressedBatchProofOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/CompressedExistenceProof.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/ics23/v1/CompressedExistenceProof.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/CompressedExistenceProof.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/ics23/v1/CompressedExistenceProof.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/CompressedExistenceProofOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/ics23/v1/CompressedExistenceProofOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/CompressedExistenceProofOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/ics23/v1/CompressedExistenceProofOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/CompressedNonExistenceProof.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/ics23/v1/CompressedNonExistenceProof.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/CompressedNonExistenceProof.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/ics23/v1/CompressedNonExistenceProof.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/CompressedNonExistenceProofOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/ics23/v1/CompressedNonExistenceProofOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/CompressedNonExistenceProofOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/ics23/v1/CompressedNonExistenceProofOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/ExistenceProof.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/ics23/v1/ExistenceProof.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/ExistenceProof.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/ics23/v1/ExistenceProof.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/ExistenceProofOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/ics23/v1/ExistenceProofOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/ExistenceProofOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/ics23/v1/ExistenceProofOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/HashOp.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/ics23/v1/HashOp.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/HashOp.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/ics23/v1/HashOp.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/InnerOp.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/ics23/v1/InnerOp.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/InnerOp.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/ics23/v1/InnerOp.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/InnerOpOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/ics23/v1/InnerOpOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/InnerOpOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/ics23/v1/InnerOpOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/InnerSpec.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/ics23/v1/InnerSpec.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/InnerSpec.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/ics23/v1/InnerSpec.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/InnerSpecOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/ics23/v1/InnerSpecOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/InnerSpecOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/ics23/v1/InnerSpecOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/LeafOp.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/ics23/v1/LeafOp.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/LeafOp.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/ics23/v1/LeafOp.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/LeafOpOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/ics23/v1/LeafOpOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/LeafOpOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/ics23/v1/LeafOpOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/LengthOp.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/ics23/v1/LengthOp.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/LengthOp.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/ics23/v1/LengthOp.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/NonExistenceProof.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/ics23/v1/NonExistenceProof.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/NonExistenceProof.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/ics23/v1/NonExistenceProof.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/NonExistenceProofOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/ics23/v1/NonExistenceProofOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/NonExistenceProofOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/ics23/v1/NonExistenceProofOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/ProofSpec.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/ics23/v1/ProofSpec.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/ProofSpec.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/ics23/v1/ProofSpec.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/ProofSpecOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/ics23/v1/ProofSpecOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/ProofSpecOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/ics23/v1/ProofSpecOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/ProofsProto.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/ics23/v1/ProofsProto.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/ics23/v1/ProofsProto.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/ics23/v1/ProofsProto.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/upgrade/v1beta1/CancelSoftwareUpgradeProposal.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/upgrade/v1beta1/CancelSoftwareUpgradeProposal.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/upgrade/v1beta1/CancelSoftwareUpgradeProposal.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/upgrade/v1beta1/CancelSoftwareUpgradeProposal.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/upgrade/v1beta1/CancelSoftwareUpgradeProposalOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/upgrade/v1beta1/CancelSoftwareUpgradeProposalOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/upgrade/v1beta1/CancelSoftwareUpgradeProposalOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/upgrade/v1beta1/CancelSoftwareUpgradeProposalOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/upgrade/v1beta1/ModuleVersion.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/upgrade/v1beta1/ModuleVersion.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/upgrade/v1beta1/ModuleVersion.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/upgrade/v1beta1/ModuleVersion.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/upgrade/v1beta1/ModuleVersionOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/upgrade/v1beta1/ModuleVersionOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/upgrade/v1beta1/ModuleVersionOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/upgrade/v1beta1/ModuleVersionOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/upgrade/v1beta1/Plan.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/upgrade/v1beta1/Plan.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/upgrade/v1beta1/Plan.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/upgrade/v1beta1/Plan.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/upgrade/v1beta1/PlanOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/upgrade/v1beta1/PlanOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/upgrade/v1beta1/PlanOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/upgrade/v1beta1/PlanOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/upgrade/v1beta1/SoftwareUpgradeProposal.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/upgrade/v1beta1/SoftwareUpgradeProposal.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/upgrade/v1beta1/SoftwareUpgradeProposal.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/upgrade/v1beta1/SoftwareUpgradeProposal.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/upgrade/v1beta1/SoftwareUpgradeProposalOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/upgrade/v1beta1/SoftwareUpgradeProposalOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/upgrade/v1beta1/SoftwareUpgradeProposalOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/upgrade/v1beta1/SoftwareUpgradeProposalOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/upgrade/v1beta1/UpgradeProto.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/upgrade/v1beta1/UpgradeProto.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos/upgrade/v1beta1/UpgradeProto.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos/upgrade/v1beta1/UpgradeProto.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos_proto/CosmosProto.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos_proto/CosmosProto.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos_proto/CosmosProto.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos_proto/CosmosProto.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos_proto/InterfaceDescriptor.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos_proto/InterfaceDescriptor.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos_proto/InterfaceDescriptor.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos_proto/InterfaceDescriptor.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos_proto/InterfaceDescriptorOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos_proto/InterfaceDescriptorOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos_proto/InterfaceDescriptorOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos_proto/InterfaceDescriptorOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos_proto/ScalarDescriptor.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos_proto/ScalarDescriptor.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos_proto/ScalarDescriptor.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos_proto/ScalarDescriptor.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos_proto/ScalarDescriptorOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos_proto/ScalarDescriptorOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos_proto/ScalarDescriptorOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos_proto/ScalarDescriptorOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos_proto/ScalarType.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos_proto/ScalarType.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/cosmos_proto/ScalarType.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/cosmos_proto/ScalarType.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/gogoproto/GogoProto.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/gogoproto/GogoProto.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/gogoproto/GogoProto.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/gogoproto/GogoProto.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/ClientConsensusStates.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/ibc/core/client/v1/ClientConsensusStates.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/ClientConsensusStates.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/ibc/core/client/v1/ClientConsensusStates.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/ClientConsensusStatesOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/ibc/core/client/v1/ClientConsensusStatesOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/ClientConsensusStatesOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/ibc/core/client/v1/ClientConsensusStatesOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/ClientProto.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/ibc/core/client/v1/ClientProto.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/ClientProto.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/ibc/core/client/v1/ClientProto.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/ClientUpdateProposal.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/ibc/core/client/v1/ClientUpdateProposal.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/ClientUpdateProposal.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/ibc/core/client/v1/ClientUpdateProposal.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/ClientUpdateProposalOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/ibc/core/client/v1/ClientUpdateProposalOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/ClientUpdateProposalOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/ibc/core/client/v1/ClientUpdateProposalOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/ConsensusStateWithHeight.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/ibc/core/client/v1/ConsensusStateWithHeight.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/ConsensusStateWithHeight.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/ibc/core/client/v1/ConsensusStateWithHeight.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/ConsensusStateWithHeightOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/ibc/core/client/v1/ConsensusStateWithHeightOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/ConsensusStateWithHeightOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/ibc/core/client/v1/ConsensusStateWithHeightOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/Height.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/ibc/core/client/v1/Height.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/Height.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/ibc/core/client/v1/Height.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/HeightOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/ibc/core/client/v1/HeightOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/HeightOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/ibc/core/client/v1/HeightOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/IdentifiedClientState.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/ibc/core/client/v1/IdentifiedClientState.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/IdentifiedClientState.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/ibc/core/client/v1/IdentifiedClientState.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/IdentifiedClientStateOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/ibc/core/client/v1/IdentifiedClientStateOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/IdentifiedClientStateOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/ibc/core/client/v1/IdentifiedClientStateOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/Params.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/ibc/core/client/v1/Params.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/Params.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/ibc/core/client/v1/Params.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/ParamsOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/ibc/core/client/v1/ParamsOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/ParamsOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/ibc/core/client/v1/ParamsOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/UpgradeProposal.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/ibc/core/client/v1/UpgradeProposal.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/UpgradeProposal.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/ibc/core/client/v1/UpgradeProposal.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/UpgradeProposalOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/ibc/core/client/v1/UpgradeProposalOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/client/v1/UpgradeProposalOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/ibc/core/client/v1/UpgradeProposalOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/commitment/v1/CommitmentProto.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/ibc/core/commitment/v1/CommitmentProto.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/commitment/v1/CommitmentProto.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/ibc/core/commitment/v1/CommitmentProto.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/commitment/v1/MerklePath.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/ibc/core/commitment/v1/MerklePath.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/commitment/v1/MerklePath.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/ibc/core/commitment/v1/MerklePath.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/commitment/v1/MerklePathOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/ibc/core/commitment/v1/MerklePathOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/commitment/v1/MerklePathOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/ibc/core/commitment/v1/MerklePathOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/commitment/v1/MerklePrefix.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/ibc/core/commitment/v1/MerklePrefix.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/commitment/v1/MerklePrefix.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/ibc/core/commitment/v1/MerklePrefix.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/commitment/v1/MerklePrefixOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/ibc/core/commitment/v1/MerklePrefixOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/commitment/v1/MerklePrefixOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/ibc/core/commitment/v1/MerklePrefixOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/commitment/v1/MerkleProof.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/ibc/core/commitment/v1/MerkleProof.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/commitment/v1/MerkleProof.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/ibc/core/commitment/v1/MerkleProof.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/commitment/v1/MerkleProofOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/ibc/core/commitment/v1/MerkleProofOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/commitment/v1/MerkleProofOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/ibc/core/commitment/v1/MerkleProofOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/commitment/v1/MerkleRoot.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/ibc/core/commitment/v1/MerkleRoot.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/commitment/v1/MerkleRoot.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/ibc/core/commitment/v1/MerkleRoot.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/commitment/v1/MerkleRootOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/ibc/core/commitment/v1/MerkleRootOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/core/commitment/v1/MerkleRootOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/ibc/core/commitment/v1/MerkleRootOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/lightclients/tendermint/v1/ClientState.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/ibc/lightclients/tendermint/v1/ClientState.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/lightclients/tendermint/v1/ClientState.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/ibc/lightclients/tendermint/v1/ClientState.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/lightclients/tendermint/v1/ClientStateOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/ibc/lightclients/tendermint/v1/ClientStateOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/lightclients/tendermint/v1/ClientStateOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/ibc/lightclients/tendermint/v1/ClientStateOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/lightclients/tendermint/v1/ConsensusState.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/ibc/lightclients/tendermint/v1/ConsensusState.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/lightclients/tendermint/v1/ConsensusState.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/ibc/lightclients/tendermint/v1/ConsensusState.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/lightclients/tendermint/v1/ConsensusStateOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/ibc/lightclients/tendermint/v1/ConsensusStateOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/lightclients/tendermint/v1/ConsensusStateOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/ibc/lightclients/tendermint/v1/ConsensusStateOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/lightclients/tendermint/v1/Fraction.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/ibc/lightclients/tendermint/v1/Fraction.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/lightclients/tendermint/v1/Fraction.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/ibc/lightclients/tendermint/v1/Fraction.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/lightclients/tendermint/v1/FractionOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/ibc/lightclients/tendermint/v1/FractionOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/lightclients/tendermint/v1/FractionOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/ibc/lightclients/tendermint/v1/FractionOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/lightclients/tendermint/v1/Header.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/ibc/lightclients/tendermint/v1/Header.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/lightclients/tendermint/v1/Header.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/ibc/lightclients/tendermint/v1/Header.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/lightclients/tendermint/v1/HeaderOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/ibc/lightclients/tendermint/v1/HeaderOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/lightclients/tendermint/v1/HeaderOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/ibc/lightclients/tendermint/v1/HeaderOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/lightclients/tendermint/v1/Misbehaviour.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/ibc/lightclients/tendermint/v1/Misbehaviour.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/lightclients/tendermint/v1/Misbehaviour.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/ibc/lightclients/tendermint/v1/Misbehaviour.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/lightclients/tendermint/v1/MisbehaviourOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/ibc/lightclients/tendermint/v1/MisbehaviourOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/lightclients/tendermint/v1/MisbehaviourOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/ibc/lightclients/tendermint/v1/MisbehaviourOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/lightclients/tendermint/v1/TendermintLightProto.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/ibc/lightclients/tendermint/v1/TendermintLightProto.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/ibc/lightclients/tendermint/v1/TendermintLightProto.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/ibc/lightclients/tendermint/v1/TendermintLightProto.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/lightclient/v1/BlockUpdate.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/lightclient/v1/BlockUpdate.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/lightclient/v1/BlockUpdate.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/lightclient/v1/BlockUpdate.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/lightclient/v1/BlockUpdateOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/lightclient/v1/BlockUpdateOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/lightclient/v1/BlockUpdateOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/lightclient/v1/BlockUpdateOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/lightclient/v1/ClientState.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/lightclient/v1/ClientState.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/lightclient/v1/ClientState.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/lightclient/v1/ClientState.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/lightclient/v1/ClientStateOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/lightclient/v1/ClientStateOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/lightclient/v1/ClientStateOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/lightclient/v1/ClientStateOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/lightclient/v1/ConsensusState.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/lightclient/v1/ConsensusState.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/lightclient/v1/ConsensusState.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/lightclient/v1/ConsensusState.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/lightclient/v1/ConsensusStateOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/lightclient/v1/ConsensusStateOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/lightclient/v1/ConsensusStateOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/lightclient/v1/ConsensusStateOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/lightclient/v1/LightProto.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/lightclient/v1/LightProto.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/lightclient/v1/LightProto.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/lightclient/v1/LightProto.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/lightclient/v1/Misbehaviour.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/lightclient/v1/Misbehaviour.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/lightclient/v1/Misbehaviour.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/lightclient/v1/Misbehaviour.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/lightclient/v1/MisbehaviourOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/lightclient/v1/MisbehaviourOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/lightclient/v1/MisbehaviourOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/lightclient/v1/MisbehaviourOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/lightclient/v1/TrustLevel.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/lightclient/v1/TrustLevel.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/lightclient/v1/TrustLevel.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/lightclient/v1/TrustLevel.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/lightclient/v1/TrustLevelOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/lightclient/v1/TrustLevelOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/lightclient/v1/TrustLevelOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/lightclient/v1/TrustLevelOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/channel/Channel.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/channel/Channel.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/channel/Channel.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/channel/Channel.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/channel/ChannelOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/channel/ChannelOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/channel/ChannelOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/channel/ChannelOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/channel/ChannelProto.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/channel/ChannelProto.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/channel/ChannelProto.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/channel/ChannelProto.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/channel/Packet.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/channel/Packet.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/channel/Packet.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/channel/Packet.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/channel/PacketOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/channel/PacketOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/channel/PacketOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/channel/PacketOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/channel/PacketState.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/channel/PacketState.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/channel/PacketState.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/channel/PacketState.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/channel/PacketStateOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/channel/PacketStateOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/channel/PacketStateOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/channel/PacketStateOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/client/ClientProto.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/client/ClientProto.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/client/ClientProto.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/client/ClientProto.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/client/Height.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/client/Height.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/client/Height.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/client/Height.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/client/HeightOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/client/HeightOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/client/HeightOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/client/HeightOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/BatchEntry.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/BatchEntry.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/BatchEntry.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/BatchEntry.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/BatchEntryOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/BatchEntryOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/BatchEntryOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/BatchEntryOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/BatchProof.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/BatchProof.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/BatchProof.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/BatchProof.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/BatchProofOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/BatchProofOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/BatchProofOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/BatchProofOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/CommitmentProof.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/CommitmentProof.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/CommitmentProof.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/CommitmentProof.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/CommitmentProofOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/CommitmentProofOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/CommitmentProofOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/CommitmentProofOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/CommitmentProto.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/CommitmentProto.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/CommitmentProto.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/CommitmentProto.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/CompressedBatchEntry.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/CompressedBatchEntry.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/CompressedBatchEntry.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/CompressedBatchEntry.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/CompressedBatchEntryOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/CompressedBatchEntryOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/CompressedBatchEntryOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/CompressedBatchEntryOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/CompressedBatchProof.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/CompressedBatchProof.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/CompressedBatchProof.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/CompressedBatchProof.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/CompressedBatchProofOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/CompressedBatchProofOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/CompressedBatchProofOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/CompressedBatchProofOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/CompressedExistenceProof.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/CompressedExistenceProof.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/CompressedExistenceProof.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/CompressedExistenceProof.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/CompressedExistenceProofOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/CompressedExistenceProofOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/CompressedExistenceProofOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/CompressedExistenceProofOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/CompressedNonExistenceProof.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/CompressedNonExistenceProof.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/CompressedNonExistenceProof.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/CompressedNonExistenceProof.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/CompressedNonExistenceProofOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/CompressedNonExistenceProofOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/CompressedNonExistenceProofOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/CompressedNonExistenceProofOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/ExistenceProof.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/ExistenceProof.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/ExistenceProof.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/ExistenceProof.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/ExistenceProofOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/ExistenceProofOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/ExistenceProofOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/ExistenceProofOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/HashOp.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/HashOp.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/HashOp.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/HashOp.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/InnerOp.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/InnerOp.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/InnerOp.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/InnerOp.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/InnerOpOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/InnerOpOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/InnerOpOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/InnerOpOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/InnerSpec.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/InnerSpec.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/InnerSpec.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/InnerSpec.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/InnerSpecOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/InnerSpecOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/InnerSpecOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/InnerSpecOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/LeafOp.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/LeafOp.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/LeafOp.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/LeafOp.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/LeafOpOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/LeafOpOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/LeafOpOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/LeafOpOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/LengthOp.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/LengthOp.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/LengthOp.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/LengthOp.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/MerklePath.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/MerklePath.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/MerklePath.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/MerklePath.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/MerklePathOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/MerklePathOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/MerklePathOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/MerklePathOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/MerklePrefix.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/MerklePrefix.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/MerklePrefix.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/MerklePrefix.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/MerklePrefixOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/MerklePrefixOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/MerklePrefixOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/MerklePrefixOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/MerkleProof.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/MerkleProof.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/MerkleProof.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/MerkleProof.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/MerkleProofOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/MerkleProofOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/MerkleProofOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/MerkleProofOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/MerkleRoot.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/MerkleRoot.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/MerkleRoot.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/MerkleRoot.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/MerkleRootOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/MerkleRootOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/MerkleRootOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/MerkleRootOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/NonExistenceProof.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/NonExistenceProof.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/NonExistenceProof.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/NonExistenceProof.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/NonExistenceProofOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/NonExistenceProofOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/NonExistenceProofOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/NonExistenceProofOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/ProofSpec.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/ProofSpec.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/ProofSpec.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/ProofSpec.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/ProofSpecOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/ProofSpecOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/ProofSpecOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/ProofSpecOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/ProofsProto.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/ProofsProto.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/commitment/ProofsProto.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/commitment/ProofsProto.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/connection/ConnectionEnd.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/connection/ConnectionEnd.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/connection/ConnectionEnd.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/connection/ConnectionEnd.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/connection/ConnectionEndOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/connection/ConnectionEndOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/connection/ConnectionEndOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/connection/ConnectionEndOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/connection/ConnectionProto.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/connection/ConnectionProto.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/connection/ConnectionProto.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/connection/ConnectionProto.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/connection/Counterparty.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/connection/Counterparty.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/connection/Counterparty.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/connection/Counterparty.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/connection/CounterpartyOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/connection/CounterpartyOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/connection/CounterpartyOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/connection/CounterpartyOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/connection/Version.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/connection/Version.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/connection/Version.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/connection/Version.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/connection/VersionOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/connection/VersionOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/proto/core/connection/VersionOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/proto/core/connection/VersionOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/types/v1/BTPHeader.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/types/v1/BTPHeader.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/types/v1/BTPHeader.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/types/v1/BTPHeader.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/types/v1/BTPHeaderOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/types/v1/BTPHeaderOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/types/v1/BTPHeaderOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/types/v1/BTPHeaderOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/types/v1/BlockIDFlag.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/types/v1/BlockIDFlag.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/types/v1/BlockIDFlag.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/types/v1/BlockIDFlag.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/types/v1/MerkleNode.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/types/v1/MerkleNode.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/types/v1/MerkleNode.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/types/v1/MerkleNode.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/types/v1/MerkleNodeOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/types/v1/MerkleNodeOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/types/v1/MerkleNodeOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/types/v1/MerkleNodeOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/types/v1/MerkleProofs.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/types/v1/MerkleProofs.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/types/v1/MerkleProofs.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/types/v1/MerkleProofs.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/types/v1/MerkleProofsOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/types/v1/MerkleProofsOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/types/v1/MerkleProofsOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/types/v1/MerkleProofsOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/types/v1/SignedHeader.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/types/v1/SignedHeader.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/types/v1/SignedHeader.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/types/v1/SignedHeader.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/types/v1/SignedHeaderOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/types/v1/SignedHeaderOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/types/v1/SignedHeaderOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/types/v1/SignedHeaderOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/types/v1/SignedMsgType.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/types/v1/SignedMsgType.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/types/v1/SignedMsgType.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/types/v1/SignedMsgType.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/types/v1/TypesProto.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/types/v1/TypesProto.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/icon/types/v1/TypesProto.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/icon/types/v1/TypesProto.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/DominoOp.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/crypto/DominoOp.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/DominoOp.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/crypto/DominoOp.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/DominoOpOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/crypto/DominoOpOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/DominoOpOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/crypto/DominoOpOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/KeysProto.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/crypto/KeysProto.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/KeysProto.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/crypto/KeysProto.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/Proof.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/crypto/Proof.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/Proof.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/crypto/Proof.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/ProofOp.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/crypto/ProofOp.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/ProofOp.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/crypto/ProofOp.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/ProofOpOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/crypto/ProofOpOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/ProofOpOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/crypto/ProofOpOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/ProofOps.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/crypto/ProofOps.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/ProofOps.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/crypto/ProofOps.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/ProofOpsOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/crypto/ProofOpsOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/ProofOpsOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/crypto/ProofOpsOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/ProofOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/crypto/ProofOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/ProofOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/crypto/ProofOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/ProofProto.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/crypto/ProofProto.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/ProofProto.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/crypto/ProofProto.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/PublicKey.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/crypto/PublicKey.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/PublicKey.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/crypto/PublicKey.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/PublicKeyOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/crypto/PublicKeyOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/PublicKeyOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/crypto/PublicKeyOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/ValueOp.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/crypto/ValueOp.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/ValueOp.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/crypto/ValueOp.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/ValueOpOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/crypto/ValueOpOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/crypto/ValueOpOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/crypto/ValueOpOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/BlockID.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/types/BlockID.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/BlockID.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/types/BlockID.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/BlockIDFlag.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/types/BlockIDFlag.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/BlockIDFlag.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/types/BlockIDFlag.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/BlockIDOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/types/BlockIDOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/BlockIDOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/types/BlockIDOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/BlockMeta.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/types/BlockMeta.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/BlockMeta.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/types/BlockMeta.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/BlockMetaOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/types/BlockMetaOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/BlockMetaOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/types/BlockMetaOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/Commit.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/types/Commit.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/Commit.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/types/Commit.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/CommitOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/types/CommitOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/CommitOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/types/CommitOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/CommitSig.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/types/CommitSig.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/CommitSig.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/types/CommitSig.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/CommitSigOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/types/CommitSigOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/CommitSigOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/types/CommitSigOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/Data.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/types/Data.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/Data.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/types/Data.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/DataOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/types/DataOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/DataOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/types/DataOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/Header.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/types/Header.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/Header.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/types/Header.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/HeaderOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/types/HeaderOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/HeaderOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/types/HeaderOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/LightBlock.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/types/LightBlock.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/LightBlock.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/types/LightBlock.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/LightBlockOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/types/LightBlockOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/LightBlockOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/types/LightBlockOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/Part.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/types/Part.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/Part.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/types/Part.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/PartOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/types/PartOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/PartOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/types/PartOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/PartSetHeader.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/types/PartSetHeader.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/PartSetHeader.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/types/PartSetHeader.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/PartSetHeaderOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/types/PartSetHeaderOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/PartSetHeaderOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/types/PartSetHeaderOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/Proposal.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/types/Proposal.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/Proposal.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/types/Proposal.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/ProposalOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/types/ProposalOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/ProposalOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/types/ProposalOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/SignedHeader.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/types/SignedHeader.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/SignedHeader.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/types/SignedHeader.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/SignedHeaderOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/types/SignedHeaderOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/SignedHeaderOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/types/SignedHeaderOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/SignedMsgType.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/types/SignedMsgType.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/SignedMsgType.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/types/SignedMsgType.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/SimpleValidator.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/types/SimpleValidator.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/SimpleValidator.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/types/SimpleValidator.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/SimpleValidatorOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/types/SimpleValidatorOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/SimpleValidatorOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/types/SimpleValidatorOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/TxProof.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/types/TxProof.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/TxProof.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/types/TxProof.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/TxProofOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/types/TxProofOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/TxProofOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/types/TxProofOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/TypesProto.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/types/TypesProto.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/TypesProto.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/types/TypesProto.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/Validator.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/types/Validator.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/Validator.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/types/Validator.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/ValidatorOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/types/ValidatorOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/ValidatorOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/types/ValidatorOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/ValidatorProto.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/types/ValidatorProto.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/ValidatorProto.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/types/ValidatorProto.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/ValidatorSet.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/types/ValidatorSet.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/ValidatorSet.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/types/ValidatorSet.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/ValidatorSetOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/types/ValidatorSetOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/ValidatorSetOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/types/ValidatorSetOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/Vote.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/types/Vote.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/Vote.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/types/Vote.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/VoteOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/types/VoteOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/types/VoteOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/types/VoteOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/version/App.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/version/App.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/version/App.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/version/App.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/version/AppOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/version/AppOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/version/AppOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/version/AppOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/version/Consensus.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/version/Consensus.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/version/Consensus.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/version/Consensus.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/version/ConsensusOrBuilder.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/version/ConsensusOrBuilder.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/version/ConsensusOrBuilder.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/version/ConsensusOrBuilder.java diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/version/TypesProto.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/version/TypesProto.java similarity index 100% rename from contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/test/proto/tendermint/version/TypesProto.java rename to contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/test/proto/tendermint/version/TypesProto.java diff --git a/contracts/javascore/lightclients/tendermint/build.gradle b/contracts/javascore/lightclients/tendermint/build.gradle index eedfc9ade..53ee7d3c0 100644 --- a/contracts/javascore/lightclients/tendermint/build.gradle +++ b/contracts/javascore/lightclients/tendermint/build.gradle @@ -6,11 +6,9 @@ dependencies { implementation project(':lib') implementation project(':score-util') implementation project(':ibc') - implementation project(':proto-lib') testImplementation 'com.google.protobuf:protobuf-javalite:3.16.3' - testImplementation 'com.google.protobuf:protobuf-java-util:3.16.3' testImplementation 'foundation.icon:javaee-rt:0.9.3' testImplementation("org.mockito:mockito-core:$mockitoCoreVersion") testImplementation("org.mockito:mockito-inline:$mockitoCoreVersion") @@ -27,7 +25,7 @@ dependencies { test { useJUnitPlatform() - finalizedBy jacocoTestReport + // finalizedBy jacocoTestReport } jacocoTestReport { @@ -37,7 +35,6 @@ jacocoTestReport { dependsOn ':ibc:jacocoTestReport' dependsOn ':ibc:processTestResources' dependsOn ':lib:test' - dependsOn ':proto-lib:test' dependsOn ':mockapp:compileJava' dependsOn ':mockapp:test' dependsOn ':proto-util:compileJava' diff --git a/contracts/javascore/lightclients/tendermint/src/main/java/ibc/tendermint/Tendermint.java b/contracts/javascore/lightclients/tendermint/src/main/java/ibc/tendermint/Tendermint.java index 7f2e99b63..11f3aa8ff 100644 --- a/contracts/javascore/lightclients/tendermint/src/main/java/ibc/tendermint/Tendermint.java +++ b/contracts/javascore/lightclients/tendermint/src/main/java/ibc/tendermint/Tendermint.java @@ -4,9 +4,7 @@ import java.util.Arrays; import ibc.icon.score.util.Proto; -import tendermint.types.*; -import google.protobuf.*; -import ibc.lightclients.tendermint.v1.*; +import icon.proto.clients.tendermint.*; import score.Context; import static ibc.tendermint.TendermintHelper.*; @@ -258,7 +256,7 @@ protected byte[] voteSignBytes( String chainID, int idx) { - return toCanonicalVote(commit, idx, chainID); + return toCanonicalVote(commit, idx, chainID).encode(); } protected byte[] voteSignBytesDelim( diff --git a/contracts/javascore/lightclients/tendermint/src/main/java/ibc/tendermint/TendermintHelper.java b/contracts/javascore/lightclients/tendermint/src/main/java/ibc/tendermint/TendermintHelper.java index d11c56d1c..a0ea42cfc 100644 --- a/contracts/javascore/lightclients/tendermint/src/main/java/ibc/tendermint/TendermintHelper.java +++ b/contracts/javascore/lightclients/tendermint/src/main/java/ibc/tendermint/TendermintHelper.java @@ -5,38 +5,40 @@ import ibc.icon.score.util.MerkleTree; import ibc.icon.score.util.Proto; -import ibc.icon.score.util.ByteUtil; -import tendermint.types.Commit; -import tendermint.types.CommitSig; -import ibc.lightclients.tendermint.v1.ConsensusState; -import tendermint.types.Header; +import icon.proto.clients.tendermint.CanonicalVote; +import icon.proto.clients.tendermint.Commit; +import icon.proto.clients.tendermint.CommitSig; +import icon.proto.clients.tendermint.ConsensusState; +import icon.proto.clients.tendermint.Duration; +import icon.proto.clients.tendermint.LightHeader; +import icon.proto.clients.tendermint.SignedHeader; +import icon.proto.clients.tendermint.SignedMsgType; +import icon.proto.clients.tendermint.SimpleValidator; +import icon.proto.clients.tendermint.Timestamp; +import icon.proto.clients.tendermint.TmHeader; +import icon.proto.clients.tendermint.Validator; +import icon.proto.clients.tendermint.ValidatorSet; import ibc.core.commitment.v1.MerkleRoot; -import tendermint.types.SignedHeader; -import tendermint.types.SignedMsgType; -import tendermint.types.SimpleValidator; -import tendermint.types.Validator; -import tendermint.types.ValidatorSet; -import ibc.core.client.v1.Height; - -import google.protobuf.Timestamp; -import google.protobuf.Duration; +import icon.proto.core.client.Height; import score.Context; public class TendermintHelper { public static final BigInteger MICRO_SECONDS_IN_A_SECOND = BigInteger.valueOf(1_000_000); - public static byte[] toCanonicalVote(Commit commit, int valIdx, String chainId) { + public static CanonicalVote toCanonicalVote(Commit commit, int valIdx, String chainId) { CommitSig commitSig = commit.getSignatures().get(valIdx); - return ByteUtil.join( - Proto.encode(1, SignedMsgType.SIGNED_MSG_TYPE_PRECOMMIT), - Proto.encodeFixed64(2, commit.getHeight()), - Proto.encodeFixed64(3, commit.getRound()), - Proto.encode(4, commit.getBlockId()), - Proto.encode(5, commitSig.getTimestamp()), - Proto.encode(6, chainId)); + CanonicalVote vote = new CanonicalVote(); + + vote.setType(SignedMsgType.SIGNED_MSG_TYPE_PRECOMMIT); + vote.setHeight(commit.getHeight()); + vote.setRound(commit.getRound()); + vote.setBlockId(commit.getBlockId()); + vote.setTimestamp(commitSig.getTimestamp()); + vote.setChainId(chainId); + return vote; } - public static ConsensusState toConsensusState(ibc.lightclients.tendermint.v1.Header header) { + public static ConsensusState toConsensusState(TmHeader header) { ConsensusState state = new ConsensusState(); state.setNextValidatorsHash(header.getSignedHeader().getHeader().getNextValidatorsHash()); state.setTimestamp(header.getSignedHeader().getHeader().getTime()); @@ -57,14 +59,6 @@ public static BigInteger getTotalVotingPower(ValidatorSet validatorSet) { return validatorSet.getTotalVotingPower(); } - public static BigInteger getRevisionNumber(String chainId) { - int id = chainId.indexOf("-"); - if (id >= 0) { - return new BigInteger(chainId.substring(id+1)); - } - return BigInteger.ZERO; - } - public static int getByAddress(ValidatorSet validatorSet, byte[] addr) { int size = validatorSet.getValidators().size(); for (int idx = 0; idx < size; idx++) { @@ -76,10 +70,10 @@ public static int getByAddress(ValidatorSet validatorSet, byte[] addr) { return -1; } - public static Height newHeight(BigInteger blockHeight, BigInteger revision) { + public static Height newHeight(BigInteger blockHeight) { Height height = new Height(); height.setRevisionHeight(blockHeight); - height.setRevisionNumber(revision); + height.setRevisionNumber(BigInteger.ZERO); return height; } @@ -135,7 +129,7 @@ public static byte[] hash(ValidatorSet validatorSet) { return MerkleTree.merkleRootHash(data, 0, size); } - public static byte[] hash(Header header) { + public static byte[] hash(LightHeader header) { byte[] hbz = Proto.encode(1, header.getVersion().getBlock()); byte[] pbt = header.getTime().encode(); byte[] bzbi = header.getLastBlockId().encode(); diff --git a/contracts/javascore/lightclients/tendermint/src/main/java/ibc/tendermint/TendermintLightClient.java b/contracts/javascore/lightclients/tendermint/src/main/java/ibc/tendermint/TendermintLightClient.java index fbe9cc0c0..aff686b6f 100644 --- a/contracts/javascore/lightclients/tendermint/src/main/java/ibc/tendermint/TendermintLightClient.java +++ b/contracts/javascore/lightclients/tendermint/src/main/java/ibc/tendermint/TendermintLightClient.java @@ -1,23 +1,19 @@ package ibc.tendermint; -import icon.ibc.interfaces.ILightClient; +import icon.ibc.interfaces.ILightClient;; import ibc.icon.score.util.ByteUtil; import ibc.icon.score.util.NullChecker; import ibc.icon.score.util.StringUtil; import ibc.ics23.commitment.types.Merkle; import ibc.ics24.host.IBCCommitment; -import cosmos.ics23.v1.*; -import google.protobuf.*; -import tendermint.types.*; -import ibc.core.commitment.v1.*; -import ibc.lightclients.tendermint.v1.*; -import ibc.core.client.v1.Height; +import icon.proto.clients.tendermint.*; +import icon.proto.core.client.Height; +import ibc.core.commitment.v1.MerkleProof; import score.Address; import score.BranchDB; import score.Context; import score.DictDB; import score.annotation.External; -import score.annotation.Optional; import java.math.BigInteger; import java.util.Arrays; @@ -76,7 +72,7 @@ public byte[] getLatestHeight(String clientId) { byte[] encodedClientState = clientStates.get(clientId); NullChecker.requireNotNull(encodedClientState, "Client does not exist"); ClientState clientState = ClientState.decode(encodedClientState); - return clientState.getLatestHeight().encode(); + return newHeight(clientState.getLatestHeight()).encode(); } @External(readonly = true) @@ -105,12 +101,12 @@ public Map createClient(String clientId, byte[] clientStateBytes "trustLevel has zero Denominator"); clientStates.set(clientId, clientStateBytes); - consensusStates.at(clientId).set(clientState.getLatestHeight().getRevisionHeight(), consensusStateBytes); + consensusStates.at(clientId).set(clientState.getLatestHeight(), consensusStateBytes); return Map.of( "clientStateCommitment", IBCCommitment.keccak256(clientStateBytes), "consensusStateCommitment", IBCCommitment.keccak256(consensusStateBytes), - "height", clientState.getLatestHeight().encode()); + "height", newHeight(clientState.getLatestHeight()).encode()); } /** @@ -119,8 +115,9 @@ public Map createClient(String clientId, byte[] clientStateBytes @External public Map updateClient(String clientId, byte[] clientMessageBytes) { onlyHandler(); - ibc.lightclients.tendermint.v1.Header tmHeader = ibc.lightclients.tendermint.v1.Header.decode(clientMessageBytes); + TmHeader tmHeader = TmHeader.decode(clientMessageBytes); boolean conflictingHeader = false; + // Check if the Client store already has a consensus state for the header's // height // If the consensus state exists, and it matches the header then we return early @@ -143,7 +140,7 @@ public Map updateClient(String clientId, byte[] clientMessageByt byte[] encodedClientState = clientStates.get(clientId); require(encodedClientState != null, "LC: client state is invalid"); ClientState clientState = ClientState.decode(encodedClientState); - byte[] encodedTrustedonsensusState = consensusStates.at(clientId).get(tmHeader.getTrustedHeight().getRevisionHeight()); + byte[] encodedTrustedonsensusState = consensusStates.at(clientId).get(tmHeader.getTrustedHeight()); require(encodedTrustedonsensusState != null, "LC: consensusState not found at trusted height"); ConsensusState trustedConsensusState = ConsensusState.decode(encodedTrustedonsensusState); @@ -153,13 +150,12 @@ public Map updateClient(String clientId, byte[] clientMessageByt // Header is different from existing consensus state and also valid, so freeze // the client and return if (conflictingHeader) { - BigInteger revision = getRevisionNumber(tmHeader.getSignedHeader().getHeader().getChainId()); - clientState.setFrozenHeight(newHeight(tmHeader.getSignedHeader().getHeader().getHeight(), revision)); + clientState.setFrozenHeight(tmHeader.getSignedHeader().getHeader().getHeight()); encodedClientState = clientState.encode(); clientStates.set(clientId, encodedClientState); byte[] encodedConsensusState = toConsensusState(tmHeader).encode(); - consensusStates.at(clientId).set(clientState.getLatestHeight().getRevisionHeight(), encodedConsensusState); + consensusStates.at(clientId).set(clientState.getLatestHeight(), encodedConsensusState); processedHeights.at(clientId).set(tmHeader.getSignedHeader().getHeader().getHeight(), BigInteger.valueOf(Context.getBlockHeight())); processedTimes.at(clientId).set(tmHeader.getSignedHeader().getHeader().getHeight(), @@ -169,13 +165,12 @@ public Map updateClient(String clientId, byte[] clientMessageByt "clientStateCommitment", IBCCommitment.keccak256(encodedClientState), "consensusStateCommitment", IBCCommitment.keccak256(encodedConsensusState), "height", - newHeight(tmHeader.getSignedHeader().getHeader().getHeight(), revision).encode()); + newHeight(tmHeader.getSignedHeader().getHeader().getHeight()).encode()); } // update the consensus state from a new header and set processed time metadata - if (tmHeader.getSignedHeader().getHeader().getHeight().compareTo(clientState.getLatestHeight().getRevisionHeight()) > 0) { - BigInteger revision = getRevisionNumber(tmHeader.getSignedHeader().getHeader().getChainId()); - clientState.setLatestHeight(newHeight(tmHeader.getSignedHeader().getHeader().getHeight(), revision)); + if (tmHeader.getSignedHeader().getHeader().getHeight().compareTo(clientState.getLatestHeight()) > 0) { + clientState.setLatestHeight(tmHeader.getSignedHeader().getHeader().getHeight()); encodedClientState = clientState.encode(); clientStates.set(clientId, encodedClientState); } @@ -191,7 +186,7 @@ public Map updateClient(String clientId, byte[] clientMessageByt return Map.of( "clientStateCommitment", IBCCommitment.keccak256(encodedClientState), "consensusStateCommitment", IBCCommitment.keccak256(encodedConsensusState), - "height", clientState.getLatestHeight().encode()); + "height", newHeight(clientState.getLatestHeight()).encode()); } @External(readonly = true) @@ -218,7 +213,7 @@ public void verifyMembership( var root = consensusState.getRoot(); var merkleProof = MerkleProof.decode(proof); - var merklePath = applyPrefix(new String(path)); + var merklePath = applyPrefix(StringUtil.bytesToHex("wasm".getBytes()), new String(path)); Merkle.verifyMembership(merkleProof, Merkle.SDK_SPEC, root, merklePath, value); } @@ -245,7 +240,7 @@ public void verifyNonMembership( var root = consensusState.getRoot(); var merkleProof = MerkleProof.decode(proof); - var merklePath = applyPrefix(new String(path)); + var merklePath = applyPrefix(StringUtil.bytesToHex("wasm".getBytes()), new String(path)); Merkle.verifyNonMembership(merkleProof, Merkle.SDK_SPEC, root, merklePath); } @@ -254,17 +249,17 @@ public void verifyNonMembership( public void checkValidity( ClientState clientState, ConsensusState trustedConsensusState, - ibc.lightclients.tendermint.v1.Header tmHeader, + TmHeader tmHeader, Timestamp currentTime) { // assert header height is newer than consensus state require( tmHeader.getSignedHeader().getHeader().getHeight() - .compareTo(tmHeader.getTrustedHeight().getRevisionHeight()) > 0, + .compareTo(tmHeader.getTrustedHeight()) > 0, "LC: Trusted height is higher than untrusted header height"); - tendermint.types.Header lc = new tendermint.types.Header(); + LightHeader lc = new LightHeader(); lc.setChainId(clientState.getChainId()); - lc.setHeight(tmHeader.getTrustedHeight().getRevisionHeight()); + lc.setHeight(tmHeader.getTrustedHeight()); lc.setTime(trustedConsensusState.getTimestamp()); lc.setNextValidatorsHash(trustedConsensusState.getNextValidatorsHash()); @@ -292,10 +287,10 @@ public void checkValidity( } private void validateArgs(ClientState cs, BigInteger height, byte[] prefix, byte[] proof) { - Context.require(cs.getLatestHeight().getRevisionHeight().compareTo(height) >= 0, + Context.require(cs.getLatestHeight().compareTo(height) >= 0, "Latest height must be greater or equal to proof height"); - Context.require(cs.getFrozenHeight().getRevisionHeight().equals(BigInteger.ZERO) || - cs.getFrozenHeight().getRevisionHeight().compareTo(height) >= 0, + Context.require(cs.getFrozenHeight().equals(BigInteger.ZERO) || + cs.getFrozenHeight().compareTo(height) >= 0, "Client is Frozen"); Context.require(prefix.length > 0, "Prefix cant be empty"); Context.require(proof.length > 0, "Proof cant be empty"); diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/LightClientTest.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/LightClientTest.java index d6e80de32..b7260667c 100644 --- a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/LightClientTest.java +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/LightClientTest.java @@ -9,20 +9,19 @@ import java.math.BigInteger; - -import com.google.protobuf.Timestamp; -import com.google.protobuf.Duration; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import com.ibc.core.client.v1.Height; - +import ibc.tendermint.light.TendermintLight.ClientState; +import ibc.tendermint.light.TendermintLight.ConsensusState; +import ibc.tendermint.light.TendermintLight.Duration; +import ibc.tendermint.light.TendermintLight.Fraction; +import ibc.tendermint.light.TendermintLight.SignedHeader; +import icon.proto.clients.tendermint.Timestamp; +import icon.proto.clients.tendermint.TmHeader; +import icon.proto.core.client.Height; import score.Address; -import com.ibc.lightclients.tendermint.v1.*; -import com.tendermint.types.*; - public class LightClientTest extends LightClientTestBase { @BeforeEach @@ -40,11 +39,11 @@ void createClient() throws Exception { // Assert ClientState clientState = getClientState(); - assertEquals(clientState.getLatestHeight().getRevisionHeight(), initialHeader.getHeader().getHeight()); + assertEquals(clientState.getLatestHeight(), initialHeader.getHeader().getHeight()); assertEquals(clientState.getAllowUpdateAfterExpiry(), allowUpdateAfterExpiry); assertEquals(clientState.getAllowUpdateAfterMisbehaviour(), allowUpdateAfterMisbehaviour); assertEquals(clientState.getChainId(), initialHeader.getHeader().getChainId()); - assertEquals(clientState.getFrozenHeight(), Height.newBuilder().build()); + assertEquals(clientState.getFrozenHeight(), 0); assertEquals(clientState.getMaxClockDrift(), maxClockDrift); assertEquals(clientState.getTrustLevel(), trustLevel); assertEquals(clientState.getTrustingPeriod(), trustingPeriod); @@ -75,7 +74,7 @@ void update_NonAdjacentInOrder() throws Exception { // Assert ClientState clientState = getClientState(); - assertEquals(clientState.getLatestHeight().getRevisionHeight(), lastHeader.getHeader().getHeight()); + assertEquals(clientState.getLatestHeight(), lastHeader.getHeader().getHeight()); assertConsensusState(parseSignedHeader(1)); assertConsensusState(parseSignedHeader(2)); assertConsensusState(lastHeader); @@ -93,7 +92,7 @@ void update_NonAdjacentOutOfOrder() throws Exception { // Assert ClientState clientState = getClientState(); - assertEquals(clientState.getLatestHeight().getRevisionHeight(), lastHeader.getHeader().getHeight()); + assertEquals(clientState.getLatestHeight(), lastHeader.getHeader().getHeight()); assertConsensusState(parseSignedHeader(1)); assertConsensusState(parseSignedHeader(2)); assertConsensusState(lastHeader); @@ -112,7 +111,26 @@ void updateMultiValidator() throws Exception { // Assert ClientState clientState = getClientState(); - assertEquals(clientState.getLatestHeight().getRevisionHeight(), lastHeader.getHeader().getHeight()); + assertEquals(clientState.getLatestHeight(), lastHeader.getHeader().getHeight()); + assertConsensusState(parseSignedHeader(1)); + assertConsensusState(parseSignedHeader(2)); + assertConsensusState(lastHeader); + } + + @Test + void updateValidatorWithLargePower() throws Exception { + // Arrange + blockSetPath = BLOCK_SET_LONG_POWER; + SignedHeader lastHeader = parseSignedHeader(3); + + // Act + initializeClient(1); + updateClient(2, 1); + updateClient(3, 2); + + // Assert + ClientState clientState = getClientState(); + assertEquals(clientState.getLatestHeight(), lastHeader.getHeader().getHeight()); assertConsensusState(parseSignedHeader(1)); assertConsensusState(parseSignedHeader(2)); assertConsensusState(lastHeader); @@ -131,7 +149,7 @@ void updateAdjacentBlocks() throws Exception { // Assert ClientState clientState = getClientState(); - assertEquals(clientState.getLatestHeight().getRevisionHeight(), lastHeader.getHeader().getHeight()); + assertEquals(clientState.getLatestHeight(), lastHeader.getHeader().getHeight()); assertConsensusState(parseSignedHeader(1)); assertConsensusState(parseSignedHeader(2)); assertConsensusState(lastHeader); @@ -145,17 +163,17 @@ void updateConflictingHeader() throws Exception { initializeClient(1); updateClient(2, 1); doNothing().when(clientSpy).checkValidity( - any(ibc.lightclients.tendermint.v1.ClientState.class), - any(ibc.lightclients.tendermint.v1.ConsensusState.class), - any(ibc.lightclients.tendermint.v1.Header.class), - any()); + any(icon.proto.clients.tendermint.ClientState.class), + any(icon.proto.clients.tendermint.ConsensusState.class), + any(TmHeader.class), + any(Timestamp.class)); // Act updateClient(3, 1); // Assert ClientState clientState = getClientState(); - assertEquals(clientState.getFrozenHeight().getRevisionHeight(), duplicatedHeader.getHeader().getHeight()); + assertEquals(clientState.getFrozenHeight(), duplicatedHeader.getHeader().getHeight()); } @Test @@ -247,14 +265,16 @@ void getTimestampAtHeight() throws Exception { SignedHeader header1 = parseSignedHeader(1); SignedHeader header2 = parseSignedHeader(2); - Height height1 = Height.newBuilder().setRevisionHeight(header1.getHeader().getHeight()).build(); - Height height2 = Height.newBuilder().setRevisionHeight(header2.getHeader().getHeight()).build(); + Height height1 = new Height(); + height1.setRevisionHeight(BigInteger.valueOf(header1.getHeader().getHeight())); + Height height2 = new Height(); + height2.setRevisionHeight(BigInteger.valueOf(header2.getHeader().getHeight())); long expectedTime1 = header1.getHeader().getTime().getSeconds(); long expectedTime2 = header2.getHeader().getTime().getSeconds(); // Act - BigInteger t1 = (BigInteger) client.call("getTimestampAtHeight", clientId, height1.toByteArray()); - BigInteger t2 = (BigInteger) client.call("getTimestampAtHeight", clientId, height2.toByteArray()); + BigInteger t1 = (BigInteger) client.call("getTimestampAtHeight", clientId, height1.encode()); + BigInteger t2 = (BigInteger) client.call("getTimestampAtHeight", clientId, height2.encode()); // Assert assertEquals(expectedTime1, t1.longValue()); @@ -264,13 +284,14 @@ void getTimestampAtHeight() throws Exception { @Test void getTimestampAtHeight_noConsensusState() throws Exception { // Arrange - Height height = Height.newBuilder().setRevisionHeight(1).build(); + Height height = new Height(); + height.setRevisionHeight(BigInteger.ONE); String expectedErrorMessage = "height: " + height.getRevisionHeight() + " does not have a consensus state"; // Act & Assert AssertionError e = assertThrows(AssertionError.class, - () -> client.call("getTimestampAtHeight", clientId, height.toByteArray())); + () -> client.call("getTimestampAtHeight", clientId, height.encode())); assertTrue(e.getMessage().contains(expectedErrorMessage)); } @@ -280,21 +301,22 @@ void getLatestHeight() throws Exception { SignedHeader header1 = parseSignedHeader(1); SignedHeader header2 = parseSignedHeader(2); - BigInteger revision = TendermintHelper.getRevisionNumber(header1.getHeader().getChainId()); - Height height1 = Height.newBuilder().setRevisionHeight(header1.getHeader().getHeight()).setRevisionNumber(revision.intValue()).build(); - Height height2 = Height.newBuilder().setRevisionHeight(header2.getHeader().getHeight()).setRevisionNumber(revision.intValue()).build(); + Height height1 = new Height(); + height1.setRevisionHeight(BigInteger.valueOf(header1.getHeader().getHeight())); + Height height2 = new Height(); + height2.setRevisionHeight(BigInteger.valueOf(header2.getHeader().getHeight())); // Act initializeClient(1); // Assert - assertArrayEquals(height1.toByteArray(), (byte[]) client.call("getLatestHeight", clientId)); + assertArrayEquals(height1.encode(), (byte[]) client.call("getLatestHeight", clientId)); // Act updateClient(2, 1); // Assert - assertArrayEquals(height2.toByteArray(), (byte[]) client.call("getLatestHeight", clientId)); + assertArrayEquals(height2.encode(), (byte[]) client.call("getLatestHeight", clientId)); } @Test diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/LightClientTestBase.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/LightClientTestBase.java index 547782b87..ede85857f 100644 --- a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/LightClientTestBase.java +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/LightClientTestBase.java @@ -8,7 +8,7 @@ import com.iconloop.score.test.ServiceManager; import com.iconloop.score.test.TestBase; import foundation.icon.ee.util.Crypto; -import ibc.lightclients.tendermint.v1.*; +import ibc.tendermint.light.TendermintLight.*; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -40,22 +40,11 @@ import com.iconloop.score.test.ServiceManager; import com.iconloop.score.test.TestBase; -import com.google.protobuf.Timestamp; -import com.google.protobuf.Duration; +import ibc.tendermint.light.TendermintLight.*; +import icon.proto.core.client.Height; import score.Context; import foundation.icon.ee.util.Crypto; -import com.ibc.lightclients.tendermint.v1.*; -import com.ibc.lightclients.tendermint.v1.ConsensusState; -import com.ibc.lightclients.tendermint.v1.ClientState; -import com.ibc.lightclients.tendermint.v1.Header; -import com.tendermint.types.*; -import com.tendermint.crypto.*; -import com.ibc.lightclients.tendermint.v1.Fraction; -import com.ibc.core.client.v1.Height; -import com.ibc.core.commitment.v1.MerkleRoot; -import com.tendermint.version.Consensus; - import static org.mockito.Mockito.spy; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.any; @@ -82,6 +71,7 @@ public class LightClientTestBase extends TestBase { protected static final String BLOCK_SET_MUTILPLE_VALIDATORS = BLOCK_SET_BASE_PATH + "multi-validator/"; protected static final String BLOCK_SET_ADJACENT = BLOCK_SET_BASE_PATH + "adjacent/"; protected static final String BLOCK_SET_MALICIOUS = BLOCK_SET_BASE_PATH + "malicious/"; + protected static final String BLOCK_SET_LONG_POWER = BLOCK_SET_BASE_PATH + "validator-with-long-voting-power/"; protected String blockSetPath = BLOCK_SET_SIMPLE; static { @@ -141,40 +131,38 @@ protected void teardown() { } protected void initializeClient(int blockOrder) throws Exception { - Header header = Header.newBuilder() + TmHeader tmHeader = TmHeader.newBuilder() .setSignedHeader(parseSignedHeader(blockOrder)) .setValidatorSet(parseValidatorSet(blockOrder)).build(); - BigInteger revisionNumber = TendermintHelper.getRevisionNumber(header.getSignedHeader().getHeader().getChainId()); + ClientState clientState = ClientState.newBuilder() - .setChainId(header.getSignedHeader().getHeader().getChainId()) + .setChainId(tmHeader.getSignedHeader().getHeader().getChainId()) .setTrustLevel(trustLevel) .setTrustingPeriod(trustingPeriod) .setMaxClockDrift(maxClockDrift) - .setLatestHeight(Height.newBuilder() - .setRevisionHeight(header.getSignedHeader().getHeader().getHeight()) - .setRevisionNumber(revisionNumber.intValue())) + .setLatestHeight(tmHeader.getSignedHeader().getHeader().getHeight()) .setAllowUpdateAfterExpiry(allowUpdateAfterExpiry) .setAllowUpdateAfterMisbehaviour(allowUpdateAfterMisbehaviour).build(); MerkleRoot root = MerkleRoot.newBuilder() - .setHash(header.getSignedHeader().getHeader().getAppHash()).build(); + .setHash(tmHeader.getSignedHeader().getHeader().getAppHash()).build(); ConsensusState consensusState = ConsensusState.newBuilder() - .setTimestamp(header.getSignedHeader().getHeader().getTime()) + .setTimestamp(tmHeader.getSignedHeader().getHeader().getTime()) .setRoot(root) - .setNextValidatorsHash(header.getSignedHeader().getHeader().getNextValidatorsHash()).build(); + .setNextValidatorsHash(tmHeader.getSignedHeader().getHeader().getNextValidatorsHash()).build(); client.invoke(ibcHandler, "createClient", clientId, clientState.toByteArray(), consensusState.toByteArray(), new byte[0]); } protected void updateClient(int blockOrder, int referenceBlock) throws Exception { - Header header = createHeader(blockOrder, referenceBlock); - client.invoke(ibcHandler, "updateClient", clientId, header.toByteArray()); + TmHeader tmHeader = createHeader(blockOrder, referenceBlock); + client.invoke(ibcHandler, "updateClient", clientId, tmHeader.toByteArray()); } protected ConsensusState getConsensusState(Height height) throws Exception { - return ConsensusState.parseFrom((byte[]) client.call("getConsensusState", clientId, height.toByteArray())); + return ConsensusState.parseFrom((byte[]) client.call("getConsensusState", clientId, height.encode())); } protected ClientState getClientState() throws Exception { @@ -182,20 +170,21 @@ protected ClientState getClientState() throws Exception { } protected void assertConsensusState(SignedHeader header) throws Exception { - Height height = Height.newBuilder().setRevisionHeight(header.getHeader().getHeight()).build(); + Height height = new Height(); + height.setRevisionHeight(BigInteger.valueOf(header.getHeader().getHeight())); ConsensusState consensusState = getConsensusState(height); assertEquals(header.getHeader().getNextValidatorsHash(), consensusState.getNextValidatorsHash()); assertEquals(header.getHeader().getAppHash(), consensusState.getRoot().getHash()); assertEquals(header.getHeader().getTime(), consensusState.getTimestamp()); } - protected Header createHeader(int blockOrder, int referenceBlock) throws Exception { - Header header = Header.newBuilder() + protected TmHeader createHeader(int blockOrder, int referenceBlock) throws Exception { + TmHeader tmHeader = TmHeader.newBuilder() .setSignedHeader(parseSignedHeader(blockOrder)) .setValidatorSet(parseValidatorSet(blockOrder)) - .setTrustedHeight(Height.newBuilder().setRevisionHeight(parseSignedHeader(referenceBlock).getHeader().getHeight())) + .setTrustedHeight(parseSignedHeader(referenceBlock).getHeader().getHeight()) .setTrustedValidators(parseValidatorSet(referenceBlock)).build(); - return header; + return tmHeader; } protected SignedHeader parseSignedHeader(int blockOrder) throws Exception { @@ -210,7 +199,7 @@ protected SignedHeader parseSignedHeader(int blockOrder) throws Exception { Consensus version = Consensus.newBuilder() .setBlock(jsonHeader.get("version").get("block").asInt()).build(); - com.tendermint.types.Header lightHeader = com.tendermint.types.Header.newBuilder() + LightHeader lightHeader = LightHeader.newBuilder() .setVersion(version) .setChainId(jsonHeader.get("chain_id").asText()) .setHeight(jsonHeader.get("height").asInt()) diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/data/validator-with-long-voting-power/commit.1.json b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/data/validator-with-long-voting-power/commit.1.json new file mode 100644 index 000000000..cd80b3202 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/data/validator-with-long-voting-power/commit.1.json @@ -0,0 +1,72 @@ +{ + "signed_header": { + "header": { + "version": { + "block": "11" + }, + "chain_id": "injective-888", + "height": "17920038", + "time": "2023-11-02T13:33:21.027116706Z", + "last_block_id": { + "hash": "C08020E636E8C907A70003E6D65E066AD80F5EB460D9872CF6E27BF4737859BF", + "parts": { + "total": 1, + "hash": "CD289D26FD3291FFCB3D26A2AA70409CE6A49F0A5A9B9655B9C3105211FD2C6E" + } + }, + "last_commit_hash": "5F2FF8F52ACA9C21601B689D27EDD5FDB8FD31926B674A512ABE3406921D5E83", + "data_hash": "ADF4E59E6EDDF65C7A37AB51A5B90228816E6F3A46A9AB6C4291ABE5AF5C0DD8", + "validators_hash": "E947FC8185006455AE3606D4F1CA18097AD3E352C76D2F405D6DF3509BC84A45", + "next_validators_hash": "E947FC8185006455AE3606D4F1CA18097AD3E352C76D2F405D6DF3509BC84A45", + "consensus_hash": "E5BBA9239C0D3F967F8EF879506FF6EBDFB940F8904D7291351A461F00AAAD4D", + "app_hash": "9C4104E2CD45CA1B26EE54E43E2CAFAF73C3D3BC4A1D1759A7B5E5E234150C14", + "last_results_hash": "279D27AC52700DCF9F02609C1912CD90D76A217D8AB00843598177E99B73F5A8", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "proposer_address": "3391E35B61004E03BEB88FA1DAB4444B913BD7BE" + }, + "commit": { + "height": "17920038", + "round": 0, + "block_id": { + "hash": "67C262CBA5552BAB48AEF8B09D5E80907B2014D0D45EB6665D11A7E3848E3381", + "parts": { + "total": 1, + "hash": "302AF52F2B1AE2F23DF50351F56EEB9797E0F14474D14DBB403EBB92425F12AF" + } + }, + "signatures": [ + { + "block_id_flag": 2, + "validator_address": "3391E35B61004E03BEB88FA1DAB4444B913BD7BE", + "timestamp": "2023-11-02T13:33:23.442609428Z", + "signature": "7cUkUt2IRrQ88cT7BTJ20wpQQOAx1vOOGXAHCHZEO5hH8cl8yJd6lQ7fkQ95mSgvTSKkTiefVcGAhXY3DhwcAA==" + }, + { + "block_id_flag": 2, + "validator_address": "36FF1CB8B136E4BE26827071F2C842986EBCC5F7", + "timestamp": "2023-11-02T13:33:23.441884438Z", + "signature": "vzkh7jwM7asuWXvsWS7qGSwD8iQoyo2uZwJH0GKDvoUHSk/hr4yHU8qrQh0+QtlA/TKVgWrPkOFAqxWIDmczAQ==" + }, + { + "block_id_flag": 2, + "validator_address": "39B51761D4BC8DF4D234FA2750114F2647EDEDE0", + "timestamp": "2023-11-02T13:33:23.342446104Z", + "signature": "sVPZebPvRFW8Ffn08S3p8FtLI/cDezRWA4ZIabCKzsn/bjw3lGJTgsCamPEfVoAW258KwVHOqa0+99weF/asBQ==" + }, + { + "block_id_flag": 2, + "validator_address": "CBC72D2784292744BB653558ED14C4E33D614B67", + "timestamp": "2023-11-02T13:33:23.347423377Z", + "signature": "8WgFInmQutXqp96VAQ8CrMoptrUOUUJADtntuNl2ybUbVlGdDXD7090NlHFpiGcOMrHb/QdrpyMF5363YSjeCQ==" + }, + { + "block_id_flag": 2, + "validator_address": "2CBA0C86B9BE7034D7BD2F02C1A5FEDFE1FAD2D8", + "timestamp": "2023-11-02T13:33:23.605327672Z", + "signature": "ZvcrZitOEbPbb9GEaZB36bBoN+ohXBCTkZBKm2ZBWevOVdSXdU9WzuIDhK15CPmYuQgVNUWavUZXEZ1Wsmz8Aw==" + } + ] + } + }, + "canonical": true +} \ No newline at end of file diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/data/validator-with-long-voting-power/commit.2.json b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/data/validator-with-long-voting-power/commit.2.json new file mode 100644 index 000000000..d2a0855ff --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/data/validator-with-long-voting-power/commit.2.json @@ -0,0 +1,72 @@ +{ + "signed_header": { + "header": { + "version": { + "block": "11" + }, + "chain_id": "injective-888", + "height": "17920039", + "time": "2023-11-02T13:33:23.441884438Z", + "last_block_id": { + "hash": "67C262CBA5552BAB48AEF8B09D5E80907B2014D0D45EB6665D11A7E3848E3381", + "parts": { + "total": 1, + "hash": "302AF52F2B1AE2F23DF50351F56EEB9797E0F14474D14DBB403EBB92425F12AF" + } + }, + "last_commit_hash": "62ABAAA7AFE658FDF3298F1EBD134B172A6C3D3DBDE00B7A8D99A5ADED077843", + "data_hash": "143A710FE20ACCFE5CE1D12E9420F854EFB2C92E00EB80EE813F162C7E6200D5", + "validators_hash": "E947FC8185006455AE3606D4F1CA18097AD3E352C76D2F405D6DF3509BC84A45", + "next_validators_hash": "E947FC8185006455AE3606D4F1CA18097AD3E352C76D2F405D6DF3509BC84A45", + "consensus_hash": "E5BBA9239C0D3F967F8EF879506FF6EBDFB940F8904D7291351A461F00AAAD4D", + "app_hash": "AFE74B9B502591D084C6E899B756A248EADF7E273BCBF3C6D82D482BFD2EFB8A", + "last_results_hash": "CC759FD069BB67EF291E281E710B4B846CF1DCFD459FFBF7706BD6D1B9A828EB", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "proposer_address": "36FF1CB8B136E4BE26827071F2C842986EBCC5F7" + }, + "commit": { + "height": "17920039", + "round": 0, + "block_id": { + "hash": "AA76FDD15D36BE82CB3C4232E7ADBAC5A46363725DCB3239B7470E5801405BDA", + "parts": { + "total": 1, + "hash": "1CE121BB7F8B9C91A6AA4D2AF1F221E72B11ED88F174BB224CC17583CC7CB8DA" + } + }, + "signatures": [ + { + "block_id_flag": 2, + "validator_address": "3391E35B61004E03BEB88FA1DAB4444B913BD7BE", + "timestamp": "2023-11-02T13:33:25.645542243Z", + "signature": "HtctXHea3ma7xqHuBldAq2bQX7YpQb9rxuxavwHg/B4x6+TtKZLe/E7gloLizC2mxrOEJ6iXBMJfZ9GYiLesDA==" + }, + { + "block_id_flag": 2, + "validator_address": "36FF1CB8B136E4BE26827071F2C842986EBCC5F7", + "timestamp": "2023-11-02T13:33:25.656553715Z", + "signature": "QepzfO1DNtIQW62LN683OUW7n2o/KRkEFjBFK7OqAarMSLZNqhJxZ/k2W1KaZJHz8Jybw1Y2MAT300g70CYjDw==" + }, + { + "block_id_flag": 2, + "validator_address": "39B51761D4BC8DF4D234FA2750114F2647EDEDE0", + "timestamp": "2023-11-02T13:33:25.658405119Z", + "signature": "Wg+ipzg9zYtRvIEZ9CeTyiT6bXFPbsaYttTBFpU0sHCzVuDcP+6ktLiWoY1aIIHtfiPVOAqQQpn6EIWkvqZ+DQ==" + }, + { + "block_id_flag": 2, + "validator_address": "CBC72D2784292744BB653558ED14C4E33D614B67", + "timestamp": "2023-11-02T13:33:25.645294352Z", + "signature": "VEboNAJyPm42pVUc6YsqyeRWFyKCM66SpWYrV6Q9Uk0aiEJ1WDBrbTnLsjkOmJJKCz2yF+OHv43RKq/DLOlYBQ==" + }, + { + "block_id_flag": 2, + "validator_address": "2CBA0C86B9BE7034D7BD2F02C1A5FEDFE1FAD2D8", + "timestamp": "2023-11-02T13:33:25.820218014Z", + "signature": "uc+YW3uiqDA6n4xjRgawH8oY27yiYa3aw1gKEiQqslkLACm6rvild+mwqITVX0dJCzM+EZGpPMZqOlGOk9S2BQ==" + } + ] + } + }, + "canonical": true +} \ No newline at end of file diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/data/validator-with-long-voting-power/commit.3.json b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/data/validator-with-long-voting-power/commit.3.json new file mode 100644 index 000000000..9c7314bad --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/data/validator-with-long-voting-power/commit.3.json @@ -0,0 +1,72 @@ +{ + "signed_header": { + "header": { + "version": { + "block": "11" + }, + "chain_id": "injective-888", + "height": "17920086", + "time": "2023-11-02T13:35:02.047390058Z", + "last_block_id": { + "hash": "347BE8943E602C19DAC7185E926EDC4DBA096BA20A417D8CF3381BDCA948A649", + "parts": { + "total": 1, + "hash": "BEE955F8690D6EA3A945F213B9CBDCCF288391C08928986751EF81E6CAFEF42B" + } + }, + "last_commit_hash": "D582AC642827C533166497DE555730DC3A30F82EDE41E94AB9520BDF56A1DC87", + "data_hash": "8403500554D652B74C08E70DBE91A13BD4EFF700B7670AFD9DEE68BD169BB1D9", + "validators_hash": "E947FC8185006455AE3606D4F1CA18097AD3E352C76D2F405D6DF3509BC84A45", + "next_validators_hash": "E947FC8185006455AE3606D4F1CA18097AD3E352C76D2F405D6DF3509BC84A45", + "consensus_hash": "E5BBA9239C0D3F967F8EF879506FF6EBDFB940F8904D7291351A461F00AAAD4D", + "app_hash": "C45F52638BECEDAA7C8DDE1380C3EBECD9DE86B55260576A2531B0301D39C936", + "last_results_hash": "D750BEF56A672385C2ECD2DBB2161FFF0AB8A1814CE6B18A229377A95F45E329", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "proposer_address": "3391E35B61004E03BEB88FA1DAB4444B913BD7BE" + }, + "commit": { + "height": "17920086", + "round": 0, + "block_id": { + "hash": "C5FC14C1B1395314AA208B610A516B4679486A38D5074887D53C990FC35C212B", + "parts": { + "total": 1, + "hash": "731E65E02962832F2F1FCCA0F856D82840F9785CD83FA4DDC0729C2100C5FE55" + } + }, + "signatures": [ + { + "block_id_flag": 2, + "validator_address": "3391E35B61004E03BEB88FA1DAB4444B913BD7BE", + "timestamp": "2023-11-02T13:35:04.368632789Z", + "signature": "rMzn9p/2xwscq4BW29QKUxq5G2IzzxwarlUOWkE4S/JV1r2WlSfiwZqjfORqK+fSOI5bbkaIR99dh22ZwcRwDw==" + }, + { + "block_id_flag": 2, + "validator_address": "36FF1CB8B136E4BE26827071F2C842986EBCC5F7", + "timestamp": "2023-11-02T13:35:04.367578967Z", + "signature": "WmPCYXNO32DcCaYpqTC2dEKthLyVpCYwmkVLKPmHGsblAQk1swHtHRITHnDlaShSjqQ5Tch/YlMxyINOsdOJCA==" + }, + { + "block_id_flag": 2, + "validator_address": "39B51761D4BC8DF4D234FA2750114F2647EDEDE0", + "timestamp": "2023-11-02T13:35:04.367406356Z", + "signature": "itVX4sSqUnuQcqnKud1a2Dv+LJQiU0jCdXl/+BEZfMUqAhtSnwQOSPK96LPzOiLBcdvrluM4SLK3Lz2KtqWPBQ==" + }, + { + "block_id_flag": 2, + "validator_address": "CBC72D2784292744BB653558ED14C4E33D614B67", + "timestamp": "2023-11-02T13:35:04.371872862Z", + "signature": "7QlwrUBp31unqQwcm051usk+jrhDFEgBCjGTc7kWffLsotiW8pKTxqv0lzao8uF//X/Rc0bM3tC2zNkQQRJqBA==" + }, + { + "block_id_flag": 2, + "validator_address": "2CBA0C86B9BE7034D7BD2F02C1A5FEDFE1FAD2D8", + "timestamp": "2023-11-02T13:35:04.621696944Z", + "signature": "HbIOEh15/7Q0vn+WHb7NgTuO6HkAnV6+ycfGz+WeLO/W081/6llsnQyHQMFjcegbCphM+KWKRys/KwC7frOkBQ==" + } + ] + } + }, + "canonical": true +} \ No newline at end of file diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/data/validator-with-long-voting-power/validators.1.json b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/data/validator-with-long-voting-power/validators.1.json new file mode 100644 index 000000000..8d0b09497 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/data/validator-with-long-voting-power/validators.1.json @@ -0,0 +1,52 @@ +{ + "block_height": "17920038", + "validators": [ + { + "address": "3391E35B61004E03BEB88FA1DAB4444B913BD7BE", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "Puku/I45dAZ4wKeN+rbYKnmuUUA7Yh7/TrKX3ZoTmk4=" + }, + "voting_power": "200058118992377", + "proposer_priority": "-132697491409996" + }, + { + "address": "36FF1CB8B136E4BE26827071F2C842986EBCC5F7", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "Bi/7vbVB1uj/zz40/aozZOvVBFkV6hLqqxBIQr5kSc4=" + }, + "voting_power": "200001135854983", + "proposer_priority": "461765604364692" + }, + { + "address": "39B51761D4BC8DF4D234FA2750114F2647EDEDE0", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "WlL4lTR+iTbd0rn3xP6oH0juOnGRZ+Hh73Oj6/Lt/Wg=" + }, + "voting_power": "200000136407721", + "proposer_priority": "-42343657761476" + }, + { + "address": "CBC72D2784292744BB653558ED14C4E33D614B67", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "1mF7OEpB9A60O0e+64pICbqS/nN8VnsVfoySMEW2w1Q=" + }, + "voting_power": "199825725805690", + "proposer_priority": "433172150149401" + }, + { + "address": "2CBA0C86B9BE7034D7BD2F02C1A5FEDFE1FAD2D8", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "eUvXue8zslf+dC4TxNBXVIzMZzf6CtwagwObU6rQxb4=" + }, + "voting_power": "7", + "proposer_priority": "-719896605342617" + } + ], + "count": "5", + "total": "5" +} \ No newline at end of file diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/data/validator-with-long-voting-power/validators.2.json b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/data/validator-with-long-voting-power/validators.2.json new file mode 100644 index 000000000..3e6dd2b0a --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/data/validator-with-long-voting-power/validators.2.json @@ -0,0 +1,52 @@ +{ + "block_height": "17920039", + "validators": [ + { + "address": "3391E35B61004E03BEB88FA1DAB4444B913BD7BE", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "Puku/I45dAZ4wKeN+rbYKnmuUUA7Yh7/TrKX3ZoTmk4=" + }, + "voting_power": "200058118992377", + "proposer_priority": "67360627582381" + }, + { + "address": "36FF1CB8B136E4BE26827071F2C842986EBCC5F7", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "Bi/7vbVB1uj/zz40/aozZOvVBFkV6hLqqxBIQr5kSc4=" + }, + "voting_power": "200001135854983", + "proposer_priority": "-138118376841103" + }, + { + "address": "39B51761D4BC8DF4D234FA2750114F2647EDEDE0", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "WlL4lTR+iTbd0rn3xP6oH0juOnGRZ+Hh73Oj6/Lt/Wg=" + }, + "voting_power": "200000136407721", + "proposer_priority": "157656478646245" + }, + { + "address": "CBC72D2784292744BB653558ED14C4E33D614B67", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "1mF7OEpB9A60O0e+64pICbqS/nN8VnsVfoySMEW2w1Q=" + }, + "voting_power": "199825725805690", + "proposer_priority": "632997875955091" + }, + { + "address": "2CBA0C86B9BE7034D7BD2F02C1A5FEDFE1FAD2D8", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "eUvXue8zslf+dC4TxNBXVIzMZzf6CtwagwObU6rQxb4=" + }, + "voting_power": "7", + "proposer_priority": "-719896605342610" + } + ], + "count": "5", + "total": "5" +} \ No newline at end of file diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/data/validator-with-long-voting-power/validators.3.json b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/data/validator-with-long-voting-power/validators.3.json new file mode 100644 index 000000000..52ee2b633 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/data/validator-with-long-voting-power/validators.3.json @@ -0,0 +1,52 @@ +{ + "block_height": "17920086", + "validators": [ + { + "address": "3391E35B61004E03BEB88FA1DAB4444B913BD7BE", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "Puku/I45dAZ4wKeN+rbYKnmuUUA7Yh7/TrKX3ZoTmk4=" + }, + "voting_power": "200058118992377", + "proposer_priority": "-128529184505236" + }, + { + "address": "36FF1CB8B136E4BE26827071F2C842986EBCC5F7", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "Bi/7vbVB1uj/zz40/aozZOvVBFkV6hLqqxBIQr5kSc4=" + }, + "voting_power": "200001135854983", + "proposer_priority": "463198720674540" + }, + { + "address": "39B51761D4BC8DF4D234FA2750114F2647EDEDE0", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "WlL4lTR+iTbd0rn3xP6oH0juOnGRZ+Hh73Oj6/Lt/Wg=" + }, + "voting_power": "200000136407721", + "proposer_priority": "-40958514920204" + }, + { + "address": "CBC72D2784292744BB653558ED14C4E33D614B67", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "1mF7OEpB9A60O0e+64pICbqS/nN8VnsVfoySMEW2w1Q=" + }, + "voting_power": "199825725805690", + "proposer_priority": "426185584093185" + }, + { + "address": "2CBA0C86B9BE7034D7BD2F02C1A5FEDFE1FAD2D8", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "eUvXue8zslf+dC4TxNBXVIzMZzf6CtwagwObU6rQxb4=" + }, + "voting_power": "7", + "proposer_priority": "-719896605342281" + } + ], + "count": "5", + "total": "5" +} \ No newline at end of file diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/light/TendermintLight.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/light/TendermintLight.java new file mode 100644 index 000000000..2ecc57971 --- /dev/null +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/light/TendermintLight.java @@ -0,0 +1,11972 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: proto/clients/tendermint/TendermintLight.proto + +package ibc.tendermint.light; + +public final class TendermintLight { + private TendermintLight() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + /** + * Protobuf enum {@code ibc.tendermint.light.BlockIDFlag} + */ + public enum BlockIDFlag + implements com.google.protobuf.Internal.EnumLite { + /** + * BLOCK_ID_FLAG_UNKNOWN = 0; + */ + BLOCK_ID_FLAG_UNKNOWN(0), + /** + * BLOCK_ID_FLAG_ABSENT = 1; + */ + BLOCK_ID_FLAG_ABSENT(1), + /** + * BLOCK_ID_FLAG_COMMIT = 2; + */ + BLOCK_ID_FLAG_COMMIT(2), + /** + * BLOCK_ID_FLAG_NIL = 3; + */ + BLOCK_ID_FLAG_NIL(3), + UNRECOGNIZED(-1), + ; + + /** + * BLOCK_ID_FLAG_UNKNOWN = 0; + */ + public static final int BLOCK_ID_FLAG_UNKNOWN_VALUE = 0; + /** + * BLOCK_ID_FLAG_ABSENT = 1; + */ + public static final int BLOCK_ID_FLAG_ABSENT_VALUE = 1; + /** + * BLOCK_ID_FLAG_COMMIT = 2; + */ + public static final int BLOCK_ID_FLAG_COMMIT_VALUE = 2; + /** + * BLOCK_ID_FLAG_NIL = 3; + */ + public static final int BLOCK_ID_FLAG_NIL_VALUE = 3; + + + @java.lang.Override + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static BlockIDFlag valueOf(int value) { + return forNumber(value); + } + + public static BlockIDFlag forNumber(int value) { + switch (value) { + case 0: return BLOCK_ID_FLAG_UNKNOWN; + case 1: return BLOCK_ID_FLAG_ABSENT; + case 2: return BLOCK_ID_FLAG_COMMIT; + case 3: return BLOCK_ID_FLAG_NIL; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + BlockIDFlag> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + @java.lang.Override + public BlockIDFlag findValueByNumber(int number) { + return BlockIDFlag.forNumber(number); + } + }; + + public static com.google.protobuf.Internal.EnumVerifier + internalGetVerifier() { + return BlockIDFlagVerifier.INSTANCE; + } + + private static final class BlockIDFlagVerifier implements + com.google.protobuf.Internal.EnumVerifier { + static final com.google.protobuf.Internal.EnumVerifier INSTANCE = new BlockIDFlagVerifier(); + @java.lang.Override + public boolean isInRange(int number) { + return BlockIDFlag.forNumber(number) != null; + } + }; + + private final int value; + + private BlockIDFlag(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:ibc.tendermint.light.BlockIDFlag) + } + + /** + * Protobuf enum {@code ibc.tendermint.light.SignedMsgType} + */ + public enum SignedMsgType + implements com.google.protobuf.Internal.EnumLite { + /** + * SIGNED_MSG_TYPE_UNKNOWN = 0; + */ + SIGNED_MSG_TYPE_UNKNOWN(0), + /** + *
+     * Votes
+     * 
+ * + * SIGNED_MSG_TYPE_PREVOTE = 1; + */ + SIGNED_MSG_TYPE_PREVOTE(1), + /** + * SIGNED_MSG_TYPE_PRECOMMIT = 2; + */ + SIGNED_MSG_TYPE_PRECOMMIT(2), + /** + *
+     * Proposals
+     * 
+ * + * SIGNED_MSG_TYPE_PROPOSAL = 32; + */ + SIGNED_MSG_TYPE_PROPOSAL(32), + UNRECOGNIZED(-1), + ; + + /** + * SIGNED_MSG_TYPE_UNKNOWN = 0; + */ + public static final int SIGNED_MSG_TYPE_UNKNOWN_VALUE = 0; + /** + *
+     * Votes
+     * 
+ * + * SIGNED_MSG_TYPE_PREVOTE = 1; + */ + public static final int SIGNED_MSG_TYPE_PREVOTE_VALUE = 1; + /** + * SIGNED_MSG_TYPE_PRECOMMIT = 2; + */ + public static final int SIGNED_MSG_TYPE_PRECOMMIT_VALUE = 2; + /** + *
+     * Proposals
+     * 
+ * + * SIGNED_MSG_TYPE_PROPOSAL = 32; + */ + public static final int SIGNED_MSG_TYPE_PROPOSAL_VALUE = 32; + + + @java.lang.Override + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SignedMsgType valueOf(int value) { + return forNumber(value); + } + + public static SignedMsgType forNumber(int value) { + switch (value) { + case 0: return SIGNED_MSG_TYPE_UNKNOWN; + case 1: return SIGNED_MSG_TYPE_PREVOTE; + case 2: return SIGNED_MSG_TYPE_PRECOMMIT; + case 32: return SIGNED_MSG_TYPE_PROPOSAL; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + SignedMsgType> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + @java.lang.Override + public SignedMsgType findValueByNumber(int number) { + return SignedMsgType.forNumber(number); + } + }; + + public static com.google.protobuf.Internal.EnumVerifier + internalGetVerifier() { + return SignedMsgTypeVerifier.INSTANCE; + } + + private static final class SignedMsgTypeVerifier implements + com.google.protobuf.Internal.EnumVerifier { + static final com.google.protobuf.Internal.EnumVerifier INSTANCE = new SignedMsgTypeVerifier(); + @java.lang.Override + public boolean isInRange(int number) { + return SignedMsgType.forNumber(number) != null; + } + }; + + private final int value; + + private SignedMsgType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:ibc.tendermint.light.SignedMsgType) + } + + public interface FractionOrBuilder extends + // @@protoc_insertion_point(interface_extends:ibc.tendermint.light.Fraction) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * uint64 numerator = 1; + * @return The numerator. + */ + long getNumerator(); + + /** + * uint64 denominator = 2; + * @return The denominator. + */ + long getDenominator(); + } + /** + * Protobuf type {@code ibc.tendermint.light.Fraction} + */ + public static final class Fraction extends + com.google.protobuf.GeneratedMessageLite< + Fraction, Fraction.Builder> implements + // @@protoc_insertion_point(message_implements:ibc.tendermint.light.Fraction) + FractionOrBuilder { + private Fraction() { + } + public static final int NUMERATOR_FIELD_NUMBER = 1; + private long numerator_; + /** + * uint64 numerator = 1; + * @return The numerator. + */ + @java.lang.Override + public long getNumerator() { + return numerator_; + } + /** + * uint64 numerator = 1; + * @param value The numerator to set. + */ + private void setNumerator(long value) { + + numerator_ = value; + } + /** + * uint64 numerator = 1; + */ + private void clearNumerator() { + + numerator_ = 0L; + } + + public static final int DENOMINATOR_FIELD_NUMBER = 2; + private long denominator_; + /** + * uint64 denominator = 2; + * @return The denominator. + */ + @java.lang.Override + public long getDenominator() { + return denominator_; + } + /** + * uint64 denominator = 2; + * @param value The denominator to set. + */ + private void setDenominator(long value) { + + denominator_ = value; + } + /** + * uint64 denominator = 2; + */ + private void clearDenominator() { + + denominator_ = 0L; + } + + public static ibc.tendermint.light.TendermintLight.Fraction parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static ibc.tendermint.light.TendermintLight.Fraction parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.Fraction parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static ibc.tendermint.light.TendermintLight.Fraction parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.Fraction parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static ibc.tendermint.light.TendermintLight.Fraction parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.Fraction parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static ibc.tendermint.light.TendermintLight.Fraction parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.Fraction parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static ibc.tendermint.light.TendermintLight.Fraction parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.Fraction parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static ibc.tendermint.light.TendermintLight.Fraction parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(ibc.tendermint.light.TendermintLight.Fraction prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + * Protobuf type {@code ibc.tendermint.light.Fraction} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + ibc.tendermint.light.TendermintLight.Fraction, Builder> implements + // @@protoc_insertion_point(builder_implements:ibc.tendermint.light.Fraction) + ibc.tendermint.light.TendermintLight.FractionOrBuilder { + // Construct using ibc.tendermint.light.TendermintLight.Fraction.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * uint64 numerator = 1; + * @return The numerator. + */ + @java.lang.Override + public long getNumerator() { + return instance.getNumerator(); + } + /** + * uint64 numerator = 1; + * @param value The numerator to set. + * @return This builder for chaining. + */ + public Builder setNumerator(long value) { + copyOnWrite(); + instance.setNumerator(value); + return this; + } + /** + * uint64 numerator = 1; + * @return This builder for chaining. + */ + public Builder clearNumerator() { + copyOnWrite(); + instance.clearNumerator(); + return this; + } + + /** + * uint64 denominator = 2; + * @return The denominator. + */ + @java.lang.Override + public long getDenominator() { + return instance.getDenominator(); + } + /** + * uint64 denominator = 2; + * @param value The denominator to set. + * @return This builder for chaining. + */ + public Builder setDenominator(long value) { + copyOnWrite(); + instance.setDenominator(value); + return this; + } + /** + * uint64 denominator = 2; + * @return This builder for chaining. + */ + public Builder clearDenominator() { + copyOnWrite(); + instance.clearDenominator(); + return this; + } + + // @@protoc_insertion_point(builder_scope:ibc.tendermint.light.Fraction) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new ibc.tendermint.light.TendermintLight.Fraction(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "numerator_", + "denominator_", + }; + java.lang.String info = + "\u0000\u0002\u0000\u0000\u0001\u0002\u0002\u0000\u0000\u0000\u0001\u0003\u0002\u0003" + + ""; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (ibc.tendermint.light.TendermintLight.Fraction.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:ibc.tendermint.light.Fraction) + private static final ibc.tendermint.light.TendermintLight.Fraction DEFAULT_INSTANCE; + static { + Fraction defaultInstance = new Fraction(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + Fraction.class, defaultInstance); + } + + public static ibc.tendermint.light.TendermintLight.Fraction getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } + } + + public interface DurationOrBuilder extends + // @@protoc_insertion_point(interface_extends:ibc.tendermint.light.Duration) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * int64 seconds = 1; + * @return The seconds. + */ + long getSeconds(); + + /** + * int32 nanos = 2; + * @return The nanos. + */ + int getNanos(); + } + /** + *
+   * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Timestamp
+   * 
+ * + * Protobuf type {@code ibc.tendermint.light.Duration} + */ + public static final class Duration extends + com.google.protobuf.GeneratedMessageLite< + Duration, Duration.Builder> implements + // @@protoc_insertion_point(message_implements:ibc.tendermint.light.Duration) + DurationOrBuilder { + private Duration() { + } + public static final int SECONDS_FIELD_NUMBER = 1; + private long seconds_; + /** + * int64 seconds = 1; + * @return The seconds. + */ + @java.lang.Override + public long getSeconds() { + return seconds_; + } + /** + * int64 seconds = 1; + * @param value The seconds to set. + */ + private void setSeconds(long value) { + + seconds_ = value; + } + /** + * int64 seconds = 1; + */ + private void clearSeconds() { + + seconds_ = 0L; + } + + public static final int NANOS_FIELD_NUMBER = 2; + private int nanos_; + /** + * int32 nanos = 2; + * @return The nanos. + */ + @java.lang.Override + public int getNanos() { + return nanos_; + } + /** + * int32 nanos = 2; + * @param value The nanos to set. + */ + private void setNanos(int value) { + + nanos_ = value; + } + /** + * int32 nanos = 2; + */ + private void clearNanos() { + + nanos_ = 0; + } + + public static ibc.tendermint.light.TendermintLight.Duration parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static ibc.tendermint.light.TendermintLight.Duration parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.Duration parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static ibc.tendermint.light.TendermintLight.Duration parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.Duration parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static ibc.tendermint.light.TendermintLight.Duration parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.Duration parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static ibc.tendermint.light.TendermintLight.Duration parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.Duration parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static ibc.tendermint.light.TendermintLight.Duration parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.Duration parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static ibc.tendermint.light.TendermintLight.Duration parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(ibc.tendermint.light.TendermintLight.Duration prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Timestamp
+     * 
+ * + * Protobuf type {@code ibc.tendermint.light.Duration} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + ibc.tendermint.light.TendermintLight.Duration, Builder> implements + // @@protoc_insertion_point(builder_implements:ibc.tendermint.light.Duration) + ibc.tendermint.light.TendermintLight.DurationOrBuilder { + // Construct using ibc.tendermint.light.TendermintLight.Duration.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * int64 seconds = 1; + * @return The seconds. + */ + @java.lang.Override + public long getSeconds() { + return instance.getSeconds(); + } + /** + * int64 seconds = 1; + * @param value The seconds to set. + * @return This builder for chaining. + */ + public Builder setSeconds(long value) { + copyOnWrite(); + instance.setSeconds(value); + return this; + } + /** + * int64 seconds = 1; + * @return This builder for chaining. + */ + public Builder clearSeconds() { + copyOnWrite(); + instance.clearSeconds(); + return this; + } + + /** + * int32 nanos = 2; + * @return The nanos. + */ + @java.lang.Override + public int getNanos() { + return instance.getNanos(); + } + /** + * int32 nanos = 2; + * @param value The nanos to set. + * @return This builder for chaining. + */ + public Builder setNanos(int value) { + copyOnWrite(); + instance.setNanos(value); + return this; + } + /** + * int32 nanos = 2; + * @return This builder for chaining. + */ + public Builder clearNanos() { + copyOnWrite(); + instance.clearNanos(); + return this; + } + + // @@protoc_insertion_point(builder_scope:ibc.tendermint.light.Duration) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new ibc.tendermint.light.TendermintLight.Duration(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "seconds_", + "nanos_", + }; + java.lang.String info = + "\u0000\u0002\u0000\u0000\u0001\u0002\u0002\u0000\u0000\u0000\u0001\u0002\u0002\u0004" + + ""; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (ibc.tendermint.light.TendermintLight.Duration.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:ibc.tendermint.light.Duration) + private static final ibc.tendermint.light.TendermintLight.Duration DEFAULT_INSTANCE; + static { + Duration defaultInstance = new Duration(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + Duration.class, defaultInstance); + } + + public static ibc.tendermint.light.TendermintLight.Duration getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } + } + + public interface ConsensusOrBuilder extends + // @@protoc_insertion_point(interface_extends:ibc.tendermint.light.Consensus) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * uint64 block = 1; + * @return The block. + */ + long getBlock(); + + /** + * uint64 app = 2; + * @return The app. + */ + long getApp(); + } + /** + * Protobuf type {@code ibc.tendermint.light.Consensus} + */ + public static final class Consensus extends + com.google.protobuf.GeneratedMessageLite< + Consensus, Consensus.Builder> implements + // @@protoc_insertion_point(message_implements:ibc.tendermint.light.Consensus) + ConsensusOrBuilder { + private Consensus() { + } + public static final int BLOCK_FIELD_NUMBER = 1; + private long block_; + /** + * uint64 block = 1; + * @return The block. + */ + @java.lang.Override + public long getBlock() { + return block_; + } + /** + * uint64 block = 1; + * @param value The block to set. + */ + private void setBlock(long value) { + + block_ = value; + } + /** + * uint64 block = 1; + */ + private void clearBlock() { + + block_ = 0L; + } + + public static final int APP_FIELD_NUMBER = 2; + private long app_; + /** + * uint64 app = 2; + * @return The app. + */ + @java.lang.Override + public long getApp() { + return app_; + } + /** + * uint64 app = 2; + * @param value The app to set. + */ + private void setApp(long value) { + + app_ = value; + } + /** + * uint64 app = 2; + */ + private void clearApp() { + + app_ = 0L; + } + + public static ibc.tendermint.light.TendermintLight.Consensus parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static ibc.tendermint.light.TendermintLight.Consensus parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.Consensus parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static ibc.tendermint.light.TendermintLight.Consensus parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.Consensus parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static ibc.tendermint.light.TendermintLight.Consensus parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.Consensus parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static ibc.tendermint.light.TendermintLight.Consensus parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.Consensus parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static ibc.tendermint.light.TendermintLight.Consensus parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.Consensus parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static ibc.tendermint.light.TendermintLight.Consensus parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(ibc.tendermint.light.TendermintLight.Consensus prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + * Protobuf type {@code ibc.tendermint.light.Consensus} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + ibc.tendermint.light.TendermintLight.Consensus, Builder> implements + // @@protoc_insertion_point(builder_implements:ibc.tendermint.light.Consensus) + ibc.tendermint.light.TendermintLight.ConsensusOrBuilder { + // Construct using ibc.tendermint.light.TendermintLight.Consensus.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * uint64 block = 1; + * @return The block. + */ + @java.lang.Override + public long getBlock() { + return instance.getBlock(); + } + /** + * uint64 block = 1; + * @param value The block to set. + * @return This builder for chaining. + */ + public Builder setBlock(long value) { + copyOnWrite(); + instance.setBlock(value); + return this; + } + /** + * uint64 block = 1; + * @return This builder for chaining. + */ + public Builder clearBlock() { + copyOnWrite(); + instance.clearBlock(); + return this; + } + + /** + * uint64 app = 2; + * @return The app. + */ + @java.lang.Override + public long getApp() { + return instance.getApp(); + } + /** + * uint64 app = 2; + * @param value The app to set. + * @return This builder for chaining. + */ + public Builder setApp(long value) { + copyOnWrite(); + instance.setApp(value); + return this; + } + /** + * uint64 app = 2; + * @return This builder for chaining. + */ + public Builder clearApp() { + copyOnWrite(); + instance.clearApp(); + return this; + } + + // @@protoc_insertion_point(builder_scope:ibc.tendermint.light.Consensus) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new ibc.tendermint.light.TendermintLight.Consensus(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "block_", + "app_", + }; + java.lang.String info = + "\u0000\u0002\u0000\u0000\u0001\u0002\u0002\u0000\u0000\u0000\u0001\u0003\u0002\u0003" + + ""; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (ibc.tendermint.light.TendermintLight.Consensus.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:ibc.tendermint.light.Consensus) + private static final ibc.tendermint.light.TendermintLight.Consensus DEFAULT_INSTANCE; + static { + Consensus defaultInstance = new Consensus(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + Consensus.class, defaultInstance); + } + + public static ibc.tendermint.light.TendermintLight.Consensus getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } + } + + public interface ClientStateOrBuilder extends + // @@protoc_insertion_point(interface_extends:ibc.tendermint.light.ClientState) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * string chain_id = 1; + * @return The chainId. + */ + java.lang.String getChainId(); + /** + * string chain_id = 1; + * @return The bytes for chainId. + */ + com.google.protobuf.ByteString + getChainIdBytes(); + + /** + * .ibc.tendermint.light.Fraction trust_level = 2; + * @return Whether the trustLevel field is set. + */ + boolean hasTrustLevel(); + /** + * .ibc.tendermint.light.Fraction trust_level = 2; + * @return The trustLevel. + */ + ibc.tendermint.light.TendermintLight.Fraction getTrustLevel(); + + /** + *
+     * duration of the period since the LastestTimestamp during which the
+     * submitted headers are valid for upgrade
+     * 
+ * + * .ibc.tendermint.light.Duration trusting_period = 3; + * @return Whether the trustingPeriod field is set. + */ + boolean hasTrustingPeriod(); + /** + *
+     * duration of the period since the LastestTimestamp during which the
+     * submitted headers are valid for upgrade
+     * 
+ * + * .ibc.tendermint.light.Duration trusting_period = 3; + * @return The trustingPeriod. + */ + ibc.tendermint.light.TendermintLight.Duration getTrustingPeriod(); + + /** + *
+     * duration of the staking unbonding period
+     * 
+ * + * .ibc.tendermint.light.Duration unbonding_period = 4; + * @return Whether the unbondingPeriod field is set. + */ + boolean hasUnbondingPeriod(); + /** + *
+     * duration of the staking unbonding period
+     * 
+ * + * .ibc.tendermint.light.Duration unbonding_period = 4; + * @return The unbondingPeriod. + */ + ibc.tendermint.light.TendermintLight.Duration getUnbondingPeriod(); + + /** + *
+     * defines how much new (untrusted) header's Time can drift into the future.
+     * 
+ * + * .ibc.tendermint.light.Duration max_clock_drift = 5; + * @return Whether the maxClockDrift field is set. + */ + boolean hasMaxClockDrift(); + /** + *
+     * defines how much new (untrusted) header's Time can drift into the future.
+     * 
+ * + * .ibc.tendermint.light.Duration max_clock_drift = 5; + * @return The maxClockDrift. + */ + ibc.tendermint.light.TendermintLight.Duration getMaxClockDrift(); + + /** + *
+     * Block height when the client was frozen due to a misbehaviour
+     *ibc.core.client.v1.Height frozen_height = 6;
+     * 
+ * + * int64 frozen_height = 6; + * @return The frozenHeight. + */ + long getFrozenHeight(); + + /** + *
+     * Latest height the client was updated to
+     * 
+ * + * int64 latest_height = 7; + * @return The latestHeight. + */ + long getLatestHeight(); + + /** + *
+     * This flag, when set to true, will allow governance to recover a client
+     * which has expired
+     * 
+ * + * bool allow_update_after_expiry = 8; + * @return The allowUpdateAfterExpiry. + */ + boolean getAllowUpdateAfterExpiry(); + + /** + *
+     * This flag, when set to true, will allow governance to unfreeze a client
+     * whose chain has experienced a misbehaviour event
+     * 
+ * + * bool allow_update_after_misbehaviour = 9; + * @return The allowUpdateAfterMisbehaviour. + */ + boolean getAllowUpdateAfterMisbehaviour(); + } + /** + * Protobuf type {@code ibc.tendermint.light.ClientState} + */ + public static final class ClientState extends + com.google.protobuf.GeneratedMessageLite< + ClientState, ClientState.Builder> implements + // @@protoc_insertion_point(message_implements:ibc.tendermint.light.ClientState) + ClientStateOrBuilder { + private ClientState() { + chainId_ = ""; + } + public static final int CHAIN_ID_FIELD_NUMBER = 1; + private java.lang.String chainId_; + /** + * string chain_id = 1; + * @return The chainId. + */ + @java.lang.Override + public java.lang.String getChainId() { + return chainId_; + } + /** + * string chain_id = 1; + * @return The bytes for chainId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getChainIdBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(chainId_); + } + /** + * string chain_id = 1; + * @param value The chainId to set. + */ + private void setChainId( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + chainId_ = value; + } + /** + * string chain_id = 1; + */ + private void clearChainId() { + + chainId_ = getDefaultInstance().getChainId(); + } + /** + * string chain_id = 1; + * @param value The bytes for chainId to set. + */ + private void setChainIdBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + chainId_ = value.toStringUtf8(); + + } + + public static final int TRUST_LEVEL_FIELD_NUMBER = 2; + private ibc.tendermint.light.TendermintLight.Fraction trustLevel_; + /** + * .ibc.tendermint.light.Fraction trust_level = 2; + */ + @java.lang.Override + public boolean hasTrustLevel() { + return trustLevel_ != null; + } + /** + * .ibc.tendermint.light.Fraction trust_level = 2; + */ + @java.lang.Override + public ibc.tendermint.light.TendermintLight.Fraction getTrustLevel() { + return trustLevel_ == null ? ibc.tendermint.light.TendermintLight.Fraction.getDefaultInstance() : trustLevel_; + } + /** + * .ibc.tendermint.light.Fraction trust_level = 2; + */ + private void setTrustLevel(ibc.tendermint.light.TendermintLight.Fraction value) { + value.getClass(); + trustLevel_ = value; + + } + /** + * .ibc.tendermint.light.Fraction trust_level = 2; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeTrustLevel(ibc.tendermint.light.TendermintLight.Fraction value) { + value.getClass(); + if (trustLevel_ != null && + trustLevel_ != ibc.tendermint.light.TendermintLight.Fraction.getDefaultInstance()) { + trustLevel_ = + ibc.tendermint.light.TendermintLight.Fraction.newBuilder(trustLevel_).mergeFrom(value).buildPartial(); + } else { + trustLevel_ = value; + } + + } + /** + * .ibc.tendermint.light.Fraction trust_level = 2; + */ + private void clearTrustLevel() { trustLevel_ = null; + + } + + public static final int TRUSTING_PERIOD_FIELD_NUMBER = 3; + private ibc.tendermint.light.TendermintLight.Duration trustingPeriod_; + /** + *
+     * duration of the period since the LastestTimestamp during which the
+     * submitted headers are valid for upgrade
+     * 
+ * + * .ibc.tendermint.light.Duration trusting_period = 3; + */ + @java.lang.Override + public boolean hasTrustingPeriod() { + return trustingPeriod_ != null; + } + /** + *
+     * duration of the period since the LastestTimestamp during which the
+     * submitted headers are valid for upgrade
+     * 
+ * + * .ibc.tendermint.light.Duration trusting_period = 3; + */ + @java.lang.Override + public ibc.tendermint.light.TendermintLight.Duration getTrustingPeriod() { + return trustingPeriod_ == null ? ibc.tendermint.light.TendermintLight.Duration.getDefaultInstance() : trustingPeriod_; + } + /** + *
+     * duration of the period since the LastestTimestamp during which the
+     * submitted headers are valid for upgrade
+     * 
+ * + * .ibc.tendermint.light.Duration trusting_period = 3; + */ + private void setTrustingPeriod(ibc.tendermint.light.TendermintLight.Duration value) { + value.getClass(); + trustingPeriod_ = value; + + } + /** + *
+     * duration of the period since the LastestTimestamp during which the
+     * submitted headers are valid for upgrade
+     * 
+ * + * .ibc.tendermint.light.Duration trusting_period = 3; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeTrustingPeriod(ibc.tendermint.light.TendermintLight.Duration value) { + value.getClass(); + if (trustingPeriod_ != null && + trustingPeriod_ != ibc.tendermint.light.TendermintLight.Duration.getDefaultInstance()) { + trustingPeriod_ = + ibc.tendermint.light.TendermintLight.Duration.newBuilder(trustingPeriod_).mergeFrom(value).buildPartial(); + } else { + trustingPeriod_ = value; + } + + } + /** + *
+     * duration of the period since the LastestTimestamp during which the
+     * submitted headers are valid for upgrade
+     * 
+ * + * .ibc.tendermint.light.Duration trusting_period = 3; + */ + private void clearTrustingPeriod() { trustingPeriod_ = null; + + } + + public static final int UNBONDING_PERIOD_FIELD_NUMBER = 4; + private ibc.tendermint.light.TendermintLight.Duration unbondingPeriod_; + /** + *
+     * duration of the staking unbonding period
+     * 
+ * + * .ibc.tendermint.light.Duration unbonding_period = 4; + */ + @java.lang.Override + public boolean hasUnbondingPeriod() { + return unbondingPeriod_ != null; + } + /** + *
+     * duration of the staking unbonding period
+     * 
+ * + * .ibc.tendermint.light.Duration unbonding_period = 4; + */ + @java.lang.Override + public ibc.tendermint.light.TendermintLight.Duration getUnbondingPeriod() { + return unbondingPeriod_ == null ? ibc.tendermint.light.TendermintLight.Duration.getDefaultInstance() : unbondingPeriod_; + } + /** + *
+     * duration of the staking unbonding period
+     * 
+ * + * .ibc.tendermint.light.Duration unbonding_period = 4; + */ + private void setUnbondingPeriod(ibc.tendermint.light.TendermintLight.Duration value) { + value.getClass(); + unbondingPeriod_ = value; + + } + /** + *
+     * duration of the staking unbonding period
+     * 
+ * + * .ibc.tendermint.light.Duration unbonding_period = 4; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeUnbondingPeriod(ibc.tendermint.light.TendermintLight.Duration value) { + value.getClass(); + if (unbondingPeriod_ != null && + unbondingPeriod_ != ibc.tendermint.light.TendermintLight.Duration.getDefaultInstance()) { + unbondingPeriod_ = + ibc.tendermint.light.TendermintLight.Duration.newBuilder(unbondingPeriod_).mergeFrom(value).buildPartial(); + } else { + unbondingPeriod_ = value; + } + + } + /** + *
+     * duration of the staking unbonding period
+     * 
+ * + * .ibc.tendermint.light.Duration unbonding_period = 4; + */ + private void clearUnbondingPeriod() { unbondingPeriod_ = null; + + } + + public static final int MAX_CLOCK_DRIFT_FIELD_NUMBER = 5; + private ibc.tendermint.light.TendermintLight.Duration maxClockDrift_; + /** + *
+     * defines how much new (untrusted) header's Time can drift into the future.
+     * 
+ * + * .ibc.tendermint.light.Duration max_clock_drift = 5; + */ + @java.lang.Override + public boolean hasMaxClockDrift() { + return maxClockDrift_ != null; + } + /** + *
+     * defines how much new (untrusted) header's Time can drift into the future.
+     * 
+ * + * .ibc.tendermint.light.Duration max_clock_drift = 5; + */ + @java.lang.Override + public ibc.tendermint.light.TendermintLight.Duration getMaxClockDrift() { + return maxClockDrift_ == null ? ibc.tendermint.light.TendermintLight.Duration.getDefaultInstance() : maxClockDrift_; + } + /** + *
+     * defines how much new (untrusted) header's Time can drift into the future.
+     * 
+ * + * .ibc.tendermint.light.Duration max_clock_drift = 5; + */ + private void setMaxClockDrift(ibc.tendermint.light.TendermintLight.Duration value) { + value.getClass(); + maxClockDrift_ = value; + + } + /** + *
+     * defines how much new (untrusted) header's Time can drift into the future.
+     * 
+ * + * .ibc.tendermint.light.Duration max_clock_drift = 5; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeMaxClockDrift(ibc.tendermint.light.TendermintLight.Duration value) { + value.getClass(); + if (maxClockDrift_ != null && + maxClockDrift_ != ibc.tendermint.light.TendermintLight.Duration.getDefaultInstance()) { + maxClockDrift_ = + ibc.tendermint.light.TendermintLight.Duration.newBuilder(maxClockDrift_).mergeFrom(value).buildPartial(); + } else { + maxClockDrift_ = value; + } + + } + /** + *
+     * defines how much new (untrusted) header's Time can drift into the future.
+     * 
+ * + * .ibc.tendermint.light.Duration max_clock_drift = 5; + */ + private void clearMaxClockDrift() { maxClockDrift_ = null; + + } + + public static final int FROZEN_HEIGHT_FIELD_NUMBER = 6; + private long frozenHeight_; + /** + *
+     * Block height when the client was frozen due to a misbehaviour
+     *ibc.core.client.v1.Height frozen_height = 6;
+     * 
+ * + * int64 frozen_height = 6; + * @return The frozenHeight. + */ + @java.lang.Override + public long getFrozenHeight() { + return frozenHeight_; + } + /** + *
+     * Block height when the client was frozen due to a misbehaviour
+     *ibc.core.client.v1.Height frozen_height = 6;
+     * 
+ * + * int64 frozen_height = 6; + * @param value The frozenHeight to set. + */ + private void setFrozenHeight(long value) { + + frozenHeight_ = value; + } + /** + *
+     * Block height when the client was frozen due to a misbehaviour
+     *ibc.core.client.v1.Height frozen_height = 6;
+     * 
+ * + * int64 frozen_height = 6; + */ + private void clearFrozenHeight() { + + frozenHeight_ = 0L; + } + + public static final int LATEST_HEIGHT_FIELD_NUMBER = 7; + private long latestHeight_; + /** + *
+     * Latest height the client was updated to
+     * 
+ * + * int64 latest_height = 7; + * @return The latestHeight. + */ + @java.lang.Override + public long getLatestHeight() { + return latestHeight_; + } + /** + *
+     * Latest height the client was updated to
+     * 
+ * + * int64 latest_height = 7; + * @param value The latestHeight to set. + */ + private void setLatestHeight(long value) { + + latestHeight_ = value; + } + /** + *
+     * Latest height the client was updated to
+     * 
+ * + * int64 latest_height = 7; + */ + private void clearLatestHeight() { + + latestHeight_ = 0L; + } + + public static final int ALLOW_UPDATE_AFTER_EXPIRY_FIELD_NUMBER = 8; + private boolean allowUpdateAfterExpiry_; + /** + *
+     * This flag, when set to true, will allow governance to recover a client
+     * which has expired
+     * 
+ * + * bool allow_update_after_expiry = 8; + * @return The allowUpdateAfterExpiry. + */ + @java.lang.Override + public boolean getAllowUpdateAfterExpiry() { + return allowUpdateAfterExpiry_; + } + /** + *
+     * This flag, when set to true, will allow governance to recover a client
+     * which has expired
+     * 
+ * + * bool allow_update_after_expiry = 8; + * @param value The allowUpdateAfterExpiry to set. + */ + private void setAllowUpdateAfterExpiry(boolean value) { + + allowUpdateAfterExpiry_ = value; + } + /** + *
+     * This flag, when set to true, will allow governance to recover a client
+     * which has expired
+     * 
+ * + * bool allow_update_after_expiry = 8; + */ + private void clearAllowUpdateAfterExpiry() { + + allowUpdateAfterExpiry_ = false; + } + + public static final int ALLOW_UPDATE_AFTER_MISBEHAVIOUR_FIELD_NUMBER = 9; + private boolean allowUpdateAfterMisbehaviour_; + /** + *
+     * This flag, when set to true, will allow governance to unfreeze a client
+     * whose chain has experienced a misbehaviour event
+     * 
+ * + * bool allow_update_after_misbehaviour = 9; + * @return The allowUpdateAfterMisbehaviour. + */ + @java.lang.Override + public boolean getAllowUpdateAfterMisbehaviour() { + return allowUpdateAfterMisbehaviour_; + } + /** + *
+     * This flag, when set to true, will allow governance to unfreeze a client
+     * whose chain has experienced a misbehaviour event
+     * 
+ * + * bool allow_update_after_misbehaviour = 9; + * @param value The allowUpdateAfterMisbehaviour to set. + */ + private void setAllowUpdateAfterMisbehaviour(boolean value) { + + allowUpdateAfterMisbehaviour_ = value; + } + /** + *
+     * This flag, when set to true, will allow governance to unfreeze a client
+     * whose chain has experienced a misbehaviour event
+     * 
+ * + * bool allow_update_after_misbehaviour = 9; + */ + private void clearAllowUpdateAfterMisbehaviour() { + + allowUpdateAfterMisbehaviour_ = false; + } + + public static ibc.tendermint.light.TendermintLight.ClientState parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static ibc.tendermint.light.TendermintLight.ClientState parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.ClientState parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static ibc.tendermint.light.TendermintLight.ClientState parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.ClientState parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static ibc.tendermint.light.TendermintLight.ClientState parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.ClientState parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static ibc.tendermint.light.TendermintLight.ClientState parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.ClientState parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static ibc.tendermint.light.TendermintLight.ClientState parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.ClientState parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static ibc.tendermint.light.TendermintLight.ClientState parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(ibc.tendermint.light.TendermintLight.ClientState prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + * Protobuf type {@code ibc.tendermint.light.ClientState} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + ibc.tendermint.light.TendermintLight.ClientState, Builder> implements + // @@protoc_insertion_point(builder_implements:ibc.tendermint.light.ClientState) + ibc.tendermint.light.TendermintLight.ClientStateOrBuilder { + // Construct using ibc.tendermint.light.TendermintLight.ClientState.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * string chain_id = 1; + * @return The chainId. + */ + @java.lang.Override + public java.lang.String getChainId() { + return instance.getChainId(); + } + /** + * string chain_id = 1; + * @return The bytes for chainId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getChainIdBytes() { + return instance.getChainIdBytes(); + } + /** + * string chain_id = 1; + * @param value The chainId to set. + * @return This builder for chaining. + */ + public Builder setChainId( + java.lang.String value) { + copyOnWrite(); + instance.setChainId(value); + return this; + } + /** + * string chain_id = 1; + * @return This builder for chaining. + */ + public Builder clearChainId() { + copyOnWrite(); + instance.clearChainId(); + return this; + } + /** + * string chain_id = 1; + * @param value The bytes for chainId to set. + * @return This builder for chaining. + */ + public Builder setChainIdBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setChainIdBytes(value); + return this; + } + + /** + * .ibc.tendermint.light.Fraction trust_level = 2; + */ + @java.lang.Override + public boolean hasTrustLevel() { + return instance.hasTrustLevel(); + } + /** + * .ibc.tendermint.light.Fraction trust_level = 2; + */ + @java.lang.Override + public ibc.tendermint.light.TendermintLight.Fraction getTrustLevel() { + return instance.getTrustLevel(); + } + /** + * .ibc.tendermint.light.Fraction trust_level = 2; + */ + public Builder setTrustLevel(ibc.tendermint.light.TendermintLight.Fraction value) { + copyOnWrite(); + instance.setTrustLevel(value); + return this; + } + /** + * .ibc.tendermint.light.Fraction trust_level = 2; + */ + public Builder setTrustLevel( + ibc.tendermint.light.TendermintLight.Fraction.Builder builderForValue) { + copyOnWrite(); + instance.setTrustLevel(builderForValue.build()); + return this; + } + /** + * .ibc.tendermint.light.Fraction trust_level = 2; + */ + public Builder mergeTrustLevel(ibc.tendermint.light.TendermintLight.Fraction value) { + copyOnWrite(); + instance.mergeTrustLevel(value); + return this; + } + /** + * .ibc.tendermint.light.Fraction trust_level = 2; + */ + public Builder clearTrustLevel() { copyOnWrite(); + instance.clearTrustLevel(); + return this; + } + + /** + *
+       * duration of the period since the LastestTimestamp during which the
+       * submitted headers are valid for upgrade
+       * 
+ * + * .ibc.tendermint.light.Duration trusting_period = 3; + */ + @java.lang.Override + public boolean hasTrustingPeriod() { + return instance.hasTrustingPeriod(); + } + /** + *
+       * duration of the period since the LastestTimestamp during which the
+       * submitted headers are valid for upgrade
+       * 
+ * + * .ibc.tendermint.light.Duration trusting_period = 3; + */ + @java.lang.Override + public ibc.tendermint.light.TendermintLight.Duration getTrustingPeriod() { + return instance.getTrustingPeriod(); + } + /** + *
+       * duration of the period since the LastestTimestamp during which the
+       * submitted headers are valid for upgrade
+       * 
+ * + * .ibc.tendermint.light.Duration trusting_period = 3; + */ + public Builder setTrustingPeriod(ibc.tendermint.light.TendermintLight.Duration value) { + copyOnWrite(); + instance.setTrustingPeriod(value); + return this; + } + /** + *
+       * duration of the period since the LastestTimestamp during which the
+       * submitted headers are valid for upgrade
+       * 
+ * + * .ibc.tendermint.light.Duration trusting_period = 3; + */ + public Builder setTrustingPeriod( + ibc.tendermint.light.TendermintLight.Duration.Builder builderForValue) { + copyOnWrite(); + instance.setTrustingPeriod(builderForValue.build()); + return this; + } + /** + *
+       * duration of the period since the LastestTimestamp during which the
+       * submitted headers are valid for upgrade
+       * 
+ * + * .ibc.tendermint.light.Duration trusting_period = 3; + */ + public Builder mergeTrustingPeriod(ibc.tendermint.light.TendermintLight.Duration value) { + copyOnWrite(); + instance.mergeTrustingPeriod(value); + return this; + } + /** + *
+       * duration of the period since the LastestTimestamp during which the
+       * submitted headers are valid for upgrade
+       * 
+ * + * .ibc.tendermint.light.Duration trusting_period = 3; + */ + public Builder clearTrustingPeriod() { copyOnWrite(); + instance.clearTrustingPeriod(); + return this; + } + + /** + *
+       * duration of the staking unbonding period
+       * 
+ * + * .ibc.tendermint.light.Duration unbonding_period = 4; + */ + @java.lang.Override + public boolean hasUnbondingPeriod() { + return instance.hasUnbondingPeriod(); + } + /** + *
+       * duration of the staking unbonding period
+       * 
+ * + * .ibc.tendermint.light.Duration unbonding_period = 4; + */ + @java.lang.Override + public ibc.tendermint.light.TendermintLight.Duration getUnbondingPeriod() { + return instance.getUnbondingPeriod(); + } + /** + *
+       * duration of the staking unbonding period
+       * 
+ * + * .ibc.tendermint.light.Duration unbonding_period = 4; + */ + public Builder setUnbondingPeriod(ibc.tendermint.light.TendermintLight.Duration value) { + copyOnWrite(); + instance.setUnbondingPeriod(value); + return this; + } + /** + *
+       * duration of the staking unbonding period
+       * 
+ * + * .ibc.tendermint.light.Duration unbonding_period = 4; + */ + public Builder setUnbondingPeriod( + ibc.tendermint.light.TendermintLight.Duration.Builder builderForValue) { + copyOnWrite(); + instance.setUnbondingPeriod(builderForValue.build()); + return this; + } + /** + *
+       * duration of the staking unbonding period
+       * 
+ * + * .ibc.tendermint.light.Duration unbonding_period = 4; + */ + public Builder mergeUnbondingPeriod(ibc.tendermint.light.TendermintLight.Duration value) { + copyOnWrite(); + instance.mergeUnbondingPeriod(value); + return this; + } + /** + *
+       * duration of the staking unbonding period
+       * 
+ * + * .ibc.tendermint.light.Duration unbonding_period = 4; + */ + public Builder clearUnbondingPeriod() { copyOnWrite(); + instance.clearUnbondingPeriod(); + return this; + } + + /** + *
+       * defines how much new (untrusted) header's Time can drift into the future.
+       * 
+ * + * .ibc.tendermint.light.Duration max_clock_drift = 5; + */ + @java.lang.Override + public boolean hasMaxClockDrift() { + return instance.hasMaxClockDrift(); + } + /** + *
+       * defines how much new (untrusted) header's Time can drift into the future.
+       * 
+ * + * .ibc.tendermint.light.Duration max_clock_drift = 5; + */ + @java.lang.Override + public ibc.tendermint.light.TendermintLight.Duration getMaxClockDrift() { + return instance.getMaxClockDrift(); + } + /** + *
+       * defines how much new (untrusted) header's Time can drift into the future.
+       * 
+ * + * .ibc.tendermint.light.Duration max_clock_drift = 5; + */ + public Builder setMaxClockDrift(ibc.tendermint.light.TendermintLight.Duration value) { + copyOnWrite(); + instance.setMaxClockDrift(value); + return this; + } + /** + *
+       * defines how much new (untrusted) header's Time can drift into the future.
+       * 
+ * + * .ibc.tendermint.light.Duration max_clock_drift = 5; + */ + public Builder setMaxClockDrift( + ibc.tendermint.light.TendermintLight.Duration.Builder builderForValue) { + copyOnWrite(); + instance.setMaxClockDrift(builderForValue.build()); + return this; + } + /** + *
+       * defines how much new (untrusted) header's Time can drift into the future.
+       * 
+ * + * .ibc.tendermint.light.Duration max_clock_drift = 5; + */ + public Builder mergeMaxClockDrift(ibc.tendermint.light.TendermintLight.Duration value) { + copyOnWrite(); + instance.mergeMaxClockDrift(value); + return this; + } + /** + *
+       * defines how much new (untrusted) header's Time can drift into the future.
+       * 
+ * + * .ibc.tendermint.light.Duration max_clock_drift = 5; + */ + public Builder clearMaxClockDrift() { copyOnWrite(); + instance.clearMaxClockDrift(); + return this; + } + + /** + *
+       * Block height when the client was frozen due to a misbehaviour
+       *ibc.core.client.v1.Height frozen_height = 6;
+       * 
+ * + * int64 frozen_height = 6; + * @return The frozenHeight. + */ + @java.lang.Override + public long getFrozenHeight() { + return instance.getFrozenHeight(); + } + /** + *
+       * Block height when the client was frozen due to a misbehaviour
+       *ibc.core.client.v1.Height frozen_height = 6;
+       * 
+ * + * int64 frozen_height = 6; + * @param value The frozenHeight to set. + * @return This builder for chaining. + */ + public Builder setFrozenHeight(long value) { + copyOnWrite(); + instance.setFrozenHeight(value); + return this; + } + /** + *
+       * Block height when the client was frozen due to a misbehaviour
+       *ibc.core.client.v1.Height frozen_height = 6;
+       * 
+ * + * int64 frozen_height = 6; + * @return This builder for chaining. + */ + public Builder clearFrozenHeight() { + copyOnWrite(); + instance.clearFrozenHeight(); + return this; + } + + /** + *
+       * Latest height the client was updated to
+       * 
+ * + * int64 latest_height = 7; + * @return The latestHeight. + */ + @java.lang.Override + public long getLatestHeight() { + return instance.getLatestHeight(); + } + /** + *
+       * Latest height the client was updated to
+       * 
+ * + * int64 latest_height = 7; + * @param value The latestHeight to set. + * @return This builder for chaining. + */ + public Builder setLatestHeight(long value) { + copyOnWrite(); + instance.setLatestHeight(value); + return this; + } + /** + *
+       * Latest height the client was updated to
+       * 
+ * + * int64 latest_height = 7; + * @return This builder for chaining. + */ + public Builder clearLatestHeight() { + copyOnWrite(); + instance.clearLatestHeight(); + return this; + } + + /** + *
+       * This flag, when set to true, will allow governance to recover a client
+       * which has expired
+       * 
+ * + * bool allow_update_after_expiry = 8; + * @return The allowUpdateAfterExpiry. + */ + @java.lang.Override + public boolean getAllowUpdateAfterExpiry() { + return instance.getAllowUpdateAfterExpiry(); + } + /** + *
+       * This flag, when set to true, will allow governance to recover a client
+       * which has expired
+       * 
+ * + * bool allow_update_after_expiry = 8; + * @param value The allowUpdateAfterExpiry to set. + * @return This builder for chaining. + */ + public Builder setAllowUpdateAfterExpiry(boolean value) { + copyOnWrite(); + instance.setAllowUpdateAfterExpiry(value); + return this; + } + /** + *
+       * This flag, when set to true, will allow governance to recover a client
+       * which has expired
+       * 
+ * + * bool allow_update_after_expiry = 8; + * @return This builder for chaining. + */ + public Builder clearAllowUpdateAfterExpiry() { + copyOnWrite(); + instance.clearAllowUpdateAfterExpiry(); + return this; + } + + /** + *
+       * This flag, when set to true, will allow governance to unfreeze a client
+       * whose chain has experienced a misbehaviour event
+       * 
+ * + * bool allow_update_after_misbehaviour = 9; + * @return The allowUpdateAfterMisbehaviour. + */ + @java.lang.Override + public boolean getAllowUpdateAfterMisbehaviour() { + return instance.getAllowUpdateAfterMisbehaviour(); + } + /** + *
+       * This flag, when set to true, will allow governance to unfreeze a client
+       * whose chain has experienced a misbehaviour event
+       * 
+ * + * bool allow_update_after_misbehaviour = 9; + * @param value The allowUpdateAfterMisbehaviour to set. + * @return This builder for chaining. + */ + public Builder setAllowUpdateAfterMisbehaviour(boolean value) { + copyOnWrite(); + instance.setAllowUpdateAfterMisbehaviour(value); + return this; + } + /** + *
+       * This flag, when set to true, will allow governance to unfreeze a client
+       * whose chain has experienced a misbehaviour event
+       * 
+ * + * bool allow_update_after_misbehaviour = 9; + * @return This builder for chaining. + */ + public Builder clearAllowUpdateAfterMisbehaviour() { + copyOnWrite(); + instance.clearAllowUpdateAfterMisbehaviour(); + return this; + } + + // @@protoc_insertion_point(builder_scope:ibc.tendermint.light.ClientState) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new ibc.tendermint.light.TendermintLight.ClientState(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "chainId_", + "trustLevel_", + "trustingPeriod_", + "unbondingPeriod_", + "maxClockDrift_", + "frozenHeight_", + "latestHeight_", + "allowUpdateAfterExpiry_", + "allowUpdateAfterMisbehaviour_", + }; + java.lang.String info = + "\u0000\t\u0000\u0000\u0001\t\t\u0000\u0000\u0000\u0001\u0208\u0002\t\u0003\t\u0004" + + "\t\u0005\t\u0006\u0002\u0007\u0002\b\u0007\t\u0007"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (ibc.tendermint.light.TendermintLight.ClientState.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:ibc.tendermint.light.ClientState) + private static final ibc.tendermint.light.TendermintLight.ClientState DEFAULT_INSTANCE; + static { + ClientState defaultInstance = new ClientState(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + ClientState.class, defaultInstance); + } + + public static ibc.tendermint.light.TendermintLight.ClientState getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } + } + + public interface ConsensusStateOrBuilder extends + // @@protoc_insertion_point(interface_extends:ibc.tendermint.light.ConsensusState) + com.google.protobuf.MessageLiteOrBuilder { + + /** + *
+     * timestamp that corresponds to the block height in which the ConsensusState
+     * was stored.
+     * 
+ * + * .ibc.tendermint.light.Timestamp timestamp = 1; + * @return Whether the timestamp field is set. + */ + boolean hasTimestamp(); + /** + *
+     * timestamp that corresponds to the block height in which the ConsensusState
+     * was stored.
+     * 
+ * + * .ibc.tendermint.light.Timestamp timestamp = 1; + * @return The timestamp. + */ + ibc.tendermint.light.TendermintLight.Timestamp getTimestamp(); + + /** + *
+     * commitment root (i.e app hash)
+     * 
+ * + * .ibc.tendermint.light.MerkleRoot root = 2; + * @return Whether the root field is set. + */ + boolean hasRoot(); + /** + *
+     * commitment root (i.e app hash)
+     * 
+ * + * .ibc.tendermint.light.MerkleRoot root = 2; + * @return The root. + */ + ibc.tendermint.light.TendermintLight.MerkleRoot getRoot(); + + /** + * bytes next_validators_hash = 3; + * @return The nextValidatorsHash. + */ + com.google.protobuf.ByteString getNextValidatorsHash(); + } + /** + *
+   * ConsensusState defines the consensus state from Tendermint.
+   * 
+ * + * Protobuf type {@code ibc.tendermint.light.ConsensusState} + */ + public static final class ConsensusState extends + com.google.protobuf.GeneratedMessageLite< + ConsensusState, ConsensusState.Builder> implements + // @@protoc_insertion_point(message_implements:ibc.tendermint.light.ConsensusState) + ConsensusStateOrBuilder { + private ConsensusState() { + nextValidatorsHash_ = com.google.protobuf.ByteString.EMPTY; + } + public static final int TIMESTAMP_FIELD_NUMBER = 1; + private ibc.tendermint.light.TendermintLight.Timestamp timestamp_; + /** + *
+     * timestamp that corresponds to the block height in which the ConsensusState
+     * was stored.
+     * 
+ * + * .ibc.tendermint.light.Timestamp timestamp = 1; + */ + @java.lang.Override + public boolean hasTimestamp() { + return timestamp_ != null; + } + /** + *
+     * timestamp that corresponds to the block height in which the ConsensusState
+     * was stored.
+     * 
+ * + * .ibc.tendermint.light.Timestamp timestamp = 1; + */ + @java.lang.Override + public ibc.tendermint.light.TendermintLight.Timestamp getTimestamp() { + return timestamp_ == null ? ibc.tendermint.light.TendermintLight.Timestamp.getDefaultInstance() : timestamp_; + } + /** + *
+     * timestamp that corresponds to the block height in which the ConsensusState
+     * was stored.
+     * 
+ * + * .ibc.tendermint.light.Timestamp timestamp = 1; + */ + private void setTimestamp(ibc.tendermint.light.TendermintLight.Timestamp value) { + value.getClass(); + timestamp_ = value; + + } + /** + *
+     * timestamp that corresponds to the block height in which the ConsensusState
+     * was stored.
+     * 
+ * + * .ibc.tendermint.light.Timestamp timestamp = 1; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeTimestamp(ibc.tendermint.light.TendermintLight.Timestamp value) { + value.getClass(); + if (timestamp_ != null && + timestamp_ != ibc.tendermint.light.TendermintLight.Timestamp.getDefaultInstance()) { + timestamp_ = + ibc.tendermint.light.TendermintLight.Timestamp.newBuilder(timestamp_).mergeFrom(value).buildPartial(); + } else { + timestamp_ = value; + } + + } + /** + *
+     * timestamp that corresponds to the block height in which the ConsensusState
+     * was stored.
+     * 
+ * + * .ibc.tendermint.light.Timestamp timestamp = 1; + */ + private void clearTimestamp() { timestamp_ = null; + + } + + public static final int ROOT_FIELD_NUMBER = 2; + private ibc.tendermint.light.TendermintLight.MerkleRoot root_; + /** + *
+     * commitment root (i.e app hash)
+     * 
+ * + * .ibc.tendermint.light.MerkleRoot root = 2; + */ + @java.lang.Override + public boolean hasRoot() { + return root_ != null; + } + /** + *
+     * commitment root (i.e app hash)
+     * 
+ * + * .ibc.tendermint.light.MerkleRoot root = 2; + */ + @java.lang.Override + public ibc.tendermint.light.TendermintLight.MerkleRoot getRoot() { + return root_ == null ? ibc.tendermint.light.TendermintLight.MerkleRoot.getDefaultInstance() : root_; + } + /** + *
+     * commitment root (i.e app hash)
+     * 
+ * + * .ibc.tendermint.light.MerkleRoot root = 2; + */ + private void setRoot(ibc.tendermint.light.TendermintLight.MerkleRoot value) { + value.getClass(); + root_ = value; + + } + /** + *
+     * commitment root (i.e app hash)
+     * 
+ * + * .ibc.tendermint.light.MerkleRoot root = 2; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeRoot(ibc.tendermint.light.TendermintLight.MerkleRoot value) { + value.getClass(); + if (root_ != null && + root_ != ibc.tendermint.light.TendermintLight.MerkleRoot.getDefaultInstance()) { + root_ = + ibc.tendermint.light.TendermintLight.MerkleRoot.newBuilder(root_).mergeFrom(value).buildPartial(); + } else { + root_ = value; + } + + } + /** + *
+     * commitment root (i.e app hash)
+     * 
+ * + * .ibc.tendermint.light.MerkleRoot root = 2; + */ + private void clearRoot() { root_ = null; + + } + + public static final int NEXT_VALIDATORS_HASH_FIELD_NUMBER = 3; + private com.google.protobuf.ByteString nextValidatorsHash_; + /** + * bytes next_validators_hash = 3; + * @return The nextValidatorsHash. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextValidatorsHash() { + return nextValidatorsHash_; + } + /** + * bytes next_validators_hash = 3; + * @param value The nextValidatorsHash to set. + */ + private void setNextValidatorsHash(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + nextValidatorsHash_ = value; + } + /** + * bytes next_validators_hash = 3; + */ + private void clearNextValidatorsHash() { + + nextValidatorsHash_ = getDefaultInstance().getNextValidatorsHash(); + } + + public static ibc.tendermint.light.TendermintLight.ConsensusState parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static ibc.tendermint.light.TendermintLight.ConsensusState parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.ConsensusState parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static ibc.tendermint.light.TendermintLight.ConsensusState parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.ConsensusState parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static ibc.tendermint.light.TendermintLight.ConsensusState parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.ConsensusState parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static ibc.tendermint.light.TendermintLight.ConsensusState parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.ConsensusState parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static ibc.tendermint.light.TendermintLight.ConsensusState parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.ConsensusState parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static ibc.tendermint.light.TendermintLight.ConsensusState parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(ibc.tendermint.light.TendermintLight.ConsensusState prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+     * ConsensusState defines the consensus state from Tendermint.
+     * 
+ * + * Protobuf type {@code ibc.tendermint.light.ConsensusState} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + ibc.tendermint.light.TendermintLight.ConsensusState, Builder> implements + // @@protoc_insertion_point(builder_implements:ibc.tendermint.light.ConsensusState) + ibc.tendermint.light.TendermintLight.ConsensusStateOrBuilder { + // Construct using ibc.tendermint.light.TendermintLight.ConsensusState.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + *
+       * timestamp that corresponds to the block height in which the ConsensusState
+       * was stored.
+       * 
+ * + * .ibc.tendermint.light.Timestamp timestamp = 1; + */ + @java.lang.Override + public boolean hasTimestamp() { + return instance.hasTimestamp(); + } + /** + *
+       * timestamp that corresponds to the block height in which the ConsensusState
+       * was stored.
+       * 
+ * + * .ibc.tendermint.light.Timestamp timestamp = 1; + */ + @java.lang.Override + public ibc.tendermint.light.TendermintLight.Timestamp getTimestamp() { + return instance.getTimestamp(); + } + /** + *
+       * timestamp that corresponds to the block height in which the ConsensusState
+       * was stored.
+       * 
+ * + * .ibc.tendermint.light.Timestamp timestamp = 1; + */ + public Builder setTimestamp(ibc.tendermint.light.TendermintLight.Timestamp value) { + copyOnWrite(); + instance.setTimestamp(value); + return this; + } + /** + *
+       * timestamp that corresponds to the block height in which the ConsensusState
+       * was stored.
+       * 
+ * + * .ibc.tendermint.light.Timestamp timestamp = 1; + */ + public Builder setTimestamp( + ibc.tendermint.light.TendermintLight.Timestamp.Builder builderForValue) { + copyOnWrite(); + instance.setTimestamp(builderForValue.build()); + return this; + } + /** + *
+       * timestamp that corresponds to the block height in which the ConsensusState
+       * was stored.
+       * 
+ * + * .ibc.tendermint.light.Timestamp timestamp = 1; + */ + public Builder mergeTimestamp(ibc.tendermint.light.TendermintLight.Timestamp value) { + copyOnWrite(); + instance.mergeTimestamp(value); + return this; + } + /** + *
+       * timestamp that corresponds to the block height in which the ConsensusState
+       * was stored.
+       * 
+ * + * .ibc.tendermint.light.Timestamp timestamp = 1; + */ + public Builder clearTimestamp() { copyOnWrite(); + instance.clearTimestamp(); + return this; + } + + /** + *
+       * commitment root (i.e app hash)
+       * 
+ * + * .ibc.tendermint.light.MerkleRoot root = 2; + */ + @java.lang.Override + public boolean hasRoot() { + return instance.hasRoot(); + } + /** + *
+       * commitment root (i.e app hash)
+       * 
+ * + * .ibc.tendermint.light.MerkleRoot root = 2; + */ + @java.lang.Override + public ibc.tendermint.light.TendermintLight.MerkleRoot getRoot() { + return instance.getRoot(); + } + /** + *
+       * commitment root (i.e app hash)
+       * 
+ * + * .ibc.tendermint.light.MerkleRoot root = 2; + */ + public Builder setRoot(ibc.tendermint.light.TendermintLight.MerkleRoot value) { + copyOnWrite(); + instance.setRoot(value); + return this; + } + /** + *
+       * commitment root (i.e app hash)
+       * 
+ * + * .ibc.tendermint.light.MerkleRoot root = 2; + */ + public Builder setRoot( + ibc.tendermint.light.TendermintLight.MerkleRoot.Builder builderForValue) { + copyOnWrite(); + instance.setRoot(builderForValue.build()); + return this; + } + /** + *
+       * commitment root (i.e app hash)
+       * 
+ * + * .ibc.tendermint.light.MerkleRoot root = 2; + */ + public Builder mergeRoot(ibc.tendermint.light.TendermintLight.MerkleRoot value) { + copyOnWrite(); + instance.mergeRoot(value); + return this; + } + /** + *
+       * commitment root (i.e app hash)
+       * 
+ * + * .ibc.tendermint.light.MerkleRoot root = 2; + */ + public Builder clearRoot() { copyOnWrite(); + instance.clearRoot(); + return this; + } + + /** + * bytes next_validators_hash = 3; + * @return The nextValidatorsHash. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextValidatorsHash() { + return instance.getNextValidatorsHash(); + } + /** + * bytes next_validators_hash = 3; + * @param value The nextValidatorsHash to set. + * @return This builder for chaining. + */ + public Builder setNextValidatorsHash(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setNextValidatorsHash(value); + return this; + } + /** + * bytes next_validators_hash = 3; + * @return This builder for chaining. + */ + public Builder clearNextValidatorsHash() { + copyOnWrite(); + instance.clearNextValidatorsHash(); + return this; + } + + // @@protoc_insertion_point(builder_scope:ibc.tendermint.light.ConsensusState) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new ibc.tendermint.light.TendermintLight.ConsensusState(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "timestamp_", + "root_", + "nextValidatorsHash_", + }; + java.lang.String info = + "\u0000\u0003\u0000\u0000\u0001\u0003\u0003\u0000\u0000\u0000\u0001\t\u0002\t\u0003" + + "\n"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (ibc.tendermint.light.TendermintLight.ConsensusState.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:ibc.tendermint.light.ConsensusState) + private static final ibc.tendermint.light.TendermintLight.ConsensusState DEFAULT_INSTANCE; + static { + ConsensusState defaultInstance = new ConsensusState(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + ConsensusState.class, defaultInstance); + } + + public static ibc.tendermint.light.TendermintLight.ConsensusState getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } + } + + public interface MerkleRootOrBuilder extends + // @@protoc_insertion_point(interface_extends:ibc.tendermint.light.MerkleRoot) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * bytes hash = 1; + * @return The hash. + */ + com.google.protobuf.ByteString getHash(); + } + /** + *
+   * MerkleRoot defines a merkle root hash.
+   * In the Cosmos SDK, the AppHash of a block header becomes the root.
+   * 
+ * + * Protobuf type {@code ibc.tendermint.light.MerkleRoot} + */ + public static final class MerkleRoot extends + com.google.protobuf.GeneratedMessageLite< + MerkleRoot, MerkleRoot.Builder> implements + // @@protoc_insertion_point(message_implements:ibc.tendermint.light.MerkleRoot) + MerkleRootOrBuilder { + private MerkleRoot() { + hash_ = com.google.protobuf.ByteString.EMPTY; + } + public static final int HASH_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString hash_; + /** + * bytes hash = 1; + * @return The hash. + */ + @java.lang.Override + public com.google.protobuf.ByteString getHash() { + return hash_; + } + /** + * bytes hash = 1; + * @param value The hash to set. + */ + private void setHash(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + hash_ = value; + } + /** + * bytes hash = 1; + */ + private void clearHash() { + + hash_ = getDefaultInstance().getHash(); + } + + public static ibc.tendermint.light.TendermintLight.MerkleRoot parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static ibc.tendermint.light.TendermintLight.MerkleRoot parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.MerkleRoot parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static ibc.tendermint.light.TendermintLight.MerkleRoot parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.MerkleRoot parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static ibc.tendermint.light.TendermintLight.MerkleRoot parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.MerkleRoot parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static ibc.tendermint.light.TendermintLight.MerkleRoot parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.MerkleRoot parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static ibc.tendermint.light.TendermintLight.MerkleRoot parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.MerkleRoot parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static ibc.tendermint.light.TendermintLight.MerkleRoot parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(ibc.tendermint.light.TendermintLight.MerkleRoot prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+     * MerkleRoot defines a merkle root hash.
+     * In the Cosmos SDK, the AppHash of a block header becomes the root.
+     * 
+ * + * Protobuf type {@code ibc.tendermint.light.MerkleRoot} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + ibc.tendermint.light.TendermintLight.MerkleRoot, Builder> implements + // @@protoc_insertion_point(builder_implements:ibc.tendermint.light.MerkleRoot) + ibc.tendermint.light.TendermintLight.MerkleRootOrBuilder { + // Construct using ibc.tendermint.light.TendermintLight.MerkleRoot.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * bytes hash = 1; + * @return The hash. + */ + @java.lang.Override + public com.google.protobuf.ByteString getHash() { + return instance.getHash(); + } + /** + * bytes hash = 1; + * @param value The hash to set. + * @return This builder for chaining. + */ + public Builder setHash(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setHash(value); + return this; + } + /** + * bytes hash = 1; + * @return This builder for chaining. + */ + public Builder clearHash() { + copyOnWrite(); + instance.clearHash(); + return this; + } + + // @@protoc_insertion_point(builder_scope:ibc.tendermint.light.MerkleRoot) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new ibc.tendermint.light.TendermintLight.MerkleRoot(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "hash_", + }; + java.lang.String info = + "\u0000\u0001\u0000\u0000\u0001\u0001\u0001\u0000\u0000\u0000\u0001\n"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (ibc.tendermint.light.TendermintLight.MerkleRoot.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:ibc.tendermint.light.MerkleRoot) + private static final ibc.tendermint.light.TendermintLight.MerkleRoot DEFAULT_INSTANCE; + static { + MerkleRoot defaultInstance = new MerkleRoot(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + MerkleRoot.class, defaultInstance); + } + + public static ibc.tendermint.light.TendermintLight.MerkleRoot getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } + } + + public interface CanonicalPartSetHeaderOrBuilder extends + // @@protoc_insertion_point(interface_extends:ibc.tendermint.light.CanonicalPartSetHeader) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * uint32 total = 1; + * @return The total. + */ + int getTotal(); + + /** + * bytes hash = 2; + * @return The hash. + */ + com.google.protobuf.ByteString getHash(); + } + /** + * Protobuf type {@code ibc.tendermint.light.CanonicalPartSetHeader} + */ + public static final class CanonicalPartSetHeader extends + com.google.protobuf.GeneratedMessageLite< + CanonicalPartSetHeader, CanonicalPartSetHeader.Builder> implements + // @@protoc_insertion_point(message_implements:ibc.tendermint.light.CanonicalPartSetHeader) + CanonicalPartSetHeaderOrBuilder { + private CanonicalPartSetHeader() { + hash_ = com.google.protobuf.ByteString.EMPTY; + } + public static final int TOTAL_FIELD_NUMBER = 1; + private int total_; + /** + * uint32 total = 1; + * @return The total. + */ + @java.lang.Override + public int getTotal() { + return total_; + } + /** + * uint32 total = 1; + * @param value The total to set. + */ + private void setTotal(int value) { + + total_ = value; + } + /** + * uint32 total = 1; + */ + private void clearTotal() { + + total_ = 0; + } + + public static final int HASH_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString hash_; + /** + * bytes hash = 2; + * @return The hash. + */ + @java.lang.Override + public com.google.protobuf.ByteString getHash() { + return hash_; + } + /** + * bytes hash = 2; + * @param value The hash to set. + */ + private void setHash(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + hash_ = value; + } + /** + * bytes hash = 2; + */ + private void clearHash() { + + hash_ = getDefaultInstance().getHash(); + } + + public static ibc.tendermint.light.TendermintLight.CanonicalPartSetHeader parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static ibc.tendermint.light.TendermintLight.CanonicalPartSetHeader parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.CanonicalPartSetHeader parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static ibc.tendermint.light.TendermintLight.CanonicalPartSetHeader parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.CanonicalPartSetHeader parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static ibc.tendermint.light.TendermintLight.CanonicalPartSetHeader parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.CanonicalPartSetHeader parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static ibc.tendermint.light.TendermintLight.CanonicalPartSetHeader parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.CanonicalPartSetHeader parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static ibc.tendermint.light.TendermintLight.CanonicalPartSetHeader parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.CanonicalPartSetHeader parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static ibc.tendermint.light.TendermintLight.CanonicalPartSetHeader parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(ibc.tendermint.light.TendermintLight.CanonicalPartSetHeader prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + * Protobuf type {@code ibc.tendermint.light.CanonicalPartSetHeader} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + ibc.tendermint.light.TendermintLight.CanonicalPartSetHeader, Builder> implements + // @@protoc_insertion_point(builder_implements:ibc.tendermint.light.CanonicalPartSetHeader) + ibc.tendermint.light.TendermintLight.CanonicalPartSetHeaderOrBuilder { + // Construct using ibc.tendermint.light.TendermintLight.CanonicalPartSetHeader.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * uint32 total = 1; + * @return The total. + */ + @java.lang.Override + public int getTotal() { + return instance.getTotal(); + } + /** + * uint32 total = 1; + * @param value The total to set. + * @return This builder for chaining. + */ + public Builder setTotal(int value) { + copyOnWrite(); + instance.setTotal(value); + return this; + } + /** + * uint32 total = 1; + * @return This builder for chaining. + */ + public Builder clearTotal() { + copyOnWrite(); + instance.clearTotal(); + return this; + } + + /** + * bytes hash = 2; + * @return The hash. + */ + @java.lang.Override + public com.google.protobuf.ByteString getHash() { + return instance.getHash(); + } + /** + * bytes hash = 2; + * @param value The hash to set. + * @return This builder for chaining. + */ + public Builder setHash(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setHash(value); + return this; + } + /** + * bytes hash = 2; + * @return This builder for chaining. + */ + public Builder clearHash() { + copyOnWrite(); + instance.clearHash(); + return this; + } + + // @@protoc_insertion_point(builder_scope:ibc.tendermint.light.CanonicalPartSetHeader) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new ibc.tendermint.light.TendermintLight.CanonicalPartSetHeader(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "total_", + "hash_", + }; + java.lang.String info = + "\u0000\u0002\u0000\u0000\u0001\u0002\u0002\u0000\u0000\u0000\u0001\u000b\u0002\n" + + ""; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (ibc.tendermint.light.TendermintLight.CanonicalPartSetHeader.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:ibc.tendermint.light.CanonicalPartSetHeader) + private static final ibc.tendermint.light.TendermintLight.CanonicalPartSetHeader DEFAULT_INSTANCE; + static { + CanonicalPartSetHeader defaultInstance = new CanonicalPartSetHeader(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + CanonicalPartSetHeader.class, defaultInstance); + } + + public static ibc.tendermint.light.TendermintLight.CanonicalPartSetHeader getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } + } + + public interface CanonicalBlockIDOrBuilder extends + // @@protoc_insertion_point(interface_extends:ibc.tendermint.light.CanonicalBlockID) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * bytes hash = 1; + * @return The hash. + */ + com.google.protobuf.ByteString getHash(); + + /** + * .ibc.tendermint.light.CanonicalPartSetHeader part_set_header = 2; + * @return Whether the partSetHeader field is set. + */ + boolean hasPartSetHeader(); + /** + * .ibc.tendermint.light.CanonicalPartSetHeader part_set_header = 2; + * @return The partSetHeader. + */ + ibc.tendermint.light.TendermintLight.CanonicalPartSetHeader getPartSetHeader(); + } + /** + * Protobuf type {@code ibc.tendermint.light.CanonicalBlockID} + */ + public static final class CanonicalBlockID extends + com.google.protobuf.GeneratedMessageLite< + CanonicalBlockID, CanonicalBlockID.Builder> implements + // @@protoc_insertion_point(message_implements:ibc.tendermint.light.CanonicalBlockID) + CanonicalBlockIDOrBuilder { + private CanonicalBlockID() { + hash_ = com.google.protobuf.ByteString.EMPTY; + } + public static final int HASH_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString hash_; + /** + * bytes hash = 1; + * @return The hash. + */ + @java.lang.Override + public com.google.protobuf.ByteString getHash() { + return hash_; + } + /** + * bytes hash = 1; + * @param value The hash to set. + */ + private void setHash(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + hash_ = value; + } + /** + * bytes hash = 1; + */ + private void clearHash() { + + hash_ = getDefaultInstance().getHash(); + } + + public static final int PART_SET_HEADER_FIELD_NUMBER = 2; + private ibc.tendermint.light.TendermintLight.CanonicalPartSetHeader partSetHeader_; + /** + * .ibc.tendermint.light.CanonicalPartSetHeader part_set_header = 2; + */ + @java.lang.Override + public boolean hasPartSetHeader() { + return partSetHeader_ != null; + } + /** + * .ibc.tendermint.light.CanonicalPartSetHeader part_set_header = 2; + */ + @java.lang.Override + public ibc.tendermint.light.TendermintLight.CanonicalPartSetHeader getPartSetHeader() { + return partSetHeader_ == null ? ibc.tendermint.light.TendermintLight.CanonicalPartSetHeader.getDefaultInstance() : partSetHeader_; + } + /** + * .ibc.tendermint.light.CanonicalPartSetHeader part_set_header = 2; + */ + private void setPartSetHeader(ibc.tendermint.light.TendermintLight.CanonicalPartSetHeader value) { + value.getClass(); + partSetHeader_ = value; + + } + /** + * .ibc.tendermint.light.CanonicalPartSetHeader part_set_header = 2; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergePartSetHeader(ibc.tendermint.light.TendermintLight.CanonicalPartSetHeader value) { + value.getClass(); + if (partSetHeader_ != null && + partSetHeader_ != ibc.tendermint.light.TendermintLight.CanonicalPartSetHeader.getDefaultInstance()) { + partSetHeader_ = + ibc.tendermint.light.TendermintLight.CanonicalPartSetHeader.newBuilder(partSetHeader_).mergeFrom(value).buildPartial(); + } else { + partSetHeader_ = value; + } + + } + /** + * .ibc.tendermint.light.CanonicalPartSetHeader part_set_header = 2; + */ + private void clearPartSetHeader() { partSetHeader_ = null; + + } + + public static ibc.tendermint.light.TendermintLight.CanonicalBlockID parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static ibc.tendermint.light.TendermintLight.CanonicalBlockID parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.CanonicalBlockID parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static ibc.tendermint.light.TendermintLight.CanonicalBlockID parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.CanonicalBlockID parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static ibc.tendermint.light.TendermintLight.CanonicalBlockID parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.CanonicalBlockID parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static ibc.tendermint.light.TendermintLight.CanonicalBlockID parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.CanonicalBlockID parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static ibc.tendermint.light.TendermintLight.CanonicalBlockID parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.CanonicalBlockID parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static ibc.tendermint.light.TendermintLight.CanonicalBlockID parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(ibc.tendermint.light.TendermintLight.CanonicalBlockID prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + * Protobuf type {@code ibc.tendermint.light.CanonicalBlockID} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + ibc.tendermint.light.TendermintLight.CanonicalBlockID, Builder> implements + // @@protoc_insertion_point(builder_implements:ibc.tendermint.light.CanonicalBlockID) + ibc.tendermint.light.TendermintLight.CanonicalBlockIDOrBuilder { + // Construct using ibc.tendermint.light.TendermintLight.CanonicalBlockID.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * bytes hash = 1; + * @return The hash. + */ + @java.lang.Override + public com.google.protobuf.ByteString getHash() { + return instance.getHash(); + } + /** + * bytes hash = 1; + * @param value The hash to set. + * @return This builder for chaining. + */ + public Builder setHash(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setHash(value); + return this; + } + /** + * bytes hash = 1; + * @return This builder for chaining. + */ + public Builder clearHash() { + copyOnWrite(); + instance.clearHash(); + return this; + } + + /** + * .ibc.tendermint.light.CanonicalPartSetHeader part_set_header = 2; + */ + @java.lang.Override + public boolean hasPartSetHeader() { + return instance.hasPartSetHeader(); + } + /** + * .ibc.tendermint.light.CanonicalPartSetHeader part_set_header = 2; + */ + @java.lang.Override + public ibc.tendermint.light.TendermintLight.CanonicalPartSetHeader getPartSetHeader() { + return instance.getPartSetHeader(); + } + /** + * .ibc.tendermint.light.CanonicalPartSetHeader part_set_header = 2; + */ + public Builder setPartSetHeader(ibc.tendermint.light.TendermintLight.CanonicalPartSetHeader value) { + copyOnWrite(); + instance.setPartSetHeader(value); + return this; + } + /** + * .ibc.tendermint.light.CanonicalPartSetHeader part_set_header = 2; + */ + public Builder setPartSetHeader( + ibc.tendermint.light.TendermintLight.CanonicalPartSetHeader.Builder builderForValue) { + copyOnWrite(); + instance.setPartSetHeader(builderForValue.build()); + return this; + } + /** + * .ibc.tendermint.light.CanonicalPartSetHeader part_set_header = 2; + */ + public Builder mergePartSetHeader(ibc.tendermint.light.TendermintLight.CanonicalPartSetHeader value) { + copyOnWrite(); + instance.mergePartSetHeader(value); + return this; + } + /** + * .ibc.tendermint.light.CanonicalPartSetHeader part_set_header = 2; + */ + public Builder clearPartSetHeader() { copyOnWrite(); + instance.clearPartSetHeader(); + return this; + } + + // @@protoc_insertion_point(builder_scope:ibc.tendermint.light.CanonicalBlockID) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new ibc.tendermint.light.TendermintLight.CanonicalBlockID(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "hash_", + "partSetHeader_", + }; + java.lang.String info = + "\u0000\u0002\u0000\u0000\u0001\u0002\u0002\u0000\u0000\u0000\u0001\n\u0002\t"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (ibc.tendermint.light.TendermintLight.CanonicalBlockID.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:ibc.tendermint.light.CanonicalBlockID) + private static final ibc.tendermint.light.TendermintLight.CanonicalBlockID DEFAULT_INSTANCE; + static { + CanonicalBlockID defaultInstance = new CanonicalBlockID(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + CanonicalBlockID.class, defaultInstance); + } + + public static ibc.tendermint.light.TendermintLight.CanonicalBlockID getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } + } + + public interface CanonicalVoteOrBuilder extends + // @@protoc_insertion_point(interface_extends:ibc.tendermint.light.CanonicalVote) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * .ibc.tendermint.light.SignedMsgType type = 1; + * @return The enum numeric value on the wire for type. + */ + int getTypeValue(); + /** + * .ibc.tendermint.light.SignedMsgType type = 1; + * @return The type. + */ + ibc.tendermint.light.TendermintLight.SignedMsgType getType(); + + /** + * sfixed64 height = 2; + * @return The height. + */ + long getHeight(); + + /** + * sfixed64 round = 3; + * @return The round. + */ + long getRound(); + + /** + * .ibc.tendermint.light.BlockID block_id = 4; + * @return Whether the blockId field is set. + */ + boolean hasBlockId(); + /** + * .ibc.tendermint.light.BlockID block_id = 4; + * @return The blockId. + */ + ibc.tendermint.light.TendermintLight.BlockID getBlockId(); + + /** + * .ibc.tendermint.light.Timestamp timestamp = 5; + * @return Whether the timestamp field is set. + */ + boolean hasTimestamp(); + /** + * .ibc.tendermint.light.Timestamp timestamp = 5; + * @return The timestamp. + */ + ibc.tendermint.light.TendermintLight.Timestamp getTimestamp(); + + /** + * string chain_id = 6; + * @return The chainId. + */ + java.lang.String getChainId(); + /** + * string chain_id = 6; + * @return The bytes for chainId. + */ + com.google.protobuf.ByteString + getChainIdBytes(); + } + /** + * Protobuf type {@code ibc.tendermint.light.CanonicalVote} + */ + public static final class CanonicalVote extends + com.google.protobuf.GeneratedMessageLite< + CanonicalVote, CanonicalVote.Builder> implements + // @@protoc_insertion_point(message_implements:ibc.tendermint.light.CanonicalVote) + CanonicalVoteOrBuilder { + private CanonicalVote() { + chainId_ = ""; + } + public static final int TYPE_FIELD_NUMBER = 1; + private int type_; + /** + * .ibc.tendermint.light.SignedMsgType type = 1; + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + /** + * .ibc.tendermint.light.SignedMsgType type = 1; + * @return The type. + */ + @java.lang.Override + public ibc.tendermint.light.TendermintLight.SignedMsgType getType() { + ibc.tendermint.light.TendermintLight.SignedMsgType result = ibc.tendermint.light.TendermintLight.SignedMsgType.forNumber(type_); + return result == null ? ibc.tendermint.light.TendermintLight.SignedMsgType.UNRECOGNIZED : result; + } + /** + * .ibc.tendermint.light.SignedMsgType type = 1; + * @param value The enum numeric value on the wire for type to set. + */ + private void setTypeValue(int value) { + type_ = value; + } + /** + * .ibc.tendermint.light.SignedMsgType type = 1; + * @param value The type to set. + */ + private void setType(ibc.tendermint.light.TendermintLight.SignedMsgType value) { + type_ = value.getNumber(); + + } + /** + * .ibc.tendermint.light.SignedMsgType type = 1; + */ + private void clearType() { + + type_ = 0; + } + + public static final int HEIGHT_FIELD_NUMBER = 2; + private long height_; + /** + * sfixed64 height = 2; + * @return The height. + */ + @java.lang.Override + public long getHeight() { + return height_; + } + /** + * sfixed64 height = 2; + * @param value The height to set. + */ + private void setHeight(long value) { + + height_ = value; + } + /** + * sfixed64 height = 2; + */ + private void clearHeight() { + + height_ = 0L; + } + + public static final int ROUND_FIELD_NUMBER = 3; + private long round_; + /** + * sfixed64 round = 3; + * @return The round. + */ + @java.lang.Override + public long getRound() { + return round_; + } + /** + * sfixed64 round = 3; + * @param value The round to set. + */ + private void setRound(long value) { + + round_ = value; + } + /** + * sfixed64 round = 3; + */ + private void clearRound() { + + round_ = 0L; + } + + public static final int BLOCK_ID_FIELD_NUMBER = 4; + private ibc.tendermint.light.TendermintLight.BlockID blockId_; + /** + * .ibc.tendermint.light.BlockID block_id = 4; + */ + @java.lang.Override + public boolean hasBlockId() { + return blockId_ != null; + } + /** + * .ibc.tendermint.light.BlockID block_id = 4; + */ + @java.lang.Override + public ibc.tendermint.light.TendermintLight.BlockID getBlockId() { + return blockId_ == null ? ibc.tendermint.light.TendermintLight.BlockID.getDefaultInstance() : blockId_; + } + /** + * .ibc.tendermint.light.BlockID block_id = 4; + */ + private void setBlockId(ibc.tendermint.light.TendermintLight.BlockID value) { + value.getClass(); + blockId_ = value; + + } + /** + * .ibc.tendermint.light.BlockID block_id = 4; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeBlockId(ibc.tendermint.light.TendermintLight.BlockID value) { + value.getClass(); + if (blockId_ != null && + blockId_ != ibc.tendermint.light.TendermintLight.BlockID.getDefaultInstance()) { + blockId_ = + ibc.tendermint.light.TendermintLight.BlockID.newBuilder(blockId_).mergeFrom(value).buildPartial(); + } else { + blockId_ = value; + } + + } + /** + * .ibc.tendermint.light.BlockID block_id = 4; + */ + private void clearBlockId() { blockId_ = null; + + } + + public static final int TIMESTAMP_FIELD_NUMBER = 5; + private ibc.tendermint.light.TendermintLight.Timestamp timestamp_; + /** + * .ibc.tendermint.light.Timestamp timestamp = 5; + */ + @java.lang.Override + public boolean hasTimestamp() { + return timestamp_ != null; + } + /** + * .ibc.tendermint.light.Timestamp timestamp = 5; + */ + @java.lang.Override + public ibc.tendermint.light.TendermintLight.Timestamp getTimestamp() { + return timestamp_ == null ? ibc.tendermint.light.TendermintLight.Timestamp.getDefaultInstance() : timestamp_; + } + /** + * .ibc.tendermint.light.Timestamp timestamp = 5; + */ + private void setTimestamp(ibc.tendermint.light.TendermintLight.Timestamp value) { + value.getClass(); + timestamp_ = value; + + } + /** + * .ibc.tendermint.light.Timestamp timestamp = 5; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeTimestamp(ibc.tendermint.light.TendermintLight.Timestamp value) { + value.getClass(); + if (timestamp_ != null && + timestamp_ != ibc.tendermint.light.TendermintLight.Timestamp.getDefaultInstance()) { + timestamp_ = + ibc.tendermint.light.TendermintLight.Timestamp.newBuilder(timestamp_).mergeFrom(value).buildPartial(); + } else { + timestamp_ = value; + } + + } + /** + * .ibc.tendermint.light.Timestamp timestamp = 5; + */ + private void clearTimestamp() { timestamp_ = null; + + } + + public static final int CHAIN_ID_FIELD_NUMBER = 6; + private java.lang.String chainId_; + /** + * string chain_id = 6; + * @return The chainId. + */ + @java.lang.Override + public java.lang.String getChainId() { + return chainId_; + } + /** + * string chain_id = 6; + * @return The bytes for chainId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getChainIdBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(chainId_); + } + /** + * string chain_id = 6; + * @param value The chainId to set. + */ + private void setChainId( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + chainId_ = value; + } + /** + * string chain_id = 6; + */ + private void clearChainId() { + + chainId_ = getDefaultInstance().getChainId(); + } + /** + * string chain_id = 6; + * @param value The bytes for chainId to set. + */ + private void setChainIdBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + chainId_ = value.toStringUtf8(); + + } + + public static ibc.tendermint.light.TendermintLight.CanonicalVote parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static ibc.tendermint.light.TendermintLight.CanonicalVote parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.CanonicalVote parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static ibc.tendermint.light.TendermintLight.CanonicalVote parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.CanonicalVote parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static ibc.tendermint.light.TendermintLight.CanonicalVote parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.CanonicalVote parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static ibc.tendermint.light.TendermintLight.CanonicalVote parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.CanonicalVote parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static ibc.tendermint.light.TendermintLight.CanonicalVote parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.CanonicalVote parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static ibc.tendermint.light.TendermintLight.CanonicalVote parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(ibc.tendermint.light.TendermintLight.CanonicalVote prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + * Protobuf type {@code ibc.tendermint.light.CanonicalVote} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + ibc.tendermint.light.TendermintLight.CanonicalVote, Builder> implements + // @@protoc_insertion_point(builder_implements:ibc.tendermint.light.CanonicalVote) + ibc.tendermint.light.TendermintLight.CanonicalVoteOrBuilder { + // Construct using ibc.tendermint.light.TendermintLight.CanonicalVote.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * .ibc.tendermint.light.SignedMsgType type = 1; + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return instance.getTypeValue(); + } + /** + * .ibc.tendermint.light.SignedMsgType type = 1; + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setTypeValue(int value) { + copyOnWrite(); + instance.setTypeValue(value); + return this; + } + /** + * .ibc.tendermint.light.SignedMsgType type = 1; + * @return The type. + */ + @java.lang.Override + public ibc.tendermint.light.TendermintLight.SignedMsgType getType() { + return instance.getType(); + } + /** + * .ibc.tendermint.light.SignedMsgType type = 1; + * @param value The enum numeric value on the wire for type to set. + * @return This builder for chaining. + */ + public Builder setType(ibc.tendermint.light.TendermintLight.SignedMsgType value) { + copyOnWrite(); + instance.setType(value); + return this; + } + /** + * .ibc.tendermint.light.SignedMsgType type = 1; + * @return This builder for chaining. + */ + public Builder clearType() { + copyOnWrite(); + instance.clearType(); + return this; + } + + /** + * sfixed64 height = 2; + * @return The height. + */ + @java.lang.Override + public long getHeight() { + return instance.getHeight(); + } + /** + * sfixed64 height = 2; + * @param value The height to set. + * @return This builder for chaining. + */ + public Builder setHeight(long value) { + copyOnWrite(); + instance.setHeight(value); + return this; + } + /** + * sfixed64 height = 2; + * @return This builder for chaining. + */ + public Builder clearHeight() { + copyOnWrite(); + instance.clearHeight(); + return this; + } + + /** + * sfixed64 round = 3; + * @return The round. + */ + @java.lang.Override + public long getRound() { + return instance.getRound(); + } + /** + * sfixed64 round = 3; + * @param value The round to set. + * @return This builder for chaining. + */ + public Builder setRound(long value) { + copyOnWrite(); + instance.setRound(value); + return this; + } + /** + * sfixed64 round = 3; + * @return This builder for chaining. + */ + public Builder clearRound() { + copyOnWrite(); + instance.clearRound(); + return this; + } + + /** + * .ibc.tendermint.light.BlockID block_id = 4; + */ + @java.lang.Override + public boolean hasBlockId() { + return instance.hasBlockId(); + } + /** + * .ibc.tendermint.light.BlockID block_id = 4; + */ + @java.lang.Override + public ibc.tendermint.light.TendermintLight.BlockID getBlockId() { + return instance.getBlockId(); + } + /** + * .ibc.tendermint.light.BlockID block_id = 4; + */ + public Builder setBlockId(ibc.tendermint.light.TendermintLight.BlockID value) { + copyOnWrite(); + instance.setBlockId(value); + return this; + } + /** + * .ibc.tendermint.light.BlockID block_id = 4; + */ + public Builder setBlockId( + ibc.tendermint.light.TendermintLight.BlockID.Builder builderForValue) { + copyOnWrite(); + instance.setBlockId(builderForValue.build()); + return this; + } + /** + * .ibc.tendermint.light.BlockID block_id = 4; + */ + public Builder mergeBlockId(ibc.tendermint.light.TendermintLight.BlockID value) { + copyOnWrite(); + instance.mergeBlockId(value); + return this; + } + /** + * .ibc.tendermint.light.BlockID block_id = 4; + */ + public Builder clearBlockId() { copyOnWrite(); + instance.clearBlockId(); + return this; + } + + /** + * .ibc.tendermint.light.Timestamp timestamp = 5; + */ + @java.lang.Override + public boolean hasTimestamp() { + return instance.hasTimestamp(); + } + /** + * .ibc.tendermint.light.Timestamp timestamp = 5; + */ + @java.lang.Override + public ibc.tendermint.light.TendermintLight.Timestamp getTimestamp() { + return instance.getTimestamp(); + } + /** + * .ibc.tendermint.light.Timestamp timestamp = 5; + */ + public Builder setTimestamp(ibc.tendermint.light.TendermintLight.Timestamp value) { + copyOnWrite(); + instance.setTimestamp(value); + return this; + } + /** + * .ibc.tendermint.light.Timestamp timestamp = 5; + */ + public Builder setTimestamp( + ibc.tendermint.light.TendermintLight.Timestamp.Builder builderForValue) { + copyOnWrite(); + instance.setTimestamp(builderForValue.build()); + return this; + } + /** + * .ibc.tendermint.light.Timestamp timestamp = 5; + */ + public Builder mergeTimestamp(ibc.tendermint.light.TendermintLight.Timestamp value) { + copyOnWrite(); + instance.mergeTimestamp(value); + return this; + } + /** + * .ibc.tendermint.light.Timestamp timestamp = 5; + */ + public Builder clearTimestamp() { copyOnWrite(); + instance.clearTimestamp(); + return this; + } + + /** + * string chain_id = 6; + * @return The chainId. + */ + @java.lang.Override + public java.lang.String getChainId() { + return instance.getChainId(); + } + /** + * string chain_id = 6; + * @return The bytes for chainId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getChainIdBytes() { + return instance.getChainIdBytes(); + } + /** + * string chain_id = 6; + * @param value The chainId to set. + * @return This builder for chaining. + */ + public Builder setChainId( + java.lang.String value) { + copyOnWrite(); + instance.setChainId(value); + return this; + } + /** + * string chain_id = 6; + * @return This builder for chaining. + */ + public Builder clearChainId() { + copyOnWrite(); + instance.clearChainId(); + return this; + } + /** + * string chain_id = 6; + * @param value The bytes for chainId to set. + * @return This builder for chaining. + */ + public Builder setChainIdBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setChainIdBytes(value); + return this; + } + + // @@protoc_insertion_point(builder_scope:ibc.tendermint.light.CanonicalVote) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new ibc.tendermint.light.TendermintLight.CanonicalVote(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "type_", + "height_", + "round_", + "blockId_", + "timestamp_", + "chainId_", + }; + java.lang.String info = + "\u0000\u0006\u0000\u0000\u0001\u0006\u0006\u0000\u0000\u0000\u0001\f\u0002\u000e" + + "\u0003\u000e\u0004\t\u0005\t\u0006\u0208"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (ibc.tendermint.light.TendermintLight.CanonicalVote.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:ibc.tendermint.light.CanonicalVote) + private static final ibc.tendermint.light.TendermintLight.CanonicalVote DEFAULT_INSTANCE; + static { + CanonicalVote defaultInstance = new CanonicalVote(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + CanonicalVote.class, defaultInstance); + } + + public static ibc.tendermint.light.TendermintLight.CanonicalVote getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } + } + + public interface VoteOrBuilder extends + // @@protoc_insertion_point(interface_extends:ibc.tendermint.light.Vote) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * .ibc.tendermint.light.SignedMsgType type = 1; + * @return The enum numeric value on the wire for type. + */ + int getTypeValue(); + /** + * .ibc.tendermint.light.SignedMsgType type = 1; + * @return The type. + */ + ibc.tendermint.light.TendermintLight.SignedMsgType getType(); + + /** + * int64 height = 2; + * @return The height. + */ + long getHeight(); + + /** + * int32 round = 3; + * @return The round. + */ + int getRound(); + + /** + * .ibc.tendermint.light.BlockID block_id = 4; + * @return Whether the blockId field is set. + */ + boolean hasBlockId(); + /** + * .ibc.tendermint.light.BlockID block_id = 4; + * @return The blockId. + */ + ibc.tendermint.light.TendermintLight.BlockID getBlockId(); + + /** + * .ibc.tendermint.light.Timestamp timestamp = 5; + * @return Whether the timestamp field is set. + */ + boolean hasTimestamp(); + /** + * .ibc.tendermint.light.Timestamp timestamp = 5; + * @return The timestamp. + */ + ibc.tendermint.light.TendermintLight.Timestamp getTimestamp(); + + /** + * bytes validator_address = 6; + * @return The validatorAddress. + */ + com.google.protobuf.ByteString getValidatorAddress(); + + /** + * int32 validator_index = 7; + * @return The validatorIndex. + */ + int getValidatorIndex(); + + /** + * bytes signature = 8; + * @return The signature. + */ + com.google.protobuf.ByteString getSignature(); + } + /** + * Protobuf type {@code ibc.tendermint.light.Vote} + */ + public static final class Vote extends + com.google.protobuf.GeneratedMessageLite< + Vote, Vote.Builder> implements + // @@protoc_insertion_point(message_implements:ibc.tendermint.light.Vote) + VoteOrBuilder { + private Vote() { + validatorAddress_ = com.google.protobuf.ByteString.EMPTY; + signature_ = com.google.protobuf.ByteString.EMPTY; + } + public static final int TYPE_FIELD_NUMBER = 1; + private int type_; + /** + * .ibc.tendermint.light.SignedMsgType type = 1; + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + /** + * .ibc.tendermint.light.SignedMsgType type = 1; + * @return The type. + */ + @java.lang.Override + public ibc.tendermint.light.TendermintLight.SignedMsgType getType() { + ibc.tendermint.light.TendermintLight.SignedMsgType result = ibc.tendermint.light.TendermintLight.SignedMsgType.forNumber(type_); + return result == null ? ibc.tendermint.light.TendermintLight.SignedMsgType.UNRECOGNIZED : result; + } + /** + * .ibc.tendermint.light.SignedMsgType type = 1; + * @param value The enum numeric value on the wire for type to set. + */ + private void setTypeValue(int value) { + type_ = value; + } + /** + * .ibc.tendermint.light.SignedMsgType type = 1; + * @param value The type to set. + */ + private void setType(ibc.tendermint.light.TendermintLight.SignedMsgType value) { + type_ = value.getNumber(); + + } + /** + * .ibc.tendermint.light.SignedMsgType type = 1; + */ + private void clearType() { + + type_ = 0; + } + + public static final int HEIGHT_FIELD_NUMBER = 2; + private long height_; + /** + * int64 height = 2; + * @return The height. + */ + @java.lang.Override + public long getHeight() { + return height_; + } + /** + * int64 height = 2; + * @param value The height to set. + */ + private void setHeight(long value) { + + height_ = value; + } + /** + * int64 height = 2; + */ + private void clearHeight() { + + height_ = 0L; + } + + public static final int ROUND_FIELD_NUMBER = 3; + private int round_; + /** + * int32 round = 3; + * @return The round. + */ + @java.lang.Override + public int getRound() { + return round_; + } + /** + * int32 round = 3; + * @param value The round to set. + */ + private void setRound(int value) { + + round_ = value; + } + /** + * int32 round = 3; + */ + private void clearRound() { + + round_ = 0; + } + + public static final int BLOCK_ID_FIELD_NUMBER = 4; + private ibc.tendermint.light.TendermintLight.BlockID blockId_; + /** + * .ibc.tendermint.light.BlockID block_id = 4; + */ + @java.lang.Override + public boolean hasBlockId() { + return blockId_ != null; + } + /** + * .ibc.tendermint.light.BlockID block_id = 4; + */ + @java.lang.Override + public ibc.tendermint.light.TendermintLight.BlockID getBlockId() { + return blockId_ == null ? ibc.tendermint.light.TendermintLight.BlockID.getDefaultInstance() : blockId_; + } + /** + * .ibc.tendermint.light.BlockID block_id = 4; + */ + private void setBlockId(ibc.tendermint.light.TendermintLight.BlockID value) { + value.getClass(); + blockId_ = value; + + } + /** + * .ibc.tendermint.light.BlockID block_id = 4; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeBlockId(ibc.tendermint.light.TendermintLight.BlockID value) { + value.getClass(); + if (blockId_ != null && + blockId_ != ibc.tendermint.light.TendermintLight.BlockID.getDefaultInstance()) { + blockId_ = + ibc.tendermint.light.TendermintLight.BlockID.newBuilder(blockId_).mergeFrom(value).buildPartial(); + } else { + blockId_ = value; + } + + } + /** + * .ibc.tendermint.light.BlockID block_id = 4; + */ + private void clearBlockId() { blockId_ = null; + + } + + public static final int TIMESTAMP_FIELD_NUMBER = 5; + private ibc.tendermint.light.TendermintLight.Timestamp timestamp_; + /** + * .ibc.tendermint.light.Timestamp timestamp = 5; + */ + @java.lang.Override + public boolean hasTimestamp() { + return timestamp_ != null; + } + /** + * .ibc.tendermint.light.Timestamp timestamp = 5; + */ + @java.lang.Override + public ibc.tendermint.light.TendermintLight.Timestamp getTimestamp() { + return timestamp_ == null ? ibc.tendermint.light.TendermintLight.Timestamp.getDefaultInstance() : timestamp_; + } + /** + * .ibc.tendermint.light.Timestamp timestamp = 5; + */ + private void setTimestamp(ibc.tendermint.light.TendermintLight.Timestamp value) { + value.getClass(); + timestamp_ = value; + + } + /** + * .ibc.tendermint.light.Timestamp timestamp = 5; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeTimestamp(ibc.tendermint.light.TendermintLight.Timestamp value) { + value.getClass(); + if (timestamp_ != null && + timestamp_ != ibc.tendermint.light.TendermintLight.Timestamp.getDefaultInstance()) { + timestamp_ = + ibc.tendermint.light.TendermintLight.Timestamp.newBuilder(timestamp_).mergeFrom(value).buildPartial(); + } else { + timestamp_ = value; + } + + } + /** + * .ibc.tendermint.light.Timestamp timestamp = 5; + */ + private void clearTimestamp() { timestamp_ = null; + + } + + public static final int VALIDATOR_ADDRESS_FIELD_NUMBER = 6; + private com.google.protobuf.ByteString validatorAddress_; + /** + * bytes validator_address = 6; + * @return The validatorAddress. + */ + @java.lang.Override + public com.google.protobuf.ByteString getValidatorAddress() { + return validatorAddress_; + } + /** + * bytes validator_address = 6; + * @param value The validatorAddress to set. + */ + private void setValidatorAddress(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + validatorAddress_ = value; + } + /** + * bytes validator_address = 6; + */ + private void clearValidatorAddress() { + + validatorAddress_ = getDefaultInstance().getValidatorAddress(); + } + + public static final int VALIDATOR_INDEX_FIELD_NUMBER = 7; + private int validatorIndex_; + /** + * int32 validator_index = 7; + * @return The validatorIndex. + */ + @java.lang.Override + public int getValidatorIndex() { + return validatorIndex_; + } + /** + * int32 validator_index = 7; + * @param value The validatorIndex to set. + */ + private void setValidatorIndex(int value) { + + validatorIndex_ = value; + } + /** + * int32 validator_index = 7; + */ + private void clearValidatorIndex() { + + validatorIndex_ = 0; + } + + public static final int SIGNATURE_FIELD_NUMBER = 8; + private com.google.protobuf.ByteString signature_; + /** + * bytes signature = 8; + * @return The signature. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSignature() { + return signature_; + } + /** + * bytes signature = 8; + * @param value The signature to set. + */ + private void setSignature(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + signature_ = value; + } + /** + * bytes signature = 8; + */ + private void clearSignature() { + + signature_ = getDefaultInstance().getSignature(); + } + + public static ibc.tendermint.light.TendermintLight.Vote parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static ibc.tendermint.light.TendermintLight.Vote parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.Vote parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static ibc.tendermint.light.TendermintLight.Vote parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.Vote parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static ibc.tendermint.light.TendermintLight.Vote parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.Vote parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static ibc.tendermint.light.TendermintLight.Vote parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.Vote parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static ibc.tendermint.light.TendermintLight.Vote parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.Vote parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static ibc.tendermint.light.TendermintLight.Vote parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(ibc.tendermint.light.TendermintLight.Vote prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + * Protobuf type {@code ibc.tendermint.light.Vote} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + ibc.tendermint.light.TendermintLight.Vote, Builder> implements + // @@protoc_insertion_point(builder_implements:ibc.tendermint.light.Vote) + ibc.tendermint.light.TendermintLight.VoteOrBuilder { + // Construct using ibc.tendermint.light.TendermintLight.Vote.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * .ibc.tendermint.light.SignedMsgType type = 1; + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return instance.getTypeValue(); + } + /** + * .ibc.tendermint.light.SignedMsgType type = 1; + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setTypeValue(int value) { + copyOnWrite(); + instance.setTypeValue(value); + return this; + } + /** + * .ibc.tendermint.light.SignedMsgType type = 1; + * @return The type. + */ + @java.lang.Override + public ibc.tendermint.light.TendermintLight.SignedMsgType getType() { + return instance.getType(); + } + /** + * .ibc.tendermint.light.SignedMsgType type = 1; + * @param value The enum numeric value on the wire for type to set. + * @return This builder for chaining. + */ + public Builder setType(ibc.tendermint.light.TendermintLight.SignedMsgType value) { + copyOnWrite(); + instance.setType(value); + return this; + } + /** + * .ibc.tendermint.light.SignedMsgType type = 1; + * @return This builder for chaining. + */ + public Builder clearType() { + copyOnWrite(); + instance.clearType(); + return this; + } + + /** + * int64 height = 2; + * @return The height. + */ + @java.lang.Override + public long getHeight() { + return instance.getHeight(); + } + /** + * int64 height = 2; + * @param value The height to set. + * @return This builder for chaining. + */ + public Builder setHeight(long value) { + copyOnWrite(); + instance.setHeight(value); + return this; + } + /** + * int64 height = 2; + * @return This builder for chaining. + */ + public Builder clearHeight() { + copyOnWrite(); + instance.clearHeight(); + return this; + } + + /** + * int32 round = 3; + * @return The round. + */ + @java.lang.Override + public int getRound() { + return instance.getRound(); + } + /** + * int32 round = 3; + * @param value The round to set. + * @return This builder for chaining. + */ + public Builder setRound(int value) { + copyOnWrite(); + instance.setRound(value); + return this; + } + /** + * int32 round = 3; + * @return This builder for chaining. + */ + public Builder clearRound() { + copyOnWrite(); + instance.clearRound(); + return this; + } + + /** + * .ibc.tendermint.light.BlockID block_id = 4; + */ + @java.lang.Override + public boolean hasBlockId() { + return instance.hasBlockId(); + } + /** + * .ibc.tendermint.light.BlockID block_id = 4; + */ + @java.lang.Override + public ibc.tendermint.light.TendermintLight.BlockID getBlockId() { + return instance.getBlockId(); + } + /** + * .ibc.tendermint.light.BlockID block_id = 4; + */ + public Builder setBlockId(ibc.tendermint.light.TendermintLight.BlockID value) { + copyOnWrite(); + instance.setBlockId(value); + return this; + } + /** + * .ibc.tendermint.light.BlockID block_id = 4; + */ + public Builder setBlockId( + ibc.tendermint.light.TendermintLight.BlockID.Builder builderForValue) { + copyOnWrite(); + instance.setBlockId(builderForValue.build()); + return this; + } + /** + * .ibc.tendermint.light.BlockID block_id = 4; + */ + public Builder mergeBlockId(ibc.tendermint.light.TendermintLight.BlockID value) { + copyOnWrite(); + instance.mergeBlockId(value); + return this; + } + /** + * .ibc.tendermint.light.BlockID block_id = 4; + */ + public Builder clearBlockId() { copyOnWrite(); + instance.clearBlockId(); + return this; + } + + /** + * .ibc.tendermint.light.Timestamp timestamp = 5; + */ + @java.lang.Override + public boolean hasTimestamp() { + return instance.hasTimestamp(); + } + /** + * .ibc.tendermint.light.Timestamp timestamp = 5; + */ + @java.lang.Override + public ibc.tendermint.light.TendermintLight.Timestamp getTimestamp() { + return instance.getTimestamp(); + } + /** + * .ibc.tendermint.light.Timestamp timestamp = 5; + */ + public Builder setTimestamp(ibc.tendermint.light.TendermintLight.Timestamp value) { + copyOnWrite(); + instance.setTimestamp(value); + return this; + } + /** + * .ibc.tendermint.light.Timestamp timestamp = 5; + */ + public Builder setTimestamp( + ibc.tendermint.light.TendermintLight.Timestamp.Builder builderForValue) { + copyOnWrite(); + instance.setTimestamp(builderForValue.build()); + return this; + } + /** + * .ibc.tendermint.light.Timestamp timestamp = 5; + */ + public Builder mergeTimestamp(ibc.tendermint.light.TendermintLight.Timestamp value) { + copyOnWrite(); + instance.mergeTimestamp(value); + return this; + } + /** + * .ibc.tendermint.light.Timestamp timestamp = 5; + */ + public Builder clearTimestamp() { copyOnWrite(); + instance.clearTimestamp(); + return this; + } + + /** + * bytes validator_address = 6; + * @return The validatorAddress. + */ + @java.lang.Override + public com.google.protobuf.ByteString getValidatorAddress() { + return instance.getValidatorAddress(); + } + /** + * bytes validator_address = 6; + * @param value The validatorAddress to set. + * @return This builder for chaining. + */ + public Builder setValidatorAddress(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setValidatorAddress(value); + return this; + } + /** + * bytes validator_address = 6; + * @return This builder for chaining. + */ + public Builder clearValidatorAddress() { + copyOnWrite(); + instance.clearValidatorAddress(); + return this; + } + + /** + * int32 validator_index = 7; + * @return The validatorIndex. + */ + @java.lang.Override + public int getValidatorIndex() { + return instance.getValidatorIndex(); + } + /** + * int32 validator_index = 7; + * @param value The validatorIndex to set. + * @return This builder for chaining. + */ + public Builder setValidatorIndex(int value) { + copyOnWrite(); + instance.setValidatorIndex(value); + return this; + } + /** + * int32 validator_index = 7; + * @return This builder for chaining. + */ + public Builder clearValidatorIndex() { + copyOnWrite(); + instance.clearValidatorIndex(); + return this; + } + + /** + * bytes signature = 8; + * @return The signature. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSignature() { + return instance.getSignature(); + } + /** + * bytes signature = 8; + * @param value The signature to set. + * @return This builder for chaining. + */ + public Builder setSignature(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setSignature(value); + return this; + } + /** + * bytes signature = 8; + * @return This builder for chaining. + */ + public Builder clearSignature() { + copyOnWrite(); + instance.clearSignature(); + return this; + } + + // @@protoc_insertion_point(builder_scope:ibc.tendermint.light.Vote) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new ibc.tendermint.light.TendermintLight.Vote(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "type_", + "height_", + "round_", + "blockId_", + "timestamp_", + "validatorAddress_", + "validatorIndex_", + "signature_", + }; + java.lang.String info = + "\u0000\b\u0000\u0000\u0001\b\b\u0000\u0000\u0000\u0001\f\u0002\u0002\u0003\u0004" + + "\u0004\t\u0005\t\u0006\n\u0007\u0004\b\n"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (ibc.tendermint.light.TendermintLight.Vote.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:ibc.tendermint.light.Vote) + private static final ibc.tendermint.light.TendermintLight.Vote DEFAULT_INSTANCE; + static { + Vote defaultInstance = new Vote(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + Vote.class, defaultInstance); + } + + public static ibc.tendermint.light.TendermintLight.Vote getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } + } + + public interface ValidatorSetOrBuilder extends + // @@protoc_insertion_point(interface_extends:ibc.tendermint.light.ValidatorSet) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * repeated .ibc.tendermint.light.Validator validators = 1; + */ + java.util.List + getValidatorsList(); + /** + * repeated .ibc.tendermint.light.Validator validators = 1; + */ + ibc.tendermint.light.TendermintLight.Validator getValidators(int index); + /** + * repeated .ibc.tendermint.light.Validator validators = 1; + */ + int getValidatorsCount(); + + /** + * .ibc.tendermint.light.Validator proposer = 2; + * @return Whether the proposer field is set. + */ + boolean hasProposer(); + /** + * .ibc.tendermint.light.Validator proposer = 2; + * @return The proposer. + */ + ibc.tendermint.light.TendermintLight.Validator getProposer(); + + /** + * int64 total_voting_power = 3; + * @return The totalVotingPower. + */ + long getTotalVotingPower(); + } + /** + * Protobuf type {@code ibc.tendermint.light.ValidatorSet} + */ + public static final class ValidatorSet extends + com.google.protobuf.GeneratedMessageLite< + ValidatorSet, ValidatorSet.Builder> implements + // @@protoc_insertion_point(message_implements:ibc.tendermint.light.ValidatorSet) + ValidatorSetOrBuilder { + private ValidatorSet() { + validators_ = emptyProtobufList(); + } + public static final int VALIDATORS_FIELD_NUMBER = 1; + private com.google.protobuf.Internal.ProtobufList validators_; + /** + * repeated .ibc.tendermint.light.Validator validators = 1; + */ + @java.lang.Override + public java.util.List getValidatorsList() { + return validators_; + } + /** + * repeated .ibc.tendermint.light.Validator validators = 1; + */ + public java.util.List + getValidatorsOrBuilderList() { + return validators_; + } + /** + * repeated .ibc.tendermint.light.Validator validators = 1; + */ + @java.lang.Override + public int getValidatorsCount() { + return validators_.size(); + } + /** + * repeated .ibc.tendermint.light.Validator validators = 1; + */ + @java.lang.Override + public ibc.tendermint.light.TendermintLight.Validator getValidators(int index) { + return validators_.get(index); + } + /** + * repeated .ibc.tendermint.light.Validator validators = 1; + */ + public ibc.tendermint.light.TendermintLight.ValidatorOrBuilder getValidatorsOrBuilder( + int index) { + return validators_.get(index); + } + private void ensureValidatorsIsMutable() { + com.google.protobuf.Internal.ProtobufList tmp = validators_; + if (!tmp.isModifiable()) { + validators_ = + com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp); + } + } + + /** + * repeated .ibc.tendermint.light.Validator validators = 1; + */ + private void setValidators( + int index, ibc.tendermint.light.TendermintLight.Validator value) { + value.getClass(); + ensureValidatorsIsMutable(); + validators_.set(index, value); + } + /** + * repeated .ibc.tendermint.light.Validator validators = 1; + */ + private void addValidators(ibc.tendermint.light.TendermintLight.Validator value) { + value.getClass(); + ensureValidatorsIsMutable(); + validators_.add(value); + } + /** + * repeated .ibc.tendermint.light.Validator validators = 1; + */ + private void addValidators( + int index, ibc.tendermint.light.TendermintLight.Validator value) { + value.getClass(); + ensureValidatorsIsMutable(); + validators_.add(index, value); + } + /** + * repeated .ibc.tendermint.light.Validator validators = 1; + */ + private void addAllValidators( + java.lang.Iterable values) { + ensureValidatorsIsMutable(); + com.google.protobuf.AbstractMessageLite.addAll( + values, validators_); + } + /** + * repeated .ibc.tendermint.light.Validator validators = 1; + */ + private void clearValidators() { + validators_ = emptyProtobufList(); + } + /** + * repeated .ibc.tendermint.light.Validator validators = 1; + */ + private void removeValidators(int index) { + ensureValidatorsIsMutable(); + validators_.remove(index); + } + + public static final int PROPOSER_FIELD_NUMBER = 2; + private ibc.tendermint.light.TendermintLight.Validator proposer_; + /** + * .ibc.tendermint.light.Validator proposer = 2; + */ + @java.lang.Override + public boolean hasProposer() { + return proposer_ != null; + } + /** + * .ibc.tendermint.light.Validator proposer = 2; + */ + @java.lang.Override + public ibc.tendermint.light.TendermintLight.Validator getProposer() { + return proposer_ == null ? ibc.tendermint.light.TendermintLight.Validator.getDefaultInstance() : proposer_; + } + /** + * .ibc.tendermint.light.Validator proposer = 2; + */ + private void setProposer(ibc.tendermint.light.TendermintLight.Validator value) { + value.getClass(); + proposer_ = value; + + } + /** + * .ibc.tendermint.light.Validator proposer = 2; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeProposer(ibc.tendermint.light.TendermintLight.Validator value) { + value.getClass(); + if (proposer_ != null && + proposer_ != ibc.tendermint.light.TendermintLight.Validator.getDefaultInstance()) { + proposer_ = + ibc.tendermint.light.TendermintLight.Validator.newBuilder(proposer_).mergeFrom(value).buildPartial(); + } else { + proposer_ = value; + } + + } + /** + * .ibc.tendermint.light.Validator proposer = 2; + */ + private void clearProposer() { proposer_ = null; + + } + + public static final int TOTAL_VOTING_POWER_FIELD_NUMBER = 3; + private long totalVotingPower_; + /** + * int64 total_voting_power = 3; + * @return The totalVotingPower. + */ + @java.lang.Override + public long getTotalVotingPower() { + return totalVotingPower_; + } + /** + * int64 total_voting_power = 3; + * @param value The totalVotingPower to set. + */ + private void setTotalVotingPower(long value) { + + totalVotingPower_ = value; + } + /** + * int64 total_voting_power = 3; + */ + private void clearTotalVotingPower() { + + totalVotingPower_ = 0L; + } + + public static ibc.tendermint.light.TendermintLight.ValidatorSet parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static ibc.tendermint.light.TendermintLight.ValidatorSet parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.ValidatorSet parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static ibc.tendermint.light.TendermintLight.ValidatorSet parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.ValidatorSet parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static ibc.tendermint.light.TendermintLight.ValidatorSet parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.ValidatorSet parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static ibc.tendermint.light.TendermintLight.ValidatorSet parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.ValidatorSet parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static ibc.tendermint.light.TendermintLight.ValidatorSet parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.ValidatorSet parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static ibc.tendermint.light.TendermintLight.ValidatorSet parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(ibc.tendermint.light.TendermintLight.ValidatorSet prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + * Protobuf type {@code ibc.tendermint.light.ValidatorSet} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + ibc.tendermint.light.TendermintLight.ValidatorSet, Builder> implements + // @@protoc_insertion_point(builder_implements:ibc.tendermint.light.ValidatorSet) + ibc.tendermint.light.TendermintLight.ValidatorSetOrBuilder { + // Construct using ibc.tendermint.light.TendermintLight.ValidatorSet.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * repeated .ibc.tendermint.light.Validator validators = 1; + */ + @java.lang.Override + public java.util.List getValidatorsList() { + return java.util.Collections.unmodifiableList( + instance.getValidatorsList()); + } + /** + * repeated .ibc.tendermint.light.Validator validators = 1; + */ + @java.lang.Override + public int getValidatorsCount() { + return instance.getValidatorsCount(); + }/** + * repeated .ibc.tendermint.light.Validator validators = 1; + */ + @java.lang.Override + public ibc.tendermint.light.TendermintLight.Validator getValidators(int index) { + return instance.getValidators(index); + } + /** + * repeated .ibc.tendermint.light.Validator validators = 1; + */ + public Builder setValidators( + int index, ibc.tendermint.light.TendermintLight.Validator value) { + copyOnWrite(); + instance.setValidators(index, value); + return this; + } + /** + * repeated .ibc.tendermint.light.Validator validators = 1; + */ + public Builder setValidators( + int index, ibc.tendermint.light.TendermintLight.Validator.Builder builderForValue) { + copyOnWrite(); + instance.setValidators(index, + builderForValue.build()); + return this; + } + /** + * repeated .ibc.tendermint.light.Validator validators = 1; + */ + public Builder addValidators(ibc.tendermint.light.TendermintLight.Validator value) { + copyOnWrite(); + instance.addValidators(value); + return this; + } + /** + * repeated .ibc.tendermint.light.Validator validators = 1; + */ + public Builder addValidators( + int index, ibc.tendermint.light.TendermintLight.Validator value) { + copyOnWrite(); + instance.addValidators(index, value); + return this; + } + /** + * repeated .ibc.tendermint.light.Validator validators = 1; + */ + public Builder addValidators( + ibc.tendermint.light.TendermintLight.Validator.Builder builderForValue) { + copyOnWrite(); + instance.addValidators(builderForValue.build()); + return this; + } + /** + * repeated .ibc.tendermint.light.Validator validators = 1; + */ + public Builder addValidators( + int index, ibc.tendermint.light.TendermintLight.Validator.Builder builderForValue) { + copyOnWrite(); + instance.addValidators(index, + builderForValue.build()); + return this; + } + /** + * repeated .ibc.tendermint.light.Validator validators = 1; + */ + public Builder addAllValidators( + java.lang.Iterable values) { + copyOnWrite(); + instance.addAllValidators(values); + return this; + } + /** + * repeated .ibc.tendermint.light.Validator validators = 1; + */ + public Builder clearValidators() { + copyOnWrite(); + instance.clearValidators(); + return this; + } + /** + * repeated .ibc.tendermint.light.Validator validators = 1; + */ + public Builder removeValidators(int index) { + copyOnWrite(); + instance.removeValidators(index); + return this; + } + + /** + * .ibc.tendermint.light.Validator proposer = 2; + */ + @java.lang.Override + public boolean hasProposer() { + return instance.hasProposer(); + } + /** + * .ibc.tendermint.light.Validator proposer = 2; + */ + @java.lang.Override + public ibc.tendermint.light.TendermintLight.Validator getProposer() { + return instance.getProposer(); + } + /** + * .ibc.tendermint.light.Validator proposer = 2; + */ + public Builder setProposer(ibc.tendermint.light.TendermintLight.Validator value) { + copyOnWrite(); + instance.setProposer(value); + return this; + } + /** + * .ibc.tendermint.light.Validator proposer = 2; + */ + public Builder setProposer( + ibc.tendermint.light.TendermintLight.Validator.Builder builderForValue) { + copyOnWrite(); + instance.setProposer(builderForValue.build()); + return this; + } + /** + * .ibc.tendermint.light.Validator proposer = 2; + */ + public Builder mergeProposer(ibc.tendermint.light.TendermintLight.Validator value) { + copyOnWrite(); + instance.mergeProposer(value); + return this; + } + /** + * .ibc.tendermint.light.Validator proposer = 2; + */ + public Builder clearProposer() { copyOnWrite(); + instance.clearProposer(); + return this; + } + + /** + * int64 total_voting_power = 3; + * @return The totalVotingPower. + */ + @java.lang.Override + public long getTotalVotingPower() { + return instance.getTotalVotingPower(); + } + /** + * int64 total_voting_power = 3; + * @param value The totalVotingPower to set. + * @return This builder for chaining. + */ + public Builder setTotalVotingPower(long value) { + copyOnWrite(); + instance.setTotalVotingPower(value); + return this; + } + /** + * int64 total_voting_power = 3; + * @return This builder for chaining. + */ + public Builder clearTotalVotingPower() { + copyOnWrite(); + instance.clearTotalVotingPower(); + return this; + } + + // @@protoc_insertion_point(builder_scope:ibc.tendermint.light.ValidatorSet) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new ibc.tendermint.light.TendermintLight.ValidatorSet(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "validators_", + ibc.tendermint.light.TendermintLight.Validator.class, + "proposer_", + "totalVotingPower_", + }; + java.lang.String info = + "\u0000\u0003\u0000\u0000\u0001\u0003\u0003\u0000\u0001\u0000\u0001\u001b\u0002\t" + + "\u0003\u0002"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (ibc.tendermint.light.TendermintLight.ValidatorSet.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:ibc.tendermint.light.ValidatorSet) + private static final ibc.tendermint.light.TendermintLight.ValidatorSet DEFAULT_INSTANCE; + static { + ValidatorSet defaultInstance = new ValidatorSet(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + ValidatorSet.class, defaultInstance); + } + + public static ibc.tendermint.light.TendermintLight.ValidatorSet getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } + } + + public interface ValidatorOrBuilder extends + // @@protoc_insertion_point(interface_extends:ibc.tendermint.light.Validator) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * bytes address = 1; + * @return The address. + */ + com.google.protobuf.ByteString getAddress(); + + /** + * .ibc.tendermint.light.PublicKey pub_key = 2; + * @return Whether the pubKey field is set. + */ + boolean hasPubKey(); + /** + * .ibc.tendermint.light.PublicKey pub_key = 2; + * @return The pubKey. + */ + ibc.tendermint.light.TendermintLight.PublicKey getPubKey(); + + /** + * int64 voting_power = 3; + * @return The votingPower. + */ + long getVotingPower(); + + /** + * int64 proposer_priority = 4; + * @return The proposerPriority. + */ + long getProposerPriority(); + } + /** + * Protobuf type {@code ibc.tendermint.light.Validator} + */ + public static final class Validator extends + com.google.protobuf.GeneratedMessageLite< + Validator, Validator.Builder> implements + // @@protoc_insertion_point(message_implements:ibc.tendermint.light.Validator) + ValidatorOrBuilder { + private Validator() { + address_ = com.google.protobuf.ByteString.EMPTY; + } + public static final int ADDRESS_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString address_; + /** + * bytes address = 1; + * @return The address. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAddress() { + return address_; + } + /** + * bytes address = 1; + * @param value The address to set. + */ + private void setAddress(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + address_ = value; + } + /** + * bytes address = 1; + */ + private void clearAddress() { + + address_ = getDefaultInstance().getAddress(); + } + + public static final int PUB_KEY_FIELD_NUMBER = 2; + private ibc.tendermint.light.TendermintLight.PublicKey pubKey_; + /** + * .ibc.tendermint.light.PublicKey pub_key = 2; + */ + @java.lang.Override + public boolean hasPubKey() { + return pubKey_ != null; + } + /** + * .ibc.tendermint.light.PublicKey pub_key = 2; + */ + @java.lang.Override + public ibc.tendermint.light.TendermintLight.PublicKey getPubKey() { + return pubKey_ == null ? ibc.tendermint.light.TendermintLight.PublicKey.getDefaultInstance() : pubKey_; + } + /** + * .ibc.tendermint.light.PublicKey pub_key = 2; + */ + private void setPubKey(ibc.tendermint.light.TendermintLight.PublicKey value) { + value.getClass(); + pubKey_ = value; + + } + /** + * .ibc.tendermint.light.PublicKey pub_key = 2; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergePubKey(ibc.tendermint.light.TendermintLight.PublicKey value) { + value.getClass(); + if (pubKey_ != null && + pubKey_ != ibc.tendermint.light.TendermintLight.PublicKey.getDefaultInstance()) { + pubKey_ = + ibc.tendermint.light.TendermintLight.PublicKey.newBuilder(pubKey_).mergeFrom(value).buildPartial(); + } else { + pubKey_ = value; + } + + } + /** + * .ibc.tendermint.light.PublicKey pub_key = 2; + */ + private void clearPubKey() { pubKey_ = null; + + } + + public static final int VOTING_POWER_FIELD_NUMBER = 3; + private long votingPower_; + /** + * int64 voting_power = 3; + * @return The votingPower. + */ + @java.lang.Override + public long getVotingPower() { + return votingPower_; + } + /** + * int64 voting_power = 3; + * @param value The votingPower to set. + */ + private void setVotingPower(long value) { + + votingPower_ = value; + } + /** + * int64 voting_power = 3; + */ + private void clearVotingPower() { + + votingPower_ = 0L; + } + + public static final int PROPOSER_PRIORITY_FIELD_NUMBER = 4; + private long proposerPriority_; + /** + * int64 proposer_priority = 4; + * @return The proposerPriority. + */ + @java.lang.Override + public long getProposerPriority() { + return proposerPriority_; + } + /** + * int64 proposer_priority = 4; + * @param value The proposerPriority to set. + */ + private void setProposerPriority(long value) { + + proposerPriority_ = value; + } + /** + * int64 proposer_priority = 4; + */ + private void clearProposerPriority() { + + proposerPriority_ = 0L; + } + + public static ibc.tendermint.light.TendermintLight.Validator parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static ibc.tendermint.light.TendermintLight.Validator parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.Validator parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static ibc.tendermint.light.TendermintLight.Validator parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.Validator parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static ibc.tendermint.light.TendermintLight.Validator parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.Validator parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static ibc.tendermint.light.TendermintLight.Validator parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.Validator parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static ibc.tendermint.light.TendermintLight.Validator parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.Validator parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static ibc.tendermint.light.TendermintLight.Validator parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(ibc.tendermint.light.TendermintLight.Validator prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + * Protobuf type {@code ibc.tendermint.light.Validator} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + ibc.tendermint.light.TendermintLight.Validator, Builder> implements + // @@protoc_insertion_point(builder_implements:ibc.tendermint.light.Validator) + ibc.tendermint.light.TendermintLight.ValidatorOrBuilder { + // Construct using ibc.tendermint.light.TendermintLight.Validator.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * bytes address = 1; + * @return The address. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAddress() { + return instance.getAddress(); + } + /** + * bytes address = 1; + * @param value The address to set. + * @return This builder for chaining. + */ + public Builder setAddress(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setAddress(value); + return this; + } + /** + * bytes address = 1; + * @return This builder for chaining. + */ + public Builder clearAddress() { + copyOnWrite(); + instance.clearAddress(); + return this; + } + + /** + * .ibc.tendermint.light.PublicKey pub_key = 2; + */ + @java.lang.Override + public boolean hasPubKey() { + return instance.hasPubKey(); + } + /** + * .ibc.tendermint.light.PublicKey pub_key = 2; + */ + @java.lang.Override + public ibc.tendermint.light.TendermintLight.PublicKey getPubKey() { + return instance.getPubKey(); + } + /** + * .ibc.tendermint.light.PublicKey pub_key = 2; + */ + public Builder setPubKey(ibc.tendermint.light.TendermintLight.PublicKey value) { + copyOnWrite(); + instance.setPubKey(value); + return this; + } + /** + * .ibc.tendermint.light.PublicKey pub_key = 2; + */ + public Builder setPubKey( + ibc.tendermint.light.TendermintLight.PublicKey.Builder builderForValue) { + copyOnWrite(); + instance.setPubKey(builderForValue.build()); + return this; + } + /** + * .ibc.tendermint.light.PublicKey pub_key = 2; + */ + public Builder mergePubKey(ibc.tendermint.light.TendermintLight.PublicKey value) { + copyOnWrite(); + instance.mergePubKey(value); + return this; + } + /** + * .ibc.tendermint.light.PublicKey pub_key = 2; + */ + public Builder clearPubKey() { copyOnWrite(); + instance.clearPubKey(); + return this; + } + + /** + * int64 voting_power = 3; + * @return The votingPower. + */ + @java.lang.Override + public long getVotingPower() { + return instance.getVotingPower(); + } + /** + * int64 voting_power = 3; + * @param value The votingPower to set. + * @return This builder for chaining. + */ + public Builder setVotingPower(long value) { + copyOnWrite(); + instance.setVotingPower(value); + return this; + } + /** + * int64 voting_power = 3; + * @return This builder for chaining. + */ + public Builder clearVotingPower() { + copyOnWrite(); + instance.clearVotingPower(); + return this; + } + + /** + * int64 proposer_priority = 4; + * @return The proposerPriority. + */ + @java.lang.Override + public long getProposerPriority() { + return instance.getProposerPriority(); + } + /** + * int64 proposer_priority = 4; + * @param value The proposerPriority to set. + * @return This builder for chaining. + */ + public Builder setProposerPriority(long value) { + copyOnWrite(); + instance.setProposerPriority(value); + return this; + } + /** + * int64 proposer_priority = 4; + * @return This builder for chaining. + */ + public Builder clearProposerPriority() { + copyOnWrite(); + instance.clearProposerPriority(); + return this; + } + + // @@protoc_insertion_point(builder_scope:ibc.tendermint.light.Validator) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new ibc.tendermint.light.TendermintLight.Validator(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "address_", + "pubKey_", + "votingPower_", + "proposerPriority_", + }; + java.lang.String info = + "\u0000\u0004\u0000\u0000\u0001\u0004\u0004\u0000\u0000\u0000\u0001\n\u0002\t\u0003" + + "\u0002\u0004\u0002"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (ibc.tendermint.light.TendermintLight.Validator.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:ibc.tendermint.light.Validator) + private static final ibc.tendermint.light.TendermintLight.Validator DEFAULT_INSTANCE; + static { + Validator defaultInstance = new Validator(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + Validator.class, defaultInstance); + } + + public static ibc.tendermint.light.TendermintLight.Validator getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } + } + + public interface SimpleValidatorOrBuilder extends + // @@protoc_insertion_point(interface_extends:ibc.tendermint.light.SimpleValidator) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * .ibc.tendermint.light.PublicKey pub_key = 1; + * @return Whether the pubKey field is set. + */ + boolean hasPubKey(); + /** + * .ibc.tendermint.light.PublicKey pub_key = 1; + * @return The pubKey. + */ + ibc.tendermint.light.TendermintLight.PublicKey getPubKey(); + + /** + * int64 voting_power = 2; + * @return The votingPower. + */ + long getVotingPower(); + } + /** + * Protobuf type {@code ibc.tendermint.light.SimpleValidator} + */ + public static final class SimpleValidator extends + com.google.protobuf.GeneratedMessageLite< + SimpleValidator, SimpleValidator.Builder> implements + // @@protoc_insertion_point(message_implements:ibc.tendermint.light.SimpleValidator) + SimpleValidatorOrBuilder { + private SimpleValidator() { + } + public static final int PUB_KEY_FIELD_NUMBER = 1; + private ibc.tendermint.light.TendermintLight.PublicKey pubKey_; + /** + * .ibc.tendermint.light.PublicKey pub_key = 1; + */ + @java.lang.Override + public boolean hasPubKey() { + return pubKey_ != null; + } + /** + * .ibc.tendermint.light.PublicKey pub_key = 1; + */ + @java.lang.Override + public ibc.tendermint.light.TendermintLight.PublicKey getPubKey() { + return pubKey_ == null ? ibc.tendermint.light.TendermintLight.PublicKey.getDefaultInstance() : pubKey_; + } + /** + * .ibc.tendermint.light.PublicKey pub_key = 1; + */ + private void setPubKey(ibc.tendermint.light.TendermintLight.PublicKey value) { + value.getClass(); + pubKey_ = value; + + } + /** + * .ibc.tendermint.light.PublicKey pub_key = 1; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergePubKey(ibc.tendermint.light.TendermintLight.PublicKey value) { + value.getClass(); + if (pubKey_ != null && + pubKey_ != ibc.tendermint.light.TendermintLight.PublicKey.getDefaultInstance()) { + pubKey_ = + ibc.tendermint.light.TendermintLight.PublicKey.newBuilder(pubKey_).mergeFrom(value).buildPartial(); + } else { + pubKey_ = value; + } + + } + /** + * .ibc.tendermint.light.PublicKey pub_key = 1; + */ + private void clearPubKey() { pubKey_ = null; + + } + + public static final int VOTING_POWER_FIELD_NUMBER = 2; + private long votingPower_; + /** + * int64 voting_power = 2; + * @return The votingPower. + */ + @java.lang.Override + public long getVotingPower() { + return votingPower_; + } + /** + * int64 voting_power = 2; + * @param value The votingPower to set. + */ + private void setVotingPower(long value) { + + votingPower_ = value; + } + /** + * int64 voting_power = 2; + */ + private void clearVotingPower() { + + votingPower_ = 0L; + } + + public static ibc.tendermint.light.TendermintLight.SimpleValidator parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static ibc.tendermint.light.TendermintLight.SimpleValidator parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.SimpleValidator parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static ibc.tendermint.light.TendermintLight.SimpleValidator parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.SimpleValidator parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static ibc.tendermint.light.TendermintLight.SimpleValidator parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.SimpleValidator parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static ibc.tendermint.light.TendermintLight.SimpleValidator parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.SimpleValidator parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static ibc.tendermint.light.TendermintLight.SimpleValidator parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.SimpleValidator parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static ibc.tendermint.light.TendermintLight.SimpleValidator parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(ibc.tendermint.light.TendermintLight.SimpleValidator prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + * Protobuf type {@code ibc.tendermint.light.SimpleValidator} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + ibc.tendermint.light.TendermintLight.SimpleValidator, Builder> implements + // @@protoc_insertion_point(builder_implements:ibc.tendermint.light.SimpleValidator) + ibc.tendermint.light.TendermintLight.SimpleValidatorOrBuilder { + // Construct using ibc.tendermint.light.TendermintLight.SimpleValidator.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * .ibc.tendermint.light.PublicKey pub_key = 1; + */ + @java.lang.Override + public boolean hasPubKey() { + return instance.hasPubKey(); + } + /** + * .ibc.tendermint.light.PublicKey pub_key = 1; + */ + @java.lang.Override + public ibc.tendermint.light.TendermintLight.PublicKey getPubKey() { + return instance.getPubKey(); + } + /** + * .ibc.tendermint.light.PublicKey pub_key = 1; + */ + public Builder setPubKey(ibc.tendermint.light.TendermintLight.PublicKey value) { + copyOnWrite(); + instance.setPubKey(value); + return this; + } + /** + * .ibc.tendermint.light.PublicKey pub_key = 1; + */ + public Builder setPubKey( + ibc.tendermint.light.TendermintLight.PublicKey.Builder builderForValue) { + copyOnWrite(); + instance.setPubKey(builderForValue.build()); + return this; + } + /** + * .ibc.tendermint.light.PublicKey pub_key = 1; + */ + public Builder mergePubKey(ibc.tendermint.light.TendermintLight.PublicKey value) { + copyOnWrite(); + instance.mergePubKey(value); + return this; + } + /** + * .ibc.tendermint.light.PublicKey pub_key = 1; + */ + public Builder clearPubKey() { copyOnWrite(); + instance.clearPubKey(); + return this; + } + + /** + * int64 voting_power = 2; + * @return The votingPower. + */ + @java.lang.Override + public long getVotingPower() { + return instance.getVotingPower(); + } + /** + * int64 voting_power = 2; + * @param value The votingPower to set. + * @return This builder for chaining. + */ + public Builder setVotingPower(long value) { + copyOnWrite(); + instance.setVotingPower(value); + return this; + } + /** + * int64 voting_power = 2; + * @return This builder for chaining. + */ + public Builder clearVotingPower() { + copyOnWrite(); + instance.clearVotingPower(); + return this; + } + + // @@protoc_insertion_point(builder_scope:ibc.tendermint.light.SimpleValidator) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new ibc.tendermint.light.TendermintLight.SimpleValidator(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "pubKey_", + "votingPower_", + }; + java.lang.String info = + "\u0000\u0002\u0000\u0000\u0001\u0002\u0002\u0000\u0000\u0000\u0001\t\u0002\u0002" + + ""; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (ibc.tendermint.light.TendermintLight.SimpleValidator.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:ibc.tendermint.light.SimpleValidator) + private static final ibc.tendermint.light.TendermintLight.SimpleValidator DEFAULT_INSTANCE; + static { + SimpleValidator defaultInstance = new SimpleValidator(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + SimpleValidator.class, defaultInstance); + } + + public static ibc.tendermint.light.TendermintLight.SimpleValidator getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } + } + + public interface PublicKeyOrBuilder extends + // @@protoc_insertion_point(interface_extends:ibc.tendermint.light.PublicKey) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * bytes ed25519 = 1; + * @return Whether the ed25519 field is set. + */ + boolean hasEd25519(); + /** + * bytes ed25519 = 1; + * @return The ed25519. + */ + com.google.protobuf.ByteString getEd25519(); + + /** + * bytes secp256k1 = 2; + * @return Whether the secp256k1 field is set. + */ + boolean hasSecp256K1(); + /** + * bytes secp256k1 = 2; + * @return The secp256k1. + */ + com.google.protobuf.ByteString getSecp256K1(); + + /** + * bytes sr25519 = 3; + * @return Whether the sr25519 field is set. + */ + boolean hasSr25519(); + /** + * bytes sr25519 = 3; + * @return The sr25519. + */ + com.google.protobuf.ByteString getSr25519(); + + public ibc.tendermint.light.TendermintLight.PublicKey.SumCase getSumCase(); + } + /** + * Protobuf type {@code ibc.tendermint.light.PublicKey} + */ + public static final class PublicKey extends + com.google.protobuf.GeneratedMessageLite< + PublicKey, PublicKey.Builder> implements + // @@protoc_insertion_point(message_implements:ibc.tendermint.light.PublicKey) + PublicKeyOrBuilder { + private PublicKey() { + } + private int sumCase_ = 0; + private java.lang.Object sum_; + public enum SumCase { + ED25519(1), + SECP256K1(2), + SR25519(3), + SUM_NOT_SET(0); + private final int value; + private SumCase(int value) { + this.value = value; + } + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SumCase valueOf(int value) { + return forNumber(value); + } + + public static SumCase forNumber(int value) { + switch (value) { + case 1: return ED25519; + case 2: return SECP256K1; + case 3: return SR25519; + case 0: return SUM_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + @java.lang.Override + public SumCase + getSumCase() { + return SumCase.forNumber( + sumCase_); + } + + private void clearSum() { + sumCase_ = 0; + sum_ = null; + } + + public static final int ED25519_FIELD_NUMBER = 1; + /** + * bytes ed25519 = 1; + * @return Whether the ed25519 field is set. + */ + @java.lang.Override + public boolean hasEd25519() { + return sumCase_ == 1; + } + /** + * bytes ed25519 = 1; + * @return The ed25519. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEd25519() { + if (sumCase_ == 1) { + return (com.google.protobuf.ByteString) sum_; + } + return com.google.protobuf.ByteString.EMPTY; + } + /** + * bytes ed25519 = 1; + * @param value The ed25519 to set. + */ + private void setEd25519(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + sumCase_ = 1; + sum_ = value; + } + /** + * bytes ed25519 = 1; + */ + private void clearEd25519() { + if (sumCase_ == 1) { + sumCase_ = 0; + sum_ = null; + } + } + + public static final int SECP256K1_FIELD_NUMBER = 2; + /** + * bytes secp256k1 = 2; + * @return Whether the secp256k1 field is set. + */ + @java.lang.Override + public boolean hasSecp256K1() { + return sumCase_ == 2; + } + /** + * bytes secp256k1 = 2; + * @return The secp256k1. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSecp256K1() { + if (sumCase_ == 2) { + return (com.google.protobuf.ByteString) sum_; + } + return com.google.protobuf.ByteString.EMPTY; + } + /** + * bytes secp256k1 = 2; + * @param value The secp256k1 to set. + */ + private void setSecp256K1(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + sumCase_ = 2; + sum_ = value; + } + /** + * bytes secp256k1 = 2; + */ + private void clearSecp256K1() { + if (sumCase_ == 2) { + sumCase_ = 0; + sum_ = null; + } + } + + public static final int SR25519_FIELD_NUMBER = 3; + /** + * bytes sr25519 = 3; + * @return Whether the sr25519 field is set. + */ + @java.lang.Override + public boolean hasSr25519() { + return sumCase_ == 3; + } + /** + * bytes sr25519 = 3; + * @return The sr25519. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSr25519() { + if (sumCase_ == 3) { + return (com.google.protobuf.ByteString) sum_; + } + return com.google.protobuf.ByteString.EMPTY; + } + /** + * bytes sr25519 = 3; + * @param value The sr25519 to set. + */ + private void setSr25519(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + sumCase_ = 3; + sum_ = value; + } + /** + * bytes sr25519 = 3; + */ + private void clearSr25519() { + if (sumCase_ == 3) { + sumCase_ = 0; + sum_ = null; + } + } + + public static ibc.tendermint.light.TendermintLight.PublicKey parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static ibc.tendermint.light.TendermintLight.PublicKey parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.PublicKey parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static ibc.tendermint.light.TendermintLight.PublicKey parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.PublicKey parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static ibc.tendermint.light.TendermintLight.PublicKey parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.PublicKey parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static ibc.tendermint.light.TendermintLight.PublicKey parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.PublicKey parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static ibc.tendermint.light.TendermintLight.PublicKey parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.PublicKey parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static ibc.tendermint.light.TendermintLight.PublicKey parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(ibc.tendermint.light.TendermintLight.PublicKey prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + * Protobuf type {@code ibc.tendermint.light.PublicKey} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + ibc.tendermint.light.TendermintLight.PublicKey, Builder> implements + // @@protoc_insertion_point(builder_implements:ibc.tendermint.light.PublicKey) + ibc.tendermint.light.TendermintLight.PublicKeyOrBuilder { + // Construct using ibc.tendermint.light.TendermintLight.PublicKey.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + @java.lang.Override + public SumCase + getSumCase() { + return instance.getSumCase(); + } + + public Builder clearSum() { + copyOnWrite(); + instance.clearSum(); + return this; + } + + + /** + * bytes ed25519 = 1; + * @return Whether the ed25519 field is set. + */ + @java.lang.Override + public boolean hasEd25519() { + return instance.hasEd25519(); + } + /** + * bytes ed25519 = 1; + * @return The ed25519. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEd25519() { + return instance.getEd25519(); + } + /** + * bytes ed25519 = 1; + * @param value The ed25519 to set. + * @return This builder for chaining. + */ + public Builder setEd25519(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setEd25519(value); + return this; + } + /** + * bytes ed25519 = 1; + * @return This builder for chaining. + */ + public Builder clearEd25519() { + copyOnWrite(); + instance.clearEd25519(); + return this; + } + + /** + * bytes secp256k1 = 2; + * @return Whether the secp256k1 field is set. + */ + @java.lang.Override + public boolean hasSecp256K1() { + return instance.hasSecp256K1(); + } + /** + * bytes secp256k1 = 2; + * @return The secp256k1. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSecp256K1() { + return instance.getSecp256K1(); + } + /** + * bytes secp256k1 = 2; + * @param value The secp256k1 to set. + * @return This builder for chaining. + */ + public Builder setSecp256K1(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setSecp256K1(value); + return this; + } + /** + * bytes secp256k1 = 2; + * @return This builder for chaining. + */ + public Builder clearSecp256K1() { + copyOnWrite(); + instance.clearSecp256K1(); + return this; + } + + /** + * bytes sr25519 = 3; + * @return Whether the sr25519 field is set. + */ + @java.lang.Override + public boolean hasSr25519() { + return instance.hasSr25519(); + } + /** + * bytes sr25519 = 3; + * @return The sr25519. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSr25519() { + return instance.getSr25519(); + } + /** + * bytes sr25519 = 3; + * @param value The sr25519 to set. + * @return This builder for chaining. + */ + public Builder setSr25519(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setSr25519(value); + return this; + } + /** + * bytes sr25519 = 3; + * @return This builder for chaining. + */ + public Builder clearSr25519() { + copyOnWrite(); + instance.clearSr25519(); + return this; + } + + // @@protoc_insertion_point(builder_scope:ibc.tendermint.light.PublicKey) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new ibc.tendermint.light.TendermintLight.PublicKey(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "sum_", + "sumCase_", + }; + java.lang.String info = + "\u0000\u0003\u0001\u0000\u0001\u0003\u0003\u0000\u0000\u0000\u0001=\u0000\u0002=" + + "\u0000\u0003=\u0000"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (ibc.tendermint.light.TendermintLight.PublicKey.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:ibc.tendermint.light.PublicKey) + private static final ibc.tendermint.light.TendermintLight.PublicKey DEFAULT_INSTANCE; + static { + PublicKey defaultInstance = new PublicKey(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + PublicKey.class, defaultInstance); + } + + public static ibc.tendermint.light.TendermintLight.PublicKey getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } + } + + public interface PartSetHeaderOrBuilder extends + // @@protoc_insertion_point(interface_extends:ibc.tendermint.light.PartSetHeader) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * uint32 total = 1; + * @return The total. + */ + int getTotal(); + + /** + * bytes hash = 2; + * @return The hash. + */ + com.google.protobuf.ByteString getHash(); + } + /** + * Protobuf type {@code ibc.tendermint.light.PartSetHeader} + */ + public static final class PartSetHeader extends + com.google.protobuf.GeneratedMessageLite< + PartSetHeader, PartSetHeader.Builder> implements + // @@protoc_insertion_point(message_implements:ibc.tendermint.light.PartSetHeader) + PartSetHeaderOrBuilder { + private PartSetHeader() { + hash_ = com.google.protobuf.ByteString.EMPTY; + } + public static final int TOTAL_FIELD_NUMBER = 1; + private int total_; + /** + * uint32 total = 1; + * @return The total. + */ + @java.lang.Override + public int getTotal() { + return total_; + } + /** + * uint32 total = 1; + * @param value The total to set. + */ + private void setTotal(int value) { + + total_ = value; + } + /** + * uint32 total = 1; + */ + private void clearTotal() { + + total_ = 0; + } + + public static final int HASH_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString hash_; + /** + * bytes hash = 2; + * @return The hash. + */ + @java.lang.Override + public com.google.protobuf.ByteString getHash() { + return hash_; + } + /** + * bytes hash = 2; + * @param value The hash to set. + */ + private void setHash(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + hash_ = value; + } + /** + * bytes hash = 2; + */ + private void clearHash() { + + hash_ = getDefaultInstance().getHash(); + } + + public static ibc.tendermint.light.TendermintLight.PartSetHeader parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static ibc.tendermint.light.TendermintLight.PartSetHeader parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.PartSetHeader parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static ibc.tendermint.light.TendermintLight.PartSetHeader parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.PartSetHeader parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static ibc.tendermint.light.TendermintLight.PartSetHeader parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.PartSetHeader parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static ibc.tendermint.light.TendermintLight.PartSetHeader parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.PartSetHeader parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static ibc.tendermint.light.TendermintLight.PartSetHeader parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.PartSetHeader parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static ibc.tendermint.light.TendermintLight.PartSetHeader parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(ibc.tendermint.light.TendermintLight.PartSetHeader prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + * Protobuf type {@code ibc.tendermint.light.PartSetHeader} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + ibc.tendermint.light.TendermintLight.PartSetHeader, Builder> implements + // @@protoc_insertion_point(builder_implements:ibc.tendermint.light.PartSetHeader) + ibc.tendermint.light.TendermintLight.PartSetHeaderOrBuilder { + // Construct using ibc.tendermint.light.TendermintLight.PartSetHeader.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * uint32 total = 1; + * @return The total. + */ + @java.lang.Override + public int getTotal() { + return instance.getTotal(); + } + /** + * uint32 total = 1; + * @param value The total to set. + * @return This builder for chaining. + */ + public Builder setTotal(int value) { + copyOnWrite(); + instance.setTotal(value); + return this; + } + /** + * uint32 total = 1; + * @return This builder for chaining. + */ + public Builder clearTotal() { + copyOnWrite(); + instance.clearTotal(); + return this; + } + + /** + * bytes hash = 2; + * @return The hash. + */ + @java.lang.Override + public com.google.protobuf.ByteString getHash() { + return instance.getHash(); + } + /** + * bytes hash = 2; + * @param value The hash to set. + * @return This builder for chaining. + */ + public Builder setHash(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setHash(value); + return this; + } + /** + * bytes hash = 2; + * @return This builder for chaining. + */ + public Builder clearHash() { + copyOnWrite(); + instance.clearHash(); + return this; + } + + // @@protoc_insertion_point(builder_scope:ibc.tendermint.light.PartSetHeader) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new ibc.tendermint.light.TendermintLight.PartSetHeader(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "total_", + "hash_", + }; + java.lang.String info = + "\u0000\u0002\u0000\u0000\u0001\u0002\u0002\u0000\u0000\u0000\u0001\u000b\u0002\n" + + ""; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (ibc.tendermint.light.TendermintLight.PartSetHeader.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:ibc.tendermint.light.PartSetHeader) + private static final ibc.tendermint.light.TendermintLight.PartSetHeader DEFAULT_INSTANCE; + static { + PartSetHeader defaultInstance = new PartSetHeader(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + PartSetHeader.class, defaultInstance); + } + + public static ibc.tendermint.light.TendermintLight.PartSetHeader getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } + } + + public interface BlockIDOrBuilder extends + // @@protoc_insertion_point(interface_extends:ibc.tendermint.light.BlockID) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * bytes hash = 1; + * @return The hash. + */ + com.google.protobuf.ByteString getHash(); + + /** + * .ibc.tendermint.light.PartSetHeader part_set_header = 2; + * @return Whether the partSetHeader field is set. + */ + boolean hasPartSetHeader(); + /** + * .ibc.tendermint.light.PartSetHeader part_set_header = 2; + * @return The partSetHeader. + */ + ibc.tendermint.light.TendermintLight.PartSetHeader getPartSetHeader(); + } + /** + * Protobuf type {@code ibc.tendermint.light.BlockID} + */ + public static final class BlockID extends + com.google.protobuf.GeneratedMessageLite< + BlockID, BlockID.Builder> implements + // @@protoc_insertion_point(message_implements:ibc.tendermint.light.BlockID) + BlockIDOrBuilder { + private BlockID() { + hash_ = com.google.protobuf.ByteString.EMPTY; + } + public static final int HASH_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString hash_; + /** + * bytes hash = 1; + * @return The hash. + */ + @java.lang.Override + public com.google.protobuf.ByteString getHash() { + return hash_; + } + /** + * bytes hash = 1; + * @param value The hash to set. + */ + private void setHash(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + hash_ = value; + } + /** + * bytes hash = 1; + */ + private void clearHash() { + + hash_ = getDefaultInstance().getHash(); + } + + public static final int PART_SET_HEADER_FIELD_NUMBER = 2; + private ibc.tendermint.light.TendermintLight.PartSetHeader partSetHeader_; + /** + * .ibc.tendermint.light.PartSetHeader part_set_header = 2; + */ + @java.lang.Override + public boolean hasPartSetHeader() { + return partSetHeader_ != null; + } + /** + * .ibc.tendermint.light.PartSetHeader part_set_header = 2; + */ + @java.lang.Override + public ibc.tendermint.light.TendermintLight.PartSetHeader getPartSetHeader() { + return partSetHeader_ == null ? ibc.tendermint.light.TendermintLight.PartSetHeader.getDefaultInstance() : partSetHeader_; + } + /** + * .ibc.tendermint.light.PartSetHeader part_set_header = 2; + */ + private void setPartSetHeader(ibc.tendermint.light.TendermintLight.PartSetHeader value) { + value.getClass(); + partSetHeader_ = value; + + } + /** + * .ibc.tendermint.light.PartSetHeader part_set_header = 2; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergePartSetHeader(ibc.tendermint.light.TendermintLight.PartSetHeader value) { + value.getClass(); + if (partSetHeader_ != null && + partSetHeader_ != ibc.tendermint.light.TendermintLight.PartSetHeader.getDefaultInstance()) { + partSetHeader_ = + ibc.tendermint.light.TendermintLight.PartSetHeader.newBuilder(partSetHeader_).mergeFrom(value).buildPartial(); + } else { + partSetHeader_ = value; + } + + } + /** + * .ibc.tendermint.light.PartSetHeader part_set_header = 2; + */ + private void clearPartSetHeader() { partSetHeader_ = null; + + } + + public static ibc.tendermint.light.TendermintLight.BlockID parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static ibc.tendermint.light.TendermintLight.BlockID parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.BlockID parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static ibc.tendermint.light.TendermintLight.BlockID parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.BlockID parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static ibc.tendermint.light.TendermintLight.BlockID parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.BlockID parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static ibc.tendermint.light.TendermintLight.BlockID parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.BlockID parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static ibc.tendermint.light.TendermintLight.BlockID parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.BlockID parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static ibc.tendermint.light.TendermintLight.BlockID parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(ibc.tendermint.light.TendermintLight.BlockID prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + * Protobuf type {@code ibc.tendermint.light.BlockID} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + ibc.tendermint.light.TendermintLight.BlockID, Builder> implements + // @@protoc_insertion_point(builder_implements:ibc.tendermint.light.BlockID) + ibc.tendermint.light.TendermintLight.BlockIDOrBuilder { + // Construct using ibc.tendermint.light.TendermintLight.BlockID.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * bytes hash = 1; + * @return The hash. + */ + @java.lang.Override + public com.google.protobuf.ByteString getHash() { + return instance.getHash(); + } + /** + * bytes hash = 1; + * @param value The hash to set. + * @return This builder for chaining. + */ + public Builder setHash(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setHash(value); + return this; + } + /** + * bytes hash = 1; + * @return This builder for chaining. + */ + public Builder clearHash() { + copyOnWrite(); + instance.clearHash(); + return this; + } + + /** + * .ibc.tendermint.light.PartSetHeader part_set_header = 2; + */ + @java.lang.Override + public boolean hasPartSetHeader() { + return instance.hasPartSetHeader(); + } + /** + * .ibc.tendermint.light.PartSetHeader part_set_header = 2; + */ + @java.lang.Override + public ibc.tendermint.light.TendermintLight.PartSetHeader getPartSetHeader() { + return instance.getPartSetHeader(); + } + /** + * .ibc.tendermint.light.PartSetHeader part_set_header = 2; + */ + public Builder setPartSetHeader(ibc.tendermint.light.TendermintLight.PartSetHeader value) { + copyOnWrite(); + instance.setPartSetHeader(value); + return this; + } + /** + * .ibc.tendermint.light.PartSetHeader part_set_header = 2; + */ + public Builder setPartSetHeader( + ibc.tendermint.light.TendermintLight.PartSetHeader.Builder builderForValue) { + copyOnWrite(); + instance.setPartSetHeader(builderForValue.build()); + return this; + } + /** + * .ibc.tendermint.light.PartSetHeader part_set_header = 2; + */ + public Builder mergePartSetHeader(ibc.tendermint.light.TendermintLight.PartSetHeader value) { + copyOnWrite(); + instance.mergePartSetHeader(value); + return this; + } + /** + * .ibc.tendermint.light.PartSetHeader part_set_header = 2; + */ + public Builder clearPartSetHeader() { copyOnWrite(); + instance.clearPartSetHeader(); + return this; + } + + // @@protoc_insertion_point(builder_scope:ibc.tendermint.light.BlockID) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new ibc.tendermint.light.TendermintLight.BlockID(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "hash_", + "partSetHeader_", + }; + java.lang.String info = + "\u0000\u0002\u0000\u0000\u0001\u0002\u0002\u0000\u0000\u0000\u0001\n\u0002\t"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (ibc.tendermint.light.TendermintLight.BlockID.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:ibc.tendermint.light.BlockID) + private static final ibc.tendermint.light.TendermintLight.BlockID DEFAULT_INSTANCE; + static { + BlockID defaultInstance = new BlockID(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + BlockID.class, defaultInstance); + } + + public static ibc.tendermint.light.TendermintLight.BlockID getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } + } + + public interface CommitOrBuilder extends + // @@protoc_insertion_point(interface_extends:ibc.tendermint.light.Commit) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * int64 height = 1; + * @return The height. + */ + long getHeight(); + + /** + * int32 round = 2; + * @return The round. + */ + int getRound(); + + /** + * .ibc.tendermint.light.BlockID block_id = 3; + * @return Whether the blockId field is set. + */ + boolean hasBlockId(); + /** + * .ibc.tendermint.light.BlockID block_id = 3; + * @return The blockId. + */ + ibc.tendermint.light.TendermintLight.BlockID getBlockId(); + + /** + * repeated .ibc.tendermint.light.CommitSig signatures = 4; + */ + java.util.List + getSignaturesList(); + /** + * repeated .ibc.tendermint.light.CommitSig signatures = 4; + */ + ibc.tendermint.light.TendermintLight.CommitSig getSignatures(int index); + /** + * repeated .ibc.tendermint.light.CommitSig signatures = 4; + */ + int getSignaturesCount(); + } + /** + * Protobuf type {@code ibc.tendermint.light.Commit} + */ + public static final class Commit extends + com.google.protobuf.GeneratedMessageLite< + Commit, Commit.Builder> implements + // @@protoc_insertion_point(message_implements:ibc.tendermint.light.Commit) + CommitOrBuilder { + private Commit() { + signatures_ = emptyProtobufList(); + } + public static final int HEIGHT_FIELD_NUMBER = 1; + private long height_; + /** + * int64 height = 1; + * @return The height. + */ + @java.lang.Override + public long getHeight() { + return height_; + } + /** + * int64 height = 1; + * @param value The height to set. + */ + private void setHeight(long value) { + + height_ = value; + } + /** + * int64 height = 1; + */ + private void clearHeight() { + + height_ = 0L; + } + + public static final int ROUND_FIELD_NUMBER = 2; + private int round_; + /** + * int32 round = 2; + * @return The round. + */ + @java.lang.Override + public int getRound() { + return round_; + } + /** + * int32 round = 2; + * @param value The round to set. + */ + private void setRound(int value) { + + round_ = value; + } + /** + * int32 round = 2; + */ + private void clearRound() { + + round_ = 0; + } + + public static final int BLOCK_ID_FIELD_NUMBER = 3; + private ibc.tendermint.light.TendermintLight.BlockID blockId_; + /** + * .ibc.tendermint.light.BlockID block_id = 3; + */ + @java.lang.Override + public boolean hasBlockId() { + return blockId_ != null; + } + /** + * .ibc.tendermint.light.BlockID block_id = 3; + */ + @java.lang.Override + public ibc.tendermint.light.TendermintLight.BlockID getBlockId() { + return blockId_ == null ? ibc.tendermint.light.TendermintLight.BlockID.getDefaultInstance() : blockId_; + } + /** + * .ibc.tendermint.light.BlockID block_id = 3; + */ + private void setBlockId(ibc.tendermint.light.TendermintLight.BlockID value) { + value.getClass(); + blockId_ = value; + + } + /** + * .ibc.tendermint.light.BlockID block_id = 3; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeBlockId(ibc.tendermint.light.TendermintLight.BlockID value) { + value.getClass(); + if (blockId_ != null && + blockId_ != ibc.tendermint.light.TendermintLight.BlockID.getDefaultInstance()) { + blockId_ = + ibc.tendermint.light.TendermintLight.BlockID.newBuilder(blockId_).mergeFrom(value).buildPartial(); + } else { + blockId_ = value; + } + + } + /** + * .ibc.tendermint.light.BlockID block_id = 3; + */ + private void clearBlockId() { blockId_ = null; + + } + + public static final int SIGNATURES_FIELD_NUMBER = 4; + private com.google.protobuf.Internal.ProtobufList signatures_; + /** + * repeated .ibc.tendermint.light.CommitSig signatures = 4; + */ + @java.lang.Override + public java.util.List getSignaturesList() { + return signatures_; + } + /** + * repeated .ibc.tendermint.light.CommitSig signatures = 4; + */ + public java.util.List + getSignaturesOrBuilderList() { + return signatures_; + } + /** + * repeated .ibc.tendermint.light.CommitSig signatures = 4; + */ + @java.lang.Override + public int getSignaturesCount() { + return signatures_.size(); + } + /** + * repeated .ibc.tendermint.light.CommitSig signatures = 4; + */ + @java.lang.Override + public ibc.tendermint.light.TendermintLight.CommitSig getSignatures(int index) { + return signatures_.get(index); + } + /** + * repeated .ibc.tendermint.light.CommitSig signatures = 4; + */ + public ibc.tendermint.light.TendermintLight.CommitSigOrBuilder getSignaturesOrBuilder( + int index) { + return signatures_.get(index); + } + private void ensureSignaturesIsMutable() { + com.google.protobuf.Internal.ProtobufList tmp = signatures_; + if (!tmp.isModifiable()) { + signatures_ = + com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp); + } + } + + /** + * repeated .ibc.tendermint.light.CommitSig signatures = 4; + */ + private void setSignatures( + int index, ibc.tendermint.light.TendermintLight.CommitSig value) { + value.getClass(); + ensureSignaturesIsMutable(); + signatures_.set(index, value); + } + /** + * repeated .ibc.tendermint.light.CommitSig signatures = 4; + */ + private void addSignatures(ibc.tendermint.light.TendermintLight.CommitSig value) { + value.getClass(); + ensureSignaturesIsMutable(); + signatures_.add(value); + } + /** + * repeated .ibc.tendermint.light.CommitSig signatures = 4; + */ + private void addSignatures( + int index, ibc.tendermint.light.TendermintLight.CommitSig value) { + value.getClass(); + ensureSignaturesIsMutable(); + signatures_.add(index, value); + } + /** + * repeated .ibc.tendermint.light.CommitSig signatures = 4; + */ + private void addAllSignatures( + java.lang.Iterable values) { + ensureSignaturesIsMutable(); + com.google.protobuf.AbstractMessageLite.addAll( + values, signatures_); + } + /** + * repeated .ibc.tendermint.light.CommitSig signatures = 4; + */ + private void clearSignatures() { + signatures_ = emptyProtobufList(); + } + /** + * repeated .ibc.tendermint.light.CommitSig signatures = 4; + */ + private void removeSignatures(int index) { + ensureSignaturesIsMutable(); + signatures_.remove(index); + } + + public static ibc.tendermint.light.TendermintLight.Commit parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static ibc.tendermint.light.TendermintLight.Commit parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.Commit parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static ibc.tendermint.light.TendermintLight.Commit parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.Commit parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static ibc.tendermint.light.TendermintLight.Commit parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.Commit parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static ibc.tendermint.light.TendermintLight.Commit parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.Commit parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static ibc.tendermint.light.TendermintLight.Commit parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.Commit parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static ibc.tendermint.light.TendermintLight.Commit parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(ibc.tendermint.light.TendermintLight.Commit prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + * Protobuf type {@code ibc.tendermint.light.Commit} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + ibc.tendermint.light.TendermintLight.Commit, Builder> implements + // @@protoc_insertion_point(builder_implements:ibc.tendermint.light.Commit) + ibc.tendermint.light.TendermintLight.CommitOrBuilder { + // Construct using ibc.tendermint.light.TendermintLight.Commit.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * int64 height = 1; + * @return The height. + */ + @java.lang.Override + public long getHeight() { + return instance.getHeight(); + } + /** + * int64 height = 1; + * @param value The height to set. + * @return This builder for chaining. + */ + public Builder setHeight(long value) { + copyOnWrite(); + instance.setHeight(value); + return this; + } + /** + * int64 height = 1; + * @return This builder for chaining. + */ + public Builder clearHeight() { + copyOnWrite(); + instance.clearHeight(); + return this; + } + + /** + * int32 round = 2; + * @return The round. + */ + @java.lang.Override + public int getRound() { + return instance.getRound(); + } + /** + * int32 round = 2; + * @param value The round to set. + * @return This builder for chaining. + */ + public Builder setRound(int value) { + copyOnWrite(); + instance.setRound(value); + return this; + } + /** + * int32 round = 2; + * @return This builder for chaining. + */ + public Builder clearRound() { + copyOnWrite(); + instance.clearRound(); + return this; + } + + /** + * .ibc.tendermint.light.BlockID block_id = 3; + */ + @java.lang.Override + public boolean hasBlockId() { + return instance.hasBlockId(); + } + /** + * .ibc.tendermint.light.BlockID block_id = 3; + */ + @java.lang.Override + public ibc.tendermint.light.TendermintLight.BlockID getBlockId() { + return instance.getBlockId(); + } + /** + * .ibc.tendermint.light.BlockID block_id = 3; + */ + public Builder setBlockId(ibc.tendermint.light.TendermintLight.BlockID value) { + copyOnWrite(); + instance.setBlockId(value); + return this; + } + /** + * .ibc.tendermint.light.BlockID block_id = 3; + */ + public Builder setBlockId( + ibc.tendermint.light.TendermintLight.BlockID.Builder builderForValue) { + copyOnWrite(); + instance.setBlockId(builderForValue.build()); + return this; + } + /** + * .ibc.tendermint.light.BlockID block_id = 3; + */ + public Builder mergeBlockId(ibc.tendermint.light.TendermintLight.BlockID value) { + copyOnWrite(); + instance.mergeBlockId(value); + return this; + } + /** + * .ibc.tendermint.light.BlockID block_id = 3; + */ + public Builder clearBlockId() { copyOnWrite(); + instance.clearBlockId(); + return this; + } + + /** + * repeated .ibc.tendermint.light.CommitSig signatures = 4; + */ + @java.lang.Override + public java.util.List getSignaturesList() { + return java.util.Collections.unmodifiableList( + instance.getSignaturesList()); + } + /** + * repeated .ibc.tendermint.light.CommitSig signatures = 4; + */ + @java.lang.Override + public int getSignaturesCount() { + return instance.getSignaturesCount(); + }/** + * repeated .ibc.tendermint.light.CommitSig signatures = 4; + */ + @java.lang.Override + public ibc.tendermint.light.TendermintLight.CommitSig getSignatures(int index) { + return instance.getSignatures(index); + } + /** + * repeated .ibc.tendermint.light.CommitSig signatures = 4; + */ + public Builder setSignatures( + int index, ibc.tendermint.light.TendermintLight.CommitSig value) { + copyOnWrite(); + instance.setSignatures(index, value); + return this; + } + /** + * repeated .ibc.tendermint.light.CommitSig signatures = 4; + */ + public Builder setSignatures( + int index, ibc.tendermint.light.TendermintLight.CommitSig.Builder builderForValue) { + copyOnWrite(); + instance.setSignatures(index, + builderForValue.build()); + return this; + } + /** + * repeated .ibc.tendermint.light.CommitSig signatures = 4; + */ + public Builder addSignatures(ibc.tendermint.light.TendermintLight.CommitSig value) { + copyOnWrite(); + instance.addSignatures(value); + return this; + } + /** + * repeated .ibc.tendermint.light.CommitSig signatures = 4; + */ + public Builder addSignatures( + int index, ibc.tendermint.light.TendermintLight.CommitSig value) { + copyOnWrite(); + instance.addSignatures(index, value); + return this; + } + /** + * repeated .ibc.tendermint.light.CommitSig signatures = 4; + */ + public Builder addSignatures( + ibc.tendermint.light.TendermintLight.CommitSig.Builder builderForValue) { + copyOnWrite(); + instance.addSignatures(builderForValue.build()); + return this; + } + /** + * repeated .ibc.tendermint.light.CommitSig signatures = 4; + */ + public Builder addSignatures( + int index, ibc.tendermint.light.TendermintLight.CommitSig.Builder builderForValue) { + copyOnWrite(); + instance.addSignatures(index, + builderForValue.build()); + return this; + } + /** + * repeated .ibc.tendermint.light.CommitSig signatures = 4; + */ + public Builder addAllSignatures( + java.lang.Iterable values) { + copyOnWrite(); + instance.addAllSignatures(values); + return this; + } + /** + * repeated .ibc.tendermint.light.CommitSig signatures = 4; + */ + public Builder clearSignatures() { + copyOnWrite(); + instance.clearSignatures(); + return this; + } + /** + * repeated .ibc.tendermint.light.CommitSig signatures = 4; + */ + public Builder removeSignatures(int index) { + copyOnWrite(); + instance.removeSignatures(index); + return this; + } + + // @@protoc_insertion_point(builder_scope:ibc.tendermint.light.Commit) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new ibc.tendermint.light.TendermintLight.Commit(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "height_", + "round_", + "blockId_", + "signatures_", + ibc.tendermint.light.TendermintLight.CommitSig.class, + }; + java.lang.String info = + "\u0000\u0004\u0000\u0000\u0001\u0004\u0004\u0000\u0001\u0000\u0001\u0002\u0002\u0004" + + "\u0003\t\u0004\u001b"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (ibc.tendermint.light.TendermintLight.Commit.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:ibc.tendermint.light.Commit) + private static final ibc.tendermint.light.TendermintLight.Commit DEFAULT_INSTANCE; + static { + Commit defaultInstance = new Commit(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + Commit.class, defaultInstance); + } + + public static ibc.tendermint.light.TendermintLight.Commit getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } + } + + public interface CommitSigOrBuilder extends + // @@protoc_insertion_point(interface_extends:ibc.tendermint.light.CommitSig) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * .ibc.tendermint.light.BlockIDFlag block_id_flag = 1; + * @return The enum numeric value on the wire for blockIdFlag. + */ + int getBlockIdFlagValue(); + /** + * .ibc.tendermint.light.BlockIDFlag block_id_flag = 1; + * @return The blockIdFlag. + */ + ibc.tendermint.light.TendermintLight.BlockIDFlag getBlockIdFlag(); + + /** + * bytes validator_address = 2; + * @return The validatorAddress. + */ + com.google.protobuf.ByteString getValidatorAddress(); + + /** + * .ibc.tendermint.light.Timestamp timestamp = 3; + * @return Whether the timestamp field is set. + */ + boolean hasTimestamp(); + /** + * .ibc.tendermint.light.Timestamp timestamp = 3; + * @return The timestamp. + */ + ibc.tendermint.light.TendermintLight.Timestamp getTimestamp(); + + /** + * bytes signature = 4; + * @return The signature. + */ + com.google.protobuf.ByteString getSignature(); + } + /** + *
+   * CommitSig is a part of the Vote included in a Commit.
+   * 
+ * + * Protobuf type {@code ibc.tendermint.light.CommitSig} + */ + public static final class CommitSig extends + com.google.protobuf.GeneratedMessageLite< + CommitSig, CommitSig.Builder> implements + // @@protoc_insertion_point(message_implements:ibc.tendermint.light.CommitSig) + CommitSigOrBuilder { + private CommitSig() { + validatorAddress_ = com.google.protobuf.ByteString.EMPTY; + signature_ = com.google.protobuf.ByteString.EMPTY; + } + public static final int BLOCK_ID_FLAG_FIELD_NUMBER = 1; + private int blockIdFlag_; + /** + * .ibc.tendermint.light.BlockIDFlag block_id_flag = 1; + * @return The enum numeric value on the wire for blockIdFlag. + */ + @java.lang.Override + public int getBlockIdFlagValue() { + return blockIdFlag_; + } + /** + * .ibc.tendermint.light.BlockIDFlag block_id_flag = 1; + * @return The blockIdFlag. + */ + @java.lang.Override + public ibc.tendermint.light.TendermintLight.BlockIDFlag getBlockIdFlag() { + ibc.tendermint.light.TendermintLight.BlockIDFlag result = ibc.tendermint.light.TendermintLight.BlockIDFlag.forNumber(blockIdFlag_); + return result == null ? ibc.tendermint.light.TendermintLight.BlockIDFlag.UNRECOGNIZED : result; + } + /** + * .ibc.tendermint.light.BlockIDFlag block_id_flag = 1; + * @param value The enum numeric value on the wire for blockIdFlag to set. + */ + private void setBlockIdFlagValue(int value) { + blockIdFlag_ = value; + } + /** + * .ibc.tendermint.light.BlockIDFlag block_id_flag = 1; + * @param value The blockIdFlag to set. + */ + private void setBlockIdFlag(ibc.tendermint.light.TendermintLight.BlockIDFlag value) { + blockIdFlag_ = value.getNumber(); + + } + /** + * .ibc.tendermint.light.BlockIDFlag block_id_flag = 1; + */ + private void clearBlockIdFlag() { + + blockIdFlag_ = 0; + } + + public static final int VALIDATOR_ADDRESS_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString validatorAddress_; + /** + * bytes validator_address = 2; + * @return The validatorAddress. + */ + @java.lang.Override + public com.google.protobuf.ByteString getValidatorAddress() { + return validatorAddress_; + } + /** + * bytes validator_address = 2; + * @param value The validatorAddress to set. + */ + private void setValidatorAddress(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + validatorAddress_ = value; + } + /** + * bytes validator_address = 2; + */ + private void clearValidatorAddress() { + + validatorAddress_ = getDefaultInstance().getValidatorAddress(); + } + + public static final int TIMESTAMP_FIELD_NUMBER = 3; + private ibc.tendermint.light.TendermintLight.Timestamp timestamp_; + /** + * .ibc.tendermint.light.Timestamp timestamp = 3; + */ + @java.lang.Override + public boolean hasTimestamp() { + return timestamp_ != null; + } + /** + * .ibc.tendermint.light.Timestamp timestamp = 3; + */ + @java.lang.Override + public ibc.tendermint.light.TendermintLight.Timestamp getTimestamp() { + return timestamp_ == null ? ibc.tendermint.light.TendermintLight.Timestamp.getDefaultInstance() : timestamp_; + } + /** + * .ibc.tendermint.light.Timestamp timestamp = 3; + */ + private void setTimestamp(ibc.tendermint.light.TendermintLight.Timestamp value) { + value.getClass(); + timestamp_ = value; + + } + /** + * .ibc.tendermint.light.Timestamp timestamp = 3; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeTimestamp(ibc.tendermint.light.TendermintLight.Timestamp value) { + value.getClass(); + if (timestamp_ != null && + timestamp_ != ibc.tendermint.light.TendermintLight.Timestamp.getDefaultInstance()) { + timestamp_ = + ibc.tendermint.light.TendermintLight.Timestamp.newBuilder(timestamp_).mergeFrom(value).buildPartial(); + } else { + timestamp_ = value; + } + + } + /** + * .ibc.tendermint.light.Timestamp timestamp = 3; + */ + private void clearTimestamp() { timestamp_ = null; + + } + + public static final int SIGNATURE_FIELD_NUMBER = 4; + private com.google.protobuf.ByteString signature_; + /** + * bytes signature = 4; + * @return The signature. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSignature() { + return signature_; + } + /** + * bytes signature = 4; + * @param value The signature to set. + */ + private void setSignature(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + signature_ = value; + } + /** + * bytes signature = 4; + */ + private void clearSignature() { + + signature_ = getDefaultInstance().getSignature(); + } + + public static ibc.tendermint.light.TendermintLight.CommitSig parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static ibc.tendermint.light.TendermintLight.CommitSig parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.CommitSig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static ibc.tendermint.light.TendermintLight.CommitSig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.CommitSig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static ibc.tendermint.light.TendermintLight.CommitSig parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.CommitSig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static ibc.tendermint.light.TendermintLight.CommitSig parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.CommitSig parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static ibc.tendermint.light.TendermintLight.CommitSig parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.CommitSig parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static ibc.tendermint.light.TendermintLight.CommitSig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(ibc.tendermint.light.TendermintLight.CommitSig prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+     * CommitSig is a part of the Vote included in a Commit.
+     * 
+ * + * Protobuf type {@code ibc.tendermint.light.CommitSig} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + ibc.tendermint.light.TendermintLight.CommitSig, Builder> implements + // @@protoc_insertion_point(builder_implements:ibc.tendermint.light.CommitSig) + ibc.tendermint.light.TendermintLight.CommitSigOrBuilder { + // Construct using ibc.tendermint.light.TendermintLight.CommitSig.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * .ibc.tendermint.light.BlockIDFlag block_id_flag = 1; + * @return The enum numeric value on the wire for blockIdFlag. + */ + @java.lang.Override + public int getBlockIdFlagValue() { + return instance.getBlockIdFlagValue(); + } + /** + * .ibc.tendermint.light.BlockIDFlag block_id_flag = 1; + * @param value The blockIdFlag to set. + * @return This builder for chaining. + */ + public Builder setBlockIdFlagValue(int value) { + copyOnWrite(); + instance.setBlockIdFlagValue(value); + return this; + } + /** + * .ibc.tendermint.light.BlockIDFlag block_id_flag = 1; + * @return The blockIdFlag. + */ + @java.lang.Override + public ibc.tendermint.light.TendermintLight.BlockIDFlag getBlockIdFlag() { + return instance.getBlockIdFlag(); + } + /** + * .ibc.tendermint.light.BlockIDFlag block_id_flag = 1; + * @param value The enum numeric value on the wire for blockIdFlag to set. + * @return This builder for chaining. + */ + public Builder setBlockIdFlag(ibc.tendermint.light.TendermintLight.BlockIDFlag value) { + copyOnWrite(); + instance.setBlockIdFlag(value); + return this; + } + /** + * .ibc.tendermint.light.BlockIDFlag block_id_flag = 1; + * @return This builder for chaining. + */ + public Builder clearBlockIdFlag() { + copyOnWrite(); + instance.clearBlockIdFlag(); + return this; + } + + /** + * bytes validator_address = 2; + * @return The validatorAddress. + */ + @java.lang.Override + public com.google.protobuf.ByteString getValidatorAddress() { + return instance.getValidatorAddress(); + } + /** + * bytes validator_address = 2; + * @param value The validatorAddress to set. + * @return This builder for chaining. + */ + public Builder setValidatorAddress(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setValidatorAddress(value); + return this; + } + /** + * bytes validator_address = 2; + * @return This builder for chaining. + */ + public Builder clearValidatorAddress() { + copyOnWrite(); + instance.clearValidatorAddress(); + return this; + } + + /** + * .ibc.tendermint.light.Timestamp timestamp = 3; + */ + @java.lang.Override + public boolean hasTimestamp() { + return instance.hasTimestamp(); + } + /** + * .ibc.tendermint.light.Timestamp timestamp = 3; + */ + @java.lang.Override + public ibc.tendermint.light.TendermintLight.Timestamp getTimestamp() { + return instance.getTimestamp(); + } + /** + * .ibc.tendermint.light.Timestamp timestamp = 3; + */ + public Builder setTimestamp(ibc.tendermint.light.TendermintLight.Timestamp value) { + copyOnWrite(); + instance.setTimestamp(value); + return this; + } + /** + * .ibc.tendermint.light.Timestamp timestamp = 3; + */ + public Builder setTimestamp( + ibc.tendermint.light.TendermintLight.Timestamp.Builder builderForValue) { + copyOnWrite(); + instance.setTimestamp(builderForValue.build()); + return this; + } + /** + * .ibc.tendermint.light.Timestamp timestamp = 3; + */ + public Builder mergeTimestamp(ibc.tendermint.light.TendermintLight.Timestamp value) { + copyOnWrite(); + instance.mergeTimestamp(value); + return this; + } + /** + * .ibc.tendermint.light.Timestamp timestamp = 3; + */ + public Builder clearTimestamp() { copyOnWrite(); + instance.clearTimestamp(); + return this; + } + + /** + * bytes signature = 4; + * @return The signature. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSignature() { + return instance.getSignature(); + } + /** + * bytes signature = 4; + * @param value The signature to set. + * @return This builder for chaining. + */ + public Builder setSignature(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setSignature(value); + return this; + } + /** + * bytes signature = 4; + * @return This builder for chaining. + */ + public Builder clearSignature() { + copyOnWrite(); + instance.clearSignature(); + return this; + } + + // @@protoc_insertion_point(builder_scope:ibc.tendermint.light.CommitSig) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new ibc.tendermint.light.TendermintLight.CommitSig(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "blockIdFlag_", + "validatorAddress_", + "timestamp_", + "signature_", + }; + java.lang.String info = + "\u0000\u0004\u0000\u0000\u0001\u0004\u0004\u0000\u0000\u0000\u0001\f\u0002\n\u0003" + + "\t\u0004\n"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (ibc.tendermint.light.TendermintLight.CommitSig.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:ibc.tendermint.light.CommitSig) + private static final ibc.tendermint.light.TendermintLight.CommitSig DEFAULT_INSTANCE; + static { + CommitSig defaultInstance = new CommitSig(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + CommitSig.class, defaultInstance); + } + + public static ibc.tendermint.light.TendermintLight.CommitSig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } + } + + public interface TimestampOrBuilder extends + // @@protoc_insertion_point(interface_extends:ibc.tendermint.light.Timestamp) + com.google.protobuf.MessageLiteOrBuilder { + + /** + *
+     * Represents seconds of UTC time since Unix epoch
+     * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
+     * 9999-12-31T23:59:59Z inclusive.
+     * 
+ * + * int64 seconds = 1; + * @return The seconds. + */ + long getSeconds(); + + /** + *
+     * Non-negative fractions of a second at nanosecond resolution. Negative
+     * second values with fractions must still have non-negative nanos values
+     * that count forward in time. Must be from 0 to 999,999,999
+     * inclusive.
+     * 
+ * + * int32 nanos = 2; + * @return The nanos. + */ + int getNanos(); + } + /** + * Protobuf type {@code ibc.tendermint.light.Timestamp} + */ + public static final class Timestamp extends + com.google.protobuf.GeneratedMessageLite< + Timestamp, Timestamp.Builder> implements + // @@protoc_insertion_point(message_implements:ibc.tendermint.light.Timestamp) + TimestampOrBuilder { + private Timestamp() { + } + public static final int SECONDS_FIELD_NUMBER = 1; + private long seconds_; + /** + *
+     * Represents seconds of UTC time since Unix epoch
+     * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
+     * 9999-12-31T23:59:59Z inclusive.
+     * 
+ * + * int64 seconds = 1; + * @return The seconds. + */ + @java.lang.Override + public long getSeconds() { + return seconds_; + } + /** + *
+     * Represents seconds of UTC time since Unix epoch
+     * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
+     * 9999-12-31T23:59:59Z inclusive.
+     * 
+ * + * int64 seconds = 1; + * @param value The seconds to set. + */ + private void setSeconds(long value) { + + seconds_ = value; + } + /** + *
+     * Represents seconds of UTC time since Unix epoch
+     * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
+     * 9999-12-31T23:59:59Z inclusive.
+     * 
+ * + * int64 seconds = 1; + */ + private void clearSeconds() { + + seconds_ = 0L; + } + + public static final int NANOS_FIELD_NUMBER = 2; + private int nanos_; + /** + *
+     * Non-negative fractions of a second at nanosecond resolution. Negative
+     * second values with fractions must still have non-negative nanos values
+     * that count forward in time. Must be from 0 to 999,999,999
+     * inclusive.
+     * 
+ * + * int32 nanos = 2; + * @return The nanos. + */ + @java.lang.Override + public int getNanos() { + return nanos_; + } + /** + *
+     * Non-negative fractions of a second at nanosecond resolution. Negative
+     * second values with fractions must still have non-negative nanos values
+     * that count forward in time. Must be from 0 to 999,999,999
+     * inclusive.
+     * 
+ * + * int32 nanos = 2; + * @param value The nanos to set. + */ + private void setNanos(int value) { + + nanos_ = value; + } + /** + *
+     * Non-negative fractions of a second at nanosecond resolution. Negative
+     * second values with fractions must still have non-negative nanos values
+     * that count forward in time. Must be from 0 to 999,999,999
+     * inclusive.
+     * 
+ * + * int32 nanos = 2; + */ + private void clearNanos() { + + nanos_ = 0; + } + + public static ibc.tendermint.light.TendermintLight.Timestamp parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static ibc.tendermint.light.TendermintLight.Timestamp parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.Timestamp parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static ibc.tendermint.light.TendermintLight.Timestamp parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.Timestamp parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static ibc.tendermint.light.TendermintLight.Timestamp parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.Timestamp parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static ibc.tendermint.light.TendermintLight.Timestamp parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.Timestamp parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static ibc.tendermint.light.TendermintLight.Timestamp parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.Timestamp parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static ibc.tendermint.light.TendermintLight.Timestamp parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(ibc.tendermint.light.TendermintLight.Timestamp prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + * Protobuf type {@code ibc.tendermint.light.Timestamp} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + ibc.tendermint.light.TendermintLight.Timestamp, Builder> implements + // @@protoc_insertion_point(builder_implements:ibc.tendermint.light.Timestamp) + ibc.tendermint.light.TendermintLight.TimestampOrBuilder { + // Construct using ibc.tendermint.light.TendermintLight.Timestamp.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + *
+       * Represents seconds of UTC time since Unix epoch
+       * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
+       * 9999-12-31T23:59:59Z inclusive.
+       * 
+ * + * int64 seconds = 1; + * @return The seconds. + */ + @java.lang.Override + public long getSeconds() { + return instance.getSeconds(); + } + /** + *
+       * Represents seconds of UTC time since Unix epoch
+       * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
+       * 9999-12-31T23:59:59Z inclusive.
+       * 
+ * + * int64 seconds = 1; + * @param value The seconds to set. + * @return This builder for chaining. + */ + public Builder setSeconds(long value) { + copyOnWrite(); + instance.setSeconds(value); + return this; + } + /** + *
+       * Represents seconds of UTC time since Unix epoch
+       * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
+       * 9999-12-31T23:59:59Z inclusive.
+       * 
+ * + * int64 seconds = 1; + * @return This builder for chaining. + */ + public Builder clearSeconds() { + copyOnWrite(); + instance.clearSeconds(); + return this; + } + + /** + *
+       * Non-negative fractions of a second at nanosecond resolution. Negative
+       * second values with fractions must still have non-negative nanos values
+       * that count forward in time. Must be from 0 to 999,999,999
+       * inclusive.
+       * 
+ * + * int32 nanos = 2; + * @return The nanos. + */ + @java.lang.Override + public int getNanos() { + return instance.getNanos(); + } + /** + *
+       * Non-negative fractions of a second at nanosecond resolution. Negative
+       * second values with fractions must still have non-negative nanos values
+       * that count forward in time. Must be from 0 to 999,999,999
+       * inclusive.
+       * 
+ * + * int32 nanos = 2; + * @param value The nanos to set. + * @return This builder for chaining. + */ + public Builder setNanos(int value) { + copyOnWrite(); + instance.setNanos(value); + return this; + } + /** + *
+       * Non-negative fractions of a second at nanosecond resolution. Negative
+       * second values with fractions must still have non-negative nanos values
+       * that count forward in time. Must be from 0 to 999,999,999
+       * inclusive.
+       * 
+ * + * int32 nanos = 2; + * @return This builder for chaining. + */ + public Builder clearNanos() { + copyOnWrite(); + instance.clearNanos(); + return this; + } + + // @@protoc_insertion_point(builder_scope:ibc.tendermint.light.Timestamp) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new ibc.tendermint.light.TendermintLight.Timestamp(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "seconds_", + "nanos_", + }; + java.lang.String info = + "\u0000\u0002\u0000\u0000\u0001\u0002\u0002\u0000\u0000\u0000\u0001\u0002\u0002\u0004" + + ""; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (ibc.tendermint.light.TendermintLight.Timestamp.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:ibc.tendermint.light.Timestamp) + private static final ibc.tendermint.light.TendermintLight.Timestamp DEFAULT_INSTANCE; + static { + Timestamp defaultInstance = new Timestamp(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + Timestamp.class, defaultInstance); + } + + public static ibc.tendermint.light.TendermintLight.Timestamp getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } + } + + public interface LightHeaderOrBuilder extends + // @@protoc_insertion_point(interface_extends:ibc.tendermint.light.LightHeader) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * .ibc.tendermint.light.Consensus version = 1; + * @return Whether the version field is set. + */ + boolean hasVersion(); + /** + * .ibc.tendermint.light.Consensus version = 1; + * @return The version. + */ + ibc.tendermint.light.TendermintLight.Consensus getVersion(); + + /** + * string chain_id = 2; + * @return The chainId. + */ + java.lang.String getChainId(); + /** + * string chain_id = 2; + * @return The bytes for chainId. + */ + com.google.protobuf.ByteString + getChainIdBytes(); + + /** + * int64 height = 3; + * @return The height. + */ + long getHeight(); + + /** + * .ibc.tendermint.light.Timestamp time = 4; + * @return Whether the time field is set. + */ + boolean hasTime(); + /** + * .ibc.tendermint.light.Timestamp time = 4; + * @return The time. + */ + ibc.tendermint.light.TendermintLight.Timestamp getTime(); + + /** + * .ibc.tendermint.light.BlockID last_block_id = 5; + * @return Whether the lastBlockId field is set. + */ + boolean hasLastBlockId(); + /** + * .ibc.tendermint.light.BlockID last_block_id = 5; + * @return The lastBlockId. + */ + ibc.tendermint.light.TendermintLight.BlockID getLastBlockId(); + + /** + *
+     * commit from validators from the last block
+     * 
+ * + * bytes last_commit_hash = 6; + * @return The lastCommitHash. + */ + com.google.protobuf.ByteString getLastCommitHash(); + + /** + *
+     * transactions
+     * 
+ * + * bytes data_hash = 7; + * @return The dataHash. + */ + com.google.protobuf.ByteString getDataHash(); + + /** + *
+     * validators for the current block
+     * 
+ * + * bytes validators_hash = 8; + * @return The validatorsHash. + */ + com.google.protobuf.ByteString getValidatorsHash(); + + /** + *
+     * validators for the next block
+     * 
+ * + * bytes next_validators_hash = 9; + * @return The nextValidatorsHash. + */ + com.google.protobuf.ByteString getNextValidatorsHash(); + + /** + *
+     * consensus params for current block
+     * 
+ * + * bytes consensus_hash = 10; + * @return The consensusHash. + */ + com.google.protobuf.ByteString getConsensusHash(); + + /** + *
+     * state after txs from the previous block
+     * 
+ * + * bytes app_hash = 11; + * @return The appHash. + */ + com.google.protobuf.ByteString getAppHash(); + + /** + *
+     * root hash of all results from the txs from the previous block
+     * 
+ * + * bytes last_results_hash = 12; + * @return The lastResultsHash. + */ + com.google.protobuf.ByteString getLastResultsHash(); + + /** + *
+     * evidence included in the block
+     * 
+ * + * bytes evidence_hash = 13; + * @return The evidenceHash. + */ + com.google.protobuf.ByteString getEvidenceHash(); + + /** + *
+     * original proposer of the block
+     * 
+ * + * bytes proposer_address = 14; + * @return The proposerAddress. + */ + com.google.protobuf.ByteString getProposerAddress(); + } + /** + * Protobuf type {@code ibc.tendermint.light.LightHeader} + */ + public static final class LightHeader extends + com.google.protobuf.GeneratedMessageLite< + LightHeader, LightHeader.Builder> implements + // @@protoc_insertion_point(message_implements:ibc.tendermint.light.LightHeader) + LightHeaderOrBuilder { + private LightHeader() { + chainId_ = ""; + lastCommitHash_ = com.google.protobuf.ByteString.EMPTY; + dataHash_ = com.google.protobuf.ByteString.EMPTY; + validatorsHash_ = com.google.protobuf.ByteString.EMPTY; + nextValidatorsHash_ = com.google.protobuf.ByteString.EMPTY; + consensusHash_ = com.google.protobuf.ByteString.EMPTY; + appHash_ = com.google.protobuf.ByteString.EMPTY; + lastResultsHash_ = com.google.protobuf.ByteString.EMPTY; + evidenceHash_ = com.google.protobuf.ByteString.EMPTY; + proposerAddress_ = com.google.protobuf.ByteString.EMPTY; + } + public static final int VERSION_FIELD_NUMBER = 1; + private ibc.tendermint.light.TendermintLight.Consensus version_; + /** + * .ibc.tendermint.light.Consensus version = 1; + */ + @java.lang.Override + public boolean hasVersion() { + return version_ != null; + } + /** + * .ibc.tendermint.light.Consensus version = 1; + */ + @java.lang.Override + public ibc.tendermint.light.TendermintLight.Consensus getVersion() { + return version_ == null ? ibc.tendermint.light.TendermintLight.Consensus.getDefaultInstance() : version_; + } + /** + * .ibc.tendermint.light.Consensus version = 1; + */ + private void setVersion(ibc.tendermint.light.TendermintLight.Consensus value) { + value.getClass(); + version_ = value; + + } + /** + * .ibc.tendermint.light.Consensus version = 1; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeVersion(ibc.tendermint.light.TendermintLight.Consensus value) { + value.getClass(); + if (version_ != null && + version_ != ibc.tendermint.light.TendermintLight.Consensus.getDefaultInstance()) { + version_ = + ibc.tendermint.light.TendermintLight.Consensus.newBuilder(version_).mergeFrom(value).buildPartial(); + } else { + version_ = value; + } + + } + /** + * .ibc.tendermint.light.Consensus version = 1; + */ + private void clearVersion() { version_ = null; + + } + + public static final int CHAIN_ID_FIELD_NUMBER = 2; + private java.lang.String chainId_; + /** + * string chain_id = 2; + * @return The chainId. + */ + @java.lang.Override + public java.lang.String getChainId() { + return chainId_; + } + /** + * string chain_id = 2; + * @return The bytes for chainId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getChainIdBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(chainId_); + } + /** + * string chain_id = 2; + * @param value The chainId to set. + */ + private void setChainId( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + chainId_ = value; + } + /** + * string chain_id = 2; + */ + private void clearChainId() { + + chainId_ = getDefaultInstance().getChainId(); + } + /** + * string chain_id = 2; + * @param value The bytes for chainId to set. + */ + private void setChainIdBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + chainId_ = value.toStringUtf8(); + + } + + public static final int HEIGHT_FIELD_NUMBER = 3; + private long height_; + /** + * int64 height = 3; + * @return The height. + */ + @java.lang.Override + public long getHeight() { + return height_; + } + /** + * int64 height = 3; + * @param value The height to set. + */ + private void setHeight(long value) { + + height_ = value; + } + /** + * int64 height = 3; + */ + private void clearHeight() { + + height_ = 0L; + } + + public static final int TIME_FIELD_NUMBER = 4; + private ibc.tendermint.light.TendermintLight.Timestamp time_; + /** + * .ibc.tendermint.light.Timestamp time = 4; + */ + @java.lang.Override + public boolean hasTime() { + return time_ != null; + } + /** + * .ibc.tendermint.light.Timestamp time = 4; + */ + @java.lang.Override + public ibc.tendermint.light.TendermintLight.Timestamp getTime() { + return time_ == null ? ibc.tendermint.light.TendermintLight.Timestamp.getDefaultInstance() : time_; + } + /** + * .ibc.tendermint.light.Timestamp time = 4; + */ + private void setTime(ibc.tendermint.light.TendermintLight.Timestamp value) { + value.getClass(); + time_ = value; + + } + /** + * .ibc.tendermint.light.Timestamp time = 4; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeTime(ibc.tendermint.light.TendermintLight.Timestamp value) { + value.getClass(); + if (time_ != null && + time_ != ibc.tendermint.light.TendermintLight.Timestamp.getDefaultInstance()) { + time_ = + ibc.tendermint.light.TendermintLight.Timestamp.newBuilder(time_).mergeFrom(value).buildPartial(); + } else { + time_ = value; + } + + } + /** + * .ibc.tendermint.light.Timestamp time = 4; + */ + private void clearTime() { time_ = null; + + } + + public static final int LAST_BLOCK_ID_FIELD_NUMBER = 5; + private ibc.tendermint.light.TendermintLight.BlockID lastBlockId_; + /** + * .ibc.tendermint.light.BlockID last_block_id = 5; + */ + @java.lang.Override + public boolean hasLastBlockId() { + return lastBlockId_ != null; + } + /** + * .ibc.tendermint.light.BlockID last_block_id = 5; + */ + @java.lang.Override + public ibc.tendermint.light.TendermintLight.BlockID getLastBlockId() { + return lastBlockId_ == null ? ibc.tendermint.light.TendermintLight.BlockID.getDefaultInstance() : lastBlockId_; + } + /** + * .ibc.tendermint.light.BlockID last_block_id = 5; + */ + private void setLastBlockId(ibc.tendermint.light.TendermintLight.BlockID value) { + value.getClass(); + lastBlockId_ = value; + + } + /** + * .ibc.tendermint.light.BlockID last_block_id = 5; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeLastBlockId(ibc.tendermint.light.TendermintLight.BlockID value) { + value.getClass(); + if (lastBlockId_ != null && + lastBlockId_ != ibc.tendermint.light.TendermintLight.BlockID.getDefaultInstance()) { + lastBlockId_ = + ibc.tendermint.light.TendermintLight.BlockID.newBuilder(lastBlockId_).mergeFrom(value).buildPartial(); + } else { + lastBlockId_ = value; + } + + } + /** + * .ibc.tendermint.light.BlockID last_block_id = 5; + */ + private void clearLastBlockId() { lastBlockId_ = null; + + } + + public static final int LAST_COMMIT_HASH_FIELD_NUMBER = 6; + private com.google.protobuf.ByteString lastCommitHash_; + /** + *
+     * commit from validators from the last block
+     * 
+ * + * bytes last_commit_hash = 6; + * @return The lastCommitHash. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLastCommitHash() { + return lastCommitHash_; + } + /** + *
+     * commit from validators from the last block
+     * 
+ * + * bytes last_commit_hash = 6; + * @param value The lastCommitHash to set. + */ + private void setLastCommitHash(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + lastCommitHash_ = value; + } + /** + *
+     * commit from validators from the last block
+     * 
+ * + * bytes last_commit_hash = 6; + */ + private void clearLastCommitHash() { + + lastCommitHash_ = getDefaultInstance().getLastCommitHash(); + } + + public static final int DATA_HASH_FIELD_NUMBER = 7; + private com.google.protobuf.ByteString dataHash_; + /** + *
+     * transactions
+     * 
+ * + * bytes data_hash = 7; + * @return The dataHash. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDataHash() { + return dataHash_; + } + /** + *
+     * transactions
+     * 
+ * + * bytes data_hash = 7; + * @param value The dataHash to set. + */ + private void setDataHash(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + dataHash_ = value; + } + /** + *
+     * transactions
+     * 
+ * + * bytes data_hash = 7; + */ + private void clearDataHash() { + + dataHash_ = getDefaultInstance().getDataHash(); + } + + public static final int VALIDATORS_HASH_FIELD_NUMBER = 8; + private com.google.protobuf.ByteString validatorsHash_; + /** + *
+     * validators for the current block
+     * 
+ * + * bytes validators_hash = 8; + * @return The validatorsHash. + */ + @java.lang.Override + public com.google.protobuf.ByteString getValidatorsHash() { + return validatorsHash_; + } + /** + *
+     * validators for the current block
+     * 
+ * + * bytes validators_hash = 8; + * @param value The validatorsHash to set. + */ + private void setValidatorsHash(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + validatorsHash_ = value; + } + /** + *
+     * validators for the current block
+     * 
+ * + * bytes validators_hash = 8; + */ + private void clearValidatorsHash() { + + validatorsHash_ = getDefaultInstance().getValidatorsHash(); + } + + public static final int NEXT_VALIDATORS_HASH_FIELD_NUMBER = 9; + private com.google.protobuf.ByteString nextValidatorsHash_; + /** + *
+     * validators for the next block
+     * 
+ * + * bytes next_validators_hash = 9; + * @return The nextValidatorsHash. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextValidatorsHash() { + return nextValidatorsHash_; + } + /** + *
+     * validators for the next block
+     * 
+ * + * bytes next_validators_hash = 9; + * @param value The nextValidatorsHash to set. + */ + private void setNextValidatorsHash(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + nextValidatorsHash_ = value; + } + /** + *
+     * validators for the next block
+     * 
+ * + * bytes next_validators_hash = 9; + */ + private void clearNextValidatorsHash() { + + nextValidatorsHash_ = getDefaultInstance().getNextValidatorsHash(); + } + + public static final int CONSENSUS_HASH_FIELD_NUMBER = 10; + private com.google.protobuf.ByteString consensusHash_; + /** + *
+     * consensus params for current block
+     * 
+ * + * bytes consensus_hash = 10; + * @return The consensusHash. + */ + @java.lang.Override + public com.google.protobuf.ByteString getConsensusHash() { + return consensusHash_; + } + /** + *
+     * consensus params for current block
+     * 
+ * + * bytes consensus_hash = 10; + * @param value The consensusHash to set. + */ + private void setConsensusHash(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + consensusHash_ = value; + } + /** + *
+     * consensus params for current block
+     * 
+ * + * bytes consensus_hash = 10; + */ + private void clearConsensusHash() { + + consensusHash_ = getDefaultInstance().getConsensusHash(); + } + + public static final int APP_HASH_FIELD_NUMBER = 11; + private com.google.protobuf.ByteString appHash_; + /** + *
+     * state after txs from the previous block
+     * 
+ * + * bytes app_hash = 11; + * @return The appHash. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAppHash() { + return appHash_; + } + /** + *
+     * state after txs from the previous block
+     * 
+ * + * bytes app_hash = 11; + * @param value The appHash to set. + */ + private void setAppHash(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + appHash_ = value; + } + /** + *
+     * state after txs from the previous block
+     * 
+ * + * bytes app_hash = 11; + */ + private void clearAppHash() { + + appHash_ = getDefaultInstance().getAppHash(); + } + + public static final int LAST_RESULTS_HASH_FIELD_NUMBER = 12; + private com.google.protobuf.ByteString lastResultsHash_; + /** + *
+     * root hash of all results from the txs from the previous block
+     * 
+ * + * bytes last_results_hash = 12; + * @return The lastResultsHash. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLastResultsHash() { + return lastResultsHash_; + } + /** + *
+     * root hash of all results from the txs from the previous block
+     * 
+ * + * bytes last_results_hash = 12; + * @param value The lastResultsHash to set. + */ + private void setLastResultsHash(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + lastResultsHash_ = value; + } + /** + *
+     * root hash of all results from the txs from the previous block
+     * 
+ * + * bytes last_results_hash = 12; + */ + private void clearLastResultsHash() { + + lastResultsHash_ = getDefaultInstance().getLastResultsHash(); + } + + public static final int EVIDENCE_HASH_FIELD_NUMBER = 13; + private com.google.protobuf.ByteString evidenceHash_; + /** + *
+     * evidence included in the block
+     * 
+ * + * bytes evidence_hash = 13; + * @return The evidenceHash. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEvidenceHash() { + return evidenceHash_; + } + /** + *
+     * evidence included in the block
+     * 
+ * + * bytes evidence_hash = 13; + * @param value The evidenceHash to set. + */ + private void setEvidenceHash(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + evidenceHash_ = value; + } + /** + *
+     * evidence included in the block
+     * 
+ * + * bytes evidence_hash = 13; + */ + private void clearEvidenceHash() { + + evidenceHash_ = getDefaultInstance().getEvidenceHash(); + } + + public static final int PROPOSER_ADDRESS_FIELD_NUMBER = 14; + private com.google.protobuf.ByteString proposerAddress_; + /** + *
+     * original proposer of the block
+     * 
+ * + * bytes proposer_address = 14; + * @return The proposerAddress. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProposerAddress() { + return proposerAddress_; + } + /** + *
+     * original proposer of the block
+     * 
+ * + * bytes proposer_address = 14; + * @param value The proposerAddress to set. + */ + private void setProposerAddress(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + proposerAddress_ = value; + } + /** + *
+     * original proposer of the block
+     * 
+ * + * bytes proposer_address = 14; + */ + private void clearProposerAddress() { + + proposerAddress_ = getDefaultInstance().getProposerAddress(); + } + + public static ibc.tendermint.light.TendermintLight.LightHeader parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static ibc.tendermint.light.TendermintLight.LightHeader parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.LightHeader parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static ibc.tendermint.light.TendermintLight.LightHeader parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.LightHeader parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static ibc.tendermint.light.TendermintLight.LightHeader parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.LightHeader parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static ibc.tendermint.light.TendermintLight.LightHeader parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.LightHeader parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static ibc.tendermint.light.TendermintLight.LightHeader parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.LightHeader parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static ibc.tendermint.light.TendermintLight.LightHeader parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(ibc.tendermint.light.TendermintLight.LightHeader prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + * Protobuf type {@code ibc.tendermint.light.LightHeader} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + ibc.tendermint.light.TendermintLight.LightHeader, Builder> implements + // @@protoc_insertion_point(builder_implements:ibc.tendermint.light.LightHeader) + ibc.tendermint.light.TendermintLight.LightHeaderOrBuilder { + // Construct using ibc.tendermint.light.TendermintLight.LightHeader.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * .ibc.tendermint.light.Consensus version = 1; + */ + @java.lang.Override + public boolean hasVersion() { + return instance.hasVersion(); + } + /** + * .ibc.tendermint.light.Consensus version = 1; + */ + @java.lang.Override + public ibc.tendermint.light.TendermintLight.Consensus getVersion() { + return instance.getVersion(); + } + /** + * .ibc.tendermint.light.Consensus version = 1; + */ + public Builder setVersion(ibc.tendermint.light.TendermintLight.Consensus value) { + copyOnWrite(); + instance.setVersion(value); + return this; + } + /** + * .ibc.tendermint.light.Consensus version = 1; + */ + public Builder setVersion( + ibc.tendermint.light.TendermintLight.Consensus.Builder builderForValue) { + copyOnWrite(); + instance.setVersion(builderForValue.build()); + return this; + } + /** + * .ibc.tendermint.light.Consensus version = 1; + */ + public Builder mergeVersion(ibc.tendermint.light.TendermintLight.Consensus value) { + copyOnWrite(); + instance.mergeVersion(value); + return this; + } + /** + * .ibc.tendermint.light.Consensus version = 1; + */ + public Builder clearVersion() { copyOnWrite(); + instance.clearVersion(); + return this; + } + + /** + * string chain_id = 2; + * @return The chainId. + */ + @java.lang.Override + public java.lang.String getChainId() { + return instance.getChainId(); + } + /** + * string chain_id = 2; + * @return The bytes for chainId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getChainIdBytes() { + return instance.getChainIdBytes(); + } + /** + * string chain_id = 2; + * @param value The chainId to set. + * @return This builder for chaining. + */ + public Builder setChainId( + java.lang.String value) { + copyOnWrite(); + instance.setChainId(value); + return this; + } + /** + * string chain_id = 2; + * @return This builder for chaining. + */ + public Builder clearChainId() { + copyOnWrite(); + instance.clearChainId(); + return this; + } + /** + * string chain_id = 2; + * @param value The bytes for chainId to set. + * @return This builder for chaining. + */ + public Builder setChainIdBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setChainIdBytes(value); + return this; + } + + /** + * int64 height = 3; + * @return The height. + */ + @java.lang.Override + public long getHeight() { + return instance.getHeight(); + } + /** + * int64 height = 3; + * @param value The height to set. + * @return This builder for chaining. + */ + public Builder setHeight(long value) { + copyOnWrite(); + instance.setHeight(value); + return this; + } + /** + * int64 height = 3; + * @return This builder for chaining. + */ + public Builder clearHeight() { + copyOnWrite(); + instance.clearHeight(); + return this; + } + + /** + * .ibc.tendermint.light.Timestamp time = 4; + */ + @java.lang.Override + public boolean hasTime() { + return instance.hasTime(); + } + /** + * .ibc.tendermint.light.Timestamp time = 4; + */ + @java.lang.Override + public ibc.tendermint.light.TendermintLight.Timestamp getTime() { + return instance.getTime(); + } + /** + * .ibc.tendermint.light.Timestamp time = 4; + */ + public Builder setTime(ibc.tendermint.light.TendermintLight.Timestamp value) { + copyOnWrite(); + instance.setTime(value); + return this; + } + /** + * .ibc.tendermint.light.Timestamp time = 4; + */ + public Builder setTime( + ibc.tendermint.light.TendermintLight.Timestamp.Builder builderForValue) { + copyOnWrite(); + instance.setTime(builderForValue.build()); + return this; + } + /** + * .ibc.tendermint.light.Timestamp time = 4; + */ + public Builder mergeTime(ibc.tendermint.light.TendermintLight.Timestamp value) { + copyOnWrite(); + instance.mergeTime(value); + return this; + } + /** + * .ibc.tendermint.light.Timestamp time = 4; + */ + public Builder clearTime() { copyOnWrite(); + instance.clearTime(); + return this; + } + + /** + * .ibc.tendermint.light.BlockID last_block_id = 5; + */ + @java.lang.Override + public boolean hasLastBlockId() { + return instance.hasLastBlockId(); + } + /** + * .ibc.tendermint.light.BlockID last_block_id = 5; + */ + @java.lang.Override + public ibc.tendermint.light.TendermintLight.BlockID getLastBlockId() { + return instance.getLastBlockId(); + } + /** + * .ibc.tendermint.light.BlockID last_block_id = 5; + */ + public Builder setLastBlockId(ibc.tendermint.light.TendermintLight.BlockID value) { + copyOnWrite(); + instance.setLastBlockId(value); + return this; + } + /** + * .ibc.tendermint.light.BlockID last_block_id = 5; + */ + public Builder setLastBlockId( + ibc.tendermint.light.TendermintLight.BlockID.Builder builderForValue) { + copyOnWrite(); + instance.setLastBlockId(builderForValue.build()); + return this; + } + /** + * .ibc.tendermint.light.BlockID last_block_id = 5; + */ + public Builder mergeLastBlockId(ibc.tendermint.light.TendermintLight.BlockID value) { + copyOnWrite(); + instance.mergeLastBlockId(value); + return this; + } + /** + * .ibc.tendermint.light.BlockID last_block_id = 5; + */ + public Builder clearLastBlockId() { copyOnWrite(); + instance.clearLastBlockId(); + return this; + } + + /** + *
+       * commit from validators from the last block
+       * 
+ * + * bytes last_commit_hash = 6; + * @return The lastCommitHash. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLastCommitHash() { + return instance.getLastCommitHash(); + } + /** + *
+       * commit from validators from the last block
+       * 
+ * + * bytes last_commit_hash = 6; + * @param value The lastCommitHash to set. + * @return This builder for chaining. + */ + public Builder setLastCommitHash(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setLastCommitHash(value); + return this; + } + /** + *
+       * commit from validators from the last block
+       * 
+ * + * bytes last_commit_hash = 6; + * @return This builder for chaining. + */ + public Builder clearLastCommitHash() { + copyOnWrite(); + instance.clearLastCommitHash(); + return this; + } + + /** + *
+       * transactions
+       * 
+ * + * bytes data_hash = 7; + * @return The dataHash. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDataHash() { + return instance.getDataHash(); + } + /** + *
+       * transactions
+       * 
+ * + * bytes data_hash = 7; + * @param value The dataHash to set. + * @return This builder for chaining. + */ + public Builder setDataHash(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setDataHash(value); + return this; + } + /** + *
+       * transactions
+       * 
+ * + * bytes data_hash = 7; + * @return This builder for chaining. + */ + public Builder clearDataHash() { + copyOnWrite(); + instance.clearDataHash(); + return this; + } + + /** + *
+       * validators for the current block
+       * 
+ * + * bytes validators_hash = 8; + * @return The validatorsHash. + */ + @java.lang.Override + public com.google.protobuf.ByteString getValidatorsHash() { + return instance.getValidatorsHash(); + } + /** + *
+       * validators for the current block
+       * 
+ * + * bytes validators_hash = 8; + * @param value The validatorsHash to set. + * @return This builder for chaining. + */ + public Builder setValidatorsHash(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setValidatorsHash(value); + return this; + } + /** + *
+       * validators for the current block
+       * 
+ * + * bytes validators_hash = 8; + * @return This builder for chaining. + */ + public Builder clearValidatorsHash() { + copyOnWrite(); + instance.clearValidatorsHash(); + return this; + } + + /** + *
+       * validators for the next block
+       * 
+ * + * bytes next_validators_hash = 9; + * @return The nextValidatorsHash. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextValidatorsHash() { + return instance.getNextValidatorsHash(); + } + /** + *
+       * validators for the next block
+       * 
+ * + * bytes next_validators_hash = 9; + * @param value The nextValidatorsHash to set. + * @return This builder for chaining. + */ + public Builder setNextValidatorsHash(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setNextValidatorsHash(value); + return this; + } + /** + *
+       * validators for the next block
+       * 
+ * + * bytes next_validators_hash = 9; + * @return This builder for chaining. + */ + public Builder clearNextValidatorsHash() { + copyOnWrite(); + instance.clearNextValidatorsHash(); + return this; + } + + /** + *
+       * consensus params for current block
+       * 
+ * + * bytes consensus_hash = 10; + * @return The consensusHash. + */ + @java.lang.Override + public com.google.protobuf.ByteString getConsensusHash() { + return instance.getConsensusHash(); + } + /** + *
+       * consensus params for current block
+       * 
+ * + * bytes consensus_hash = 10; + * @param value The consensusHash to set. + * @return This builder for chaining. + */ + public Builder setConsensusHash(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setConsensusHash(value); + return this; + } + /** + *
+       * consensus params for current block
+       * 
+ * + * bytes consensus_hash = 10; + * @return This builder for chaining. + */ + public Builder clearConsensusHash() { + copyOnWrite(); + instance.clearConsensusHash(); + return this; + } + + /** + *
+       * state after txs from the previous block
+       * 
+ * + * bytes app_hash = 11; + * @return The appHash. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAppHash() { + return instance.getAppHash(); + } + /** + *
+       * state after txs from the previous block
+       * 
+ * + * bytes app_hash = 11; + * @param value The appHash to set. + * @return This builder for chaining. + */ + public Builder setAppHash(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setAppHash(value); + return this; + } + /** + *
+       * state after txs from the previous block
+       * 
+ * + * bytes app_hash = 11; + * @return This builder for chaining. + */ + public Builder clearAppHash() { + copyOnWrite(); + instance.clearAppHash(); + return this; + } + + /** + *
+       * root hash of all results from the txs from the previous block
+       * 
+ * + * bytes last_results_hash = 12; + * @return The lastResultsHash. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLastResultsHash() { + return instance.getLastResultsHash(); + } + /** + *
+       * root hash of all results from the txs from the previous block
+       * 
+ * + * bytes last_results_hash = 12; + * @param value The lastResultsHash to set. + * @return This builder for chaining. + */ + public Builder setLastResultsHash(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setLastResultsHash(value); + return this; + } + /** + *
+       * root hash of all results from the txs from the previous block
+       * 
+ * + * bytes last_results_hash = 12; + * @return This builder for chaining. + */ + public Builder clearLastResultsHash() { + copyOnWrite(); + instance.clearLastResultsHash(); + return this; + } + + /** + *
+       * evidence included in the block
+       * 
+ * + * bytes evidence_hash = 13; + * @return The evidenceHash. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEvidenceHash() { + return instance.getEvidenceHash(); + } + /** + *
+       * evidence included in the block
+       * 
+ * + * bytes evidence_hash = 13; + * @param value The evidenceHash to set. + * @return This builder for chaining. + */ + public Builder setEvidenceHash(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setEvidenceHash(value); + return this; + } + /** + *
+       * evidence included in the block
+       * 
+ * + * bytes evidence_hash = 13; + * @return This builder for chaining. + */ + public Builder clearEvidenceHash() { + copyOnWrite(); + instance.clearEvidenceHash(); + return this; + } + + /** + *
+       * original proposer of the block
+       * 
+ * + * bytes proposer_address = 14; + * @return The proposerAddress. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProposerAddress() { + return instance.getProposerAddress(); + } + /** + *
+       * original proposer of the block
+       * 
+ * + * bytes proposer_address = 14; + * @param value The proposerAddress to set. + * @return This builder for chaining. + */ + public Builder setProposerAddress(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setProposerAddress(value); + return this; + } + /** + *
+       * original proposer of the block
+       * 
+ * + * bytes proposer_address = 14; + * @return This builder for chaining. + */ + public Builder clearProposerAddress() { + copyOnWrite(); + instance.clearProposerAddress(); + return this; + } + + // @@protoc_insertion_point(builder_scope:ibc.tendermint.light.LightHeader) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new ibc.tendermint.light.TendermintLight.LightHeader(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "version_", + "chainId_", + "height_", + "time_", + "lastBlockId_", + "lastCommitHash_", + "dataHash_", + "validatorsHash_", + "nextValidatorsHash_", + "consensusHash_", + "appHash_", + "lastResultsHash_", + "evidenceHash_", + "proposerAddress_", + }; + java.lang.String info = + "\u0000\u000e\u0000\u0000\u0001\u000e\u000e\u0000\u0000\u0000\u0001\t\u0002\u0208" + + "\u0003\u0002\u0004\t\u0005\t\u0006\n\u0007\n\b\n\t\n\n\n\u000b\n\f\n\r\n\u000e\n" + + ""; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (ibc.tendermint.light.TendermintLight.LightHeader.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:ibc.tendermint.light.LightHeader) + private static final ibc.tendermint.light.TendermintLight.LightHeader DEFAULT_INSTANCE; + static { + LightHeader defaultInstance = new LightHeader(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + LightHeader.class, defaultInstance); + } + + public static ibc.tendermint.light.TendermintLight.LightHeader getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } + } + + public interface SignedHeaderOrBuilder extends + // @@protoc_insertion_point(interface_extends:ibc.tendermint.light.SignedHeader) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * .ibc.tendermint.light.LightHeader header = 1; + * @return Whether the header field is set. + */ + boolean hasHeader(); + /** + * .ibc.tendermint.light.LightHeader header = 1; + * @return The header. + */ + ibc.tendermint.light.TendermintLight.LightHeader getHeader(); + + /** + * .ibc.tendermint.light.Commit commit = 2; + * @return Whether the commit field is set. + */ + boolean hasCommit(); + /** + * .ibc.tendermint.light.Commit commit = 2; + * @return The commit. + */ + ibc.tendermint.light.TendermintLight.Commit getCommit(); + } + /** + * Protobuf type {@code ibc.tendermint.light.SignedHeader} + */ + public static final class SignedHeader extends + com.google.protobuf.GeneratedMessageLite< + SignedHeader, SignedHeader.Builder> implements + // @@protoc_insertion_point(message_implements:ibc.tendermint.light.SignedHeader) + SignedHeaderOrBuilder { + private SignedHeader() { + } + public static final int HEADER_FIELD_NUMBER = 1; + private ibc.tendermint.light.TendermintLight.LightHeader header_; + /** + * .ibc.tendermint.light.LightHeader header = 1; + */ + @java.lang.Override + public boolean hasHeader() { + return header_ != null; + } + /** + * .ibc.tendermint.light.LightHeader header = 1; + */ + @java.lang.Override + public ibc.tendermint.light.TendermintLight.LightHeader getHeader() { + return header_ == null ? ibc.tendermint.light.TendermintLight.LightHeader.getDefaultInstance() : header_; + } + /** + * .ibc.tendermint.light.LightHeader header = 1; + */ + private void setHeader(ibc.tendermint.light.TendermintLight.LightHeader value) { + value.getClass(); + header_ = value; + + } + /** + * .ibc.tendermint.light.LightHeader header = 1; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeHeader(ibc.tendermint.light.TendermintLight.LightHeader value) { + value.getClass(); + if (header_ != null && + header_ != ibc.tendermint.light.TendermintLight.LightHeader.getDefaultInstance()) { + header_ = + ibc.tendermint.light.TendermintLight.LightHeader.newBuilder(header_).mergeFrom(value).buildPartial(); + } else { + header_ = value; + } + + } + /** + * .ibc.tendermint.light.LightHeader header = 1; + */ + private void clearHeader() { header_ = null; + + } + + public static final int COMMIT_FIELD_NUMBER = 2; + private ibc.tendermint.light.TendermintLight.Commit commit_; + /** + * .ibc.tendermint.light.Commit commit = 2; + */ + @java.lang.Override + public boolean hasCommit() { + return commit_ != null; + } + /** + * .ibc.tendermint.light.Commit commit = 2; + */ + @java.lang.Override + public ibc.tendermint.light.TendermintLight.Commit getCommit() { + return commit_ == null ? ibc.tendermint.light.TendermintLight.Commit.getDefaultInstance() : commit_; + } + /** + * .ibc.tendermint.light.Commit commit = 2; + */ + private void setCommit(ibc.tendermint.light.TendermintLight.Commit value) { + value.getClass(); + commit_ = value; + + } + /** + * .ibc.tendermint.light.Commit commit = 2; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeCommit(ibc.tendermint.light.TendermintLight.Commit value) { + value.getClass(); + if (commit_ != null && + commit_ != ibc.tendermint.light.TendermintLight.Commit.getDefaultInstance()) { + commit_ = + ibc.tendermint.light.TendermintLight.Commit.newBuilder(commit_).mergeFrom(value).buildPartial(); + } else { + commit_ = value; + } + + } + /** + * .ibc.tendermint.light.Commit commit = 2; + */ + private void clearCommit() { commit_ = null; + + } + + public static ibc.tendermint.light.TendermintLight.SignedHeader parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static ibc.tendermint.light.TendermintLight.SignedHeader parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.SignedHeader parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static ibc.tendermint.light.TendermintLight.SignedHeader parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.SignedHeader parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static ibc.tendermint.light.TendermintLight.SignedHeader parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.SignedHeader parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static ibc.tendermint.light.TendermintLight.SignedHeader parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.SignedHeader parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static ibc.tendermint.light.TendermintLight.SignedHeader parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.SignedHeader parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static ibc.tendermint.light.TendermintLight.SignedHeader parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(ibc.tendermint.light.TendermintLight.SignedHeader prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + * Protobuf type {@code ibc.tendermint.light.SignedHeader} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + ibc.tendermint.light.TendermintLight.SignedHeader, Builder> implements + // @@protoc_insertion_point(builder_implements:ibc.tendermint.light.SignedHeader) + ibc.tendermint.light.TendermintLight.SignedHeaderOrBuilder { + // Construct using ibc.tendermint.light.TendermintLight.SignedHeader.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * .ibc.tendermint.light.LightHeader header = 1; + */ + @java.lang.Override + public boolean hasHeader() { + return instance.hasHeader(); + } + /** + * .ibc.tendermint.light.LightHeader header = 1; + */ + @java.lang.Override + public ibc.tendermint.light.TendermintLight.LightHeader getHeader() { + return instance.getHeader(); + } + /** + * .ibc.tendermint.light.LightHeader header = 1; + */ + public Builder setHeader(ibc.tendermint.light.TendermintLight.LightHeader value) { + copyOnWrite(); + instance.setHeader(value); + return this; + } + /** + * .ibc.tendermint.light.LightHeader header = 1; + */ + public Builder setHeader( + ibc.tendermint.light.TendermintLight.LightHeader.Builder builderForValue) { + copyOnWrite(); + instance.setHeader(builderForValue.build()); + return this; + } + /** + * .ibc.tendermint.light.LightHeader header = 1; + */ + public Builder mergeHeader(ibc.tendermint.light.TendermintLight.LightHeader value) { + copyOnWrite(); + instance.mergeHeader(value); + return this; + } + /** + * .ibc.tendermint.light.LightHeader header = 1; + */ + public Builder clearHeader() { copyOnWrite(); + instance.clearHeader(); + return this; + } + + /** + * .ibc.tendermint.light.Commit commit = 2; + */ + @java.lang.Override + public boolean hasCommit() { + return instance.hasCommit(); + } + /** + * .ibc.tendermint.light.Commit commit = 2; + */ + @java.lang.Override + public ibc.tendermint.light.TendermintLight.Commit getCommit() { + return instance.getCommit(); + } + /** + * .ibc.tendermint.light.Commit commit = 2; + */ + public Builder setCommit(ibc.tendermint.light.TendermintLight.Commit value) { + copyOnWrite(); + instance.setCommit(value); + return this; + } + /** + * .ibc.tendermint.light.Commit commit = 2; + */ + public Builder setCommit( + ibc.tendermint.light.TendermintLight.Commit.Builder builderForValue) { + copyOnWrite(); + instance.setCommit(builderForValue.build()); + return this; + } + /** + * .ibc.tendermint.light.Commit commit = 2; + */ + public Builder mergeCommit(ibc.tendermint.light.TendermintLight.Commit value) { + copyOnWrite(); + instance.mergeCommit(value); + return this; + } + /** + * .ibc.tendermint.light.Commit commit = 2; + */ + public Builder clearCommit() { copyOnWrite(); + instance.clearCommit(); + return this; + } + + // @@protoc_insertion_point(builder_scope:ibc.tendermint.light.SignedHeader) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new ibc.tendermint.light.TendermintLight.SignedHeader(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "header_", + "commit_", + }; + java.lang.String info = + "\u0000\u0002\u0000\u0000\u0001\u0002\u0002\u0000\u0000\u0000\u0001\t\u0002\t"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (ibc.tendermint.light.TendermintLight.SignedHeader.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:ibc.tendermint.light.SignedHeader) + private static final ibc.tendermint.light.TendermintLight.SignedHeader DEFAULT_INSTANCE; + static { + SignedHeader defaultInstance = new SignedHeader(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + SignedHeader.class, defaultInstance); + } + + public static ibc.tendermint.light.TendermintLight.SignedHeader getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } + } + + public interface TmHeaderOrBuilder extends + // @@protoc_insertion_point(interface_extends:ibc.tendermint.light.TmHeader) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * .ibc.tendermint.light.SignedHeader signed_header = 1; + * @return Whether the signedHeader field is set. + */ + boolean hasSignedHeader(); + /** + * .ibc.tendermint.light.SignedHeader signed_header = 1; + * @return The signedHeader. + */ + ibc.tendermint.light.TendermintLight.SignedHeader getSignedHeader(); + + /** + * .ibc.tendermint.light.ValidatorSet validator_set = 2; + * @return Whether the validatorSet field is set. + */ + boolean hasValidatorSet(); + /** + * .ibc.tendermint.light.ValidatorSet validator_set = 2; + * @return The validatorSet. + */ + ibc.tendermint.light.TendermintLight.ValidatorSet getValidatorSet(); + + /** + * int64 trusted_height = 3; + * @return The trustedHeight. + */ + long getTrustedHeight(); + + /** + * .ibc.tendermint.light.ValidatorSet trusted_validators = 4; + * @return Whether the trustedValidators field is set. + */ + boolean hasTrustedValidators(); + /** + * .ibc.tendermint.light.ValidatorSet trusted_validators = 4; + * @return The trustedValidators. + */ + ibc.tendermint.light.TendermintLight.ValidatorSet getTrustedValidators(); + } + /** + * Protobuf type {@code ibc.tendermint.light.TmHeader} + */ + public static final class TmHeader extends + com.google.protobuf.GeneratedMessageLite< + TmHeader, TmHeader.Builder> implements + // @@protoc_insertion_point(message_implements:ibc.tendermint.light.TmHeader) + TmHeaderOrBuilder { + private TmHeader() { + } + public static final int SIGNED_HEADER_FIELD_NUMBER = 1; + private ibc.tendermint.light.TendermintLight.SignedHeader signedHeader_; + /** + * .ibc.tendermint.light.SignedHeader signed_header = 1; + */ + @java.lang.Override + public boolean hasSignedHeader() { + return signedHeader_ != null; + } + /** + * .ibc.tendermint.light.SignedHeader signed_header = 1; + */ + @java.lang.Override + public ibc.tendermint.light.TendermintLight.SignedHeader getSignedHeader() { + return signedHeader_ == null ? ibc.tendermint.light.TendermintLight.SignedHeader.getDefaultInstance() : signedHeader_; + } + /** + * .ibc.tendermint.light.SignedHeader signed_header = 1; + */ + private void setSignedHeader(ibc.tendermint.light.TendermintLight.SignedHeader value) { + value.getClass(); + signedHeader_ = value; + + } + /** + * .ibc.tendermint.light.SignedHeader signed_header = 1; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeSignedHeader(ibc.tendermint.light.TendermintLight.SignedHeader value) { + value.getClass(); + if (signedHeader_ != null && + signedHeader_ != ibc.tendermint.light.TendermintLight.SignedHeader.getDefaultInstance()) { + signedHeader_ = + ibc.tendermint.light.TendermintLight.SignedHeader.newBuilder(signedHeader_).mergeFrom(value).buildPartial(); + } else { + signedHeader_ = value; + } + + } + /** + * .ibc.tendermint.light.SignedHeader signed_header = 1; + */ + private void clearSignedHeader() { signedHeader_ = null; + + } + + public static final int VALIDATOR_SET_FIELD_NUMBER = 2; + private ibc.tendermint.light.TendermintLight.ValidatorSet validatorSet_; + /** + * .ibc.tendermint.light.ValidatorSet validator_set = 2; + */ + @java.lang.Override + public boolean hasValidatorSet() { + return validatorSet_ != null; + } + /** + * .ibc.tendermint.light.ValidatorSet validator_set = 2; + */ + @java.lang.Override + public ibc.tendermint.light.TendermintLight.ValidatorSet getValidatorSet() { + return validatorSet_ == null ? ibc.tendermint.light.TendermintLight.ValidatorSet.getDefaultInstance() : validatorSet_; + } + /** + * .ibc.tendermint.light.ValidatorSet validator_set = 2; + */ + private void setValidatorSet(ibc.tendermint.light.TendermintLight.ValidatorSet value) { + value.getClass(); + validatorSet_ = value; + + } + /** + * .ibc.tendermint.light.ValidatorSet validator_set = 2; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeValidatorSet(ibc.tendermint.light.TendermintLight.ValidatorSet value) { + value.getClass(); + if (validatorSet_ != null && + validatorSet_ != ibc.tendermint.light.TendermintLight.ValidatorSet.getDefaultInstance()) { + validatorSet_ = + ibc.tendermint.light.TendermintLight.ValidatorSet.newBuilder(validatorSet_).mergeFrom(value).buildPartial(); + } else { + validatorSet_ = value; + } + + } + /** + * .ibc.tendermint.light.ValidatorSet validator_set = 2; + */ + private void clearValidatorSet() { validatorSet_ = null; + + } + + public static final int TRUSTED_HEIGHT_FIELD_NUMBER = 3; + private long trustedHeight_; + /** + * int64 trusted_height = 3; + * @return The trustedHeight. + */ + @java.lang.Override + public long getTrustedHeight() { + return trustedHeight_; + } + /** + * int64 trusted_height = 3; + * @param value The trustedHeight to set. + */ + private void setTrustedHeight(long value) { + + trustedHeight_ = value; + } + /** + * int64 trusted_height = 3; + */ + private void clearTrustedHeight() { + + trustedHeight_ = 0L; + } + + public static final int TRUSTED_VALIDATORS_FIELD_NUMBER = 4; + private ibc.tendermint.light.TendermintLight.ValidatorSet trustedValidators_; + /** + * .ibc.tendermint.light.ValidatorSet trusted_validators = 4; + */ + @java.lang.Override + public boolean hasTrustedValidators() { + return trustedValidators_ != null; + } + /** + * .ibc.tendermint.light.ValidatorSet trusted_validators = 4; + */ + @java.lang.Override + public ibc.tendermint.light.TendermintLight.ValidatorSet getTrustedValidators() { + return trustedValidators_ == null ? ibc.tendermint.light.TendermintLight.ValidatorSet.getDefaultInstance() : trustedValidators_; + } + /** + * .ibc.tendermint.light.ValidatorSet trusted_validators = 4; + */ + private void setTrustedValidators(ibc.tendermint.light.TendermintLight.ValidatorSet value) { + value.getClass(); + trustedValidators_ = value; + + } + /** + * .ibc.tendermint.light.ValidatorSet trusted_validators = 4; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeTrustedValidators(ibc.tendermint.light.TendermintLight.ValidatorSet value) { + value.getClass(); + if (trustedValidators_ != null && + trustedValidators_ != ibc.tendermint.light.TendermintLight.ValidatorSet.getDefaultInstance()) { + trustedValidators_ = + ibc.tendermint.light.TendermintLight.ValidatorSet.newBuilder(trustedValidators_).mergeFrom(value).buildPartial(); + } else { + trustedValidators_ = value; + } + + } + /** + * .ibc.tendermint.light.ValidatorSet trusted_validators = 4; + */ + private void clearTrustedValidators() { trustedValidators_ = null; + + } + + public static ibc.tendermint.light.TendermintLight.TmHeader parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static ibc.tendermint.light.TendermintLight.TmHeader parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.TmHeader parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static ibc.tendermint.light.TendermintLight.TmHeader parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.TmHeader parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static ibc.tendermint.light.TendermintLight.TmHeader parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.TmHeader parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static ibc.tendermint.light.TendermintLight.TmHeader parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.TmHeader parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static ibc.tendermint.light.TendermintLight.TmHeader parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static ibc.tendermint.light.TendermintLight.TmHeader parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static ibc.tendermint.light.TendermintLight.TmHeader parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(ibc.tendermint.light.TendermintLight.TmHeader prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + * Protobuf type {@code ibc.tendermint.light.TmHeader} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + ibc.tendermint.light.TendermintLight.TmHeader, Builder> implements + // @@protoc_insertion_point(builder_implements:ibc.tendermint.light.TmHeader) + ibc.tendermint.light.TendermintLight.TmHeaderOrBuilder { + // Construct using ibc.tendermint.light.TendermintLight.TmHeader.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * .ibc.tendermint.light.SignedHeader signed_header = 1; + */ + @java.lang.Override + public boolean hasSignedHeader() { + return instance.hasSignedHeader(); + } + /** + * .ibc.tendermint.light.SignedHeader signed_header = 1; + */ + @java.lang.Override + public ibc.tendermint.light.TendermintLight.SignedHeader getSignedHeader() { + return instance.getSignedHeader(); + } + /** + * .ibc.tendermint.light.SignedHeader signed_header = 1; + */ + public Builder setSignedHeader(ibc.tendermint.light.TendermintLight.SignedHeader value) { + copyOnWrite(); + instance.setSignedHeader(value); + return this; + } + /** + * .ibc.tendermint.light.SignedHeader signed_header = 1; + */ + public Builder setSignedHeader( + ibc.tendermint.light.TendermintLight.SignedHeader.Builder builderForValue) { + copyOnWrite(); + instance.setSignedHeader(builderForValue.build()); + return this; + } + /** + * .ibc.tendermint.light.SignedHeader signed_header = 1; + */ + public Builder mergeSignedHeader(ibc.tendermint.light.TendermintLight.SignedHeader value) { + copyOnWrite(); + instance.mergeSignedHeader(value); + return this; + } + /** + * .ibc.tendermint.light.SignedHeader signed_header = 1; + */ + public Builder clearSignedHeader() { copyOnWrite(); + instance.clearSignedHeader(); + return this; + } + + /** + * .ibc.tendermint.light.ValidatorSet validator_set = 2; + */ + @java.lang.Override + public boolean hasValidatorSet() { + return instance.hasValidatorSet(); + } + /** + * .ibc.tendermint.light.ValidatorSet validator_set = 2; + */ + @java.lang.Override + public ibc.tendermint.light.TendermintLight.ValidatorSet getValidatorSet() { + return instance.getValidatorSet(); + } + /** + * .ibc.tendermint.light.ValidatorSet validator_set = 2; + */ + public Builder setValidatorSet(ibc.tendermint.light.TendermintLight.ValidatorSet value) { + copyOnWrite(); + instance.setValidatorSet(value); + return this; + } + /** + * .ibc.tendermint.light.ValidatorSet validator_set = 2; + */ + public Builder setValidatorSet( + ibc.tendermint.light.TendermintLight.ValidatorSet.Builder builderForValue) { + copyOnWrite(); + instance.setValidatorSet(builderForValue.build()); + return this; + } + /** + * .ibc.tendermint.light.ValidatorSet validator_set = 2; + */ + public Builder mergeValidatorSet(ibc.tendermint.light.TendermintLight.ValidatorSet value) { + copyOnWrite(); + instance.mergeValidatorSet(value); + return this; + } + /** + * .ibc.tendermint.light.ValidatorSet validator_set = 2; + */ + public Builder clearValidatorSet() { copyOnWrite(); + instance.clearValidatorSet(); + return this; + } + + /** + * int64 trusted_height = 3; + * @return The trustedHeight. + */ + @java.lang.Override + public long getTrustedHeight() { + return instance.getTrustedHeight(); + } + /** + * int64 trusted_height = 3; + * @param value The trustedHeight to set. + * @return This builder for chaining. + */ + public Builder setTrustedHeight(long value) { + copyOnWrite(); + instance.setTrustedHeight(value); + return this; + } + /** + * int64 trusted_height = 3; + * @return This builder for chaining. + */ + public Builder clearTrustedHeight() { + copyOnWrite(); + instance.clearTrustedHeight(); + return this; + } + + /** + * .ibc.tendermint.light.ValidatorSet trusted_validators = 4; + */ + @java.lang.Override + public boolean hasTrustedValidators() { + return instance.hasTrustedValidators(); + } + /** + * .ibc.tendermint.light.ValidatorSet trusted_validators = 4; + */ + @java.lang.Override + public ibc.tendermint.light.TendermintLight.ValidatorSet getTrustedValidators() { + return instance.getTrustedValidators(); + } + /** + * .ibc.tendermint.light.ValidatorSet trusted_validators = 4; + */ + public Builder setTrustedValidators(ibc.tendermint.light.TendermintLight.ValidatorSet value) { + copyOnWrite(); + instance.setTrustedValidators(value); + return this; + } + /** + * .ibc.tendermint.light.ValidatorSet trusted_validators = 4; + */ + public Builder setTrustedValidators( + ibc.tendermint.light.TendermintLight.ValidatorSet.Builder builderForValue) { + copyOnWrite(); + instance.setTrustedValidators(builderForValue.build()); + return this; + } + /** + * .ibc.tendermint.light.ValidatorSet trusted_validators = 4; + */ + public Builder mergeTrustedValidators(ibc.tendermint.light.TendermintLight.ValidatorSet value) { + copyOnWrite(); + instance.mergeTrustedValidators(value); + return this; + } + /** + * .ibc.tendermint.light.ValidatorSet trusted_validators = 4; + */ + public Builder clearTrustedValidators() { copyOnWrite(); + instance.clearTrustedValidators(); + return this; + } + + // @@protoc_insertion_point(builder_scope:ibc.tendermint.light.TmHeader) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new ibc.tendermint.light.TendermintLight.TmHeader(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "signedHeader_", + "validatorSet_", + "trustedHeight_", + "trustedValidators_", + }; + java.lang.String info = + "\u0000\u0004\u0000\u0000\u0001\u0004\u0004\u0000\u0000\u0000\u0001\t\u0002\t\u0003" + + "\u0002\u0004\t"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (ibc.tendermint.light.TendermintLight.TmHeader.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:ibc.tendermint.light.TmHeader) + private static final ibc.tendermint.light.TendermintLight.TmHeader DEFAULT_INSTANCE; + static { + TmHeader defaultInstance = new TmHeader(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + TmHeader.class, defaultInstance); + } + + public static ibc.tendermint.light.TendermintLight.TmHeader getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } + } + + + static { + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/BlockID.java b/contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/BlockID.java new file mode 100644 index 000000000..84116722c --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/BlockID.java @@ -0,0 +1,59 @@ +package icon.proto.clients.tendermint; + +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ProtoMessage; + +public class BlockID extends ProtoMessage { + private byte[] hash = new byte[0]; + + private PartSetHeader partSetHeader = new PartSetHeader(); + + public byte[] getHash() { + return this.hash; + } + + public void setHash(byte[] hash) { + this.hash = hash; + } + + public PartSetHeader getPartSetHeader() { + return this.partSetHeader; + } + + public void setPartSetHeader(PartSetHeader partSetHeader) { + this.partSetHeader = partSetHeader; + } + + public byte[] encode() { + return ByteUtil.join( + Proto.encode(1, this.hash), + Proto.encode(2, this.partSetHeader)); + } + + public static BlockID decode(byte[] data) { + BlockID obj = new BlockID(); + int index = 0; + int order; + int length = data.length; + while (index < length) { + order = data[index] >> 3; + index++; + switch(order) { + case 1: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.hash = resp.res; + break; + } + case 2: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.partSetHeader = PartSetHeader.decode(resp.res); + break; + } + } + } + return obj; + } +} diff --git a/contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/BlockIDFlag.java b/contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/BlockIDFlag.java new file mode 100644 index 000000000..bca418fb0 --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/BlockIDFlag.java @@ -0,0 +1,11 @@ +package icon.proto.clients.tendermint; + +public class BlockIDFlag { + public static final int BLOCK_ID_FLAG_UNKNOWN = 0; + + public static final int BLOCK_ID_FLAG_ABSENT = 1; + + public static final int BLOCK_ID_FLAG_COMMIT = 2; + + public static final int BLOCK_ID_FLAG_NIL = 3; +} diff --git a/contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/CanonicalBlockID.java b/contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/CanonicalBlockID.java new file mode 100644 index 000000000..9f639a47e --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/CanonicalBlockID.java @@ -0,0 +1,59 @@ +package icon.proto.clients.tendermint; + +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ProtoMessage; + +public class CanonicalBlockID extends ProtoMessage { + private byte[] hash = new byte[0]; + + private CanonicalPartSetHeader partSetHeader = new CanonicalPartSetHeader(); + + public byte[] getHash() { + return this.hash; + } + + public void setHash(byte[] hash) { + this.hash = hash; + } + + public CanonicalPartSetHeader getPartSetHeader() { + return this.partSetHeader; + } + + public void setPartSetHeader(CanonicalPartSetHeader partSetHeader) { + this.partSetHeader = partSetHeader; + } + + public byte[] encode() { + return ByteUtil.join( + Proto.encode(1, this.hash), + Proto.encode(2, this.partSetHeader)); + } + + public static CanonicalBlockID decode(byte[] data) { + CanonicalBlockID obj = new CanonicalBlockID(); + int index = 0; + int order; + int length = data.length; + while (index < length) { + order = data[index] >> 3; + index++; + switch(order) { + case 1: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.hash = resp.res; + break; + } + case 2: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.partSetHeader = CanonicalPartSetHeader.decode(resp.res); + break; + } + } + } + return obj; + } +} diff --git a/contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/CanonicalPartSetHeader.java b/contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/CanonicalPartSetHeader.java new file mode 100644 index 000000000..cc287703b --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/CanonicalPartSetHeader.java @@ -0,0 +1,60 @@ +package icon.proto.clients.tendermint; + +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ProtoMessage; +import java.math.BigInteger; + +public class CanonicalPartSetHeader extends ProtoMessage { + private BigInteger total = BigInteger.ZERO; + + private byte[] hash = new byte[0]; + + public BigInteger getTotal() { + return this.total; + } + + public void setTotal(BigInteger total) { + this.total = total; + } + + public byte[] getHash() { + return this.hash; + } + + public void setHash(byte[] hash) { + this.hash = hash; + } + + public byte[] encode() { + return ByteUtil.join( + Proto.encode(1, this.total), + Proto.encode(2, this.hash)); + } + + public static CanonicalPartSetHeader decode(byte[] data) { + CanonicalPartSetHeader obj = new CanonicalPartSetHeader(); + int index = 0; + int order; + int length = data.length; + while (index < length) { + order = data[index] >> 3; + index++; + switch(order) { + case 1: { + Proto.DecodeResponse resp = Proto.decodeVarInt(data, index); + index = resp.index; + obj.total = resp.res; + break; + } + case 2: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.hash = resp.res; + break; + } + } + } + return obj; + } +} diff --git a/contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/CanonicalVote.java b/contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/CanonicalVote.java new file mode 100644 index 000000000..559b28383 --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/CanonicalVote.java @@ -0,0 +1,130 @@ +package icon.proto.clients.tendermint; + +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ProtoMessage; +import java.lang.Integer; +import java.lang.String; +import java.math.BigInteger; + +public class CanonicalVote extends ProtoMessage { + private int type = 0; + + private BigInteger height = BigInteger.ZERO; + + private BigInteger round = BigInteger.ZERO; + + private BlockID blockId = new BlockID(); + + private Timestamp timestamp = new Timestamp(); + + private String chainId = ""; + + public int getType() { + return this.type; + } + + public void setType(int type) { + this.type = type; + } + + public BigInteger getHeight() { + return this.height; + } + + public void setHeight(BigInteger height) { + this.height = height; + } + + public BigInteger getRound() { + return this.round; + } + + public void setRound(BigInteger round) { + this.round = round; + } + + public BlockID getBlockId() { + return this.blockId; + } + + public void setBlockId(BlockID blockId) { + this.blockId = blockId; + } + + public Timestamp getTimestamp() { + return this.timestamp; + } + + public void setTimestamp(Timestamp timestamp) { + this.timestamp = timestamp; + } + + public String getChainId() { + return this.chainId; + } + + public void setChainId(String chainId) { + this.chainId = chainId; + } + + public byte[] encode() { + return ByteUtil.join( + Proto.encode(1, this.type), + Proto.encodeFixed64(2, this.height), + Proto.encodeFixed64(3, this.round), + Proto.encode(4, this.blockId), + Proto.encode(5, this.timestamp), + Proto.encode(6, this.chainId)); + } + + public static CanonicalVote decode(byte[] data) { + CanonicalVote obj = new CanonicalVote(); + int index = 0; + int order; + int length = data.length; + while (index < length) { + order = data[index] >> 3; + index++; + switch(order) { + case 1: { + Proto.DecodeResponse resp = Proto.decodeEnum(data, index); + index = resp.index; + obj.type = resp.res; + break; + } + case 2: { + Proto.DecodeResponse resp = Proto.decodeFixed64(data, index); + index = resp.index; + obj.height = resp.res; + break; + } + case 3: { + Proto.DecodeResponse resp = Proto.decodeFixed64(data, index); + index = resp.index; + obj.round = resp.res; + break; + } + case 4: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.blockId = BlockID.decode(resp.res); + break; + } + case 5: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.timestamp = Timestamp.decode(resp.res); + break; + } + case 6: { + Proto.DecodeResponse resp = Proto.decodeString(data, index); + index = resp.index; + obj.chainId = resp.res; + break; + } + } + } + return obj; + } +} diff --git a/contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/ClientState.java b/contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/ClientState.java new file mode 100644 index 000000000..b40a46148 --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/ClientState.java @@ -0,0 +1,181 @@ +package icon.proto.clients.tendermint; + +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ProtoMessage; +import java.lang.Boolean; +import java.lang.String; +import java.math.BigInteger; + +public class ClientState extends ProtoMessage { + private String chainId = ""; + + private Fraction trustLevel = new Fraction(); + + private Duration trustingPeriod = new Duration(); + + private Duration unbondingPeriod = new Duration(); + + private Duration maxClockDrift = new Duration(); + + private BigInteger frozenHeight = BigInteger.ZERO; + + private BigInteger latestHeight = BigInteger.ZERO; + + private boolean allowUpdateAfterExpiry = false; + + private boolean allowUpdateAfterMisbehaviour = false; + + public String getChainId() { + return this.chainId; + } + + public void setChainId(String chainId) { + this.chainId = chainId; + } + + public Fraction getTrustLevel() { + return this.trustLevel; + } + + public void setTrustLevel(Fraction trustLevel) { + this.trustLevel = trustLevel; + } + + public Duration getTrustingPeriod() { + return this.trustingPeriod; + } + + public void setTrustingPeriod(Duration trustingPeriod) { + this.trustingPeriod = trustingPeriod; + } + + public Duration getUnbondingPeriod() { + return this.unbondingPeriod; + } + + public void setUnbondingPeriod(Duration unbondingPeriod) { + this.unbondingPeriod = unbondingPeriod; + } + + public Duration getMaxClockDrift() { + return this.maxClockDrift; + } + + public void setMaxClockDrift(Duration maxClockDrift) { + this.maxClockDrift = maxClockDrift; + } + + public BigInteger getFrozenHeight() { + return this.frozenHeight; + } + + public void setFrozenHeight(BigInteger frozenHeight) { + this.frozenHeight = frozenHeight; + } + + public BigInteger getLatestHeight() { + return this.latestHeight; + } + + public void setLatestHeight(BigInteger latestHeight) { + this.latestHeight = latestHeight; + } + + public boolean getAllowUpdateAfterExpiry() { + return this.allowUpdateAfterExpiry; + } + + public void setAllowUpdateAfterExpiry(boolean allowUpdateAfterExpiry) { + this.allowUpdateAfterExpiry = allowUpdateAfterExpiry; + } + + public boolean getAllowUpdateAfterMisbehaviour() { + return this.allowUpdateAfterMisbehaviour; + } + + public void setAllowUpdateAfterMisbehaviour(boolean allowUpdateAfterMisbehaviour) { + this.allowUpdateAfterMisbehaviour = allowUpdateAfterMisbehaviour; + } + + public byte[] encode() { + return ByteUtil.join( + Proto.encode(1, this.chainId), + Proto.encode(2, this.trustLevel), + Proto.encode(3, this.trustingPeriod), + Proto.encode(4, this.unbondingPeriod), + Proto.encode(5, this.maxClockDrift), + Proto.encode(6, this.frozenHeight), + Proto.encode(7, this.latestHeight), + Proto.encode(8, this.allowUpdateAfterExpiry), + Proto.encode(9, this.allowUpdateAfterMisbehaviour)); + } + + public static ClientState decode(byte[] data) { + ClientState obj = new ClientState(); + int index = 0; + int order; + int length = data.length; + while (index < length) { + order = data[index] >> 3; + index++; + switch(order) { + case 1: { + Proto.DecodeResponse resp = Proto.decodeString(data, index); + index = resp.index; + obj.chainId = resp.res; + break; + } + case 2: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.trustLevel = Fraction.decode(resp.res); + break; + } + case 3: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.trustingPeriod = Duration.decode(resp.res); + break; + } + case 4: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.unbondingPeriod = Duration.decode(resp.res); + break; + } + case 5: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.maxClockDrift = Duration.decode(resp.res); + break; + } + case 6: { + Proto.DecodeResponse resp = Proto.decodeVarInt(data, index); + index = resp.index; + obj.frozenHeight = resp.res; + break; + } + case 7: { + Proto.DecodeResponse resp = Proto.decodeVarInt(data, index); + index = resp.index; + obj.latestHeight = resp.res; + break; + } + case 8: { + Proto.DecodeResponse resp = Proto.decodeBoolean(data, index); + index = resp.index; + obj.allowUpdateAfterExpiry = resp.res; + break; + } + case 9: { + Proto.DecodeResponse resp = Proto.decodeBoolean(data, index); + index = resp.index; + obj.allowUpdateAfterMisbehaviour = resp.res; + break; + } + } + } + return obj; + } +} diff --git a/contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/Commit.java b/contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/Commit.java new file mode 100644 index 000000000..0a52c1d58 --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/Commit.java @@ -0,0 +1,96 @@ +package icon.proto.clients.tendermint; + +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ProtoMessage; +import java.math.BigInteger; +import java.util.List; +import scorex.util.ArrayList; + +public class Commit extends ProtoMessage { + private BigInteger height = BigInteger.ZERO; + + private BigInteger round = BigInteger.ZERO; + + private BlockID blockId = new BlockID(); + + private List signatures = new ArrayList<>(); + + public BigInteger getHeight() { + return this.height; + } + + public void setHeight(BigInteger height) { + this.height = height; + } + + public BigInteger getRound() { + return this.round; + } + + public void setRound(BigInteger round) { + this.round = round; + } + + public BlockID getBlockId() { + return this.blockId; + } + + public void setBlockId(BlockID blockId) { + this.blockId = blockId; + } + + public List getSignatures() { + return this.signatures; + } + + public void setSignatures(List signatures) { + this.signatures = signatures; + } + + public byte[] encode() { + return ByteUtil.join( + Proto.encode(1, this.height), + Proto.encode(2, this.round), + Proto.encode(3, this.blockId), + Proto.encodeMessageArray(4, this.signatures)); + } + + public static Commit decode(byte[] data) { + Commit obj = new Commit(); + int index = 0; + int order; + int length = data.length; + while (index < length) { + order = data[index] >> 3; + index++; + switch(order) { + case 1: { + Proto.DecodeResponse resp = Proto.decodeVarInt(data, index); + index = resp.index; + obj.height = resp.res; + break; + } + case 2: { + Proto.DecodeResponse resp = Proto.decodeVarInt(data, index); + index = resp.index; + obj.round = resp.res; + break; + } + case 3: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.blockId = BlockID.decode(resp.res); + break; + } + case 4: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.signatures.add(CommitSig.decode(resp.res)); + break; + } + } + } + return obj; + } +} diff --git a/contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/CommitSig.java b/contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/CommitSig.java new file mode 100644 index 000000000..b55756288 --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/CommitSig.java @@ -0,0 +1,94 @@ +package icon.proto.clients.tendermint; + +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ProtoMessage; +import java.lang.Integer; + +public class CommitSig extends ProtoMessage { + private int blockIdFlag = 0; + + private byte[] validatorAddress = new byte[0]; + + private Timestamp timestamp = new Timestamp(); + + private byte[] signature = new byte[0]; + + public int getBlockIdFlag() { + return this.blockIdFlag; + } + + public void setBlockIdFlag(int blockIdFlag) { + this.blockIdFlag = blockIdFlag; + } + + public byte[] getValidatorAddress() { + return this.validatorAddress; + } + + public void setValidatorAddress(byte[] validatorAddress) { + this.validatorAddress = validatorAddress; + } + + public Timestamp getTimestamp() { + return this.timestamp; + } + + public void setTimestamp(Timestamp timestamp) { + this.timestamp = timestamp; + } + + public byte[] getSignature() { + return this.signature; + } + + public void setSignature(byte[] signature) { + this.signature = signature; + } + + public byte[] encode() { + return ByteUtil.join( + Proto.encode(1, this.blockIdFlag), + Proto.encode(2, this.validatorAddress), + Proto.encode(3, this.timestamp), + Proto.encode(4, this.signature)); + } + + public static CommitSig decode(byte[] data) { + CommitSig obj = new CommitSig(); + int index = 0; + int order; + int length = data.length; + while (index < length) { + order = data[index] >> 3; + index++; + switch(order) { + case 1: { + Proto.DecodeResponse resp = Proto.decodeEnum(data, index); + index = resp.index; + obj.blockIdFlag = resp.res; + break; + } + case 2: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.validatorAddress = resp.res; + break; + } + case 3: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.timestamp = Timestamp.decode(resp.res); + break; + } + case 4: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.signature = resp.res; + break; + } + } + } + return obj; + } +} diff --git a/contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/Consensus.java b/contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/Consensus.java new file mode 100644 index 000000000..86a7bc394 --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/Consensus.java @@ -0,0 +1,60 @@ +package icon.proto.clients.tendermint; + +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ProtoMessage; +import java.math.BigInteger; + +public class Consensus extends ProtoMessage { + private BigInteger block = BigInteger.ZERO; + + private BigInteger app = BigInteger.ZERO; + + public BigInteger getBlock() { + return this.block; + } + + public void setBlock(BigInteger block) { + this.block = block; + } + + public BigInteger getApp() { + return this.app; + } + + public void setApp(BigInteger app) { + this.app = app; + } + + public byte[] encode() { + return ByteUtil.join( + Proto.encode(1, this.block), + Proto.encode(2, this.app)); + } + + public static Consensus decode(byte[] data) { + Consensus obj = new Consensus(); + int index = 0; + int order; + int length = data.length; + while (index < length) { + order = data[index] >> 3; + index++; + switch(order) { + case 1: { + Proto.DecodeResponse resp = Proto.decodeVarInt(data, index); + index = resp.index; + obj.block = resp.res; + break; + } + case 2: { + Proto.DecodeResponse resp = Proto.decodeVarInt(data, index); + index = resp.index; + obj.app = resp.res; + break; + } + } + } + return obj; + } +} diff --git a/contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/ConsensusState.java b/contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/ConsensusState.java new file mode 100644 index 000000000..c40689c5e --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/ConsensusState.java @@ -0,0 +1,77 @@ +package icon.proto.clients.tendermint; + +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ProtoMessage; +import ibc.core.commitment.v1.MerkleRoot; + +public class ConsensusState extends ProtoMessage { + private Timestamp timestamp = new Timestamp(); + + private MerkleRoot root = new MerkleRoot(); + + private byte[] nextValidatorsHash = new byte[0]; + + public Timestamp getTimestamp() { + return this.timestamp; + } + + public void setTimestamp(Timestamp timestamp) { + this.timestamp = timestamp; + } + + public MerkleRoot getRoot() { + return this.root; + } + + public void setRoot(MerkleRoot root) { + this.root = root; + } + + public byte[] getNextValidatorsHash() { + return this.nextValidatorsHash; + } + + public void setNextValidatorsHash(byte[] nextValidatorsHash) { + this.nextValidatorsHash = nextValidatorsHash; + } + + public byte[] encode() { + return ByteUtil.join( + Proto.encode(1, this.timestamp), + Proto.encode(2, this.root), + Proto.encode(3, this.nextValidatorsHash)); + } + + public static ConsensusState decode(byte[] data) { + ConsensusState obj = new ConsensusState(); + int index = 0; + int order; + int length = data.length; + while (index < length) { + order = data[index] >> 3; + index++; + switch(order) { + case 1: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.timestamp = Timestamp.decode(resp.res); + break; + } + case 2: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.root = MerkleRoot.decode(resp.res); + break; + } + case 3: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.nextValidatorsHash = resp.res; + break; + } + } + } + return obj; + } +} diff --git a/contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/Duration.java b/contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/Duration.java new file mode 100644 index 000000000..d556663c2 --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/Duration.java @@ -0,0 +1,60 @@ +package icon.proto.clients.tendermint; + +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ProtoMessage; +import java.math.BigInteger; + +public class Duration extends ProtoMessage { + private BigInteger seconds = BigInteger.ZERO; + + private BigInteger nanos = BigInteger.ZERO; + + public BigInteger getSeconds() { + return this.seconds; + } + + public void setSeconds(BigInteger seconds) { + this.seconds = seconds; + } + + public BigInteger getNanos() { + return this.nanos; + } + + public void setNanos(BigInteger nanos) { + this.nanos = nanos; + } + + public byte[] encode() { + return ByteUtil.join( + Proto.encode(1, this.seconds), + Proto.encode(2, this.nanos)); + } + + public static Duration decode(byte[] data) { + Duration obj = new Duration(); + int index = 0; + int order; + int length = data.length; + while (index < length) { + order = data[index] >> 3; + index++; + switch(order) { + case 1: { + Proto.DecodeResponse resp = Proto.decodeVarInt(data, index); + index = resp.index; + obj.seconds = resp.res; + break; + } + case 2: { + Proto.DecodeResponse resp = Proto.decodeVarInt(data, index); + index = resp.index; + obj.nanos = resp.res; + break; + } + } + } + return obj; + } +} diff --git a/contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/Fraction.java b/contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/Fraction.java new file mode 100644 index 000000000..bfd27289e --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/Fraction.java @@ -0,0 +1,60 @@ +package icon.proto.clients.tendermint; + +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ProtoMessage; +import java.math.BigInteger; + +public class Fraction extends ProtoMessage { + private BigInteger numerator = BigInteger.ZERO; + + private BigInteger denominator = BigInteger.ZERO; + + public BigInteger getNumerator() { + return this.numerator; + } + + public void setNumerator(BigInteger numerator) { + this.numerator = numerator; + } + + public BigInteger getDenominator() { + return this.denominator; + } + + public void setDenominator(BigInteger denominator) { + this.denominator = denominator; + } + + public byte[] encode() { + return ByteUtil.join( + Proto.encode(1, this.numerator), + Proto.encode(2, this.denominator)); + } + + public static Fraction decode(byte[] data) { + Fraction obj = new Fraction(); + int index = 0; + int order; + int length = data.length; + while (index < length) { + order = data[index] >> 3; + index++; + switch(order) { + case 1: { + Proto.DecodeResponse resp = Proto.decodeVarInt(data, index); + index = resp.index; + obj.numerator = resp.res; + break; + } + case 2: { + Proto.DecodeResponse resp = Proto.decodeVarInt(data, index); + index = resp.index; + obj.denominator = resp.res; + break; + } + } + } + return obj; + } +} diff --git a/contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/LightHeader.java b/contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/LightHeader.java new file mode 100644 index 000000000..5dbae16e9 --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/LightHeader.java @@ -0,0 +1,265 @@ +package icon.proto.clients.tendermint; + +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ProtoMessage; +import java.lang.String; +import java.math.BigInteger; + +public class LightHeader extends ProtoMessage { + private Consensus version = new Consensus(); + + private String chainId = ""; + + private BigInteger height = BigInteger.ZERO; + + private Timestamp time = new Timestamp(); + + private BlockID lastBlockId = new BlockID(); + + private byte[] lastCommitHash = new byte[0]; + + private byte[] dataHash = new byte[0]; + + private byte[] validatorsHash = new byte[0]; + + private byte[] nextValidatorsHash = new byte[0]; + + private byte[] consensusHash = new byte[0]; + + private byte[] appHash = new byte[0]; + + private byte[] lastResultsHash = new byte[0]; + + private byte[] evidenceHash = new byte[0]; + + private byte[] proposerAddress = new byte[0]; + + public Consensus getVersion() { + return this.version; + } + + public void setVersion(Consensus version) { + this.version = version; + } + + public String getChainId() { + return this.chainId; + } + + public void setChainId(String chainId) { + this.chainId = chainId; + } + + public BigInteger getHeight() { + return this.height; + } + + public void setHeight(BigInteger height) { + this.height = height; + } + + public Timestamp getTime() { + return this.time; + } + + public void setTime(Timestamp time) { + this.time = time; + } + + public BlockID getLastBlockId() { + return this.lastBlockId; + } + + public void setLastBlockId(BlockID lastBlockId) { + this.lastBlockId = lastBlockId; + } + + public byte[] getLastCommitHash() { + return this.lastCommitHash; + } + + public void setLastCommitHash(byte[] lastCommitHash) { + this.lastCommitHash = lastCommitHash; + } + + public byte[] getDataHash() { + return this.dataHash; + } + + public void setDataHash(byte[] dataHash) { + this.dataHash = dataHash; + } + + public byte[] getValidatorsHash() { + return this.validatorsHash; + } + + public void setValidatorsHash(byte[] validatorsHash) { + this.validatorsHash = validatorsHash; + } + + public byte[] getNextValidatorsHash() { + return this.nextValidatorsHash; + } + + public void setNextValidatorsHash(byte[] nextValidatorsHash) { + this.nextValidatorsHash = nextValidatorsHash; + } + + public byte[] getConsensusHash() { + return this.consensusHash; + } + + public void setConsensusHash(byte[] consensusHash) { + this.consensusHash = consensusHash; + } + + public byte[] getAppHash() { + return this.appHash; + } + + public void setAppHash(byte[] appHash) { + this.appHash = appHash; + } + + public byte[] getLastResultsHash() { + return this.lastResultsHash; + } + + public void setLastResultsHash(byte[] lastResultsHash) { + this.lastResultsHash = lastResultsHash; + } + + public byte[] getEvidenceHash() { + return this.evidenceHash; + } + + public void setEvidenceHash(byte[] evidenceHash) { + this.evidenceHash = evidenceHash; + } + + public byte[] getProposerAddress() { + return this.proposerAddress; + } + + public void setProposerAddress(byte[] proposerAddress) { + this.proposerAddress = proposerAddress; + } + + public byte[] encode() { + return ByteUtil.join( + Proto.encode(1, this.version), + Proto.encode(2, this.chainId), + Proto.encode(3, this.height), + Proto.encode(4, this.time), + Proto.encode(5, this.lastBlockId), + Proto.encode(6, this.lastCommitHash), + Proto.encode(7, this.dataHash), + Proto.encode(8, this.validatorsHash), + Proto.encode(9, this.nextValidatorsHash), + Proto.encode(10, this.consensusHash), + Proto.encode(11, this.appHash), + Proto.encode(12, this.lastResultsHash), + Proto.encode(13, this.evidenceHash), + Proto.encode(14, this.proposerAddress)); + } + + public static LightHeader decode(byte[] data) { + LightHeader obj = new LightHeader(); + int index = 0; + int order; + int length = data.length; + while (index < length) { + order = data[index] >> 3; + index++; + switch(order) { + case 1: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.version = Consensus.decode(resp.res); + break; + } + case 2: { + Proto.DecodeResponse resp = Proto.decodeString(data, index); + index = resp.index; + obj.chainId = resp.res; + break; + } + case 3: { + Proto.DecodeResponse resp = Proto.decodeVarInt(data, index); + index = resp.index; + obj.height = resp.res; + break; + } + case 4: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.time = Timestamp.decode(resp.res); + break; + } + case 5: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.lastBlockId = BlockID.decode(resp.res); + break; + } + case 6: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.lastCommitHash = resp.res; + break; + } + case 7: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.dataHash = resp.res; + break; + } + case 8: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.validatorsHash = resp.res; + break; + } + case 9: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.nextValidatorsHash = resp.res; + break; + } + case 10: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.consensusHash = resp.res; + break; + } + case 11: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.appHash = resp.res; + break; + } + case 12: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.lastResultsHash = resp.res; + break; + } + case 13: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.evidenceHash = resp.res; + break; + } + case 14: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.proposerAddress = resp.res; + break; + } + } + } + return obj; + } +} diff --git a/contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/PartSetHeader.java b/contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/PartSetHeader.java new file mode 100644 index 000000000..919b02c28 --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/PartSetHeader.java @@ -0,0 +1,60 @@ +package icon.proto.clients.tendermint; + +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ProtoMessage; +import java.math.BigInteger; + +public class PartSetHeader extends ProtoMessage { + private BigInteger total = BigInteger.ZERO; + + private byte[] hash = new byte[0]; + + public BigInteger getTotal() { + return this.total; + } + + public void setTotal(BigInteger total) { + this.total = total; + } + + public byte[] getHash() { + return this.hash; + } + + public void setHash(byte[] hash) { + this.hash = hash; + } + + public byte[] encode() { + return ByteUtil.join( + Proto.encode(1, this.total), + Proto.encode(2, this.hash)); + } + + public static PartSetHeader decode(byte[] data) { + PartSetHeader obj = new PartSetHeader(); + int index = 0; + int order; + int length = data.length; + while (index < length) { + order = data[index] >> 3; + index++; + switch(order) { + case 1: { + Proto.DecodeResponse resp = Proto.decodeVarInt(data, index); + index = resp.index; + obj.total = resp.res; + break; + } + case 2: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.hash = resp.res; + break; + } + } + } + return obj; + } +} diff --git a/contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/PublicKey.java b/contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/PublicKey.java new file mode 100644 index 000000000..1ee5bb457 --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/PublicKey.java @@ -0,0 +1,76 @@ +package icon.proto.clients.tendermint; + +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ProtoMessage; + +public class PublicKey extends ProtoMessage { + private byte[] ed25519 = new byte[0]; + + private byte[] secp256k1 = new byte[0]; + + private byte[] sr25519 = new byte[0]; + + public byte[] getEd25519() { + return this.ed25519; + } + + public void setEd25519(byte[] ed25519) { + this.ed25519 = ed25519; + } + + public byte[] getSecp256k1() { + return this.secp256k1; + } + + public void setSecp256k1(byte[] secp256k1) { + this.secp256k1 = secp256k1; + } + + public byte[] getSr25519() { + return this.sr25519; + } + + public void setSr25519(byte[] sr25519) { + this.sr25519 = sr25519; + } + + public byte[] encode() { + return ByteUtil.join( + Proto.encode(1, this.ed25519), + Proto.encode(2, this.secp256k1), + Proto.encode(3, this.sr25519)); + } + + public static PublicKey decode(byte[] data) { + PublicKey obj = new PublicKey(); + int index = 0; + int order; + int length = data.length; + while (index < length) { + order = data[index] >> 3; + index++; + switch(order) { + case 1: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.ed25519 = resp.res; + break; + } + case 2: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.secp256k1 = resp.res; + break; + } + case 3: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.sr25519 = resp.res; + break; + } + } + } + return obj; + } +} diff --git a/contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/SignedHeader.java b/contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/SignedHeader.java new file mode 100644 index 000000000..b3ef2c33a --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/SignedHeader.java @@ -0,0 +1,59 @@ +package icon.proto.clients.tendermint; + +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ProtoMessage; + +public class SignedHeader extends ProtoMessage { + private LightHeader header = new LightHeader(); + + private Commit commit = new Commit(); + + public LightHeader getHeader() { + return this.header; + } + + public void setHeader(LightHeader header) { + this.header = header; + } + + public Commit getCommit() { + return this.commit; + } + + public void setCommit(Commit commit) { + this.commit = commit; + } + + public byte[] encode() { + return ByteUtil.join( + Proto.encode(1, this.header), + Proto.encode(2, this.commit)); + } + + public static SignedHeader decode(byte[] data) { + SignedHeader obj = new SignedHeader(); + int index = 0; + int order; + int length = data.length; + while (index < length) { + order = data[index] >> 3; + index++; + switch(order) { + case 1: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.header = LightHeader.decode(resp.res); + break; + } + case 2: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.commit = Commit.decode(resp.res); + break; + } + } + } + return obj; + } +} diff --git a/contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/SignedMsgType.java b/contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/SignedMsgType.java new file mode 100644 index 000000000..92cb55e93 --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/SignedMsgType.java @@ -0,0 +1,11 @@ +package icon.proto.clients.tendermint; + +public class SignedMsgType { + public static final int SIGNED_MSG_TYPE_UNKNOWN = 0; + + public static final int SIGNED_MSG_TYPE_PREVOTE = 1; + + public static final int SIGNED_MSG_TYPE_PRECOMMIT = 2; + + public static final int SIGNED_MSG_TYPE_PROPOSAL = 32; +} diff --git a/contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/SimpleValidator.java b/contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/SimpleValidator.java new file mode 100644 index 000000000..d832d5e02 --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/SimpleValidator.java @@ -0,0 +1,60 @@ +package icon.proto.clients.tendermint; + +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ProtoMessage; +import java.math.BigInteger; + +public class SimpleValidator extends ProtoMessage { + private PublicKey pubKey = new PublicKey(); + + private BigInteger votingPower = BigInteger.ZERO; + + public PublicKey getPubKey() { + return this.pubKey; + } + + public void setPubKey(PublicKey pubKey) { + this.pubKey = pubKey; + } + + public BigInteger getVotingPower() { + return this.votingPower; + } + + public void setVotingPower(BigInteger votingPower) { + this.votingPower = votingPower; + } + + public byte[] encode() { + return ByteUtil.join( + Proto.encode(1, this.pubKey), + Proto.encode(2, this.votingPower)); + } + + public static SimpleValidator decode(byte[] data) { + SimpleValidator obj = new SimpleValidator(); + int index = 0; + int order; + int length = data.length; + while (index < length) { + order = data[index] >> 3; + index++; + switch(order) { + case 1: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.pubKey = PublicKey.decode(resp.res); + break; + } + case 2: { + Proto.DecodeResponse resp = Proto.decodeVarInt(data, index); + index = resp.index; + obj.votingPower = resp.res; + break; + } + } + } + return obj; + } +} diff --git a/contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/Timestamp.java b/contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/Timestamp.java new file mode 100644 index 000000000..27bcfa95f --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/Timestamp.java @@ -0,0 +1,60 @@ +package icon.proto.clients.tendermint; + +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ProtoMessage; +import java.math.BigInteger; + +public class Timestamp extends ProtoMessage { + private BigInteger seconds = BigInteger.ZERO; + + private BigInteger nanos = BigInteger.ZERO; + + public BigInteger getSeconds() { + return this.seconds; + } + + public void setSeconds(BigInteger seconds) { + this.seconds = seconds; + } + + public BigInteger getNanos() { + return this.nanos; + } + + public void setNanos(BigInteger nanos) { + this.nanos = nanos; + } + + public byte[] encode() { + return ByteUtil.join( + Proto.encode(1, this.seconds), + Proto.encode(2, this.nanos)); + } + + public static Timestamp decode(byte[] data) { + Timestamp obj = new Timestamp(); + int index = 0; + int order; + int length = data.length; + while (index < length) { + order = data[index] >> 3; + index++; + switch(order) { + case 1: { + Proto.DecodeResponse resp = Proto.decodeVarInt(data, index); + index = resp.index; + obj.seconds = resp.res; + break; + } + case 2: { + Proto.DecodeResponse resp = Proto.decodeVarInt(data, index); + index = resp.index; + obj.nanos = resp.res; + break; + } + } + } + return obj; + } +} diff --git a/contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/TmHeader.java b/contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/TmHeader.java new file mode 100644 index 000000000..41ec037d0 --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/TmHeader.java @@ -0,0 +1,94 @@ +package icon.proto.clients.tendermint; + +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ProtoMessage; +import java.math.BigInteger; + +public class TmHeader extends ProtoMessage { + private SignedHeader signedHeader = new SignedHeader(); + + private ValidatorSet validatorSet = new ValidatorSet(); + + private BigInteger trustedHeight = BigInteger.ZERO; + + private ValidatorSet trustedValidators = new ValidatorSet(); + + public SignedHeader getSignedHeader() { + return this.signedHeader; + } + + public void setSignedHeader(SignedHeader signedHeader) { + this.signedHeader = signedHeader; + } + + public ValidatorSet getValidatorSet() { + return this.validatorSet; + } + + public void setValidatorSet(ValidatorSet validatorSet) { + this.validatorSet = validatorSet; + } + + public BigInteger getTrustedHeight() { + return this.trustedHeight; + } + + public void setTrustedHeight(BigInteger trustedHeight) { + this.trustedHeight = trustedHeight; + } + + public ValidatorSet getTrustedValidators() { + return this.trustedValidators; + } + + public void setTrustedValidators(ValidatorSet trustedValidators) { + this.trustedValidators = trustedValidators; + } + + public byte[] encode() { + return ByteUtil.join( + Proto.encode(1, this.signedHeader), + Proto.encode(2, this.validatorSet), + Proto.encode(3, this.trustedHeight), + Proto.encode(4, this.trustedValidators)); + } + + public static TmHeader decode(byte[] data) { + TmHeader obj = new TmHeader(); + int index = 0; + int order; + int length = data.length; + while (index < length) { + order = data[index] >> 3; + index++; + switch(order) { + case 1: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.signedHeader = SignedHeader.decode(resp.res); + break; + } + case 2: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.validatorSet = ValidatorSet.decode(resp.res); + break; + } + case 3: { + Proto.DecodeResponse resp = Proto.decodeVarInt(data, index); + index = resp.index; + obj.trustedHeight = resp.res; + break; + } + case 4: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.trustedValidators = ValidatorSet.decode(resp.res); + break; + } + } + } + return obj; + } +} diff --git a/contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/Validator.java b/contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/Validator.java new file mode 100644 index 000000000..8524099ae --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/Validator.java @@ -0,0 +1,94 @@ +package icon.proto.clients.tendermint; + +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ProtoMessage; +import java.math.BigInteger; + +public class Validator extends ProtoMessage { + private byte[] address = new byte[0]; + + private PublicKey pubKey = new PublicKey(); + + private BigInteger votingPower = BigInteger.ZERO; + + private BigInteger proposerPriority = BigInteger.ZERO; + + public byte[] getAddress() { + return this.address; + } + + public void setAddress(byte[] address) { + this.address = address; + } + + public PublicKey getPubKey() { + return this.pubKey; + } + + public void setPubKey(PublicKey pubKey) { + this.pubKey = pubKey; + } + + public BigInteger getVotingPower() { + return this.votingPower; + } + + public void setVotingPower(BigInteger votingPower) { + this.votingPower = votingPower; + } + + public BigInteger getProposerPriority() { + return this.proposerPriority; + } + + public void setProposerPriority(BigInteger proposerPriority) { + this.proposerPriority = proposerPriority; + } + + public byte[] encode() { + return ByteUtil.join( + Proto.encode(1, this.address), + Proto.encode(2, this.pubKey), + Proto.encode(3, this.votingPower), + Proto.encode(4, this.proposerPriority)); + } + + public static Validator decode(byte[] data) { + Validator obj = new Validator(); + int index = 0; + int order; + int length = data.length; + while (index < length) { + order = data[index] >> 3; + index++; + switch(order) { + case 1: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.address = resp.res; + break; + } + case 2: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.pubKey = PublicKey.decode(resp.res); + break; + } + case 3: { + Proto.DecodeResponse resp = Proto.decodeVarInt(data, index); + index = resp.index; + obj.votingPower = resp.res; + break; + } + case 4: { + Proto.DecodeResponse resp = Proto.decodeVarInt(data, index); + index = resp.index; + obj.proposerPriority = resp.res; + break; + } + } + } + return obj; + } +} diff --git a/contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/ValidatorSet.java b/contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/ValidatorSet.java new file mode 100644 index 000000000..323e57cda --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/ValidatorSet.java @@ -0,0 +1,79 @@ +package icon.proto.clients.tendermint; + +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ProtoMessage; +import java.math.BigInteger; +import java.util.List; +import scorex.util.ArrayList; + +public class ValidatorSet extends ProtoMessage { + private List validators = new ArrayList<>(); + + private Validator proposer = new Validator(); + + private BigInteger totalVotingPower = BigInteger.ZERO; + + public List getValidators() { + return this.validators; + } + + public void setValidators(List validators) { + this.validators = validators; + } + + public Validator getProposer() { + return this.proposer; + } + + public void setProposer(Validator proposer) { + this.proposer = proposer; + } + + public BigInteger getTotalVotingPower() { + return this.totalVotingPower; + } + + public void setTotalVotingPower(BigInteger totalVotingPower) { + this.totalVotingPower = totalVotingPower; + } + + public byte[] encode() { + return ByteUtil.join( + Proto.encodeMessageArray(1, this.validators), + Proto.encode(2, this.proposer), + Proto.encode(3, this.totalVotingPower)); + } + + public static ValidatorSet decode(byte[] data) { + ValidatorSet obj = new ValidatorSet(); + int index = 0; + int order; + int length = data.length; + while (index < length) { + order = data[index] >> 3; + index++; + switch(order) { + case 1: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.validators.add(Validator.decode(resp.res)); + break; + } + case 2: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.proposer = Validator.decode(resp.res); + break; + } + case 3: { + Proto.DecodeResponse resp = Proto.decodeVarInt(data, index); + index = resp.index; + obj.totalVotingPower = resp.res; + break; + } + } + } + return obj; + } +} diff --git a/contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/Vote.java b/contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/Vote.java new file mode 100644 index 000000000..5894f89f2 --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/icon/proto/clients/tendermint/Vote.java @@ -0,0 +1,163 @@ +package icon.proto.clients.tendermint; + +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ProtoMessage; +import java.lang.Integer; +import java.math.BigInteger; + +public class Vote extends ProtoMessage { + private int type = 0; + + private BigInteger height = BigInteger.ZERO; + + private BigInteger round = BigInteger.ZERO; + + private BlockID blockId = new BlockID(); + + private Timestamp timestamp = new Timestamp(); + + private byte[] validatorAddress = new byte[0]; + + private BigInteger validatorIndex = BigInteger.ZERO; + + private byte[] signature = new byte[0]; + + public int getType() { + return this.type; + } + + public void setType(int type) { + this.type = type; + } + + public BigInteger getHeight() { + return this.height; + } + + public void setHeight(BigInteger height) { + this.height = height; + } + + public BigInteger getRound() { + return this.round; + } + + public void setRound(BigInteger round) { + this.round = round; + } + + public BlockID getBlockId() { + return this.blockId; + } + + public void setBlockId(BlockID blockId) { + this.blockId = blockId; + } + + public Timestamp getTimestamp() { + return this.timestamp; + } + + public void setTimestamp(Timestamp timestamp) { + this.timestamp = timestamp; + } + + public byte[] getValidatorAddress() { + return this.validatorAddress; + } + + public void setValidatorAddress(byte[] validatorAddress) { + this.validatorAddress = validatorAddress; + } + + public BigInteger getValidatorIndex() { + return this.validatorIndex; + } + + public void setValidatorIndex(BigInteger validatorIndex) { + this.validatorIndex = validatorIndex; + } + + public byte[] getSignature() { + return this.signature; + } + + public void setSignature(byte[] signature) { + this.signature = signature; + } + + public byte[] encode() { + return ByteUtil.join( + Proto.encode(1, this.type), + Proto.encode(2, this.height), + Proto.encode(3, this.round), + Proto.encode(4, this.blockId), + Proto.encode(5, this.timestamp), + Proto.encode(6, this.validatorAddress), + Proto.encode(7, this.validatorIndex), + Proto.encode(8, this.signature)); + } + + public static Vote decode(byte[] data) { + Vote obj = new Vote(); + int index = 0; + int order; + int length = data.length; + while (index < length) { + order = data[index] >> 3; + index++; + switch(order) { + case 1: { + Proto.DecodeResponse resp = Proto.decodeEnum(data, index); + index = resp.index; + obj.type = resp.res; + break; + } + case 2: { + Proto.DecodeResponse resp = Proto.decodeVarInt(data, index); + index = resp.index; + obj.height = resp.res; + break; + } + case 3: { + Proto.DecodeResponse resp = Proto.decodeVarInt(data, index); + index = resp.index; + obj.round = resp.res; + break; + } + case 4: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.blockId = BlockID.decode(resp.res); + break; + } + case 5: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.timestamp = Timestamp.decode(resp.res); + break; + } + case 6: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.validatorAddress = resp.res; + break; + } + case 7: { + Proto.DecodeResponse resp = Proto.decodeVarInt(data, index); + index = resp.index; + obj.validatorIndex = resp.res; + break; + } + case 8: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.signature = resp.res; + break; + } + } + } + return obj; + } +} diff --git a/contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/BatchEntry.java b/contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/BatchEntry.java new file mode 100644 index 000000000..b52936cd9 --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/BatchEntry.java @@ -0,0 +1,59 @@ +package icon.proto.core.commitment; + +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ProtoMessage; + +public class BatchEntry extends ProtoMessage { + private ExistenceProof exist = new ExistenceProof(); + + private NonExistenceProof nonexist = new NonExistenceProof(); + + public ExistenceProof getExist() { + return this.exist; + } + + public void setExist(ExistenceProof exist) { + this.exist = exist; + } + + public NonExistenceProof getNonexist() { + return this.nonexist; + } + + public void setNonexist(NonExistenceProof nonexist) { + this.nonexist = nonexist; + } + + public byte[] encode() { + return ByteUtil.join( + Proto.encode(1, this.exist), + Proto.encode(2, this.nonexist)); + } + + public static BatchEntry decode(byte[] data) { + BatchEntry obj = new BatchEntry(); + int index = 0; + int order; + int length = data.length; + while (index < length) { + order = data[index] >> 3; + index++; + switch(order) { + case 1: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.exist = ExistenceProof.decode(resp.res); + break; + } + case 2: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.nonexist = NonExistenceProof.decode(resp.res); + break; + } + } + } + return obj; + } +} diff --git a/contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/BatchProof.java b/contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/BatchProof.java new file mode 100644 index 000000000..bb711115c --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/BatchProof.java @@ -0,0 +1,44 @@ +package icon.proto.core.commitment; + +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ProtoMessage; +import java.util.List; +import scorex.util.ArrayList; + +public class BatchProof extends ProtoMessage { + private List entries = new ArrayList<>(); + + public List getEntries() { + return this.entries; + } + + public void setEntries(List entries) { + this.entries = entries; + } + + public byte[] encode() { + return ByteUtil.join( + Proto.encodeMessageArray(1, this.entries)); + } + + public static BatchProof decode(byte[] data) { + BatchProof obj = new BatchProof(); + int index = 0; + int order; + int length = data.length; + while (index < length) { + order = data[index] >> 3; + index++; + switch(order) { + case 1: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.entries.add(BatchEntry.decode(resp.res)); + break; + } + } + } + return obj; + } +} diff --git a/contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/CommitmentProof.java b/contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/CommitmentProof.java new file mode 100644 index 000000000..47fa142c6 --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/CommitmentProof.java @@ -0,0 +1,93 @@ +package icon.proto.core.commitment; + +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ProtoMessage; + +public class CommitmentProof extends ProtoMessage { + private ExistenceProof exist = new ExistenceProof(); + + private NonExistenceProof nonexist = new NonExistenceProof(); + + private BatchProof batch = new BatchProof(); + + private CompressedBatchProof compressed = new CompressedBatchProof(); + + public ExistenceProof getExist() { + return this.exist; + } + + public void setExist(ExistenceProof exist) { + this.exist = exist; + } + + public NonExistenceProof getNonexist() { + return this.nonexist; + } + + public void setNonexist(NonExistenceProof nonexist) { + this.nonexist = nonexist; + } + + public BatchProof getBatch() { + return this.batch; + } + + public void setBatch(BatchProof batch) { + this.batch = batch; + } + + public CompressedBatchProof getCompressed() { + return this.compressed; + } + + public void setCompressed(CompressedBatchProof compressed) { + this.compressed = compressed; + } + + public byte[] encode() { + return ByteUtil.join( + Proto.encode(1, this.exist), + Proto.encode(2, this.nonexist), + Proto.encode(3, this.batch), + Proto.encode(4, this.compressed)); + } + + public static CommitmentProof decode(byte[] data) { + CommitmentProof obj = new CommitmentProof(); + int index = 0; + int order; + int length = data.length; + while (index < length) { + order = data[index] >> 3; + index++; + switch(order) { + case 1: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.exist = ExistenceProof.decode(resp.res); + break; + } + case 2: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.nonexist = NonExistenceProof.decode(resp.res); + break; + } + case 3: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.batch = BatchProof.decode(resp.res); + break; + } + case 4: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.compressed = CompressedBatchProof.decode(resp.res); + break; + } + } + } + return obj; + } +} diff --git a/contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/CompressedBatchEntry.java b/contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/CompressedBatchEntry.java new file mode 100644 index 000000000..00be2e01b --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/CompressedBatchEntry.java @@ -0,0 +1,59 @@ +package icon.proto.core.commitment; + +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ProtoMessage; + +public class CompressedBatchEntry extends ProtoMessage { + private CompressedExistenceProof exist = new CompressedExistenceProof(); + + private CompressedNonExistenceProof nonexist = new CompressedNonExistenceProof(); + + public CompressedExistenceProof getExist() { + return this.exist; + } + + public void setExist(CompressedExistenceProof exist) { + this.exist = exist; + } + + public CompressedNonExistenceProof getNonexist() { + return this.nonexist; + } + + public void setNonexist(CompressedNonExistenceProof nonexist) { + this.nonexist = nonexist; + } + + public byte[] encode() { + return ByteUtil.join( + Proto.encode(1, this.exist), + Proto.encode(2, this.nonexist)); + } + + public static CompressedBatchEntry decode(byte[] data) { + CompressedBatchEntry obj = new CompressedBatchEntry(); + int index = 0; + int order; + int length = data.length; + while (index < length) { + order = data[index] >> 3; + index++; + switch(order) { + case 1: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.exist = CompressedExistenceProof.decode(resp.res); + break; + } + case 2: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.nonexist = CompressedNonExistenceProof.decode(resp.res); + break; + } + } + } + return obj; + } +} diff --git a/contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/CompressedBatchProof.java b/contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/CompressedBatchProof.java new file mode 100644 index 000000000..639c1200a --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/CompressedBatchProof.java @@ -0,0 +1,61 @@ +package icon.proto.core.commitment; + +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ProtoMessage; +import java.util.List; +import scorex.util.ArrayList; + +public class CompressedBatchProof extends ProtoMessage { + private List entries = new ArrayList<>(); + + private List lookupInners = new ArrayList<>(); + + public List getEntries() { + return this.entries; + } + + public void setEntries(List entries) { + this.entries = entries; + } + + public List getLookupInners() { + return this.lookupInners; + } + + public void setLookupInners(List lookupInners) { + this.lookupInners = lookupInners; + } + + public byte[] encode() { + return ByteUtil.join( + Proto.encodeMessageArray(1, this.entries), + Proto.encodeMessageArray(2, this.lookupInners)); + } + + public static CompressedBatchProof decode(byte[] data) { + CompressedBatchProof obj = new CompressedBatchProof(); + int index = 0; + int order; + int length = data.length; + while (index < length) { + order = data[index] >> 3; + index++; + switch(order) { + case 1: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.entries.add(CompressedBatchEntry.decode(resp.res)); + break; + } + case 2: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.lookupInners.add(InnerOp.decode(resp.res)); + break; + } + } + } + return obj; + } +} diff --git a/contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/CompressedExistenceProof.java b/contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/CompressedExistenceProof.java new file mode 100644 index 000000000..0e65292e3 --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/CompressedExistenceProof.java @@ -0,0 +1,96 @@ +package icon.proto.core.commitment; + +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ProtoMessage; +import java.math.BigInteger; +import java.util.List; +import scorex.util.ArrayList; + +public class CompressedExistenceProof extends ProtoMessage { + private byte[] key = new byte[0]; + + private byte[] value = new byte[0]; + + private LeafOp leaf = new LeafOp(); + + private List path = new ArrayList<>(); + + public byte[] getKey() { + return this.key; + } + + public void setKey(byte[] key) { + this.key = key; + } + + public byte[] getValue() { + return this.value; + } + + public void setValue(byte[] value) { + this.value = value; + } + + public LeafOp getLeaf() { + return this.leaf; + } + + public void setLeaf(LeafOp leaf) { + this.leaf = leaf; + } + + public List getPath() { + return this.path; + } + + public void setPath(List path) { + this.path = path; + } + + public byte[] encode() { + return ByteUtil.join( + Proto.encode(1, this.key), + Proto.encode(2, this.value), + Proto.encode(3, this.leaf), + Proto.encodeVarIntArray(4, this.path)); + } + + public static CompressedExistenceProof decode(byte[] data) { + CompressedExistenceProof obj = new CompressedExistenceProof(); + int index = 0; + int order; + int length = data.length; + while (index < length) { + order = data[index] >> 3; + index++; + switch(order) { + case 1: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.key = resp.res; + break; + } + case 2: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.value = resp.res; + break; + } + case 3: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.leaf = LeafOp.decode(resp.res); + break; + } + case 4: { + Proto.DecodeResponse> resp = Proto.decodeVarIntArray(data, index); + index = resp.index; + obj.path.addAll(resp.res); + break; + } + } + } + return obj; + } +} diff --git a/contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/CompressedNonExistenceProof.java b/contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/CompressedNonExistenceProof.java new file mode 100644 index 000000000..d69d005a6 --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/CompressedNonExistenceProof.java @@ -0,0 +1,76 @@ +package icon.proto.core.commitment; + +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ProtoMessage; + +public class CompressedNonExistenceProof extends ProtoMessage { + private byte[] key = new byte[0]; + + private CompressedExistenceProof left = new CompressedExistenceProof(); + + private CompressedExistenceProof right = new CompressedExistenceProof(); + + public byte[] getKey() { + return this.key; + } + + public void setKey(byte[] key) { + this.key = key; + } + + public CompressedExistenceProof getLeft() { + return this.left; + } + + public void setLeft(CompressedExistenceProof left) { + this.left = left; + } + + public CompressedExistenceProof getRight() { + return this.right; + } + + public void setRight(CompressedExistenceProof right) { + this.right = right; + } + + public byte[] encode() { + return ByteUtil.join( + Proto.encode(1, this.key), + Proto.encode(2, this.left), + Proto.encode(3, this.right)); + } + + public static CompressedNonExistenceProof decode(byte[] data) { + CompressedNonExistenceProof obj = new CompressedNonExistenceProof(); + int index = 0; + int order; + int length = data.length; + while (index < length) { + order = data[index] >> 3; + index++; + switch(order) { + case 1: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.key = resp.res; + break; + } + case 2: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.left = CompressedExistenceProof.decode(resp.res); + break; + } + case 3: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.right = CompressedExistenceProof.decode(resp.res); + break; + } + } + } + return obj; + } +} diff --git a/contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/ExistenceProof.java b/contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/ExistenceProof.java new file mode 100644 index 000000000..a1185209d --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/ExistenceProof.java @@ -0,0 +1,95 @@ +package icon.proto.core.commitment; + +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ProtoMessage; +import java.util.List; +import scorex.util.ArrayList; + +public class ExistenceProof extends ProtoMessage { + private byte[] key = new byte[0]; + + private byte[] value = new byte[0]; + + private LeafOp leaf = new LeafOp(); + + private List path = new ArrayList<>(); + + public byte[] getKey() { + return this.key; + } + + public void setKey(byte[] key) { + this.key = key; + } + + public byte[] getValue() { + return this.value; + } + + public void setValue(byte[] value) { + this.value = value; + } + + public LeafOp getLeaf() { + return this.leaf; + } + + public void setLeaf(LeafOp leaf) { + this.leaf = leaf; + } + + public List getPath() { + return this.path; + } + + public void setPath(List path) { + this.path = path; + } + + public byte[] encode() { + return ByteUtil.join( + Proto.encode(1, this.key), + Proto.encode(2, this.value), + Proto.encode(3, this.leaf), + Proto.encodeMessageArray(4, this.path)); + } + + public static ExistenceProof decode(byte[] data) { + ExistenceProof obj = new ExistenceProof(); + int index = 0; + int order; + int length = data.length; + while (index < length) { + order = data[index] >> 3; + index++; + switch(order) { + case 1: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.key = resp.res; + break; + } + case 2: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.value = resp.res; + break; + } + case 3: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.leaf = LeafOp.decode(resp.res); + break; + } + case 4: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.path.add(InnerOp.decode(resp.res)); + break; + } + } + } + return obj; + } +} diff --git a/contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/HashOp.java b/contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/HashOp.java new file mode 100644 index 000000000..c678aca68 --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/HashOp.java @@ -0,0 +1,17 @@ +package icon.proto.core.commitment; + +public class HashOp { + public static final int NO_HASH = 0; + + public static final int SHA256 = 1; + + public static final int SHA512 = 2; + + public static final int KECCAK = 3; + + public static final int RIPEMD160 = 4; + + public static final int BITCOIN = 5; + + public static final int SHA512_256 = 6; +} diff --git a/contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/InnerOp.java b/contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/InnerOp.java new file mode 100644 index 000000000..0dc6ec0f4 --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/InnerOp.java @@ -0,0 +1,77 @@ +package icon.proto.core.commitment; + +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ProtoMessage; +import java.lang.Integer; + +public class InnerOp extends ProtoMessage { + private int hash = 0; + + private byte[] prefix = new byte[0]; + + private byte[] suffix = new byte[0]; + + public int getHash() { + return this.hash; + } + + public void setHash(int hash) { + this.hash = hash; + } + + public byte[] getPrefix() { + return this.prefix; + } + + public void setPrefix(byte[] prefix) { + this.prefix = prefix; + } + + public byte[] getSuffix() { + return this.suffix; + } + + public void setSuffix(byte[] suffix) { + this.suffix = suffix; + } + + public byte[] encode() { + return ByteUtil.join( + Proto.encode(1, this.hash), + Proto.encode(2, this.prefix), + Proto.encode(3, this.suffix)); + } + + public static InnerOp decode(byte[] data) { + InnerOp obj = new InnerOp(); + int index = 0; + int order; + int length = data.length; + while (index < length) { + order = data[index] >> 3; + index++; + switch(order) { + case 1: { + Proto.DecodeResponse resp = Proto.decodeEnum(data, index); + index = resp.index; + obj.hash = resp.res; + break; + } + case 2: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.prefix = resp.res; + break; + } + case 3: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.suffix = resp.res; + break; + } + } + } + return obj; + } +} diff --git a/contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/InnerSpec.java b/contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/InnerSpec.java new file mode 100644 index 000000000..35d85d14a --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/InnerSpec.java @@ -0,0 +1,131 @@ +package icon.proto.core.commitment; + +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ProtoMessage; +import java.lang.Integer; +import java.math.BigInteger; +import java.util.List; +import scorex.util.ArrayList; + +public class InnerSpec extends ProtoMessage { + private List childOrder = new ArrayList<>(); + + private BigInteger childSize = BigInteger.ZERO; + + private BigInteger minPrefixLength = BigInteger.ZERO; + + private BigInteger maxPrefixLength = BigInteger.ZERO; + + private byte[] emptyChild = new byte[0]; + + private int hash = 0; + + public List getChildOrder() { + return this.childOrder; + } + + public void setChildOrder(List childOrder) { + this.childOrder = childOrder; + } + + public BigInteger getChildSize() { + return this.childSize; + } + + public void setChildSize(BigInteger childSize) { + this.childSize = childSize; + } + + public BigInteger getMinPrefixLength() { + return this.minPrefixLength; + } + + public void setMinPrefixLength(BigInteger minPrefixLength) { + this.minPrefixLength = minPrefixLength; + } + + public BigInteger getMaxPrefixLength() { + return this.maxPrefixLength; + } + + public void setMaxPrefixLength(BigInteger maxPrefixLength) { + this.maxPrefixLength = maxPrefixLength; + } + + public byte[] getEmptyChild() { + return this.emptyChild; + } + + public void setEmptyChild(byte[] emptyChild) { + this.emptyChild = emptyChild; + } + + public int getHash() { + return this.hash; + } + + public void setHash(int hash) { + this.hash = hash; + } + + public byte[] encode() { + return ByteUtil.join( + Proto.encodeVarIntArray(1, this.childOrder), + Proto.encode(2, this.childSize), + Proto.encode(3, this.minPrefixLength), + Proto.encode(4, this.maxPrefixLength), + Proto.encode(5, this.emptyChild), + Proto.encode(6, this.hash)); + } + + public static InnerSpec decode(byte[] data) { + InnerSpec obj = new InnerSpec(); + int index = 0; + int order; + int length = data.length; + while (index < length) { + order = data[index] >> 3; + index++; + switch(order) { + case 1: { + Proto.DecodeResponse> resp = Proto.decodeVarIntArray(data, index); + index = resp.index; + obj.childOrder.addAll(resp.res); + break; + } + case 2: { + Proto.DecodeResponse resp = Proto.decodeVarInt(data, index); + index = resp.index; + obj.childSize = resp.res; + break; + } + case 3: { + Proto.DecodeResponse resp = Proto.decodeVarInt(data, index); + index = resp.index; + obj.minPrefixLength = resp.res; + break; + } + case 4: { + Proto.DecodeResponse resp = Proto.decodeVarInt(data, index); + index = resp.index; + obj.maxPrefixLength = resp.res; + break; + } + case 5: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.emptyChild = resp.res; + break; + } + case 6: { + Proto.DecodeResponse resp = Proto.decodeEnum(data, index); + index = resp.index; + obj.hash = resp.res; + break; + } + } + } + return obj; + } +} diff --git a/contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/LeafOp.java b/contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/LeafOp.java new file mode 100644 index 000000000..162a98314 --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/LeafOp.java @@ -0,0 +1,111 @@ +package icon.proto.core.commitment; + +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ProtoMessage; +import java.lang.Integer; + +public class LeafOp extends ProtoMessage { + private int hash = 0; + + private int prehashKey = 0; + + private int prehashValue = 0; + + private int length = 0; + + private byte[] prefix = new byte[0]; + + public int getHash() { + return this.hash; + } + + public void setHash(int hash) { + this.hash = hash; + } + + public int getPrehashKey() { + return this.prehashKey; + } + + public void setPrehashKey(int prehashKey) { + this.prehashKey = prehashKey; + } + + public int getPrehashValue() { + return this.prehashValue; + } + + public void setPrehashValue(int prehashValue) { + this.prehashValue = prehashValue; + } + + public int getLength() { + return this.length; + } + + public void setLength(int length) { + this.length = length; + } + + public byte[] getPrefix() { + return this.prefix; + } + + public void setPrefix(byte[] prefix) { + this.prefix = prefix; + } + + public byte[] encode() { + return ByteUtil.join( + Proto.encode(1, this.hash), + Proto.encode(2, this.prehashKey), + Proto.encode(3, this.prehashValue), + Proto.encode(4, this.length), + Proto.encode(5, this.prefix)); + } + + public static LeafOp decode(byte[] data) { + LeafOp obj = new LeafOp(); + int index = 0; + int order; + int length = data.length; + while (index < length) { + order = data[index] >> 3; + index++; + switch(order) { + case 1: { + Proto.DecodeResponse resp = Proto.decodeEnum(data, index); + index = resp.index; + obj.hash = resp.res; + break; + } + case 2: { + Proto.DecodeResponse resp = Proto.decodeEnum(data, index); + index = resp.index; + obj.prehashKey = resp.res; + break; + } + case 3: { + Proto.DecodeResponse resp = Proto.decodeEnum(data, index); + index = resp.index; + obj.prehashValue = resp.res; + break; + } + case 4: { + Proto.DecodeResponse resp = Proto.decodeEnum(data, index); + index = resp.index; + obj.length = resp.res; + break; + } + case 5: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.prefix = resp.res; + break; + } + } + } + return obj; + } +} diff --git a/contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/LengthOp.java b/contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/LengthOp.java new file mode 100644 index 000000000..d6849b353 --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/LengthOp.java @@ -0,0 +1,21 @@ +package icon.proto.core.commitment; + +public class LengthOp { + public static final int NO_PREFIX = 0; + + public static final int VAR_PROTO = 1; + + public static final int VAR_RLP = 2; + + public static final int FIXED32_BIG = 3; + + public static final int FIXED32_LITTLE = 4; + + public static final int FIXED64_BIG = 5; + + public static final int FIXED64_LITTLE = 6; + + public static final int REQUIRE_32_BYTES = 7; + + public static final int REQUIRE_64_BYTES = 8; +} diff --git a/contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/MerklePath.java b/contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/MerklePath.java new file mode 100644 index 000000000..73a3efc40 --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/MerklePath.java @@ -0,0 +1,45 @@ +package icon.proto.core.commitment; + +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ProtoMessage; +import java.lang.String; +import java.util.List; +import scorex.util.ArrayList; + +public class MerklePath extends ProtoMessage { + private List keyPath = new ArrayList<>(); + + public List getKeyPath() { + return this.keyPath; + } + + public void setKeyPath(List keyPath) { + this.keyPath = keyPath; + } + + public byte[] encode() { + return ByteUtil.join( + Proto.encodeStringArray(1, this.keyPath)); + } + + public static MerklePath decode(byte[] data) { + MerklePath obj = new MerklePath(); + int index = 0; + int order; + int length = data.length; + while (index < length) { + order = data[index] >> 3; + index++; + switch(order) { + case 1: { + Proto.DecodeResponse resp = Proto.decodeString(data, index); + index = resp.index; + obj.keyPath.add(resp.res); + break; + } + } + } + return obj; + } +} diff --git a/contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/MerklePrefix.java b/contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/MerklePrefix.java new file mode 100644 index 000000000..13af209cb --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/MerklePrefix.java @@ -0,0 +1,42 @@ +package icon.proto.core.commitment; + +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ProtoMessage; + +public class MerklePrefix extends ProtoMessage { + private byte[] keyPrefix = new byte[0]; + + public byte[] getKeyPrefix() { + return this.keyPrefix; + } + + public void setKeyPrefix(byte[] keyPrefix) { + this.keyPrefix = keyPrefix; + } + + public byte[] encode() { + return ByteUtil.join( + Proto.encode(1, this.keyPrefix)); + } + + public static MerklePrefix decode(byte[] data) { + MerklePrefix obj = new MerklePrefix(); + int index = 0; + int order; + int length = data.length; + while (index < length) { + order = data[index] >> 3; + index++; + switch(order) { + case 1: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.keyPrefix = resp.res; + break; + } + } + } + return obj; + } +} diff --git a/contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/MerkleProof.java b/contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/MerkleProof.java new file mode 100644 index 000000000..063c82f2a --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/MerkleProof.java @@ -0,0 +1,44 @@ +package icon.proto.core.commitment; + +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ProtoMessage; +import java.util.List; +import scorex.util.ArrayList; + +public class MerkleProof extends ProtoMessage { + private List proofs = new ArrayList<>(); + + public List getProofs() { + return this.proofs; + } + + public void setProofs(List proofs) { + this.proofs = proofs; + } + + public byte[] encode() { + return ByteUtil.join( + Proto.encodeMessageArray(1, this.proofs)); + } + + public static MerkleProof decode(byte[] data) { + MerkleProof obj = new MerkleProof(); + int index = 0; + int order; + int length = data.length; + while (index < length) { + order = data[index] >> 3; + index++; + switch(order) { + case 1: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.proofs.add(CommitmentProof.decode(resp.res)); + break; + } + } + } + return obj; + } +} diff --git a/contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/MerkleRoot.java b/contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/MerkleRoot.java new file mode 100644 index 000000000..0e1bd3eed --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/MerkleRoot.java @@ -0,0 +1,42 @@ +package icon.proto.core.commitment; + +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ProtoMessage; + +public class MerkleRoot extends ProtoMessage { + private byte[] hash = new byte[0]; + + public byte[] getHash() { + return this.hash; + } + + public void setHash(byte[] hash) { + this.hash = hash; + } + + public byte[] encode() { + return ByteUtil.join( + Proto.encode(1, this.hash)); + } + + public static MerkleRoot decode(byte[] data) { + MerkleRoot obj = new MerkleRoot(); + int index = 0; + int order; + int length = data.length; + while (index < length) { + order = data[index] >> 3; + index++; + switch(order) { + case 1: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.hash = resp.res; + break; + } + } + } + return obj; + } +} diff --git a/contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/NonExistenceProof.java b/contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/NonExistenceProof.java new file mode 100644 index 000000000..91a9b37e5 --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/NonExistenceProof.java @@ -0,0 +1,76 @@ +package icon.proto.core.commitment; + +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ProtoMessage; + +public class NonExistenceProof extends ProtoMessage { + private byte[] key = new byte[0]; + + private ExistenceProof left = new ExistenceProof(); + + private ExistenceProof right = new ExistenceProof(); + + public byte[] getKey() { + return this.key; + } + + public void setKey(byte[] key) { + this.key = key; + } + + public ExistenceProof getLeft() { + return this.left; + } + + public void setLeft(ExistenceProof left) { + this.left = left; + } + + public ExistenceProof getRight() { + return this.right; + } + + public void setRight(ExistenceProof right) { + this.right = right; + } + + public byte[] encode() { + return ByteUtil.join( + Proto.encode(1, this.key), + Proto.encode(2, this.left), + Proto.encode(3, this.right)); + } + + public static NonExistenceProof decode(byte[] data) { + NonExistenceProof obj = new NonExistenceProof(); + int index = 0; + int order; + int length = data.length; + while (index < length) { + order = data[index] >> 3; + index++; + switch(order) { + case 1: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.key = resp.res; + break; + } + case 2: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.left = ExistenceProof.decode(resp.res); + break; + } + case 3: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.right = ExistenceProof.decode(resp.res); + break; + } + } + } + return obj; + } +} diff --git a/contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/ProofSpec.java b/contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/ProofSpec.java new file mode 100644 index 000000000..75e8d3b04 --- /dev/null +++ b/contracts/javascore/proto-lib/src/main/java/icon/proto/core/commitment/ProofSpec.java @@ -0,0 +1,112 @@ +package icon.proto.core.commitment; + +import ibc.icon.score.util.ByteUtil; +import ibc.icon.score.util.Proto; +import ibc.icon.score.util.ProtoMessage; +import java.lang.Boolean; +import java.math.BigInteger; + +public class ProofSpec extends ProtoMessage { + private LeafOp leafSpec = new LeafOp(); + + private InnerSpec innerSpec = new InnerSpec(); + + private BigInteger maxDepth = BigInteger.ZERO; + + private BigInteger minDepth = BigInteger.ZERO; + + private boolean prehashKeyBeforeComparison = false; + + public LeafOp getLeafSpec() { + return this.leafSpec; + } + + public void setLeafSpec(LeafOp leafSpec) { + this.leafSpec = leafSpec; + } + + public InnerSpec getInnerSpec() { + return this.innerSpec; + } + + public void setInnerSpec(InnerSpec innerSpec) { + this.innerSpec = innerSpec; + } + + public BigInteger getMaxDepth() { + return this.maxDepth; + } + + public void setMaxDepth(BigInteger maxDepth) { + this.maxDepth = maxDepth; + } + + public BigInteger getMinDepth() { + return this.minDepth; + } + + public void setMinDepth(BigInteger minDepth) { + this.minDepth = minDepth; + } + + public boolean getPrehashKeyBeforeComparison() { + return this.prehashKeyBeforeComparison; + } + + public void setPrehashKeyBeforeComparison(boolean prehashKeyBeforeComparison) { + this.prehashKeyBeforeComparison = prehashKeyBeforeComparison; + } + + public byte[] encode() { + return ByteUtil.join( + Proto.encode(1, this.leafSpec), + Proto.encode(2, this.innerSpec), + Proto.encode(3, this.maxDepth), + Proto.encode(4, this.minDepth), + Proto.encode(5, this.prehashKeyBeforeComparison)); + } + + public static ProofSpec decode(byte[] data) { + ProofSpec obj = new ProofSpec(); + int index = 0; + int order; + int length = data.length; + while (index < length) { + order = data[index] >> 3; + index++; + switch(order) { + case 1: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.leafSpec = LeafOp.decode(resp.res); + break; + } + case 2: { + Proto.DecodeResponse resp = Proto.decodeBytes(data, index); + index = resp.index; + obj.innerSpec = InnerSpec.decode(resp.res); + break; + } + case 3: { + Proto.DecodeResponse resp = Proto.decodeVarInt(data, index); + index = resp.index; + obj.maxDepth = resp.res; + break; + } + case 4: { + Proto.DecodeResponse resp = Proto.decodeVarInt(data, index); + index = resp.index; + obj.minDepth = resp.res; + break; + } + case 5: { + Proto.DecodeResponse resp = Proto.decodeBoolean(data, index); + index = resp.index; + obj.prehashKeyBeforeComparison = resp.res; + break; + } + } + } + return obj; + } +} diff --git a/contracts/javascore/score-util/src/main/java/ibc/icon/score/util/Proto.java b/contracts/javascore/score-util/src/main/java/ibc/icon/score/util/Proto.java index b1d0a96d4..0f176b3fa 100644 --- a/contracts/javascore/score-util/src/main/java/ibc/icon/score/util/Proto.java +++ b/contracts/javascore/score-util/src/main/java/ibc/icon/score/util/Proto.java @@ -64,10 +64,18 @@ public static DecodeResponse decodeEnum(byte[] data, int index) { public static DecodeResponse decodeVarInt(byte[] data, int index) { DecodeResponse resp = new DecodeResponse<>(); - DataSize dataSize = getDataSize(data, index); + long value = 0; + for (int shift = 0; shift < 64; shift += 7) { + final byte b = data[index]; + index++; + value |= (long) (b & 0x7F) << shift; + if ((b & 0x80) == 0) { + break; + } + } - resp.index = dataSize.index; - resp.res = BigInteger.valueOf(dataSize.length); + resp.index = index; + resp.res = BigInteger.valueOf(value); return resp; } @@ -162,7 +170,7 @@ public static byte[] encodeBooleanArray(int order, List items) { } public static byte[] encode(int order, Boolean item) { - if (item == null) { + if (item == null || item == false) { return new byte[0]; } diff --git a/contracts/javascore/settings.gradle b/contracts/javascore/settings.gradle index d669e3543..beb9a637f 100644 --- a/contracts/javascore/settings.gradle +++ b/contracts/javascore/settings.gradle @@ -13,6 +13,10 @@ include(':tendermint') project(':tendermint').projectDir = file("lightclients/tendermint") project(':tendermint').name = "tendermint" +include(':ics-08-tendermint') +project(':ics-08-tendermint').projectDir = file("lightclients/ics-08-tendermint") +project(':ics-08-tendermint').name = "ics-08-tendermint" + include(':mockclient') project(':mockclient').projectDir = file("lightclients/mockclient") project(':mockclient').name = "mockclient" diff --git a/proto/clients/tendermint/TendermintLight.proto b/proto/clients/tendermint/TendermintLight.proto new file mode 100644 index 000000000..1c802d95c --- /dev/null +++ b/proto/clients/tendermint/TendermintLight.proto @@ -0,0 +1,206 @@ +syntax = "proto3"; +package tendermint.light; + +option go_package = "libraries/go/common/tendermint;tendermint"; +import "gogoproto/gogo.proto"; + +message Fraction { + uint64 numerator = 1; + uint64 denominator = 2; +} + +// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Timestamp +message Duration { + int64 seconds = 1; + int32 nanos = 2; +} + +message Consensus { + uint64 block = 1; + uint64 app = 2; +} + +message ClientState { + option (gogoproto.goproto_getters) = false; + + string chain_id = 1; + Fraction trust_level = 2; + + // duration of the period since the LastestTimestamp during which the + // submitted headers are valid for upgrade + Duration trusting_period = 3; + // duration of the staking unbonding period + Duration unbonding_period = 4; + // defines how much new (untrusted) header's Time can drift into the future. + Duration max_clock_drift = 5; + // Block height when the client was frozen due to a misbehaviour + //ibc.core.client.v1.Height frozen_height = 6; + int64 frozen_height = 6; + // Latest height the client was updated to + int64 latest_height = 7; + // This flag, when set to true, will allow governance to recover a client + // which has expired + bool allow_update_after_expiry = 8; + // This flag, when set to true, will allow governance to unfreeze a client + // whose chain has experienced a misbehaviour event + bool allow_update_after_misbehaviour = 9; +} + +// ConsensusState defines the consensus state from Tendermint. +message ConsensusState { + option (gogoproto.goproto_getters) = false; + // timestamp that corresponds to the block height in which the ConsensusState + // was stored. + Timestamp timestamp = 1; + + // commitment root (i.e app hash) + MerkleRoot root = 2; + bytes next_validators_hash = 3; +} + +// MerkleRoot defines a merkle root hash. +// In the Cosmos SDK, the AppHash of a block header becomes the root. +message MerkleRoot { + bytes hash = 1; +} + +enum BlockIDFlag { + BLOCK_ID_FLAG_UNKNOWN = 0; + BLOCK_ID_FLAG_ABSENT = 1; + BLOCK_ID_FLAG_COMMIT = 2; + BLOCK_ID_FLAG_NIL = 3; +} + +enum SignedMsgType { + SIGNED_MSG_TYPE_UNKNOWN = 0; + // Votes + SIGNED_MSG_TYPE_PREVOTE = 1; + SIGNED_MSG_TYPE_PRECOMMIT = 2; + + // Proposals + SIGNED_MSG_TYPE_PROPOSAL = 32; +} + +message CanonicalPartSetHeader { + uint32 total = 1; + bytes hash = 2; +} + +message CanonicalBlockID { + bytes hash = 1; + CanonicalPartSetHeader part_set_header = 2; +} + +message CanonicalVote { + SignedMsgType type = 1; + sfixed64 height = 2; + sfixed64 round = 3; + BlockID block_id = 4; + Timestamp timestamp = 5; + string chain_id = 6; +} + +message Vote { + SignedMsgType type = 1; + int64 height = 2; + int32 round = 3; + BlockID block_id = 4; + Timestamp timestamp = 5; + bytes validator_address = 6; + int32 validator_index = 7; + bytes signature = 8; +} + +message ValidatorSet { + repeated Validator validators = 1; + Validator proposer = 2; + int64 total_voting_power = 3; +} + +message Validator { + bytes address = 1; + PublicKey pub_key = 2; + int64 voting_power = 3; + int64 proposer_priority = 4; +} + +message SimpleValidator { + PublicKey pub_key = 1; + int64 voting_power = 2; +} + +message PublicKey { + oneof sum { + bytes ed25519 = 1; + bytes secp256k1 = 2; + bytes sr25519 = 3; + } +} + +message PartSetHeader { + uint32 total = 1; + bytes hash= 2; +} + +message BlockID { + bytes hash = 1; + PartSetHeader part_set_header = 2; +} + +message Commit { + int64 height = 1; + int32 round = 2; + BlockID block_id = 3; + repeated CommitSig signatures = 4; +} + +// CommitSig is a part of the Vote included in a Commit. +message CommitSig { + BlockIDFlag block_id_flag = 1; + bytes validator_address = 2; + Timestamp timestamp = 3; + bytes signature = 4; +} + +message Timestamp { + // Represents seconds of UTC time since Unix epoch + // 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + // 9999-12-31T23:59:59Z inclusive. + int64 seconds = 1; + + // Non-negative fractions of a second at nanosecond resolution. Negative + // second values with fractions must still have non-negative nanos values + // that count forward in time. Must be from 0 to 999,999,999 + // inclusive. + int32 nanos = 2; +} + +message LightHeader { + Consensus version = 1; + string chain_id = 2; + int64 height = 3; + Timestamp time = 4; + BlockID last_block_id = 5; + bytes last_commit_hash = 6; // commit from validators from the last block + bytes data_hash = 7; // transactions + bytes validators_hash = 8; // validators for the current block + bytes next_validators_hash = 9; // validators for the next block + bytes consensus_hash = 10; // consensus params for current block + bytes app_hash = 11; // state after txs from the previous block + bytes last_results_hash = 12; // root hash of all results from the txs from the previous block + bytes evidence_hash = 13; // evidence included in the block + bytes proposer_address = 14; // original proposer of the block +} + +message SignedHeader { + LightHeader header = 1; + Commit commit = 2; +} + +message TmHeader { + SignedHeader signed_header = 1; + ValidatorSet validator_set = 2; + + int64 trusted_height = 3; + ValidatorSet trusted_validators = 4; +} From 68daa8cc563b14330d5c6583852bb5aba3ed4f2b Mon Sep 17 00:00:00 2001 From: gcranju <134275268+gcranju@users.noreply.github.com> Date: Mon, 1 Apr 2024 09:51:11 +0545 Subject: [PATCH 04/12] feat: add ics20-irc2 support (#852) --- contracts/javascore/ics20/build.gradle | 85 +++ .../main/java/ibc/ics20/ICS20Transfer.java | 508 ++++++++++++++++++ .../java/ibc/ics20/ICS20TransferTest.java | 446 +++++++++++++++ .../lib/src/main/java/ics20/ICS20Lib.java | 90 ++++ .../java/ibc/icon/score/util/StringUtil.java | 28 +- contracts/javascore/settings.gradle | 1 + 6 files changed, 1157 insertions(+), 1 deletion(-) create mode 100644 contracts/javascore/ics20/build.gradle create mode 100644 contracts/javascore/ics20/src/main/java/ibc/ics20/ICS20Transfer.java create mode 100644 contracts/javascore/ics20/src/test/java/ibc/ics20/ICS20TransferTest.java create mode 100644 contracts/javascore/lib/src/main/java/ics20/ICS20Lib.java diff --git a/contracts/javascore/ics20/build.gradle b/contracts/javascore/ics20/build.gradle new file mode 100644 index 000000000..b6254c930 --- /dev/null +++ b/contracts/javascore/ics20/build.gradle @@ -0,0 +1,85 @@ +version = '0.1.0' + +dependencies { + implementation project(':lib') + implementation project(':score-util') + implementation project(':proto-lib') + implementation "com.github.sink772:minimal-json:0.9.6" + testImplementation project(':test-lib') +} + + +test { + useJUnitPlatform() + finalizedBy jacocoTestReport +} + +jacocoTestReport { + dependsOn test + reports { + xml.required = true + csv.required = false + html.outputLocation = layout.buildDirectory.dir('jacocoHtml') + } +} + +optimizedJar { + dependsOn(project(':lib').jar) + dependsOn(project(':score-util').jar) + dependsOn(project(':proto-lib').jar) + mainClassName = 'ibc.ics20.ICS20Transfer' + duplicatesStrategy = DuplicatesStrategy.EXCLUDE + from { + configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } + } +} + +deployJar { + endpoints { + berlin { + uri = 'https://berlin.net.solidwallet.io/api/v3' + nid = 0x7 + } + lisbon { + uri = 'https://lisbon.net.solidwallet.io/api/v3' + nid = 0x2 + } + local { + uri = 'http://localhost:9082/api/v3' + nid = 0x3 + } + uat { + uri = project.findProperty('uat.host') as String + nid = property('uat.nid') as Integer + to = "$xCallConnection"?:null + } + } + keystore = rootProject.hasProperty('keystoreName') ? "$keystoreName" : '' + password = rootProject.hasProperty('keystorePass') ? "$keystorePass" : '' + parameters { + arg('_ibcHandler', "$ibcCore") + arg('_serializeIrc2', "") + } +} + +task integrationTest(type: Test) { + useJUnitPlatform() + + rootProject.allprojects { + if (it.getTasks().findByName('optimizedJar')) { + dependsOn(it.getTasks().getByName('optimizedJar')) + } + } + + options { + testLogging.showStandardStreams = true + description = 'Runs integration tests.' + group = 'verification' + + testClassesDirs = sourceSets.intTest.output.classesDirs + classpath = sourceSets.intTest.runtimeClasspath + + systemProperty "java", optimizedJar.outputJarName + } + +} diff --git a/contracts/javascore/ics20/src/main/java/ibc/ics20/ICS20Transfer.java b/contracts/javascore/ics20/src/main/java/ibc/ics20/ICS20Transfer.java new file mode 100644 index 000000000..5363f34d1 --- /dev/null +++ b/contracts/javascore/ics20/src/main/java/ibc/ics20/ICS20Transfer.java @@ -0,0 +1,508 @@ +package ibc.ics20; + +import com.eclipsesource.json.Json; +import com.eclipsesource.json.JsonObject; +import com.eclipsesource.json.JsonValue; + +import icon.proto.core.channel.Channel; +import icon.proto.core.channel.Packet; +import icon.proto.core.client.Height; +import ics20.ICS20Lib; +import score.Address; +import score.Context; +import score.DictDB; +import score.VarDB; +import score.annotation.External; +import score.annotation.Optional; +import score.annotation.Payable; +import icon.ibc.interfaces.IIBCModule; + + +import java.math.BigInteger; + +public class ICS20Transfer implements IIBCModule { + public static final String TAG = "ICS20"; + public static final String ICS20_VERSION = "ics20-1"; + + private final DictDB destinationPort = Context.newDictDB("destinationPort", String.class); + private final DictDB destinationChannel = Context.newDictDB("destinationChannel", String.class); + + private final VarDB
ibcHandler = Context.newVarDB("ibcHandler", Address.class); + private final DictDB tokenContracts = Context.newDictDB("tokenContracts", Address.class); + private final VarDB
admin = Context.newVarDB("admin", Address.class); + + public final byte[] serializedIrc2; + + public ICS20Transfer(Address _ibcHandler, byte[] _serializeIrc2) { + if (ibcHandler.get() == null) { + ibcHandler.set(_ibcHandler); + admin.set(Context.getCaller()); + } + serializedIrc2 = _serializeIrc2; + } + + /** + * Set the admin address and ensure only admin can call this function. + * + * @param _admin the new admin address + * @return void + */ + @External + public void setAdmin(Address _admin) { + onlyAdmin(); + admin.set(_admin); + } + + /** + * Retrieves the admin address. + * + * @return the admin address + */ + @External(readonly = true) + public Address getAdmin() { + return admin.get(); + } + + /** + * Retrieves the IBC handler address. + * + * @return the IBC handler address + */ + @External(readonly = true) + public Address getIBCAddress() { + return ibcHandler.get(); + } + + /** + * Retrieves the destination port for the given channel ID. + * + * @param channelId the source channel id + * @return the destination port associated with the channel ID + */ + @External(readonly = true) + public String getDestinationPort(String channelId) { + return destinationPort.get(channelId); + } + + /** + * Retrieves the destination channel for the given channel ID. + * + * @param channelId the source channel id + * @return the destination channel associated with the channel ID + */ + @External(readonly = true) + public String getDestinationChannel(String channelId) { + return destinationChannel.get(channelId); + } + + /** + * Retrieves the token contract address for the given denom. + * + * @param denom the token denom + * @return the token contract address + */ + @External(readonly = true) + public Address getTokenContractAddress(String denom) { + Context.require(tokenContracts.get(denom) != null, TAG + " : Token not registered"); + return tokenContracts.get(denom); + } + + /** + * Register a token contract for cosmos chain. + * + * @param name + * @param symbol + * @param decimals + */ + @External + public void registerCosmosToken(String name, String symbol, int decimals) { + onlyAdmin(); + Address tokenAddress = Context.deploy(serializedIrc2, name, symbol, decimals); + tokenContracts.set(name, tokenAddress); + } + + /** + * Register a token contract for icon chain. + * + * @param tokenAddress the irc2 token contract address + */ + @External + public void registerIconToken(Address tokenAddress) { + onlyAdmin(); + tokenContracts.set(tokenAddress.toString(), tokenAddress); + } + + /** + * Fallback function for token transfer. + * + * @param from Sender address + * @param value Amount + * @param _data Data in json bytes in format of + * { + * "method": "sendFungibleTokens", + * "params": { + * "denomination": "string", + * "amount": "uint64", + * "sender": "string", + * "receiver": "string", + * "sourcePort": "string", + * "sourceChannel": "string", + * "timeoutHeight": { + * "latestHeight": "uint64", + * "revisionNumber": "uint64", + * }, + * "timeoutTimestamp": "uint64", + * "memo":"string" + * } + * } + * + */ + @External + public void tokenFallback(Address from, BigInteger value, byte[] _data) { + String method = ""; + JsonValue params = null; + + try { + String data = new String(_data); + JsonObject json = Json.parse(data).asObject(); + + method = json.get("method").asString(); + params = json.get("params"); + } catch (Exception e) { + Context.revert(TAG + " Invalid data: " + _data.toString()); + } + + if (method.equals("sendFungibleTokens")) { + JsonObject fungibleToken = params.asObject(); + String denomination = fungibleToken.getString("denomination", ""); + BigInteger amount = BigInteger.valueOf(fungibleToken.getLong("amount", 0)); + String sender = fungibleToken.getString("sender", ""); + String receiver = fungibleToken.getString("receiver", ""); + String sourcePort = fungibleToken.getString("sourcePort", ""); + String sourceChannel = fungibleToken.getString("sourceChannel", ""); + BigInteger timeoutTimestamp = BigInteger.valueOf(fungibleToken.getLong("timeoutTimestamp", 0)); + String memo = fungibleToken.getString("memo", ""); + + JsonObject timeoutHeight = fungibleToken.get("timeoutHeight").asObject(); + Height height = new Height(); + height.setRevisionNumber(BigInteger.valueOf(timeoutHeight.getLong("revisionNumber", 0))); + height.setRevisionHeight(BigInteger.valueOf(timeoutHeight.getLong("latestHeight", 0))); + + Context.require(amount.equals(value), TAG + " : Mismatched amount"); + Context.require(sender.equals(from.toString()), TAG + " : Sender address mismatched"); + Context.require(tokenContracts.get(denomination) == Context.getCaller(), + TAG + " : Sender Token Contract not registered"); + + sendFungibleToken(denomination, amount, sender, receiver, sourcePort, sourceChannel, height, + timeoutTimestamp, memo); + } else { + Context.revert(TAG + " : Unknown method"); + } + + } + + /** + * Sends ICX to the specified receiver via the specified channel and port. + * + * @param receiver the cross chain address of the receiver + * @param sourcePort the source port + * @param sourceChannel the source channel + * @param timeoutHeight the timeout height + * @param timeoutTimestamp the timeout timestamp + * @param memo an optional memo + */ + @Payable + @External + public void sendICX(String receiver, String sourcePort, String sourceChannel, Height timeoutHeight, + BigInteger timeoutTimestamp, @Optional String memo) { + Context.require(Context.getValue().compareTo(BigInteger.ZERO) > 0, + TAG + " : ICX amount should be greater than 0"); + + sendFungibleToken("icx", Context.getValue(), Context.getCaller().toString(), receiver, sourcePort, + sourceChannel, timeoutHeight, timeoutTimestamp, memo); + + } + + /** + * Sends a irc2 token from the sender to the receiver. + * + * @param denomination the denomination of the token to send + * @param amount the amount of the token to send + * @param sender the address of the sender + * @param receiver the cross chain address of the receiver + * @param sourcePort the source port + * @param sourceChannel the source channel + * @param timeoutHeight the timeout height(latest height and revision number) + * @param timeoutTimestamp the timeout timestamp + * @param memo an optional memo for the transaction + */ + private void sendFungibleToken(String denomination, BigInteger amount, String sender, String receiver, + String sourcePort, String sourceChannel, Height timeoutHeight, BigInteger timeoutTimestamp, + @Optional String memo) { + String denomPrefix = getDenomPrefix(sourcePort, sourceChannel); + boolean isSource = !denomination.startsWith(denomPrefix); + + if (!isSource) { + Address tokenContractAddress = getTokenContractAddress(denomination); + Context.call(tokenContractAddress, "burn", amount); + } + + byte[] data = ICS20Lib.marshalFungibleTokenPacketData(denomination, amount, sender, receiver, memo); + + String destPort = destinationPort.get(sourceChannel); + String destChannel = destinationChannel.get(sourceChannel); + + if (destChannel == null || destPort == null) { + Context.revert(TAG + " : Connection not properly Configured"); + } + + BigInteger seq = Context.call(BigInteger.class, ibcHandler.get(), "getNextSequenceSend", sourcePort, + sourceChannel); + + Packet newPacket = new Packet(); + + newPacket.setSequence(seq); + newPacket.setSourcePort(sourcePort); + newPacket.setSourceChannel(sourceChannel); + newPacket.setDestinationPort(destPort); + newPacket.setDestinationChannel(destChannel); + newPacket.setTimeoutHeight(timeoutHeight); + newPacket.setTimeoutTimestamp(timeoutTimestamp); + newPacket.setData(data); + + Context.call(ibcHandler.get(), "sendPacket", newPacket.encode()); + } + + /** + * Handles the reception of a packet + * + * @param packet the byte array representation of the packet to be processed + * @param relayer the address of the relayer + * @return a byte array representing the acknowledgement of the packet + * processing + */ + @External + public byte[] onRecvPacket(byte[] packet, Address relayer) { + onlyIBC(); + Packet packetDb = Packet.decode(packet); + ICS20Lib.FungibleTokenPacketData data; + + try { + data = ICS20Lib.unmarshalFungibleTokenPacketData(packetDb.getData()); + Context.require(!data.denom.equals("") && !data.receiver.equals("") && !data.sender.equals("") + && data.amount.compareTo(BigInteger.ZERO) > 0); + } catch (Exception e) { + return ICS20Lib.FAILED_ACKNOWLEDGEMENT_JSON; + } + + String denomPrefix = getDenomPrefix(packetDb.getSourcePort(), packetDb.getSourceChannel()); + boolean isSource = data.denom.startsWith(denomPrefix); + + byte[] ack = ICS20Lib.SUCCESSFUL_ACKNOWLEDGEMENT_JSON; + + if (!checkIfReceiverIsAddress(data.receiver)) { + return ICS20Lib.FAILED_ACKNOWLEDGEMENT_JSON; + } + + Address receiverAddr = Address.fromString(data.receiver); + + try { + if (isSource) { + String denomOnly = data.denom.substring(denomPrefix.length()); + handleSourceToken(denomOnly, receiverAddr, data.amount, data.memo); + } else { + denomPrefix = getDenomPrefix(packetDb.getDestinationPort(), packetDb.getDestinationChannel()); + String prefixedDenom = denomPrefix + data.denom; + handleDestinationToken(prefixedDenom, receiverAddr, data.amount); + } + } catch (Exception e) { + ack = ICS20Lib.FAILED_ACKNOWLEDGEMENT_JSON; + } + + return ack; + } + + /** + * Handles the acknowledgement of a packet. + * + * @param packet the packet being acknowledged + * @param acknowledgement the acknowledgement received + * @param relayer the relayer of the packet + */ + @External + public void onAcknowledgementPacket(byte[] packet, byte[] acknowledgement, Address relayer) { + onlyIBC(); + if (!acknowledgement.equals(ICS20Lib.SUCCESSFUL_ACKNOWLEDGEMENT_JSON)) { + Packet packetDb = Packet.decode(packet); + refundTokens(packetDb); + } + } + + /** + * Handles the timeout of a packet by refunding the tokens associated with the + * packet. + * + * @param packet the encoded packet data + * @param relayer the address of the relayer + */ + @External + public void onTimeoutPacket(byte[] packet, Address relayer) { + Packet packetDb = Packet.decode(packet); + refundTokens(packetDb); + } + + /** + * Refunds tokens based on the provided packet. + * + * @param packet the packet containing the token data + */ + private void refundTokens(Packet packet) { + ICS20Lib.FungibleTokenPacketData data = ICS20Lib.unmarshalFungibleTokenPacketData(packet.getData()); + + String denomPrefix = getDenomPrefix(packet.getSourcePort(), packet.getSourceChannel()); + boolean isSource = !data.denom.startsWith(denomPrefix); + + Address sender = Address.fromString(data.sender); + + if (isSource) { + handleSourceToken(data.denom, sender, data.amount, data.memo); + } else { + handleDestinationToken(data.denom, sender, data.amount); + } + } + + private void handleSourceToken(String denom, Address address, BigInteger amount, String memo) { + if (isNativeAsset(denom)) { + Context.transfer(address, amount); + } else { + Address tokenContractAddress = getTokenContractAddress(denom); + Context.call(tokenContractAddress, "transfer", address, amount, memo.getBytes()); + } + } + + private void handleDestinationToken(String denom, Address address, BigInteger amount) { + Address tokenContractAddress = getTokenContractAddress(denom); + Context.call(tokenContractAddress, "mint", address, amount); + } + + /** + * Initializes the channel opening process. + * + * @param order the order of the channel + * @param connectionHops the connection hops for the channel + * @param portId the port ID for the channel + * @param channelId the channel ID + * @param counterpartyPb the counterparty information + * @param version the version of the channel + */ + @External + public void onChanOpenInit(int order, String[] connectionHops, String portId, String channelId, + byte[] counterpartyPb, String version) { + onlyIBC(); + Context.require(order == Channel.Order.ORDER_UNORDERED, TAG + " : must be unordered"); + Context.require(version.equals(ICS20_VERSION), TAG + " : version should be same with ICS20_VERSION"); + Channel.Counterparty counterparty = Channel.Counterparty.decode(counterpartyPb); + destinationPort.set(channelId, counterparty.getPortId()); + } + + /** + * Channel Opening Process + * + * @param order the order of the channel + * @param connectionHops an array of connection hops + * @param portId the port ID + * @param channelId the channel ID + * @param counterpartyPb the counterparty in protobuf format + * @param version the version + * @param counterPartyVersion the counterparty version + */ + @External + public void onChanOpenTry(int order, String[] connectionHops, String portId, String channelId, + byte[] counterpartyPb, String version, String counterPartyVersion) { + onlyIBC(); + Context.require(order == Channel.Order.ORDER_UNORDERED, TAG + " : must be unordered"); + Context.require(counterPartyVersion.equals(ICS20_VERSION), + TAG + " : version should be same with ICS20_VERSION"); + Channel.Counterparty counterparty = Channel.Counterparty.decode(counterpartyPb); + destinationPort.set(channelId, counterparty.getPortId()); + destinationChannel.set(channelId, counterparty.getChannelId()); + } + + /** + * Handles the acknowledged by the counterparty. + * + * @param portId the identifier of the port on this chain + * @param channelId the identifier of the channel that was opened + * @param counterpartyChannelId the identifier of the channel on the + * counterparty chain + * @param counterPartyVersion the version of the ICS20 protocol used by the + * counterparty + */ + @External + public void onChanOpenAck(String portId, String channelId, String counterpartyChannelId, + String counterPartyVersion) { + onlyIBC(); + Context.require(counterPartyVersion.equals(ICS20_VERSION), + TAG + " : version should be same with ICS20_VERSION"); + destinationChannel.set(channelId, counterpartyChannelId); + } + + /** + * Handles the confirmation of a channel. + * + * @param portId the identifier of the port on this chain + * @param channelId the identifier of the channel that was opened + */ + @External + public void onChanOpenConfirm(String portId, String channelId) { + onlyIBC(); + } + + /** + * Handles the closure of a channel. + * + * @param portId the identifier of the port on this chain + * @param channelId the identifier of the channel that was opened + */ + @External + public void onChanCloseInit(String portId, String channelId) { + Context.revert(TAG + " : Not Allowed"); + } + + /** + * Handles the closing of a channel. + * + * @param portId the identifier of the port on this chain + * @param channelId the identifier of the channel that was opened + */ + @External + public void onChanCloseConfirm(String portId, String channelId) { + onlyIBC(); + } + + private static String getDenomPrefix(String port, String channel) { + return port + "/" + channel + "/"; + } + + private void onlyAdmin() { + Context.require(Context.getCaller().equals(admin.get()), TAG + " : Caller is not admin"); + } + + private void onlyIBC() { + Context.require(Context.getCaller().equals(getIBCAddress()), TAG + " : Caller is not IBC Contract"); + } + + private boolean isNativeAsset(String denom) { + return denom.equals("icx"); + } + + private static boolean checkIfReceiverIsAddress(String receiver) { + try { + Address.fromString(receiver); + return true; + } catch (Exception e) { + return false; + } + } + +} diff --git a/contracts/javascore/ics20/src/test/java/ibc/ics20/ICS20TransferTest.java b/contracts/javascore/ics20/src/test/java/ibc/ics20/ICS20TransferTest.java new file mode 100644 index 000000000..47e6942b9 --- /dev/null +++ b/contracts/javascore/ics20/src/test/java/ibc/ics20/ICS20TransferTest.java @@ -0,0 +1,446 @@ +package ibc.ics20; + +import com.eclipsesource.json.JsonObject; +import com.iconloop.score.test.Account; +import com.iconloop.score.test.Score; +import com.iconloop.score.test.ServiceManager; +import com.iconloop.score.test.TestBase; + +import icon.ibc.interfaces.IIBCHandler; +import icon.ibc.interfaces.IIBCHandlerScoreInterface; +import ibc.icon.test.MockContract; +import icon.proto.core.channel.Channel; +import icon.proto.core.channel.Packet; +import icon.proto.core.client.Height; +import ics20.ICS20Lib; + +import java.lang.String; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.mockito.MockedStatic; +import score.Address; +import score.Context; + +import java.math.BigInteger; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import org.junit.jupiter.api.function.Executable; +import org.mockito.Mockito; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.*; + +class ICS20TransferTest extends TestBase { + private static final ServiceManager sm = getServiceManager(); + + private static final Account owner = sm.createAccount(); + private static final Account admin = sm.createAccount(); + private static final Account user = sm.createAccount(); + private static final Account sender = sm.createAccount(); + private static final Account relayer = sm.createAccount(); + private static final Address receiver = sm.createAccount().getAddress(); + + private static final Account dest_irc2_token = Account.newScoreAccount(1); + + private static final Account src_irc2_token = Account.newScoreAccount(2); + + // private MockContract token1 = new + // MockContract<>(IRC2ScoreInterface.class, IRC2.class, sm, owner); + + private Score ics20Transfer; + private ICS20Transfer ics20TransferSpy; + private MockContract ibcHandler; + public static final String TAG = "ICS20"; + protected static String port = "transfer"; + protected static int ORDER = Channel.Order.ORDER_UNORDERED; + public static final String ICS20_VERSION = "ics20-1"; + + private final byte[] irc2Bytes = "test".getBytes(); + + @BeforeEach + void setup() throws Exception { + ibcHandler = new MockContract<>(IIBCHandlerScoreInterface.class, IIBCHandler.class, sm, owner); + ics20Transfer = sm.deploy(owner, ICS20Transfer.class, ibcHandler.getAddress(), irc2Bytes); + ics20TransferSpy = (ICS20Transfer) spy(ics20Transfer.getInstance()); + ics20Transfer.setInstance(ics20TransferSpy); + + ics20Transfer.invoke(owner, "setAdmin", admin.getAddress()); + + channelOpenInit("connection-0", "transfer", "channel-0"); + channelOpenAck("channel-0", "channel-1"); + + registerCosmosToken(admin, "transfer/channel-0/dest_irc2_token", "Arch", 18, dest_irc2_token); + ics20Transfer.invoke(admin, "registerIconToken", src_irc2_token.getAddress()); + + } + + @Test + void testGetIBCAddress() { + assertEquals(ibcHandler.getAddress(), ics20Transfer.call("getIBCAddress")); + } + + @Test + void testAdmin() { + assertEquals(admin.getAddress(), ics20Transfer.call("getAdmin")); + + Executable setAdmin = () -> ics20Transfer.invoke(owner, "setAdmin", + owner.getAddress()); + expectErrorMessage(setAdmin, "Reverted(0): ICS20 : Caller is not admin"); + + ics20Transfer.invoke(admin, "setAdmin", owner.getAddress()); + assertEquals(owner.getAddress(), ics20Transfer.call("getAdmin")); + } + + @Test + void testRegisterCosmosToken() { + Executable cosmosToken = () -> ics20Transfer.invoke(user, + "registerCosmosToken", "test", "test", 0); + expectErrorMessage(cosmosToken, "Reverted(0): ICS20 : Caller is not admin"); + + registerCosmosToken(admin, "abc", "ab", 18, dest_irc2_token); + + assertEquals(dest_irc2_token.getAddress(), + ics20Transfer.call("getTokenContractAddress", "abc")); + } + + @Test + void testRegisterIconToken() { + Executable icon = () -> ics20Transfer.invoke(user, "registerIconToken", + src_irc2_token.getAddress()); + expectErrorMessage(icon, "Reverted(0): ICS20 : Caller is not admin"); + + ics20Transfer.invoke(admin, "registerIconToken", + src_irc2_token.getAddress()); + assertEquals(src_irc2_token.getAddress(), + ics20Transfer.call("getTokenContractAddress", + src_irc2_token.getAddress().toString())); + } + + @Test + void testTokenFallbackExceptions() { + byte[] data = "test".getBytes(); + Executable tokenFallback = () -> ics20Transfer.invoke(user, "tokenFallback", + user.getAddress(), BigInteger.ZERO, data); + expectErrorMessage(tokenFallback, "Reverted(0): ICS20 Invalid data: " + + data.toString()); + + byte[] data2 = createByteArray("method", "iconToken", ICX, + sender.getAddress().toString(), admin.getAddress().toString(), "transfer", + "channel-0", BigInteger.ONE, BigInteger.ONE, BigInteger.valueOf(10000), + "memo"); + tokenFallback = () -> ics20Transfer.invoke(user, "tokenFallback", + user.getAddress(), BigInteger.ZERO, data2); + expectErrorMessage(tokenFallback, "Reverted(0): ICS20 : Unknown method"); + + byte[] data3 = createByteArray("sendFungibleTokens", "iconToken", ICX, + sender.getAddress().toString(), admin.getAddress().toString(), "transfer", + "channel-0", BigInteger.ONE, BigInteger.ONE, BigInteger.valueOf(10000), + "memo"); + tokenFallback = () -> ics20Transfer.invoke(user, "tokenFallback", + user.getAddress(), BigInteger.ZERO, data3); + expectErrorMessage(tokenFallback, "Reverted(0): ICS20 : Mismatched amount"); + + byte[] data4 = createByteArray("sendFungibleTokens", "iconToken", ICX, + sender.getAddress().toString(), admin.getAddress().toString(), "transfer", + "channel-0", BigInteger.ONE, BigInteger.ONE, BigInteger.valueOf(10000), + "memo"); + tokenFallback = () -> ics20Transfer.invoke(user, "tokenFallback", + user.getAddress(), ICX, data4); + expectErrorMessage(tokenFallback, "Reverted(0): ICS20 : Sender address mismatched"); + + byte[] data5 = createByteArray("sendFungibleTokens", "iconToken", ICX, + sender.getAddress().toString(), admin.getAddress().toString(), "transfer", + "channel-0", BigInteger.ONE, BigInteger.ONE, BigInteger.valueOf(10000), + "memo"); + tokenFallback = () -> ics20Transfer.invoke(user, "tokenFallback", + sender.getAddress(), ICX, data5); + expectErrorMessage(tokenFallback, "Reverted(0): ICS20 : Sender Token Contract not registered"); + + } + + @Test + void testTokenFallbackSourceToken() { + + byte[] data4 = createByteArray("sendFungibleTokens", + src_irc2_token.getAddress().toString(), ICX, sender.getAddress().toString(), + admin.getAddress().toString(), "transfer", "channel-0", BigInteger.ONE, + BigInteger.ONE, BigInteger.valueOf(10000), "memo"); + + try (MockedStatic contextMock = Mockito.mockStatic(Context.class, + Mockito.CALLS_REAL_METHODS)) { + contextMock.when(() -> Context.call(BigInteger.class, ibcHandler.getAddress(), + "getNextSequenceSend", "transfer", + "channel-0")).thenReturn(BigInteger.ONE); + contextMock.when(() -> Context.call(eq(ibcHandler.getAddress()), + eq("sendPacket"), any())).thenReturn(true); + + ics20Transfer.invoke(src_irc2_token, "tokenFallback", sender.getAddress(), + ICX, data4); + } + + } + + @Test + void testTokenFallbackDestToken() { + + byte[] data4 = createByteArray("sendFungibleTokens", + "transfer/channel-0/dest_irc2_token", ICX, sender.getAddress().toString(), + admin.getAddress().toString(), "transfer", "channel-0", BigInteger.ONE, + BigInteger.ONE, BigInteger.valueOf(10000), "memo"); + + try (MockedStatic contextMock = Mockito.mockStatic(Context.class, + Mockito.CALLS_REAL_METHODS)) { + contextMock.when(() -> Context.call(BigInteger.class, ibcHandler.getAddress(), + "getNextSequenceSend", "transfer", + "channel-0")).thenReturn(BigInteger.ONE); + contextMock.when(() -> Context.call(eq(ibcHandler.getAddress()), + eq("sendPacket"), any())).thenReturn(true); + contextMock.when(() -> Context.call(dest_irc2_token.getAddress(), "burn", + ICX)).thenReturn(true); + + ics20Transfer.invoke(dest_irc2_token, "tokenFallback", sender.getAddress(), + ICX, data4); + } + + } + + @Test + void testSendICX() { + BigInteger amount = BigInteger.TEN.multiply(ICX); + try (MockedStatic contextMock = Mockito.mockStatic(Context.class, + Mockito.CALLS_REAL_METHODS)) { + contextMock.when(() -> Context.getValue()).thenReturn(amount); + // for the non configured port or channel id + Executable sendICX = () -> ics20Transfer.invoke(sender, "sendICX", + receiver.toString(), "transfer", "channel-1", new Height(), amount, "memo"); + expectErrorMessage(sendICX, "Reverted(0): ICS20 : Connection not properly Configured"); + } + + try (MockedStatic contextMock = Mockito.mockStatic(Context.class, + Mockito.CALLS_REAL_METHODS)) { + contextMock.when(() -> Context.getValue()).thenReturn(amount); + contextMock.when(() -> Context.call(BigInteger.class, ibcHandler.getAddress(), + "getNextSequenceSend", "transfer", + "channel-0")).thenReturn(BigInteger.ONE); + contextMock.when(() -> Context.call(eq(ibcHandler.getAddress()), + eq("sendPacket"), any())).thenReturn(true); + + ics20Transfer.invoke(admin, "registerIconToken", + src_irc2_token.getAddress()); + ics20Transfer.invoke(sender, "sendICX", receiver.toString(), "transfer", + "channel-0", new Height(), amount, "memo"); + } + + } + + @Test + void testOnRecvPacket_icx() { + + try (MockedStatic contextMock = Mockito.mockStatic(Context.class, Mockito.CALLS_REAL_METHODS)) { + contextMock.when(() -> Context.transfer(receiver, ICX)).then(invocationOnMock -> null); + _onRecvPacket(ICX, "transfer/channel-1/icx"); + } + } + + @Test + void testOnRecvPacket_source() { + try (MockedStatic contextMock = Mockito.mockStatic(Context.class, Mockito.CALLS_REAL_METHODS)) { + contextMock + .when(() -> Context.call(src_irc2_token.getAddress(), "transfer", receiver, ICX, + "memo".getBytes())) + .thenReturn(true); + + _onRecvPacket(ICX, "transfer/channel-1/" + src_irc2_token.getAddress().toString()); + } + + } + + @Test + void testOnRecvPacket_dest() { + try (MockedStatic contextMock = Mockito.mockStatic(Context.class, Mockito.CALLS_REAL_METHODS)) { + contextMock + .when(() -> Context.call(dest_irc2_token.getAddress(), "mint", receiver, ICX)) + .thenReturn(true); + _onRecvPacket(ICX, "dest_irc2_token"); + } + + } + + @Test + void testOnAcknowledgement_successful() { + + Packet packet = _onRefundPacket(ICX, "src_irc2_token"); + Executable e = () -> ics20Transfer.invoke(admin, "onAcknowledgementPacket", + packet.encode(), ICS20Lib.SUCCESSFUL_ACKNOWLEDGEMENT_JSON, + relayer.getAddress()); + expectErrorMessage(e, "Reverted(0): ICS20 : Caller is not IBC Contract"); + + ics20Transfer.invoke(ibcHandler.account, "onAcknowledgementPacket", + packet.encode(), ICS20Lib.SUCCESSFUL_ACKNOWLEDGEMENT_JSON, + relayer.getAddress()); + + } + + @Test + void testOnAcknowledgement_failure_icx() { + + Packet packet = _onRefundPacket(ICX, "icx"); + + try (MockedStatic contextMock = Mockito.mockStatic(Context.class, + Mockito.CALLS_REAL_METHODS)) { + contextMock.when(() -> Context.transfer(sender.getAddress(), + ICX)).then(invocationOnMock -> null); + ics20Transfer.invoke(ibcHandler.account, "onAcknowledgementPacket", + packet.encode(), ICS20Lib.FAILED_ACKNOWLEDGEMENT_JSON, relayer.getAddress()); + } + + } + + @Test + void testOnAcknowledgement_failure_source_token() { + + Packet packet = _onRefundPacket(ICX, src_irc2_token.getAddress().toString()); + + try (MockedStatic contextMock = Mockito.mockStatic(Context.class, + Mockito.CALLS_REAL_METHODS)) { + contextMock + .when(() -> Context.call(src_irc2_token.getAddress(), "transfer", sender.getAddress(), ICX, + "memo".getBytes())) + .thenReturn(true); + contextMock.when(() -> Context.call(any(), any(), any())).thenReturn(true); + + ics20Transfer.invoke(ibcHandler.account, "onAcknowledgementPacket", + packet.encode(), ICS20Lib.FAILED_ACKNOWLEDGEMENT_JSON, relayer.getAddress()); + } + + } + + @Test + void testOnTimeOutPacket_dest_token() { + + Packet packet = _onRefundPacket(ICX, "transfer/channel-0/dest_irc2_token"); + + try (MockedStatic contextMock = Mockito.mockStatic(Context.class, + Mockito.CALLS_REAL_METHODS)) { + contextMock.when(() -> Context.call(BigInteger.class, ibcHandler.getAddress(), + "getNextSequenceSend", "transfer", + "channel-0")).thenReturn(BigInteger.ONE); + contextMock.when(() -> Context.call(dest_irc2_token.getAddress(), + "mint", sender.getAddress(), ICX)).thenReturn(true); + + ics20Transfer.invoke(ibcHandler.account, "onTimeoutPacket", packet.encode(), + relayer.getAddress()); + } + } + + void _onRecvPacket(BigInteger amount, String denom) { + String source_channel = "channel-1"; + String dest_channel = "channel-0"; + Packet packet = createPacket(denom, amount, "sender", receiver.toString(), source_channel, dest_channel); + ics20Transfer.invoke(ibcHandler.account, "onRecvPacket", packet.encode(), relayer.getAddress()); + } + + Packet _onRefundPacket(BigInteger amount, String denom) { + String source_channel = "channel-0"; + String dest_channel = "channel-1"; + Packet packet = createPacket(denom, amount, sender.getAddress().toString(), "receiver", source_channel, + dest_channel); + return packet; + } + + private Packet createPacket(String denom, BigInteger amount, String sender, String receiver, String source_channel, + String dest_channel) { + + Height timeOutHeight = new Height(); + timeOutHeight.setRevisionHeight(BigInteger.valueOf(sm.getBlock().getHeight())); + timeOutHeight.setRevisionNumber(BigInteger.ONE); + + String data = "{" + + "\"amount\":\"" + ICX.toString() + "\"," + + "\"denom\":\"" + denom + "\"," + + "\"receiver\":\"" + receiver + "\"," + + "\"sender\":\"" + sender + "\"," + + "\"memo\":\"" + "memo" + "\"" + + "}"; + + Packet packet = new Packet(); + packet.setSequence(BigInteger.ONE); + packet.setSourcePort("transfer"); + packet.setSourceChannel(source_channel); + packet.setDestinationPort("transfer"); + packet.setDestinationChannel(dest_channel); + packet.setTimeoutHeight(timeOutHeight); + packet.setTimeoutTimestamp(BigInteger.valueOf(10000)); + packet.setData(data.getBytes()); + + return packet; + + } + + private void expectErrorMessage(Executable executable, String expectedErrorMessage) { + AssertionError e = assertThrows(AssertionError.class, executable); + assertEquals(expectedErrorMessage, e.getMessage()); + } + + private void registerCosmosToken(Account deployer, String name, String symbol, int decimals, Account token) { + try (MockedStatic contextMock = Mockito.mockStatic(Context.class, Mockito.CALLS_REAL_METHODS)) { + contextMock.when(() -> Context.deploy(irc2Bytes, name, symbol, decimals)).thenReturn(token.getAddress()); + ics20Transfer.invoke(deployer, "registerCosmosToken", name, symbol, decimals); + } + } + + private byte[] createByteArray(String methodName, String denomination, BigInteger amount, String sender, + String receiver, String sourcePort, String sourceChannel, BigInteger latestHeight, + BigInteger revisionNumber, BigInteger timeoutTimestamp, String memo) { + + JsonObject timeoutHeight = new JsonObject() + .add("latestHeight", latestHeight.longValue()) + .add("revisionNumber", revisionNumber.longValue()); + + JsonObject internalParameters = new JsonObject() + .add("denomination", denomination.toString()) + .add("amount", amount.longValue()) + .add("sender", sender.toString()) + .add("receiver", receiver.toString()) + .add("sourcePort", sourcePort.toString()) + .add("sourceChannel", sourceChannel.toString()) + .add("timeoutHeight", timeoutHeight) + .add("timeoutTimestamp", timeoutTimestamp.longValue()) + .add("memo", memo.toString()); + + JsonObject jsonData = new JsonObject() + .add("method", methodName.toString()) + .add("params", internalParameters); + + return jsonData.toString().getBytes(); + } + + public void channelOpenInit(String connectionId, String counterpartyPort, String channelId) { + Channel.Counterparty counterparty = new Channel.Counterparty(); + counterparty.setPortId(counterpartyPort); + counterparty.setChannelId(""); + ics20Transfer.invoke(ibcHandler.account, "onChanOpenInit", ORDER, new String[] { connectionId }, port, + channelId, counterparty.encode(), ICS20_VERSION); + } + + public void channelOpenTry(String connectionId, String counterpartyPort, String channelId, + String counterpartyChannelId) { + Channel.Counterparty counterparty = new Channel.Counterparty(); + counterparty.setPortId(counterpartyPort); + counterparty.setChannelId(counterpartyChannelId); + ics20Transfer.invoke(ibcHandler.account, "onChanOpenTry", ORDER, new String[] { connectionId }, port, channelId, + counterparty.encode(), ICS20_VERSION, ICS20_VERSION); + } + + public void channelOpenAck(String channelId, String counterpartyChannelId) { + ics20Transfer.invoke(ibcHandler.account, "onChanOpenAck", port, channelId, counterpartyChannelId, + ICS20_VERSION); + } + + public void onChanCloseInit(String channelId) { + ics20Transfer.invoke(ibcHandler.account, "onChanCloseInit", port, channelId); + } +} diff --git a/contracts/javascore/lib/src/main/java/ics20/ICS20Lib.java b/contracts/javascore/lib/src/main/java/ics20/ICS20Lib.java new file mode 100644 index 000000000..f7acf6c1b --- /dev/null +++ b/contracts/javascore/lib/src/main/java/ics20/ICS20Lib.java @@ -0,0 +1,90 @@ +package ics20; + +import score.annotation.Optional; +import ibc.icon.score.util.StringUtil; +import java.math.BigInteger; + +public class ICS20Lib { + + public static class FungibleTokenPacketData { + public String denom; + public String sender; + public String receiver; + public BigInteger amount; + public String memo; + } + + public static final byte[] SUCCESSFUL_ACKNOWLEDGEMENT_JSON = "{\"result\":\"AQ==\"}".getBytes(); + public static final byte[] FAILED_ACKNOWLEDGEMENT_JSON = "{\"error\":\"failed\"}".getBytes(); + public static final Integer CHAR_SLASH = 0x2f; + public static final Integer CHAR_BACKSLASH = 0x5c; + public static final Integer CHAR_F = 0x66; + public static final Integer CHAR_R = 0x72; + public static final Integer CHAR_N = 0x6e; + public static final Integer CHAR_B = 0x62; + public static final Integer CHAR_T = 0x74; + public static final Integer CHAR_CLOSING_BRACE = 0x7d; + public static final Integer CHAR_M = 0x6d; + + private static final int CHAR_DOUBLE_QUOTE = '"'; + + static boolean isEscapeNeededString(byte[] bz) { + for (byte b : bz) { + int c = b & 0xFF; + if (c == CHAR_DOUBLE_QUOTE) { + return true; + } + } + return false; + } + + public static byte[] marshalFungibleTokenPacketData(String escapedDenom, BigInteger amount, String escapedSender, String escapedReceiver, @Optional String escapedMemo) { + if (escapedMemo == null) { + escapedMemo = ""; + } + String jsonString = "{" + + "\"amount\":\"" + amount.toString() + "\"," + + "\"denom\":\"" + escapedDenom + "\"," + + "\"receiver\":\"" + escapedReceiver + "\"," + + "\"sender\":\"" + escapedSender + "\"," + + "\"memo\":\"" + escapedMemo + "\"" + + "}"; + + return jsonString.getBytes(); + } + + public static FungibleTokenPacketData unmarshalFungibleTokenPacketData(byte[] packet) { + StringBuilder sanitized = new StringBuilder(); + String jsonString = new String(packet); + + for (char c : jsonString.toCharArray()){ + if (c != '\\' && c != '\"' && c !='{' && c!='}'){ + sanitized.append(c); + } + } + jsonString=sanitized.toString(); + + String[] jsonParts = StringUtil.split(jsonString, ','); + + FungibleTokenPacketData data = new FungibleTokenPacketData(); + + data.amount = new BigInteger(getValue(jsonParts[0])); + + data.denom = getValue(jsonParts[1]); + data.receiver = getValue(jsonParts[2]); + data.sender = getValue(jsonParts[3]); + if (jsonParts.length > 4) { + data.memo = getValue(jsonParts[4]); + } else { + data.memo = ""; + } + + return data; + } + + private static String getValue(String keyValue) { + return StringUtil.split(keyValue, ':')[1].trim(); + + } + +} diff --git a/contracts/javascore/score-util/src/main/java/ibc/icon/score/util/StringUtil.java b/contracts/javascore/score-util/src/main/java/ibc/icon/score/util/StringUtil.java index 99bcb7bfa..cf65901b3 100644 --- a/contracts/javascore/score-util/src/main/java/ibc/icon/score/util/StringUtil.java +++ b/contracts/javascore/score-util/src/main/java/ibc/icon/score/util/StringUtil.java @@ -125,5 +125,31 @@ public static byte[] encodePacked(Object... params) { } return result.toString().getBytes(); } - + + public static String[] split(String input, char delimiter) { + if (input == null || input.isEmpty()) { + return new String[0]; + } + + List substrings = new ArrayList<>(); + int startIndex = 0; + int delimiterIndex; + + while ((delimiterIndex = input.indexOf(delimiter, startIndex)) != -1) { + String substring = input.substring(startIndex, delimiterIndex); + substrings.add(substring); + + startIndex = delimiterIndex + 1; + } + + String lastSubstring = input.substring(startIndex); + substrings.add(lastSubstring); + + int size = substrings.size(); + String[] result = new String[size]; + for (int i = 0; i < size; i++) { + result[i] = substrings.get(i); + } + return result; + } } \ No newline at end of file diff --git a/contracts/javascore/settings.gradle b/contracts/javascore/settings.gradle index beb9a637f..98896fff7 100644 --- a/contracts/javascore/settings.gradle +++ b/contracts/javascore/settings.gradle @@ -7,6 +7,7 @@ include( 'test-lib', 'ibc', 'xcall-connection', + 'ics20' ) include(':tendermint') From 8dbb6abdf0e5a0ff13a068663f8703c65ab4b807 Mon Sep 17 00:00:00 2001 From: gcranju <134275268+gcranju@users.noreply.github.com> Date: Thu, 4 Apr 2024 16:44:11 +0545 Subject: [PATCH 05/12] fix: acknowledgement compare issue fixed (#855) --- .../javascore/ics20/src/main/java/ibc/ics20/ICS20Transfer.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contracts/javascore/ics20/src/main/java/ibc/ics20/ICS20Transfer.java b/contracts/javascore/ics20/src/main/java/ibc/ics20/ICS20Transfer.java index 5363f34d1..6f520341c 100644 --- a/contracts/javascore/ics20/src/main/java/ibc/ics20/ICS20Transfer.java +++ b/contracts/javascore/ics20/src/main/java/ibc/ics20/ICS20Transfer.java @@ -16,6 +16,7 @@ import score.annotation.Optional; import score.annotation.Payable; import icon.ibc.interfaces.IIBCModule; +import java.util.Arrays; import java.math.BigInteger; @@ -332,7 +333,7 @@ public byte[] onRecvPacket(byte[] packet, Address relayer) { @External public void onAcknowledgementPacket(byte[] packet, byte[] acknowledgement, Address relayer) { onlyIBC(); - if (!acknowledgement.equals(ICS20Lib.SUCCESSFUL_ACKNOWLEDGEMENT_JSON)) { + if (!Arrays.equals(acknowledgement,ICS20Lib.SUCCESSFUL_ACKNOWLEDGEMENT_JSON)) { Packet packetDb = Packet.decode(packet); refundTokens(packetDb); } From d0c0933dee5f986686027ce066af0d1c77dbb9ac Mon Sep 17 00:00:00 2001 From: gcranju <134275268+gcranju@users.noreply.github.com> Date: Fri, 5 Apr 2024 10:09:59 +0545 Subject: [PATCH 06/12] fix: address comparision in tokenFallback (#856) * fix: acknowledgement compare issue fixed * fix: address comparision in tokenFallback --- .../ics20/src/main/java/ibc/ics20/ICS20Transfer.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/contracts/javascore/ics20/src/main/java/ibc/ics20/ICS20Transfer.java b/contracts/javascore/ics20/src/main/java/ibc/ics20/ICS20Transfer.java index 6f520341c..a57b26164 100644 --- a/contracts/javascore/ics20/src/main/java/ibc/ics20/ICS20Transfer.java +++ b/contracts/javascore/ics20/src/main/java/ibc/ics20/ICS20Transfer.java @@ -191,7 +191,10 @@ public void tokenFallback(Address from, BigInteger value, byte[] _data) { Context.require(amount.equals(value), TAG + " : Mismatched amount"); Context.require(sender.equals(from.toString()), TAG + " : Sender address mismatched"); - Context.require(tokenContracts.get(denomination) == Context.getCaller(), + + Address tokenAddress = tokenContracts.get(denomination); + + Context.require(tokenAddress!=null && tokenAddress.equals(Context.getCaller()), TAG + " : Sender Token Contract not registered"); sendFungibleToken(denomination, amount, sender, receiver, sourcePort, sourceChannel, height, From 5fcf54cb5c338c35f396ed76aca58f3f88453f19 Mon Sep 17 00:00:00 2001 From: AntonAndell Date: Fri, 26 Apr 2024 07:15:59 +0200 Subject: [PATCH 07/12] fix: Require tendermint clientstate trustlevel to be >= 1/3 (#828) * feat: Add revision number to light client heights Add revision number but for now do not add support for resseting chain height * wip * revert to using two clients * feat: add IBC prefix for ics-08 clients and bugfixes * fix: Require tendermint clientstate trustlevel to be >= 1/3 * feat: Apply code improvments suggested during audit (#831) --- .../java/ibc/ics04/channel/IBCPacket.java | 6 +- .../ICS08TendermintLightClient.java | 158 ++++++++++-------- .../java/ibc/ics08/tendermint/Tendermint.java | 15 +- .../ics08/tendermint/TendermintHelper.java | 10 ++ .../ibc/ics08/tendermint/LightClientTest.java | 24 ++- .../main/java/ibc/tendermint/Tendermint.java | 15 +- .../java/ibc/tendermint/TendermintHelper.java | 10 ++ .../ibc/tendermint/TendermintLightClient.java | 145 ++++++++-------- .../java/ibc/tendermint/LightClientTest.java | 24 ++- 9 files changed, 229 insertions(+), 178 deletions(-) diff --git a/contracts/javascore/ibc/src/main/java/ibc/ics04/channel/IBCPacket.java b/contracts/javascore/ibc/src/main/java/ibc/ics04/channel/IBCPacket.java index 08812678e..2a134411d 100644 --- a/contracts/javascore/ibc/src/main/java/ibc/ics04/channel/IBCPacket.java +++ b/contracts/javascore/ibc/src/main/java/ibc/ics04/channel/IBCPacket.java @@ -291,11 +291,15 @@ public void _timeoutPacket(Packet packet, byte[] proofHeight, byte[] proof, BigI ConnectionEnd connection = ConnectionEnd.decode(connectionPb); // check that timeout height or timeout timestamp has passed on the other end + ILightClient client = getClient(connection.getClientId()); Height height = Height.decode(proofHeight); + BigInteger timestamp = client.getTimestampAtHeight(connection.getClientId(), proofHeight); boolean heightTimeout = packet.getTimeoutHeight().getRevisionHeight().compareTo(BigInteger.ZERO) > 0 && height.getRevisionHeight() .compareTo(packet.getTimeoutHeight().getRevisionHeight()) >= 0; - Context.require(heightTimeout, "Packet has not yet timed out"); + boolean timeTimeout = packet.getTimeoutTimestamp().compareTo(BigInteger.ZERO) > 0 + && timestamp.compareTo(packet.getTimeoutTimestamp()) >= 0; + Context.require(heightTimeout || timeTimeout, "Packet has not yet timed out"); // verify we actually sent this packet, check the store byte[] packetCommitmentKey = IBCCommitment.packetCommitmentKey(packet.getSourcePort(), diff --git a/contracts/javascore/lightclients/ics-08-tendermint/src/main/java/ibc/ics08/tendermint/ICS08TendermintLightClient.java b/contracts/javascore/lightclients/ics-08-tendermint/src/main/java/ibc/ics08/tendermint/ICS08TendermintLightClient.java index 4e9b4664c..beb28580f 100644 --- a/contracts/javascore/lightclients/ics-08-tendermint/src/main/java/ibc/ics08/tendermint/ICS08TendermintLightClient.java +++ b/contracts/javascore/lightclients/ics-08-tendermint/src/main/java/ibc/ics08/tendermint/ICS08TendermintLightClient.java @@ -1,7 +1,6 @@ package ibc.ics08.tendermint; import icon.ibc.interfaces.ILightClient; -import ibc.icon.score.util.ByteUtil; import ibc.icon.score.util.NullChecker; import ibc.icon.score.util.StringUtil; import ibc.ics23.commitment.types.Merkle; @@ -17,7 +16,6 @@ import score.Context; import score.DictDB; import score.annotation.External; -import score.annotation.Optional; import java.math.BigInteger; import java.util.Arrays; @@ -54,7 +52,7 @@ private void onlyHandler() { /** * @dev getTimestampAtHeight returns the timestamp of the consensus state at the - * given height. + * given height. */ @External(readonly = true) public BigInteger getTimestampAtHeight( @@ -101,8 +99,7 @@ public Map createClient(String clientId, byte[] clientStateBytes Context.require(clientStates.get(clientId) == null, "Client already exists"); ClientState clientState = ClientState.decode(clientStateBytes); - Context.require(!clientState.getTrustLevel().getDenominator().equals(BigInteger.ZERO), - "trustLevel has zero Denominator"); + validateTrustLevel(clientState.getTrustLevel()); clientStates.set(clientId, clientStateBytes); consensusStates.at(clientId).set(clientState.getLatestHeight().getRevisionHeight(), consensusStateBytes); @@ -119,79 +116,29 @@ public Map createClient(String clientId, byte[] clientStateBytes @External public Map updateClient(String clientId, byte[] clientMessageBytes) { onlyHandler(); - ibc.lightclients.tendermint.v1.Header tmHeader = ibc.lightclients.tendermint.v1.Header.decode(clientMessageBytes); - boolean conflictingHeader = false; - // Check if the Client store already has a consensus state for the header's - // height - // If the consensus state exists, and it matches the header then we return early - // since header has already been submitted in a previous UpdateClient. - byte[] prevConsState = consensusStates.at(clientId) - .get(tmHeader.getSignedHeader().getHeader().getHeight()); - if (prevConsState != null) { - // This header has already been submitted and the necessary state is already - // stored - Context.require(!Arrays.equals(prevConsState, toConsensusState(tmHeader).encode()), - "LC: This header has already been submitted"); - - // A consensus state already exists for this height, but it does not match the - // provided header. - // Thus, we must check that this header is valid, and if so we will freeze the - // client. - conflictingHeader = true; - } + ibc.lightclients.tendermint.v1.Header tmHeader = ibc.lightclients.tendermint.v1.Header + .decode(clientMessageBytes); + boolean conflictingHeader = checkForDuplicateHeader(clientId, tmHeader); byte[] encodedClientState = clientStates.get(clientId); require(encodedClientState != null, "LC: client state is invalid"); ClientState clientState = ClientState.decode(encodedClientState); - byte[] encodedTrustedonsensusState = consensusStates.at(clientId).get(tmHeader.getTrustedHeight().getRevisionHeight()); - require(encodedTrustedonsensusState != null, "LC: consensusState not found at trusted height"); - ConsensusState trustedConsensusState = ConsensusState.decode(encodedTrustedonsensusState); - Timestamp currentTime = getCurrentTime(); - checkValidity(clientState, trustedConsensusState, tmHeader, currentTime); + byte[] encodedTrustedConsensusState = consensusStates.at(clientId) + .get(tmHeader.getTrustedHeight().getRevisionHeight()); + require(encodedTrustedConsensusState != null, "LC: consensusState not found at trusted height"); + ConsensusState trustedConsensusState = ConsensusState.decode(encodedTrustedConsensusState); + + checkValidity(clientState, trustedConsensusState, tmHeader); // Header is different from existing consensus state and also valid, so freeze // the client and return if (conflictingHeader) { - BigInteger revision = getRevisionNumber(tmHeader.getSignedHeader().getHeader().getChainId()); - clientState.setFrozenHeight(newHeight(tmHeader.getSignedHeader().getHeader().getHeight(), revision)); - encodedClientState = clientState.encode(); - clientStates.set(clientId, encodedClientState); - - byte[] encodedConsensusState = toConsensusState(tmHeader).encode(); - consensusStates.at(clientId).set(clientState.getLatestHeight().getRevisionHeight(), encodedConsensusState); - processedHeights.at(clientId).set(tmHeader.getSignedHeader().getHeader().getHeight(), - BigInteger.valueOf(Context.getBlockHeight())); - processedTimes.at(clientId).set(tmHeader.getSignedHeader().getHeader().getHeight(), - BigInteger.valueOf(Context.getBlockTimestamp())); - - return Map.of( - "clientStateCommitment", IBCCommitment.keccak256(encodedClientState), - "consensusStateCommitment", IBCCommitment.keccak256(encodedConsensusState), - "height", - newHeight(tmHeader.getSignedHeader().getHeader().getHeight(), revision).encode()); + return handleConflict(clientId, tmHeader, clientState); } - // update the consensus state from a new header and set processed time metadata - if (tmHeader.getSignedHeader().getHeader().getHeight().compareTo(clientState.getLatestHeight().getRevisionHeight()) > 0) { - BigInteger revision = getRevisionNumber(tmHeader.getSignedHeader().getHeader().getChainId()); - clientState.setLatestHeight(newHeight(tmHeader.getSignedHeader().getHeader().getHeight(), revision)); - encodedClientState = clientState.encode(); - clientStates.set(clientId, encodedClientState); - } + return updateHeader(clientId, tmHeader, clientState, encodedClientState); - byte[] encodedConsensusState = toConsensusState(tmHeader).encode(); - consensusStates.at(clientId).set(tmHeader.getSignedHeader().getHeader().getHeight(), - encodedConsensusState); - processedHeights.at(clientId).set(tmHeader.getSignedHeader().getHeader().getHeight(), - BigInteger.valueOf(Context.getBlockHeight())); - processedTimes.at(clientId).set(tmHeader.getSignedHeader().getHeader().getHeight(), - BigInteger.valueOf(Context.getBlockTimestamp())); - - return Map.of( - "clientStateCommitment", IBCCommitment.keccak256(encodedClientState), - "consensusStateCommitment", IBCCommitment.keccak256(encodedConsensusState), - "height", clientState.getLatestHeight().encode()); } @External(readonly = true) @@ -243,12 +190,79 @@ public void verifyNonMembership( Merkle.verifyNonMembership(merkleProof, Merkle.SDK_SPEC, root, merklePath); } + private Map updateHeader(String clientId, ibc.lightclients.tendermint.v1.Header tmHeader, + ClientState clientState, byte[] encodedClientState) { + if (tmHeader.getSignedHeader().getHeader().getHeight() + .compareTo(clientState.getLatestHeight().getRevisionHeight()) > 0) { + BigInteger revision = getRevisionNumber(tmHeader.getSignedHeader().getHeader().getChainId()); + clientState.setLatestHeight(newHeight(tmHeader.getSignedHeader().getHeader().getHeight(), revision)); + encodedClientState = clientState.encode(); + clientStates.set(clientId, encodedClientState); + } + + byte[] encodedConsensusState = toConsensusState(tmHeader).encode(); + consensusStates.at(clientId).set(tmHeader.getSignedHeader().getHeader().getHeight(), + encodedConsensusState); + processedHeights.at(clientId).set(tmHeader.getSignedHeader().getHeader().getHeight(), + BigInteger.valueOf(Context.getBlockHeight())); + processedTimes.at(clientId).set(tmHeader.getSignedHeader().getHeader().getHeight(), + BigInteger.valueOf(Context.getBlockTimestamp())); + + return Map.of( + "clientStateCommitment", IBCCommitment.keccak256(encodedClientState), + "consensusStateCommitment", IBCCommitment.keccak256(encodedConsensusState), + "height", clientState.getLatestHeight().encode()); + } + + private Map handleConflict(String clientId, ibc.lightclients.tendermint.v1.Header tmHeader, + ClientState clientState) { + BigInteger revision = getRevisionNumber(tmHeader.getSignedHeader().getHeader().getChainId()); + clientState.setFrozenHeight(newHeight(tmHeader.getSignedHeader().getHeader().getHeight(), revision)); + byte[] encodedClientState = clientState.encode(); + clientStates.set(clientId, encodedClientState); + + byte[] encodedConsensusState = toConsensusState(tmHeader).encode(); + consensusStates.at(clientId).set(clientState.getLatestHeight().getRevisionHeight(), encodedConsensusState); + processedHeights.at(clientId).set(tmHeader.getSignedHeader().getHeader().getHeight(), + BigInteger.valueOf(Context.getBlockHeight())); + processedTimes.at(clientId).set(tmHeader.getSignedHeader().getHeader().getHeight(), + BigInteger.valueOf(Context.getBlockTimestamp())); + + return Map.of( + "clientStateCommitment", IBCCommitment.keccak256(encodedClientState), + "consensusStateCommitment", IBCCommitment.keccak256(encodedConsensusState), + "height", + newHeight(tmHeader.getSignedHeader().getHeader().getHeight(), revision).encode()); + } + + private boolean checkForDuplicateHeader(String clientId, ibc.lightclients.tendermint.v1.Header tmHeader) { + // Check if the Client store already has a consensus state for the header's + // height + // If the consensus state exists, and it matches the header then we return early + // since header has already been submitted in a previous UpdateClient. + byte[] prevConsState = consensusStates.at(clientId) + .get(tmHeader.getSignedHeader().getHeader().getHeight()); + if (prevConsState == null) { + return false; + } + + // This header has already been submitted and the necessary state is already + // stored + Context.require(!Arrays.equals(prevConsState, toConsensusState(tmHeader).encode()), + "LC: This header has already been submitted"); + + // A consensus state already exists for this height, but it does not match the + // provided header. + // Thus, we must check that this header is valid, and if so we will freeze the + // client. + return true; + }; + // checkValidity checks if the Tendermint header is valid. public void checkValidity( ClientState clientState, ConsensusState trustedConsensusState, - ibc.lightclients.tendermint.v1.Header tmHeader, - Timestamp currentTime) { + ibc.lightclients.tendermint.v1.Header tmHeader) { // assert header height is newer than consensus state require( tmHeader.getSignedHeader().getHeader().getHeight() @@ -268,11 +282,11 @@ public void checkValidity( SignedHeader untrustedHeader = tmHeader.getSignedHeader(); ValidatorSet untrustedVals = tmHeader.getValidatorSet(); + Timestamp currentTime = getCurrentTime(); Context.require(!isExpired(trustedHeader, clientState.getTrustingPeriod(), currentTime), "header can't be expired"); boolean ok = verify( - clientState.getTrustingPeriod(), clientState.getMaxClockDrift(), clientState.getTrustLevel(), trustedHeader, @@ -288,15 +302,15 @@ private void validateArgs(ClientState cs, BigInteger height, byte[] prefix, byte Context.require(cs.getLatestHeight().getRevisionHeight().compareTo(height) >= 0, "Latest height must be greater or equal to proof height"); Context.require(cs.getFrozenHeight().getRevisionHeight().equals(BigInteger.ZERO) || - cs.getFrozenHeight().getRevisionHeight().compareTo(height) >= 0, + cs.getFrozenHeight().getRevisionHeight().compareTo(height) >= 0, "Client is Frozen"); Context.require(prefix.length > 0, "Prefix cant be empty"); Context.require(proof.length > 0, "Proof cant be empty"); } private void validateDelayPeriod(String clientId, Height height, - BigInteger delayPeriodTime, - BigInteger delayPeriodBlocks) { + BigInteger delayPeriodTime, + BigInteger delayPeriodBlocks) { BigInteger currentTime = BigInteger.valueOf(Context.getBlockTimestamp()); BigInteger validTime = mustGetProcessedTime(clientId, height.getRevisionHeight()).add(delayPeriodTime); diff --git a/contracts/javascore/lightclients/ics-08-tendermint/src/main/java/ibc/ics08/tendermint/Tendermint.java b/contracts/javascore/lightclients/ics-08-tendermint/src/main/java/ibc/ics08/tendermint/Tendermint.java index 70b35251f..ba921fcf4 100644 --- a/contracts/javascore/lightclients/ics-08-tendermint/src/main/java/ibc/ics08/tendermint/Tendermint.java +++ b/contracts/javascore/lightclients/ics-08-tendermint/src/main/java/ibc/ics08/tendermint/Tendermint.java @@ -13,7 +13,6 @@ public abstract class Tendermint { protected boolean verify( - Duration trustingPeriod, Duration maxClockDrift, Fraction trustLevel, SignedHeader trustedHeader, @@ -26,8 +25,7 @@ protected boolean verify( boolean isAdjacent = untrustedHeader.getHeader().getHeight() .equals(trustedHeader.getHeader().getHeight().add(BigInteger.ONE)); if (isAdjacent) { - return verifyAdjacent(trustedHeader, untrustedHeader, untrustedVals, trustingPeriod, currentTime, - maxClockDrift); + return verifyAdjacent(trustedHeader, untrustedHeader, untrustedVals); } return verifyNonAdjacent( @@ -35,9 +33,6 @@ protected boolean verify( trustedVals, untrustedHeader, untrustedVals, - trustingPeriod, - currentTime, - maxClockDrift, trustLevel); } @@ -45,10 +40,7 @@ protected boolean verify( protected boolean verifyAdjacent( SignedHeader trustedHeader, SignedHeader untrustedHeader, - ValidatorSet untrustedVals, - Duration trustingPeriod, - Timestamp currentTime, - Duration maxClockDrift) { + ValidatorSet untrustedVals) { // Check the validator hashes are the same Context.require( @@ -71,9 +63,6 @@ protected boolean verifyNonAdjacent( ValidatorSet trustedVals, SignedHeader untrustedHeader, ValidatorSet untrustedVals, - Duration trustingPeriod, - Timestamp currentTime, - Duration maxClockDrift, Fraction trustLevel) { // assert that trustedVals is NextValidators of last trusted header diff --git a/contracts/javascore/lightclients/ics-08-tendermint/src/main/java/ibc/ics08/tendermint/TendermintHelper.java b/contracts/javascore/lightclients/ics-08-tendermint/src/main/java/ibc/ics08/tendermint/TendermintHelper.java index ce8c4a809..74bc8a84d 100644 --- a/contracts/javascore/lightclients/ics-08-tendermint/src/main/java/ibc/ics08/tendermint/TendermintHelper.java +++ b/contracts/javascore/lightclients/ics-08-tendermint/src/main/java/ibc/ics08/tendermint/TendermintHelper.java @@ -9,6 +9,7 @@ import tendermint.types.Commit; import tendermint.types.CommitSig; import ibc.lightclients.tendermint.v1.ConsensusState; +import ibc.lightclients.tendermint.v1.Fraction; import tendermint.types.Header; import ibc.core.commitment.v1.MerkleRoot; import tendermint.types.SignedHeader; @@ -159,4 +160,13 @@ public static byte[] hash(Header header) { return MerkleTree.merkleRootHash(all, 0, all.length); } + + public static void validateTrustLevel(Fraction tl) { + Context.require( + tl.getNumerator().multiply(BigInteger.valueOf(3)).compareTo(tl.getDenominator()) >= 0 && + tl.getNumerator().compareTo(tl.getDenominator()) <= 0 && + !tl.getDenominator().equals(BigInteger.ZERO), + "trustLevel must be within [1/3, 1]" + ); + } } diff --git a/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/LightClientTest.java b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/LightClientTest.java index 0f934fa91..a97065eeb 100644 --- a/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/LightClientTest.java +++ b/contracts/javascore/lightclients/ics-08-tendermint/src/test/java/ibc/ics08/tendermint/LightClientTest.java @@ -52,15 +52,28 @@ void createClient() throws Exception { } @Test - void createClient_withZeroDenomTrustLevel() throws Exception { + void createClient_trustLevelRestriction() throws Exception { // Arrange - // Default is zero denominator - trustLevel = Fraction.getDefaultInstance(); - String expectedErrorMessage = "trustLevel has zero Denominator"; + String expectedErrorMessage = "trustLevel must be within [1/3, 1]"; // Act & Assert + trustLevel = trustLevel = Fraction.newBuilder() + .setNumerator(1) + .setDenominator(0).build(); AssertionError e = assertThrows(AssertionError.class, () -> initializeClient(1)); assertTrue(e.getMessage().contains(expectedErrorMessage)); + + trustLevel = trustLevel = Fraction.newBuilder() + .setNumerator(2) + .setDenominator(1).build(); + e = assertThrows(AssertionError.class, () -> initializeClient(1)); + assertTrue(e.getMessage().contains(expectedErrorMessage)); + + trustLevel = trustLevel = Fraction.newBuilder() + .setNumerator(1) + .setDenominator(4).build(); + e = assertThrows(AssertionError.class, () -> initializeClient(1)); + assertTrue(e.getMessage().contains(expectedErrorMessage)); } @Test @@ -147,8 +160,7 @@ void updateConflictingHeader() throws Exception { doNothing().when(clientSpy).checkValidity( any(ibc.lightclients.tendermint.v1.ClientState.class), any(ibc.lightclients.tendermint.v1.ConsensusState.class), - any(ibc.lightclients.tendermint.v1.Header.class), - any()); + any(ibc.lightclients.tendermint.v1.Header.class)); // Act updateClient(3, 1); diff --git a/contracts/javascore/lightclients/tendermint/src/main/java/ibc/tendermint/Tendermint.java b/contracts/javascore/lightclients/tendermint/src/main/java/ibc/tendermint/Tendermint.java index 11f3aa8ff..531d64bf8 100644 --- a/contracts/javascore/lightclients/tendermint/src/main/java/ibc/tendermint/Tendermint.java +++ b/contracts/javascore/lightclients/tendermint/src/main/java/ibc/tendermint/Tendermint.java @@ -11,7 +11,6 @@ public abstract class Tendermint { protected boolean verify( - Duration trustingPeriod, Duration maxClockDrift, Fraction trustLevel, SignedHeader trustedHeader, @@ -24,8 +23,7 @@ protected boolean verify( boolean isAdjacent = untrustedHeader.getHeader().getHeight() .equals(trustedHeader.getHeader().getHeight().add(BigInteger.ONE)); if (isAdjacent) { - return verifyAdjacent(trustedHeader, untrustedHeader, untrustedVals, trustingPeriod, currentTime, - maxClockDrift); + return verifyAdjacent(trustedHeader, untrustedHeader, untrustedVals); } return verifyNonAdjacent( @@ -33,9 +31,6 @@ protected boolean verify( trustedVals, untrustedHeader, untrustedVals, - trustingPeriod, - currentTime, - maxClockDrift, trustLevel); } @@ -43,10 +38,7 @@ protected boolean verify( protected boolean verifyAdjacent( SignedHeader trustedHeader, SignedHeader untrustedHeader, - ValidatorSet untrustedVals, - Duration trustingPeriod, - Timestamp currentTime, - Duration maxClockDrift) { + ValidatorSet untrustedVals) { // Check the validator hashes are the same Context.require( @@ -69,9 +61,6 @@ protected boolean verifyNonAdjacent( ValidatorSet trustedVals, SignedHeader untrustedHeader, ValidatorSet untrustedVals, - Duration trustingPeriod, - Timestamp currentTime, - Duration maxClockDrift, Fraction trustLevel) { // assert that trustedVals is NextValidators of last trusted header diff --git a/contracts/javascore/lightclients/tendermint/src/main/java/ibc/tendermint/TendermintHelper.java b/contracts/javascore/lightclients/tendermint/src/main/java/ibc/tendermint/TendermintHelper.java index a0ea42cfc..0b88e8127 100644 --- a/contracts/javascore/lightclients/tendermint/src/main/java/ibc/tendermint/TendermintHelper.java +++ b/contracts/javascore/lightclients/tendermint/src/main/java/ibc/tendermint/TendermintHelper.java @@ -18,6 +18,7 @@ import icon.proto.clients.tendermint.TmHeader; import icon.proto.clients.tendermint.Validator; import icon.proto.clients.tendermint.ValidatorSet; +import icon.proto.clients.tendermint.Fraction; import ibc.core.commitment.v1.MerkleRoot; import icon.proto.core.client.Height; import score.Context; @@ -153,4 +154,13 @@ public static byte[] hash(LightHeader header) { return MerkleTree.merkleRootHash(all, 0, all.length); } + + public static void validateTrustLevel(Fraction tl) { + Context.require( + tl.getNumerator().multiply(BigInteger.valueOf(3)).compareTo(tl.getDenominator()) >= 0 && + tl.getNumerator().compareTo(tl.getDenominator()) <= 0 && + !tl.getDenominator().equals(BigInteger.ZERO), + "trustLevel must be within [1/3, 1]" + ); + } } diff --git a/contracts/javascore/lightclients/tendermint/src/main/java/ibc/tendermint/TendermintLightClient.java b/contracts/javascore/lightclients/tendermint/src/main/java/ibc/tendermint/TendermintLightClient.java index aff686b6f..062761560 100644 --- a/contracts/javascore/lightclients/tendermint/src/main/java/ibc/tendermint/TendermintLightClient.java +++ b/contracts/javascore/lightclients/tendermint/src/main/java/ibc/tendermint/TendermintLightClient.java @@ -97,8 +97,7 @@ public Map createClient(String clientId, byte[] clientStateBytes Context.require(clientStates.get(clientId) == null, "Client already exists"); ClientState clientState = ClientState.decode(clientStateBytes); - Context.require(!clientState.getTrustLevel().getDenominator().equals(BigInteger.ZERO), - "trustLevel has zero Denominator"); + validateTrustLevel(clientState.getTrustLevel()); clientStates.set(clientId, clientStateBytes); consensusStates.at(clientId).set(clientState.getLatestHeight(), consensusStateBytes); @@ -116,77 +115,26 @@ public Map createClient(String clientId, byte[] clientStateBytes public Map updateClient(String clientId, byte[] clientMessageBytes) { onlyHandler(); TmHeader tmHeader = TmHeader.decode(clientMessageBytes); - boolean conflictingHeader = false; - - // Check if the Client store already has a consensus state for the header's - // height - // If the consensus state exists, and it matches the header then we return early - // since header has already been submitted in a previous UpdateClient. - byte[] prevConsState = consensusStates.at(clientId) - .get(tmHeader.getSignedHeader().getHeader().getHeight()); - if (prevConsState != null) { - // This header has already been submitted and the necessary state is already - // stored - Context.require(!Arrays.equals(prevConsState, toConsensusState(tmHeader).encode()), - "LC: This header has already been submitted"); - - // A consensus state already exists for this height, but it does not match the - // provided header. - // Thus, we must check that this header is valid, and if so we will freeze the - // client. - conflictingHeader = true; - } + boolean conflictingHeader = checkForDuplicateHeader(clientId, tmHeader); byte[] encodedClientState = clientStates.get(clientId); require(encodedClientState != null, "LC: client state is invalid"); ClientState clientState = ClientState.decode(encodedClientState); - byte[] encodedTrustedonsensusState = consensusStates.at(clientId).get(tmHeader.getTrustedHeight()); - require(encodedTrustedonsensusState != null, "LC: consensusState not found at trusted height"); - ConsensusState trustedConsensusState = ConsensusState.decode(encodedTrustedonsensusState); - Timestamp currentTime = getCurrentTime(); - checkValidity(clientState, trustedConsensusState, tmHeader, currentTime); + byte[] encodedTrustedConsensusState = consensusStates.at(clientId).get(tmHeader.getTrustedHeight()); + require(encodedTrustedConsensusState != null, "LC: consensusState not found at trusted height"); + ConsensusState trustedConsensusState = ConsensusState.decode(encodedTrustedConsensusState); + + checkValidity(clientState, trustedConsensusState, tmHeader); // Header is different from existing consensus state and also valid, so freeze // the client and return if (conflictingHeader) { - clientState.setFrozenHeight(tmHeader.getSignedHeader().getHeader().getHeight()); - encodedClientState = clientState.encode(); - clientStates.set(clientId, encodedClientState); - - byte[] encodedConsensusState = toConsensusState(tmHeader).encode(); - consensusStates.at(clientId).set(clientState.getLatestHeight(), encodedConsensusState); - processedHeights.at(clientId).set(tmHeader.getSignedHeader().getHeader().getHeight(), - BigInteger.valueOf(Context.getBlockHeight())); - processedTimes.at(clientId).set(tmHeader.getSignedHeader().getHeader().getHeight(), - BigInteger.valueOf(Context.getBlockTimestamp())); - - return Map.of( - "clientStateCommitment", IBCCommitment.keccak256(encodedClientState), - "consensusStateCommitment", IBCCommitment.keccak256(encodedConsensusState), - "height", - newHeight(tmHeader.getSignedHeader().getHeader().getHeight()).encode()); + return handleConflict(clientId, tmHeader, clientState); } // update the consensus state from a new header and set processed time metadata - if (tmHeader.getSignedHeader().getHeader().getHeight().compareTo(clientState.getLatestHeight()) > 0) { - clientState.setLatestHeight(tmHeader.getSignedHeader().getHeader().getHeight()); - encodedClientState = clientState.encode(); - clientStates.set(clientId, encodedClientState); - } - - byte[] encodedConsensusState = toConsensusState(tmHeader).encode(); - consensusStates.at(clientId).set(tmHeader.getSignedHeader().getHeader().getHeight(), - encodedConsensusState); - processedHeights.at(clientId).set(tmHeader.getSignedHeader().getHeader().getHeight(), - BigInteger.valueOf(Context.getBlockHeight())); - processedTimes.at(clientId).set(tmHeader.getSignedHeader().getHeader().getHeight(), - BigInteger.valueOf(Context.getBlockTimestamp())); - - return Map.of( - "clientStateCommitment", IBCCommitment.keccak256(encodedClientState), - "consensusStateCommitment", IBCCommitment.keccak256(encodedConsensusState), - "height", newHeight(clientState.getLatestHeight()).encode()); + return updateHeader(clientId, tmHeader, clientState, encodedClientState); } @External(readonly = true) @@ -245,12 +193,75 @@ public void verifyNonMembership( Merkle.verifyNonMembership(merkleProof, Merkle.SDK_SPEC, root, merklePath); } + private Map updateHeader(String clientId, TmHeader tmHeader, ClientState clientState, + byte[] encodedClientState) { + if (tmHeader.getSignedHeader().getHeader().getHeight().compareTo(clientState.getLatestHeight()) > 0) { + clientState.setLatestHeight(tmHeader.getSignedHeader().getHeader().getHeight()); + encodedClientState = clientState.encode(); + clientStates.set(clientId, encodedClientState); + } + + byte[] encodedConsensusState = toConsensusState(tmHeader).encode(); + consensusStates.at(clientId).set(tmHeader.getSignedHeader().getHeader().getHeight(), + encodedConsensusState); + processedHeights.at(clientId).set(tmHeader.getSignedHeader().getHeader().getHeight(), + BigInteger.valueOf(Context.getBlockHeight())); + processedTimes.at(clientId).set(tmHeader.getSignedHeader().getHeader().getHeight(), + BigInteger.valueOf(Context.getBlockTimestamp())); + + return Map.of( + "clientStateCommitment", IBCCommitment.keccak256(encodedClientState), + "consensusStateCommitment", IBCCommitment.keccak256(encodedConsensusState), + "height", newHeight(clientState.getLatestHeight()).encode()); + } + + private Map handleConflict(String clientId, TmHeader tmHeader, ClientState clientState) { + clientState.setFrozenHeight(tmHeader.getSignedHeader().getHeader().getHeight()); + byte[] encodedClientState = clientState.encode(); + clientStates.set(clientId, encodedClientState); + + byte[] encodedConsensusState = toConsensusState(tmHeader).encode(); + consensusStates.at(clientId).set(clientState.getLatestHeight(), encodedConsensusState); + processedHeights.at(clientId).set(tmHeader.getSignedHeader().getHeader().getHeight(), + BigInteger.valueOf(Context.getBlockHeight())); + processedTimes.at(clientId).set(tmHeader.getSignedHeader().getHeader().getHeight(), + BigInteger.valueOf(Context.getBlockTimestamp())); + + return Map.of( + "clientStateCommitment", IBCCommitment.keccak256(encodedClientState), + "consensusStateCommitment", IBCCommitment.keccak256(encodedConsensusState), + "height", + newHeight(tmHeader.getSignedHeader().getHeader().getHeight()).encode()); + } + + private boolean checkForDuplicateHeader(String clientId, TmHeader tmHeader) { + // Check if the Client store already has a consensus state for the header's + // height + // If the consensus state exists, and it matches the header then we return early + // since header has already been submitted in a previous UpdateClient. + byte[] prevConsState = consensusStates.at(clientId) + .get(tmHeader.getSignedHeader().getHeader().getHeight()); + if (prevConsState == null) { + return false; + } + + // This header has already been submitted and the necessary state is already + // stored + Context.require(!Arrays.equals(prevConsState, toConsensusState(tmHeader).encode()), + "LC: This header has already been submitted"); + + // A consensus state already exists for this height, but it does not match the + // provided header. + // Thus, we must check that this header is valid, and if so we will freeze the + // client. + return true; + }; + // checkValidity checks if the Tendermint header is valid. public void checkValidity( ClientState clientState, ConsensusState trustedConsensusState, - TmHeader tmHeader, - Timestamp currentTime) { + TmHeader tmHeader) { // assert header height is newer than consensus state require( tmHeader.getSignedHeader().getHeader().getHeight() @@ -270,11 +281,11 @@ public void checkValidity( SignedHeader untrustedHeader = tmHeader.getSignedHeader(); ValidatorSet untrustedVals = tmHeader.getValidatorSet(); + Timestamp currentTime = getCurrentTime(); Context.require(!isExpired(trustedHeader, clientState.getTrustingPeriod(), currentTime), "header can't be expired"); boolean ok = verify( - clientState.getTrustingPeriod(), clientState.getMaxClockDrift(), clientState.getTrustLevel(), trustedHeader, @@ -290,15 +301,15 @@ private void validateArgs(ClientState cs, BigInteger height, byte[] prefix, byte Context.require(cs.getLatestHeight().compareTo(height) >= 0, "Latest height must be greater or equal to proof height"); Context.require(cs.getFrozenHeight().equals(BigInteger.ZERO) || - cs.getFrozenHeight().compareTo(height) >= 0, + cs.getFrozenHeight().compareTo(height) >= 0, "Client is Frozen"); Context.require(prefix.length > 0, "Prefix cant be empty"); Context.require(proof.length > 0, "Proof cant be empty"); } private void validateDelayPeriod(String clientId, Height height, - BigInteger delayPeriodTime, - BigInteger delayPeriodBlocks) { + BigInteger delayPeriodTime, + BigInteger delayPeriodBlocks) { BigInteger currentTime = BigInteger.valueOf(Context.getBlockTimestamp()); BigInteger validTime = mustGetProcessedTime(clientId, height.getRevisionHeight()).add(delayPeriodTime); diff --git a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/LightClientTest.java b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/LightClientTest.java index b7260667c..df5666ef9 100644 --- a/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/LightClientTest.java +++ b/contracts/javascore/lightclients/tendermint/src/test/java/ibc/tendermint/LightClientTest.java @@ -51,15 +51,28 @@ void createClient() throws Exception { } @Test - void createClient_withZeroDenomTrustLevel() throws Exception { + void createClient_trustLevelRestriction() throws Exception { // Arrange - // Default is zero denominator - trustLevel = Fraction.getDefaultInstance(); - String expectedErrorMessage = "trustLevel has zero Denominator"; + String expectedErrorMessage = "trustLevel must be within [1/3, 1]"; // Act & Assert + trustLevel = trustLevel = Fraction.newBuilder() + .setNumerator(1) + .setDenominator(0).build(); AssertionError e = assertThrows(AssertionError.class, () -> initializeClient(1)); assertTrue(e.getMessage().contains(expectedErrorMessage)); + + trustLevel = trustLevel = Fraction.newBuilder() + .setNumerator(2) + .setDenominator(1).build(); + e = assertThrows(AssertionError.class, () -> initializeClient(1)); + assertTrue(e.getMessage().contains(expectedErrorMessage)); + + trustLevel = trustLevel = Fraction.newBuilder() + .setNumerator(1) + .setDenominator(4).build(); + e = assertThrows(AssertionError.class, () -> initializeClient(1)); + assertTrue(e.getMessage().contains(expectedErrorMessage)); } @Test @@ -165,8 +178,7 @@ void updateConflictingHeader() throws Exception { doNothing().when(clientSpy).checkValidity( any(icon.proto.clients.tendermint.ClientState.class), any(icon.proto.clients.tendermint.ConsensusState.class), - any(TmHeader.class), - any(Timestamp.class)); + any(TmHeader.class)); // Act updateClient(3, 1); From 29f4ad78a71b3fe87d33127c1d75dad115821f6a Mon Sep 17 00:00:00 2001 From: ibrizsabin <101165234+ibrizsabin@users.noreply.github.com> Date: Wed, 15 May 2024 11:02:25 +0545 Subject: [PATCH 08/12] fix: javascore audit issues (#862) * fix: audit issues * fix: cleanup --- .../javascore/ics20/src/main/java/ibc/ics20/ICS20Transfer.java | 2 +- .../java/ibc/ics08/tendermint/ICS08TendermintLightClient.java | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/contracts/javascore/ics20/src/main/java/ibc/ics20/ICS20Transfer.java b/contracts/javascore/ics20/src/main/java/ibc/ics20/ICS20Transfer.java index a57b26164..8d6392b28 100644 --- a/contracts/javascore/ics20/src/main/java/ibc/ics20/ICS20Transfer.java +++ b/contracts/javascore/ics20/src/main/java/ibc/ics20/ICS20Transfer.java @@ -3,7 +3,6 @@ import com.eclipsesource.json.Json; import com.eclipsesource.json.JsonObject; import com.eclipsesource.json.JsonValue; - import icon.proto.core.channel.Channel; import icon.proto.core.channel.Packet; import icon.proto.core.client.Height; @@ -351,6 +350,7 @@ public void onAcknowledgementPacket(byte[] packet, byte[] acknowledgement, Addre */ @External public void onTimeoutPacket(byte[] packet, Address relayer) { + onlyIBC(); Packet packetDb = Packet.decode(packet); refundTokens(packetDb); } diff --git a/contracts/javascore/lightclients/ics-08-tendermint/src/main/java/ibc/ics08/tendermint/ICS08TendermintLightClient.java b/contracts/javascore/lightclients/ics-08-tendermint/src/main/java/ibc/ics08/tendermint/ICS08TendermintLightClient.java index beb28580f..916543fe1 100644 --- a/contracts/javascore/lightclients/ics-08-tendermint/src/main/java/ibc/ics08/tendermint/ICS08TendermintLightClient.java +++ b/contracts/javascore/lightclients/ics-08-tendermint/src/main/java/ibc/ics08/tendermint/ICS08TendermintLightClient.java @@ -5,7 +5,6 @@ import ibc.icon.score.util.StringUtil; import ibc.ics23.commitment.types.Merkle; import ibc.ics24.host.IBCCommitment; -import cosmos.ics23.v1.*; import google.protobuf.*; import tendermint.types.*; import ibc.core.commitment.v1.*; From 9d25c2e3506419f3e135f9e447f83abed12fc46e Mon Sep 17 00:00:00 2001 From: ibrizsabin <101165234+ibrizsabin@users.noreply.github.com> Date: Wed, 15 May 2024 11:07:16 +0545 Subject: [PATCH 09/12] feat: cw wasm light client (#754) * feat: add wasm client project * fix: add wasm proto * fix: import ics08wasm * fix: import wasm-08 * fix: generalize context * fix: build deps * fix: fix deps issue * fix: split query handler * fix: wrap result in response * feat: add verify header * feat: add genesis export * fix: impl client status * fix: fix unit test * fix: add debug logs * fix: cleanup * chore: pass build * fix: proto changes * fix: split traits * chore: pass build * fix: remove inner * fix: query handler * fix: add tests * fix: add update test * fix: downgrade * fix: downgrade cosmwasm * fix: update test utils * fix: point to downgraded xcall * fix: lower multi test * fix: lock on 1.6 * fix: revert downgrade * fix: try disable features * fix: upgrade cw-storage-plus * fix: lock to 1.4 * fix: move cw-multi test * chore: pass build * fix: fix branch * fix: add height * fix: cleanup * chore: pass build * fix: remove toolchain.toml * fix: fix verify membership * fix: ack hashing * doc: add build note * chore: pass build * fix: do sha256 * fix: check misbehaviour * chore: pass build * fix:resolve comments * chore: pass build * fix: remove unnecessary hash * chore: pass build * fix: rename client id * fix: Fix reverse sign on timestamp check for request timeout * chore: update test coverage for ibc client (#846) * chore: update test coverage for ics03-connection (#848) * chore: update test coverage for ibc client * chore: improve test coverage for ibc connection * chore: add test coverage for cosmwasm ibc core (#850) * docs: Add explanation on how a connection can be manually verified (#838) doc: Add explanation on how a connection can be manually verified * fix: add reference to CI workflow to fix error (#839) Co-authored-by: ForwardSlashBack * chore: add unit test coverage for icon light client (#851) * ci: add injectived, and neutornd binary (#858) * ci: add injectived, and neutornd binary * ci: update archwayd to v6.0.0 * ci: update archwayd to v6.0.0 * chore: add test coverage for xcall-ibc-connection (#853) * fix: fix test * fix: resolve test issues * fix: cargo fmt --------- Co-authored-by: AntonAndell Co-authored-by: undefined <107839945+bishalbikram@users.noreply.github.com> Co-authored-by: ForwardSlashBack <142098649+ForwardSlashBack@users.noreply.github.com> Co-authored-by: ForwardSlashBack Co-authored-by: DeepakBomjan <44976635+DeepakBomjan@users.noreply.github.com> --- .github/deployer/init_script.sh | 24 +- .github/workflows/runner-start.yml | 4 +- Cargo.lock | 1449 +++++++++-------- Cargo.toml | 35 +- contracts/cosmwasm-vm/cw-common/Cargo.toml | 4 +- contracts/cosmwasm-vm/cw-common/src/utils.rs | 4 +- contracts/cosmwasm-vm/cw-ibc-core/Cargo.toml | 6 +- .../cosmwasm-vm/cw-ibc-core/src/contract.rs | 42 +- .../cw-ibc-core/src/ics02_client/handler.rs | 6 +- .../src/ics03_connection/connection.rs | 17 +- .../src/ics03_connection/handler.rs | 50 +- .../cw-ibc-core/src/ics04_channel/handler.rs | 20 +- .../ics04_channel/packet/acknowledgement.rs | 20 +- .../ics04_channel/packet/receive_packet.rs | 20 +- .../src/ics04_channel/packet/send_packet.rs | 14 +- .../ics04_channel/packet/timeout_on_close.rs | 4 +- .../tests/channel/test_acknowledgement.rs | 161 +- .../tests/channel/test_channel_closeinit.rs | 23 +- .../tests/channel/test_close_confirm.rs | 23 +- .../tests/channel/test_execution_channel.rs | 20 +- .../cw-ibc-core/tests/channel/test_handler.rs | 114 ++ .../tests/channel/test_open_ack.rs | 88 +- .../tests/channel/test_open_confirm.rs | 65 +- .../cw-ibc-core/tests/channel/test_packet.rs | 17 + .../tests/channel/test_receive_packet.rs | 151 +- .../cw-ibc-core/tests/channel/test_timeout.rs | 316 +--- .../tests/channel/test_timeout_on_close.rs | 135 +- .../channel/test_write_acknowledgement.rs | 15 +- .../cosmwasm-vm/cw-ibc-core/tests/setup.rs | 75 +- .../cw-ibc-core/tests/test_channel.rs | 59 +- .../cw-ibc-core/tests/test_client.rs | 943 ++++------- .../cw-ibc-core/tests/test_connection.rs | 408 +++-- .../cw-ibc-core/tests/test_host.rs | 10 + .../cw-ibc-core/tests/test_port.rs | 16 +- .../cw-icon-light-client/Cargo.toml | 7 +- .../cw-icon-light-client/src/constants.rs | 9 - .../src/{state.rs => context.rs} | 191 ++- .../cw-icon-light-client/src/contract.rs | 138 +- .../cw-icon-light-client/src/lib.rs | 16 +- .../cw-icon-light-client/src/query_handler.rs | 259 +-- .../cw-icon-light-client/src/traits.rs | 134 -- .../cosmwasm-vm/cw-integration/Cargo.toml | 8 +- .../cosmwasm-vm/cw-integration/tests/setup.rs | 30 +- .../tests/test_host_lightclient.rs | 8 +- .../tests/test_xcall_connection.rs | 4 +- .../cw-light-client-common/Cargo.toml | 27 + .../cw-light-client-common/src/constants.rs | 20 + .../src/error.rs | 3 + .../cw-light-client-common/src/lib.rs | 5 + .../src/light_client.rs | 87 +- .../src/traits/context.rs | 80 + .../src/traits/light_client.rs | 46 + .../cw-light-client-common/src/traits/mod.rs | 44 + .../src/traits/query_handler.rs | 251 +++ .../cw-mock-ibc-connection/Cargo.toml | 6 +- .../cosmwasm-vm/cw-mock-ibc-core/Cargo.toml | 8 +- .../cosmwasm-vm/cw-mock-ibc-dapp/Cargo.toml | 6 +- .../cosmwasm-vm/cw-mock-ibc-dapp/src/admin.rs | 6 +- .../cw-mock-ibc-dapp/src/ibc_host.rs | 2 +- .../cw-wasm-light-client/.cargo/config | 4 + .../cw-wasm-light-client/Cargo.toml | 70 + .../cw-wasm-light-client/README.md | 7 + .../cw-wasm-light-client/src/constants.rs | 1 + .../cw-wasm-light-client/src/context.rs | 164 ++ .../cw-wasm-light-client/src/contract.rs | 233 +++ .../cw-wasm-light-client/src/lib.rs | 16 + .../cw-wasm-light-client/src/msg.rs | 233 +++ .../cw-wasm-light-client/src/query_handler.rs | 101 ++ .../cw-wasm-light-client/src/utils.rs | 99 ++ .../cw-wasm-light-client/tests/setup.rs | 126 ++ .../tests/test_execute.rs | 49 + .../tests/test_instantiate.rs | 38 + .../cw-xcall-ibc-connection/Cargo.toml | 6 +- .../cw-xcall-ibc-connection/src/assertion.rs | 101 ++ .../cw-xcall-ibc-connection/src/contract.rs | 20 +- .../cw-xcall-ibc-connection/src/fee.rs | 59 + .../cw-xcall-ibc-connection/src/ibc.rs | 2 +- .../cw-xcall-ibc-connection/src/ibc_host.rs | 7 +- .../src/receive_packet.rs | 2 +- .../cw-xcall-ibc-connection/tests/setup.rs | 226 ++- .../tests/test_admin.rs | 129 +- .../tests/test_call_service.rs | 35 +- .../cw-xcall-ibc-connection/tests/test_ibc.rs | 84 + .../tests/test_ibc_functions.rs | 593 ++++--- .../tests/test_owner.rs | 24 +- .../java/ibc/ics04/channel/IBCPacket.java | 5 +- .../java/ibc/ics04/channel/PacketTest.java | 65 +- docs/adr/ICON_IBC.md | 16 +- .../ibc/core/ics02_client/client_message.rs | 34 + .../common/src/ibc/core/ics02_client/mod.rs | 1 + .../src/ibc/core/ics23_commitment/merkle.rs | 196 +-- .../src/ibc/core/ics23_commitment/mod.rs | 2 +- .../rust/common/src/ibc/mock/client_state.rs | 3 +- .../common/src/ibc/mock/consensus_state.rs | 3 +- libraries/rust/common/src/ibc/mock/header.rs | 3 +- .../rust/common/src/ibc/mock/misbehaviour.rs | 3 +- libraries/rust/common/src/icon/mod.rs | 1 - libraries/rust/test-utils/Cargo.toml | 15 +- libraries/rust/test-utils/src/lib.rs | 21 +- scripts/optimize-cosmwasm.sh | 5 +- 100 files changed, 5554 insertions(+), 3001 deletions(-) delete mode 100644 contracts/cosmwasm-vm/cw-icon-light-client/src/constants.rs rename contracts/cosmwasm-vm/cw-icon-light-client/src/{state.rs => context.rs} (75%) delete mode 100644 contracts/cosmwasm-vm/cw-icon-light-client/src/traits.rs create mode 100644 contracts/cosmwasm-vm/cw-light-client-common/Cargo.toml create mode 100644 contracts/cosmwasm-vm/cw-light-client-common/src/constants.rs rename contracts/cosmwasm-vm/{cw-icon-light-client => cw-light-client-common}/src/error.rs (98%) create mode 100644 contracts/cosmwasm-vm/cw-light-client-common/src/lib.rs rename contracts/cosmwasm-vm/{cw-icon-light-client => cw-light-client-common}/src/light_client.rs (89%) create mode 100644 contracts/cosmwasm-vm/cw-light-client-common/src/traits/context.rs create mode 100644 contracts/cosmwasm-vm/cw-light-client-common/src/traits/light_client.rs create mode 100644 contracts/cosmwasm-vm/cw-light-client-common/src/traits/mod.rs create mode 100644 contracts/cosmwasm-vm/cw-light-client-common/src/traits/query_handler.rs create mode 100644 contracts/cosmwasm-vm/cw-wasm-light-client/.cargo/config create mode 100644 contracts/cosmwasm-vm/cw-wasm-light-client/Cargo.toml create mode 100644 contracts/cosmwasm-vm/cw-wasm-light-client/README.md create mode 100644 contracts/cosmwasm-vm/cw-wasm-light-client/src/constants.rs create mode 100644 contracts/cosmwasm-vm/cw-wasm-light-client/src/context.rs create mode 100644 contracts/cosmwasm-vm/cw-wasm-light-client/src/contract.rs create mode 100644 contracts/cosmwasm-vm/cw-wasm-light-client/src/lib.rs create mode 100644 contracts/cosmwasm-vm/cw-wasm-light-client/src/msg.rs create mode 100644 contracts/cosmwasm-vm/cw-wasm-light-client/src/query_handler.rs create mode 100644 contracts/cosmwasm-vm/cw-wasm-light-client/src/utils.rs create mode 100644 contracts/cosmwasm-vm/cw-wasm-light-client/tests/setup.rs create mode 100644 contracts/cosmwasm-vm/cw-wasm-light-client/tests/test_execute.rs create mode 100644 contracts/cosmwasm-vm/cw-wasm-light-client/tests/test_instantiate.rs create mode 100644 contracts/cosmwasm-vm/cw-xcall-ibc-connection/tests/test_ibc.rs create mode 100644 libraries/rust/common/src/ibc/core/ics02_client/client_message.rs diff --git a/.github/deployer/init_script.sh b/.github/deployer/init_script.sh index 8d928dcf0..bba984229 100755 --- a/.github/deployer/init_script.sh +++ b/.github/deployer/init_script.sh @@ -11,7 +11,9 @@ KMS_ID="KMS_ID_HERE" DEPLOYR_HOME="/home/deployr" GO_VERS="1.20.6" JAVA_VERS="11.0.18_10" -ARCHWAY_VERS="0.4.0" +ARCHWAY_VERS="6.0.0" +INJECTIVE_VERS="1.12.1-1705909076" +NEUTRON_VERS="3.0.2" set -x export GOROOT=/usr/local/go @@ -54,7 +56,7 @@ export TMOUT PROMPT_COMMAND='history -a >(logger -t "[$USER] $SSH_CONNECTION")' EOF -apt-get install auditd audispd-plugins -y +apt-get install auditd audispd-plugins unzip -y systemctl enable auditd systemctl start auditd @@ -103,8 +105,22 @@ tar xf OpenJDK11U-jdk_x64_linux_hotspot_$${JAVA_VERS}.tar.gz -C /opt/java go install github.com/icon-project/goloop/cmd/goloop@latest # Install archway -wget -q https://github.com/archway-network/archway/releases/download/v$${ARCHWAY_VERS}/archway_$${ARCHWAY_VERS}_linux_amd64.tar.gz -tar xf archway_$${ARCHWAY_VERS}_linux_amd64.tar.gz -C /usr/local/bin +wget -q https://github.com/archway-network/archway/releases/download/v$${ARCHWAY_VERS}/archway_$${ARCHWAY_VERS}_linux_amd64.zip +unzip archway_$${ARCHWAY_VERS}_linux_amd64.zip +sudo archwayd /usr/local/bin + +# Install injectived +wget -q https://github.com/InjectiveLabs/injective-chain-releases/releases/download/v$${INJECTIVE_VERS}/linux-amd64.zip +unzip linux-amd64.zip +sudo cp injectived peggo /usr/bin +sudo cp libwasmvm.x86_64.so /usr/lib +sudo chmod +x /usr/bin/injectived +sudo chmod +x /usr/bin/peggo + +# Install neutron +wget -q https://github.com/neutron-org/neutron/releases/download/v$${NEUTRON_VERS}/neutrond-linux-amd64 +sudo cp neutrond-linux-amd64 /usr/local/bin/neutrond +sudo chmod +x /usr/local/bin/neutrond # Install boto3, yq, and jq apt-get install python3-pip -y diff --git a/.github/workflows/runner-start.yml b/.github/workflows/runner-start.yml index 20d41a4bd..987f71422 100644 --- a/.github/workflows/runner-start.yml +++ b/.github/workflows/runner-start.yml @@ -40,7 +40,7 @@ jobs: repository: icon-project/ibc-relay - name: Start EC2 instance id: start - uses: machulav/ec2-github-runner + uses: machulav/ec2-github-runner@v2 with: mode: start github-token: ${{ secrets.GH_RUNNER_PAT }} @@ -49,4 +49,4 @@ jobs: subnet-id: subnet-f1fcd4df security-group-id: sg-03cb8034e27e1caeb pre-runner-script: | - ./build.sh ${{ inputs.relayer_version == '' && steps.relay.outputs.release || inputs.relayer_version }} \ No newline at end of file + ./build.sh ${{ inputs.relayer_version == '' && steps.relay.outputs.release || inputs.relayer_version }} diff --git a/Cargo.lock b/Cargo.lock index a68d4c36a..a1ff31536 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "ahash" -version = "0.7.6" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +checksum = "5a824f2aa7e75a0c98c5a504fceb80649e9c35265d44525b5f94de4771a395cd" dependencies = [ "getrandom", "once_cell", @@ -14,33 +14,25 @@ dependencies = [ ] [[package]] -name = "ahash" -version = "0.8.3" +name = "aho-corasick" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" dependencies = [ - "cfg-if", - "once_cell", - "version_check", + "memchr", ] -[[package]] -name = "android-tzdata" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" - [[package]] name = "anyhow" -version = "1.0.71" +version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" +checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" [[package]] name = "arrayvec" -version = "0.7.2" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" [[package]] name = "autocfg" @@ -50,9 +42,9 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "base16ct" -version = "0.1.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" [[package]] name = "base64" @@ -66,6 +58,12 @@ version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" +[[package]] +name = "base64" +version = "0.21.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" + [[package]] name = "base64ct" version = "1.6.0" @@ -85,67 +83,46 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] -name = "block-buffer" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" -dependencies = [ - "generic-array", -] - -[[package]] -name = "block-buffer" -version = "0.10.4" +name = "bitflags" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" -dependencies = [ - "generic-array", -] +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" [[package]] -name = "borsh" -version = "0.10.3" +name = "bitvec" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4114279215a005bc675e386011e594e1d9b800918cea18fcadadcce864a2046b" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" dependencies = [ - "borsh-derive", - "hashbrown 0.13.2", + "funty", + "radium", + "tap", + "wyz", ] [[package]] -name = "borsh-derive" -version = "0.10.3" +name = "block-buffer" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0754613691538d51f329cce9af41d7b7ca150bc973056f1156611489475f54f7" +checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" dependencies = [ - "borsh-derive-internal", - "borsh-schema-derive-internal", - "proc-macro-crate 0.1.5", - "proc-macro2 1.0.59", - "syn 1.0.109", + "generic-array", ] [[package]] -name = "borsh-derive-internal" -version = "0.10.3" +name = "block-buffer" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afb438156919598d2c7bad7e1c0adf3d26ed3840dbc010db1a882a65583ca2fb" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" dependencies = [ - "proc-macro2 1.0.59", - "quote 1.0.28", - "syn 1.0.109", + "generic-array", ] [[package]] -name = "borsh-schema-derive-internal" -version = "0.10.3" +name = "bnum" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634205cc43f74a1b9046ef87c4540ebda95696ec0f315024860cad7c5b0f5ccd" -dependencies = [ - "proc-macro2 1.0.59", - "quote 1.0.28", - "syn 1.0.109", -] +checksum = "ab9008b6bb9fc80b5277f2fe481c09e828743d9151203e804583eb4c9e15b31d" [[package]] name = "byte-slice-cast" @@ -155,25 +132,19 @@ checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" [[package]] name = "byteorder" -version = "1.4.3" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" dependencies = [ "serde", ] -[[package]] -name = "cc" -version = "1.0.79" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" - [[package]] name = "cfg-if" version = "1.0.0" @@ -182,11 +153,10 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.26" +version = "0.4.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec837a71355b28f6556dbd569b37b3f363091c0bd4b2e735674521b4c5fd9bc5" +checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" dependencies = [ - "android-tzdata", "num-traits", ] @@ -204,11 +174,11 @@ dependencies = [ "dyn-clone", "hex", "hex-literal 0.3.4", - "ibc-proto", - "ics23", + "ibc-proto 0.26.0", + "ics23 0.9.0", "pbjson", "pbjson-types", - "prost 0.11.9", + "prost", "prost-types", "rlp-derive", "rustc-hex", @@ -216,10 +186,10 @@ dependencies = [ "serde", "serde-json-wasm 0.5.1", "serde_json", - "sha2 0.10.6", + "sha2 0.10.8", "sha3", "subtle-encoding", - "tendermint", + "tendermint 0.29.1", "test-log", "test-utils", "time", @@ -229,7 +199,7 @@ dependencies = [ [[package]] name = "common" version = "0.1.0" -source = "git+https://github.com/icon-project/IBC-Integration.git?branch=main#8b3dbac3e846fdc2bf36861a3c0f65b917acda43" +source = "git+https://github.com/icon-project/IBC-Integration.git?branch=feat/cw-wasm-light-client#d2eb1ac6c83de203d10c0488c8c450d1017f0586" dependencies = [ "bytes", "cosmwasm-schema", @@ -241,11 +211,11 @@ dependencies = [ "dyn-clone", "hex", "hex-literal 0.3.4", - "ibc-proto", - "ics23", + "ibc-proto 0.26.0", + "ics23 0.9.0", "pbjson", "pbjson-types", - "prost 0.11.9", + "prost", "prost-types", "rlp-derive", "rustc-hex", @@ -253,18 +223,33 @@ dependencies = [ "serde", "serde-json-wasm 0.5.1", "serde_json", - "sha2 0.10.6", + "sha2 0.10.8", "sha3", "subtle-encoding", - "tendermint", + "tendermint 0.29.1", "time", ] [[package]] name = "const-oid" -version = "0.9.2" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" + +[[package]] +name = "convert_case" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "520fbf3c07483f94e3e3ca9d0cfd913d7718ef2483d2cfd91c0d9e91474ab913" +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" + +[[package]] +name = "convert_case" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" +dependencies = [ + "unicode-segmentation", +] [[package]] name = "cosmwasm" @@ -281,11 +266,12 @@ dependencies = [ [[package]] name = "cosmwasm-crypto" -version = "1.2.6" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41c0e41be7e6c7d7ab3c61cdc32fcfaa14f948491a401cbc1c74bb33b6f4b851" +checksum = "d8bb3c77c3b7ce472056968c745eb501c440fbc07be5004eba02782c35bfbbe3" dependencies = [ "digest 0.10.7", + "ecdsa", "ed25519-zebra", "k256", "rand_core 0.6.4", @@ -294,21 +280,21 @@ dependencies = [ [[package]] name = "cosmwasm-derive" -version = "1.2.6" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a7ee2798c92c00dd17bebb4210f81d5f647e5e92d847959b7977e0fd29a3500" +checksum = "fea73e9162e6efde00018d55ed0061e93a108b5d6ec4548b4f8ce3c706249687" dependencies = [ "syn 1.0.109", ] [[package]] name = "cosmwasm-schema" -version = "1.2.6" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "407aca6f1671a08b60db8167f03bb7cb6b2378f0ddd9a030367b66ba33c2fd41" +checksum = "0df41ea55f2946b6b43579659eec048cc2f66e8c8e2e3652fc5e5e476f673856" dependencies = [ "cosmwasm-schema-derive", - "schemars 0.8.12", + "schemars 0.8.16", "serde", "serde_json", "thiserror", @@ -316,50 +302,42 @@ dependencies = [ [[package]] name = "cosmwasm-schema-derive" -version = "1.2.6" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6d1e00b8fd27ff923c10303023626358e23a6f9079f8ebec23a8b4b0bfcd4b3" +checksum = "43609e92ce1b9368aa951b334dd354a2d0dd4d484931a5f83ae10e12a26c8ba9" dependencies = [ - "proc-macro2 1.0.59", - "quote 1.0.28", + "proc-macro2 1.0.70", + "quote 1.0.33", "syn 1.0.109", ] [[package]] name = "cosmwasm-std" -version = "1.2.6" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92d5fdfd112b070055f068fad079d490117c8e905a588b92a5a7c9276d029930" +checksum = "04d6864742e3a7662d024b51a94ea81c9af21db6faea2f9a6d2232bb97c6e53e" dependencies = [ - "base64 0.13.1", + "base64 0.21.5", + "bech32", + "bnum", "cosmwasm-crypto", "cosmwasm-derive", "derivative", "forward_ref", "hex", - "schemars 0.8.12", + "schemars 0.8.16", "serde", "serde-json-wasm 0.5.1", - "sha2 0.10.6", + "sha2 0.10.8", + "static_assertions", "thiserror", - "uint", -] - -[[package]] -name = "cosmwasm-storage" -version = "1.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af9e21c4f58986fd20184d7685e1c43c5732c9309337b09307d5952fd34dba6e" -dependencies = [ - "cosmwasm-std", - "serde", ] [[package]] name = "cpufeatures" -version = "0.2.7" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e4c1eaa2012c47becbbad2ab175484c2a84d1185b566fb2cc5b8707343dfe58" +checksum = "ce420fe07aecd3e67c5f910618fe65e94158f6dcc0adf44e00d69ce2bdfe0fd0" dependencies = [ "libc", ] @@ -372,9 +350,9 @@ checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] name = "crypto-bigint" -version = "0.4.9" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef2b4b23cddf68b89b8f8069890e8c270d54e2d5fe1b143820234805e4cb17ef" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ "generic-array", "rand_core 0.6.4", @@ -428,14 +406,14 @@ dependencies = [ "cosmwasm-schema", "cosmwasm-std", "cw-storage-plus 1.1.0", - "cw-xcall-lib 0.1.0 (git+https://github.com/icon-project/xCall.git?tag=v0.1.0-alpha.5)", + "cw-xcall-lib", "debug_print", "getrandom", "hex", "hex-buffer-serde", - "ibc-proto", - "prost 0.11.9", - "schemars 0.8.12", + "ibc-proto 0.26.0", + "prost", + "schemars 0.8.16", "serde", "serde-json-wasm 0.5.1", "serde_json", @@ -453,18 +431,17 @@ dependencies = [ "cosmwasm-std", "cw-common", "cw-icon-light-client", - "cw-multi-test", "cw-storage-plus 1.1.0", "cw2", "debug_print", "getrandom", "hex", - "hex-literal 0.3.4", - "prost 0.11.9", - "schemars 0.8.12", + "hex-literal 0.4.1", + "prost", + "schemars 0.8.16", "serde", "serde-json-wasm 0.5.1", - "sha2 0.10.6", + "sha2 0.10.8", "sha3", "test-utils", "thiserror", @@ -479,85 +456,43 @@ dependencies = [ "cosmwasm", "cosmwasm-schema", "cosmwasm-std", - "cosmwasm-storage", "cw-common", + "cw-light-client-common", "cw-storage-plus 1.1.0", "cw2", "debug_print", "getrandom", "hex", - "hex-literal 0.3.4", - "prost 0.11.9", - "schemars 0.8.12", + "hex-literal 0.4.1", + "prost", + "schemars 0.8.16", "serde", "serde-json-wasm 0.5.1", - "sha2 0.10.6", + "sha2 0.10.8", "sha3", "test-utils", "thiserror", ] [[package]] -name = "cw-integration" -version = "0.1.1" +name = "cw-light-client-common" +version = "0.1.0" dependencies = [ - "anyhow", "common 0.1.0", + "cosmwasm", "cosmwasm-schema", "cosmwasm-std", - "cosmwasm-storage", "cw-common", - "cw-ibc-core", - "cw-icon-light-client", - "cw-mock-dapp", - "cw-mock-dapp-multi", - "cw-mock-ibc-core", - "cw-multi-test", "cw-storage-plus 1.1.0", - "cw-xcall 0.1.0 (git+https://github.com/icon-project/xCall.git?tag=v0.1.0-alpha.5)", - "cw-xcall-ibc-connection", - "cw-xcall-lib 0.1.0 (git+https://github.com/icon-project/xCall.git?tag=v0.1.0-alpha.5)", + "debug_print", + "getrandom", "hex", - "ibc", - "prost 0.11.9", - "strum", - "strum_macros", - "test-utils", -] - -[[package]] -name = "cw-mock-dapp" -version = "0.1.0" -source = "git+https://github.com/icon-project/xCall.git?tag=v0.1.0-alpha.5#7f250bc9c6560591ccc16289cb8159dd100bbe76" -dependencies = [ - "common 0.1.0 (git+https://github.com/icon-project/IBC-Integration.git?branch=main)", - "cosmwasm-schema", - "cosmwasm-std", - "cosmwasm-storage", - "cw-storage-plus 1.1.0", - "cw-xcall-lib 0.1.0 (git+https://github.com/icon-project/xCall.git?tag=v0.1.0-alpha.5)", - "cw2", - "schemars 0.8.12", - "serde", - "serde-json-wasm 0.5.1", - "thiserror", -] - -[[package]] -name = "cw-mock-dapp-multi" -version = "0.1.0" -source = "git+https://github.com/icon-project/xCall.git?tag=v0.1.0-alpha.5#7f250bc9c6560591ccc16289cb8159dd100bbe76" -dependencies = [ - "common 0.1.0 (git+https://github.com/icon-project/IBC-Integration.git?branch=main)", - "cosmwasm-schema", - "cosmwasm-std", - "cosmwasm-storage", - "cw-storage-plus 1.1.0", - "cw-xcall-lib 0.1.0 (git+https://github.com/icon-project/xCall.git?tag=v0.1.0-alpha.5)", - "cw2", - "schemars 0.8.12", + "hex-literal 0.4.1", + "prost", + "schemars 0.8.16", "serde", "serde-json-wasm 0.5.1", + "test-utils", "thiserror", ] @@ -569,16 +504,15 @@ dependencies = [ "cosmwasm", "cosmwasm-schema", "cosmwasm-std", - "cosmwasm-storage", "cw-common", "cw-storage-plus 1.1.0", - "cw-xcall 0.1.0 (git+https://github.com/icon-project/xCall.git?tag=v0.1.0-alpha.5)", - "cw-xcall-lib 0.1.0 (git+https://github.com/icon-project/xCall.git?tag=v0.1.0-alpha.5)", + "cw-xcall", + "cw-xcall-lib", "cw2", "debug_print", "getrandom", "hex", - "schemars 0.8.12", + "schemars 0.8.16", "serde", "thiserror", ] @@ -590,14 +524,13 @@ dependencies = [ "common 0.1.0", "cosmwasm-schema", "cosmwasm-std", - "cosmwasm-storage", "cw-common", "cw-storage-plus 1.1.0", - "cw-xcall 0.1.0 (git+https://github.com/icon-project/xCall.git?branch=main)", + "cw-xcall", "cw2", "getrandom", "hex", - "schemars 0.8.12", + "schemars 0.8.16", "serde", "thiserror", ] @@ -610,105 +543,83 @@ dependencies = [ "cosmwasm", "cosmwasm-schema", "cosmwasm-std", - "cosmwasm-storage", "cw-common", "cw-storage-plus 1.1.0", "cw2", "debug_print", "getrandom", "hex", - "schemars 0.8.12", + "schemars 0.8.16", "serde", "thiserror", ] -[[package]] -name = "cw-multi-test" -version = "0.16.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a18afd2e201221c6d72a57f0886ef2a22151bbc9e6db7af276fde8a91081042" -dependencies = [ - "anyhow", - "cosmwasm-std", - "cw-storage-plus 1.0.1", - "cw-utils", - "derivative", - "itertools", - "k256", - "prost 0.9.0", - "schemars 0.8.12", - "serde", - "thiserror", -] - -[[package]] -name = "cw-storage-plus" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "053a5083c258acd68386734f428a5a171b29f7d733151ae83090c6fcc9417ffa" -dependencies = [ - "cosmwasm-std", - "schemars 0.8.12", - "serde", -] - [[package]] name = "cw-storage-plus" version = "1.1.0" source = "git+https://github.com/icon-project/cw-storage-plus.git?branch=fix-raw#238b520c3e193226143eedb717a3ed76187d11de" dependencies = [ "cosmwasm-std", - "schemars 0.8.12", + "schemars 0.8.16", "serde", ] [[package]] -name = "cw-utils" -version = "1.0.1" +name = "cw-storage-plus" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c80e93d1deccb8588db03945016a292c3c631e6325d349ebb35d2db6f4f946f7" +checksum = "d5ff29294ee99373e2cd5fd21786a3c0ced99a52fec2ca347d565489c61b723c" dependencies = [ - "cosmwasm-schema", "cosmwasm-std", - "cw2", - "schemars 0.8.12", - "semver", + "schemars 0.8.16", "serde", - "thiserror", ] [[package]] -name = "cw-xcall" +name = "cw-wasm-light-client" version = "0.1.0" -source = "git+https://github.com/icon-project/xCall.git?tag=v0.1.0-alpha.5#7f250bc9c6560591ccc16289cb8159dd100bbe76" dependencies = [ - "common 0.1.0 (git+https://github.com/icon-project/IBC-Integration.git?branch=main)", + "base64 0.13.1", + "bytes", + "common 0.1.0", + "cosmwasm", "cosmwasm-schema", "cosmwasm-std", - "cosmwasm-storage", - "cw-storage-plus 1.1.0", - "cw-xcall-lib 0.1.0 (git+https://github.com/icon-project/xCall.git?tag=v0.1.0-alpha.5)", + "cw-common", + "cw-light-client-common", "cw2", "debug_print", - "schemars 0.8.12", + "getrandom", + "hex", + "hex-literal 0.4.1", + "ibc", + "ibc-proto 0.18.0 (git+https://github.com/ComposableFi/composable-ibc.git)", + "ics07-tendermint-cw", + "ics08-wasm", + "prost", + "schemars 0.8.16", "serde", + "serde-json-wasm 0.5.1", + "sha2 0.10.8", + "sha3", + "tendermint-proto 0.28.0", + "test-utils", "thiserror", ] [[package]] name = "cw-xcall" -version = "0.1.0" -source = "git+https://github.com/icon-project/xCall.git?branch=main#59960dcb8bcfb43e7e079ebe7e86dbf9baf05160" +version = "0.2.0" +source = "git+https://github.com/icon-project/xCall.git?branch=main#a61aefea5e3458ba32c12d6b477dcc89984d4dc6" dependencies = [ - "common 0.1.0 (git+https://github.com/icon-project/IBC-Integration.git?branch=main)", + "common 0.1.0 (git+https://github.com/icon-project/IBC-Integration.git?branch=feat/cw-wasm-light-client)", "cosmwasm-schema", "cosmwasm-std", - "cosmwasm-storage", "cw-storage-plus 1.1.0", - "cw-xcall-lib 0.1.0 (git+https://github.com/icon-project/xCall.git?branch=main)", + "cw-xcall-lib", "cw2", "debug_print", - "schemars 0.8.12", + "schemars 0.8.16", "serde", "thiserror", ] @@ -721,32 +632,15 @@ dependencies = [ "cosmwasm", "cosmwasm-schema", "cosmwasm-std", - "cosmwasm-storage", "cw-common", "cw-storage-plus 1.1.0", - "cw-xcall 0.1.0 (git+https://github.com/icon-project/xCall.git?tag=v0.1.0-alpha.5)", - "cw-xcall-lib 0.1.0 (git+https://github.com/icon-project/xCall.git?tag=v0.1.0-alpha.5)", + "cw-xcall", + "cw-xcall-lib", "cw2", "debug_print", "getrandom", "hex", - "schemars 0.8.12", - "serde", - "thiserror", -] - -[[package]] -name = "cw-xcall-lib" -version = "0.1.0" -source = "git+https://github.com/icon-project/xCall.git?tag=v0.1.0-alpha.5#7f250bc9c6560591ccc16289cb8159dd100bbe76" -dependencies = [ - "cosmwasm-schema", - "cosmwasm-std", - "cosmwasm-storage", - "cw-storage-plus 1.1.0", - "cw2", - "debug_print", - "schemars 0.8.12", + "schemars 0.8.16", "serde", "thiserror", ] @@ -754,30 +648,31 @@ dependencies = [ [[package]] name = "cw-xcall-lib" version = "0.1.0" -source = "git+https://github.com/icon-project/xCall.git?branch=main#59960dcb8bcfb43e7e079ebe7e86dbf9baf05160" +source = "git+https://github.com/icon-project/xCall.git?branch=main#a61aefea5e3458ba32c12d6b477dcc89984d4dc6" dependencies = [ "cosmwasm-schema", "cosmwasm-std", - "cosmwasm-storage", "cw-storage-plus 1.1.0", "cw2", "debug_print", - "schemars 0.8.12", + "schemars 0.8.16", "serde", "thiserror", ] [[package]] name = "cw2" -version = "1.0.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fb70cee2cf0b4a8ff7253e6bc6647107905e8eb37208f87d54f67810faa62f8" +checksum = "c6c120b24fbbf5c3bedebb97f2cc85fbfa1c3287e09223428e7e597b5293c1fa" dependencies = [ "cosmwasm-schema", "cosmwasm-std", - "cw-storage-plus 1.0.1", - "schemars 0.8.12", + "cw-storage-plus 1.2.0", + "schemars 0.8.16", + "semver", "serde", + "thiserror", ] [[package]] @@ -788,9 +683,9 @@ checksum = "8f215f9b7224f49fb73256115331f677d868b34d18b65dbe4db392e6021eea90" [[package]] name = "der" -version = "0.6.1" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1a467a65c5e759bce6e65eaf91cc29f466cdc57cb65777bd646872a8a1fd4de" +checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" dependencies = [ "const-oid", "zeroize", @@ -802,8 +697,8 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" dependencies = [ - "proc-macro2 1.0.59", - "quote 1.0.28", + "proc-macro2 1.0.70", + "quote 1.0.33", "syn 1.0.109", ] @@ -813,8 +708,10 @@ version = "0.99.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" dependencies = [ - "proc-macro2 1.0.59", - "quote 1.0.28", + "convert_case 0.4.0", + "proc-macro2 1.0.70", + "quote 1.0.33", + "rustc_version", "syn 1.0.109", ] @@ -834,6 +731,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer 0.10.4", + "const-oid", "crypto-common", "subtle", ] @@ -844,9 +742,9 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ - "proc-macro2 1.0.59", - "quote 1.0.28", - "syn 2.0.18", + "proc-macro2 1.0.70", + "quote 1.0.33", + "syn 2.0.40", ] [[package]] @@ -857,20 +755,22 @@ checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" [[package]] name = "dyn-clone" -version = "1.0.11" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68b0cf012f1230e43cd00ebb729c6bb58707ecfa8ad08b52ef3a4ccd2697fc30" +checksum = "545b22097d44f8a9581187cdf93de7a71e4722bf51200cfaba810865b49a495d" [[package]] name = "ecdsa" -version = "0.14.8" +version = "0.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413301934810f597c1d19ca71c8710e99a3f1ba28a0d2ebc01551a2daeea3c5c" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" dependencies = [ "der", + "digest 0.10.7", "elliptic-curve", "rfc6979", - "signature", + "signature 2.2.0", + "spki", ] [[package]] @@ -879,7 +779,7 @@ version = "1.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "91cff35c70bba8a626e3185d8cd48cc11b5437e1a5bcd15b9b5fa3c64b6dfee7" dependencies = [ - "signature", + "signature 1.6.4", ] [[package]] @@ -912,19 +812,18 @@ dependencies = [ [[package]] name = "either" -version = "1.8.1" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" [[package]] name = "elliptic-curve" -version = "0.12.3" +version = "0.13.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7bb888ab5300a19b8e5bceef25ac745ad065f3c9f7efc6de1b91958110891d3" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" dependencies = [ "base16ct", "crypto-bigint", - "der", "digest 0.10.7", "ff", "generic-array", @@ -937,49 +836,51 @@ dependencies = [ ] [[package]] -name = "erased-serde" -version = "0.3.25" +name = "env_logger" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f2b0c2380453a92ea8b6c8e5f64ecaafccddde8ceab55ff7a8ac1029f894569" +checksum = "95b3f3e67048839cb0d0781f445682a35113da7121f7c949db0e2be96a4fbece" dependencies = [ - "serde", + "log", ] +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + [[package]] name = "errno" -version = "0.3.1" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" dependencies = [ - "errno-dragonfly", "libc", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] -name = "errno-dragonfly" -version = "0.1.2" +name = "eyre" +version = "0.6.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +checksum = "8bbb8258be8305fb0237d7b295f47bb24ff1b136a535f473baf40e70468515aa" dependencies = [ - "cc", - "libc", + "indenter", + "once_cell", ] [[package]] name = "fastrand" -version = "1.9.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" -dependencies = [ - "instant", -] +checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" [[package]] name = "ff" -version = "0.12.1" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d013fc25338cc558c5c2cfbad646908fb23591e2404481826742b651c9af7160" +checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" dependencies = [ "rand_core 0.6.4", "subtle", @@ -1006,6 +907,7 @@ version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c606d892c9de11507fa0dcffc116434f94e105d0bbdc4e405b61519464c49d7b" dependencies = [ + "eyre", "paste", ] @@ -1015,11 +917,17 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c8cbd1169bd7b4a0a20d92b9af7a7e0422888bd38a6f5ec29c1fd8c1558a272e" +[[package]] +name = "funty" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" + [[package]] name = "futures" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" +checksum = "da0290714b38af9b4a7b094b8a37086d1b4e61f2df9122c3cad2577669145335" dependencies = [ "futures-channel", "futures-core", @@ -1031,9 +939,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" +checksum = "ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb" dependencies = [ "futures-core", "futures-sink", @@ -1041,33 +949,33 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" +checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c" [[package]] name = "futures-io" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" +checksum = "8bf34a163b5c4c52d0478a4d757da8fb65cabef42ba90515efee0f6f9fa45aaa" [[package]] name = "futures-sink" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" +checksum = "e36d3378ee38c2a36ad710c5d30c2911d752cb941c00c72dbabfb786a7970817" [[package]] name = "futures-task" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" +checksum = "efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2" [[package]] name = "futures-util" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" +checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104" dependencies = [ "futures-core", "futures-sink", @@ -1084,13 +992,14 @@ checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", + "zeroize", ] [[package]] name = "getrandom" -version = "0.2.9" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c85e1d9ab2eadba7e5040d4e09cbd6d072b76a557ad64e797c2cb9d4da21d7e4" +checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" dependencies = [ "cfg-if", "libc", @@ -1099,9 +1008,9 @@ dependencies = [ [[package]] name = "group" -version = "0.12.1" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfbfb3a6cfbd390d5c9564ab283a0349b9b9fcd46a706c1eb10e0db70bfbac7" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ "ff", "rand_core 0.6.4", @@ -1114,17 +1023,14 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" dependencies = [ - "ahash 0.7.6", + "ahash", ] [[package]] name = "hashbrown" -version = "0.13.2" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" -dependencies = [ - "ahash 0.8.3", -] +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" [[package]] name = "heck" @@ -1132,12 +1038,6 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" -[[package]] -name = "hermit-abi" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" - [[package]] name = "hex" version = "0.4.3" @@ -1176,38 +1076,83 @@ dependencies = [ ] [[package]] -name = "ibc" -version = "0.32.0" +name = "home" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "030b54b02c3f35ea7265da2beedf0d7d22492208919a6582f980ff3eae82c2d0" +checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb" dependencies = [ - "bytes", - "cfg-if", + "windows-sys 0.48.0", +] + +[[package]] +name = "ibc" +version = "0.15.0" +source = "git+https://github.com/ComposableFi/composable-ibc.git?branch=master#50eb36a8a1c4f67ae573ac447f6b1ba46f37791c" +dependencies = [ + "cosmwasm-schema", "derive_more", - "displaydoc", - "dyn-clone", - "erased-serde", - "ibc-proto", - "ics23", + "flex-error", + "hex", + "ibc-derive", + "ibc-proto 0.18.0 (git+https://github.com/ComposableFi/composable-ibc.git?branch=master)", + "ics23 0.10.0", + "log", "num-traits", "parity-scale-codec", "primitive-types", - "prost 0.11.9", + "prost", "safe-regex", "scale-info", "serde", "serde_derive", "serde_json", - "sha2 0.10.6", + "sha2 0.10.8", "subtle-encoding", - "tendermint", - "tendermint-light-client-verifier", - "tendermint-proto", + "tendermint 0.28.0", + "tendermint-proto 0.28.0", "time", "tracing", "uint", ] +[[package]] +name = "ibc-derive" +version = "0.1.0" +source = "git+https://github.com/ComposableFi/composable-ibc.git?branch=master#50eb36a8a1c4f67ae573ac447f6b1ba46f37791c" +dependencies = [ + "convert_case 0.6.0", + "proc-macro-crate 1.3.1", + "proc-macro2 1.0.70", + "quote 1.0.33", + "syn 1.0.109", +] + +[[package]] +name = "ibc-proto" +version = "0.18.0" +source = "git+https://github.com/ComposableFi/composable-ibc.git?branch=master#50eb36a8a1c4f67ae573ac447f6b1ba46f37791c" +dependencies = [ + "base64 0.13.1", + "bytes", + "prost", + "schemars 0.8.16", + "serde", + "tendermint-proto 0.28.0", +] + +[[package]] +name = "ibc-proto" +version = "0.18.0" +source = "git+https://github.com/ComposableFi/composable-ibc.git#50eb36a8a1c4f67ae573ac447f6b1ba46f37791c" +dependencies = [ + "base64 0.13.1", + "bytes", + "prost", + "schemars 0.8.16", + "serde", + "tendermint-proto 0.28.0", +] + [[package]] name = "ibc-proto" version = "0.26.0" @@ -1215,15 +1160,79 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c9303a1308c886aea769ef0667c5caa422a78b01e9f8177fea8b91b08a4ff50c" dependencies = [ "base64 0.13.1", - "borsh", "bytes", "flex-error", - "parity-scale-codec", - "prost 0.11.9", - "scale-info", + "prost", "serde", "subtle-encoding", - "tendermint-proto", + "tendermint-proto 0.29.1", +] + +[[package]] +name = "ics07-tendermint" +version = "0.1.0" +source = "git+https://github.com/ComposableFi/composable-ibc.git?branch=master#50eb36a8a1c4f67ae573ac447f6b1ba46f37791c" +dependencies = [ + "bytes", + "flex-error", + "hex", + "ibc", + "ibc-proto 0.18.0 (git+https://github.com/ComposableFi/composable-ibc.git?branch=master)", + "ics23 0.10.0", + "log", + "prost", + "serde", + "serde_json", + "subtle-encoding", + "tendermint 0.28.0", + "tendermint-light-client-verifier", + "tendermint-proto 0.28.0", + "time", +] + +[[package]] +name = "ics07-tendermint-cw" +version = "0.1.0" +source = "git+https://github.com/ComposableFi/composable-ibc.git?branch=master#50eb36a8a1c4f67ae573ac447f6b1ba46f37791c" +dependencies = [ + "byteorder", + "cosmwasm-schema", + "cosmwasm-std", + "derive_more", + "digest 0.10.7", + "ed25519", + "ed25519-consensus", + "ed25519-zebra", + "hex", + "ibc", + "ibc-derive", + "ibc-proto 0.18.0 (git+https://github.com/ComposableFi/composable-ibc.git?branch=master)", + "ics07-tendermint", + "ics08-wasm", + "ics23 0.10.0", + "prost", + "schemars 0.8.16", + "serde", + "sha2 0.10.8", + "sha3", + "tendermint 0.28.0", + "tendermint-light-client-verifier", + "tendermint-proto 0.28.0", + "thiserror", +] + +[[package]] +name = "ics08-wasm" +version = "0.1.0" +source = "git+https://github.com/ComposableFi/composable-ibc.git?branch=master#50eb36a8a1c4f67ae573ac447f6b1ba46f37791c" +dependencies = [ + "cosmwasm-schema", + "hex", + "ibc", + "ibc-proto 0.18.0 (git+https://github.com/ComposableFi/composable-ibc.git?branch=master)", + "prost", + "serde", + "tendermint-proto 0.28.0", ] [[package]] @@ -1235,12 +1244,23 @@ dependencies = [ "anyhow", "bytes", "hex", - "prost 0.11.9", + "prost", "ripemd", - "sha2 0.10.6", + "sha2 0.10.8", "sha3", ] +[[package]] +name = "ics23" +version = "0.10.0" +source = "git+https://github.com/cosmos/ics23?rev=74ce807b7be39a7e0afb4e2efb8e28a57965f57b#74ce807b7be39a7e0afb4e2efb8e28a57965f57b" +dependencies = [ + "anyhow", + "bytes", + "hex", + "prost", +] + [[package]] name = "impl-serde" version = "0.4.0" @@ -1256,39 +1276,25 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" dependencies = [ - "proc-macro2 1.0.59", - "quote 1.0.28", + "proc-macro2 1.0.70", + "quote 1.0.33", "syn 1.0.109", ] [[package]] -name = "indexmap" -version = "1.9.3" +name = "indenter" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" -dependencies = [ - "autocfg", - "hashbrown 0.12.3", -] +checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" [[package]] -name = "instant" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "io-lifetimes" -version = "1.0.11" +name = "indexmap" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" +checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" dependencies = [ - "hermit-abi", - "libc", - "windows-sys 0.48.0", + "equivalent", + "hashbrown 0.14.3", ] [[package]] @@ -1302,20 +1308,22 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.6" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "k256" -version = "0.11.6" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72c1e0b51e7ec0a97369623508396067a486bd0cbed95a2659a4b863d28cfc8b" +checksum = "3f01b677d82ef7a676aa37e099defd83a28e15687112cafdd112d60236b6115b" dependencies = [ "cfg-if", "ecdsa", "elliptic-curve", - "sha2 0.10.6", + "once_cell", + "sha2 0.10.8", + "signature 2.2.0", ] [[package]] @@ -1335,21 +1343,21 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.145" +version = "0.2.151" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc86cde3ff845662b8f4ef6cb50ea0e20c524eb3d29ae048287e06a1b3fa6a81" +checksum = "302d7ab3130588088d277783b1e2d2e10c9e9e4a16dd9050e6ec93fb3e7048f4" [[package]] name = "linux-raw-sys" -version = "0.3.8" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" +checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456" [[package]] name = "log" -version = "0.4.18" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "518ef76f2f87365916b142844c16d8fefd85039bc5699050210a7778ee1cd1de" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "matchers" @@ -1357,14 +1365,14 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" dependencies = [ - "regex-automata", + "regex-automata 0.1.10", ] [[package]] name = "memchr" -version = "2.5.0" +version = "2.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" [[package]] name = "multimap" @@ -1388,25 +1396,25 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" dependencies = [ - "proc-macro2 1.0.59", - "quote 1.0.28", + "proc-macro2 1.0.70", + "quote 1.0.33", "syn 1.0.109", ] [[package]] name = "num-traits" -version = "0.2.15" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" dependencies = [ "autocfg", ] [[package]] name = "once_cell" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "opaque-debug" @@ -1422,33 +1430,35 @@ checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] name = "parity-scale-codec" -version = "3.5.0" +version = "3.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ddb756ca205bd108aee3c62c6d3c994e1df84a59b9d6d4a5ea42ee1fd5a9a28" +checksum = "881331e34fa842a2fb61cc2db9643a8fedc615e47cfcc52597d1af0db9a7e8fe" dependencies = [ "arrayvec", + "bitvec", "byte-slice-cast", "impl-trait-for-tuples", "parity-scale-codec-derive", + "serde", ] [[package]] name = "parity-scale-codec-derive" -version = "3.1.4" +version = "3.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b26a931f824dd4eca30b3e43bb4f31cd5f0d3a403c5f5ff27106b805bfde7b" +checksum = "be30eaf4b0a9fba5336683b38de57bb86d179a35862ba6bfcf57625d006bde5b" dependencies = [ - "proc-macro-crate 1.3.1", - "proc-macro2 1.0.59", - "quote 1.0.28", + "proc-macro-crate 2.0.1", + "proc-macro2 1.0.70", + "quote 1.0.33", "syn 1.0.109", ] [[package]] name = "paste" -version = "1.0.12" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f746c4065a8fa3fe23974dd82f15431cc8d40779821001404d10d2e79ca7d79" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" [[package]] name = "pbjson" @@ -1468,7 +1478,7 @@ checksum = "bdbb7b706f2afc610f3853550cdbbf6372fd324824a087806bd4480ea4996e24" dependencies = [ "heck", "itertools", - "prost 0.11.9", + "prost", "prost-types", ] @@ -1482,16 +1492,16 @@ dependencies = [ "chrono", "pbjson", "pbjson-build", - "prost 0.11.9", + "prost", "prost-build", "serde", ] [[package]] name = "petgraph" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dd7d28ee937e54fe3080c91faa1c3a46c06de6252988a7f4592ba2310ef22a4" +checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" dependencies = [ "fixedbitset", "indexmap", @@ -1499,9 +1509,9 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.2.9" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" [[package]] name = "pin-utils" @@ -1511,9 +1521,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkcs8" -version = "0.9.0" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9eca2c590a5f85da82668fa685c09ce2888b9430e83299debf1f34b65fd4a4ba" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" dependencies = [ "der", "spki", @@ -1525,15 +1535,15 @@ version = "0.1.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c8646e95016a7a6c4adea95bafa8a16baab64b583356217f2c85db4a39d9a86" dependencies = [ - "proc-macro2 1.0.59", + "proc-macro2 1.0.70", "syn 1.0.109", ] [[package]] name = "primitive-types" -version = "0.12.1" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f3486ccba82358b11a77516035647c34ba167dfa53312630de83b12bd4f3d66" +checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" dependencies = [ "fixed-hash", "impl-serde", @@ -1542,21 +1552,22 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "0.1.5" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" +checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" dependencies = [ - "toml", + "once_cell", + "toml_edit 0.19.15", ] [[package]] name = "proc-macro-crate" -version = "1.3.1" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" +checksum = "97dc5fea232fc28d2f597b37c4876b348a40e33f3b02cc975c8d006d78d94b1a" dependencies = [ - "once_cell", - "toml_edit", + "toml_datetime", + "toml_edit 0.20.2", ] [[package]] @@ -1565,28 +1576,18 @@ version = "0.4.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" dependencies = [ - "unicode-xid 0.1.0", + "unicode-xid", ] [[package]] name = "proc-macro2" -version = "1.0.59" +version = "1.0.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6aeca18b86b413c660b781aa319e4e2648a3e6f9eadc9b47e9038e6fe9f3451b" +checksum = "39278fbbf5fb4f646ce651690877f89d1c5811a3d4acb27700c1cb3cdb78fd3b" dependencies = [ "unicode-ident", ] -[[package]] -name = "prost" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "444879275cb4fd84958b1a1d5420d15e6fcf7c235fe47f053c9c2a80aceb6001" -dependencies = [ - "bytes", - "prost-derive 0.9.0", -] - [[package]] name = "prost" version = "0.11.9" @@ -1594,7 +1595,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd" dependencies = [ "bytes", - "prost-derive 0.11.9", + "prost-derive", ] [[package]] @@ -1611,7 +1612,7 @@ dependencies = [ "multimap", "petgraph", "prettyplease", - "prost 0.11.9", + "prost", "prost-types", "regex", "syn 1.0.109", @@ -1619,19 +1620,6 @@ dependencies = [ "which", ] -[[package]] -name = "prost-derive" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9cc1a3263e07e0bf68e96268f37665207b49560d98739662cdfaae215c720fe" -dependencies = [ - "anyhow", - "itertools", - "proc-macro2 1.0.59", - "quote 1.0.28", - "syn 1.0.109", -] - [[package]] name = "prost-derive" version = "0.11.9" @@ -1640,8 +1628,8 @@ checksum = "e5d2d8d10f3c6ded6da8b05b5fb3b8a5082514344d56c9f871412d29b4e075b4" dependencies = [ "anyhow", "itertools", - "proc-macro2 1.0.59", - "quote 1.0.28", + "proc-macro2 1.0.70", + "quote 1.0.33", "syn 1.0.109", ] @@ -1651,7 +1639,7 @@ version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "213622a1460818959ac1181aaeb2dc9c7f63df720db7d788b3e24eacd1983e13" dependencies = [ - "prost 0.11.9", + "prost", ] [[package]] @@ -1665,13 +1653,19 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.28" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9ab9c7eadfd8df19006f1cf1a4aed13540ed5cbc047010ece5826e10825488" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ - "proc-macro2 1.0.59", + "proc-macro2 1.0.70", ] +[[package]] +name = "radium" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" + [[package]] name = "rand_core" version = "0.5.1" @@ -1689,20 +1683,23 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.3.5" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" dependencies = [ - "bitflags", + "bitflags 1.3.2", ] [[package]] name = "regex" -version = "1.8.4" +version = "1.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0ab3ca65655bb1e41f2a8c8cd662eb4fb035e67c3f78da1d61dffe89d07300f" +checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" dependencies = [ - "regex-syntax 0.7.2", + "aho-corasick", + "memchr", + "regex-automata 0.4.3", + "regex-syntax 0.8.2", ] [[package]] @@ -1714,6 +1711,17 @@ dependencies = [ "regex-syntax 0.6.29", ] +[[package]] +name = "regex-automata" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax 0.8.2", +] + [[package]] name = "regex-syntax" version = "0.6.29" @@ -1722,19 +1730,18 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.7.2" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "436b050e76ed2903236f032a59761c1eb99e1b0aead2c257922771dab1fc8c78" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "rfc6979" -version = "0.3.1" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7743f17af12fa0b03b803ba12cd6a8d9483a587e89c69445e3909655c0b9fabb" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" dependencies = [ - "crypto-bigint", "hmac", - "zeroize", + "subtle", ] [[package]] @@ -1752,8 +1759,8 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e33d7b2abe0c340d8797fe2907d3f20d3b5ea5908683618bfe80df7f621f672a" dependencies = [ - "proc-macro2 1.0.59", - "quote 1.0.28", + "proc-macro2 1.0.70", + "quote 1.0.33", "syn 1.0.109", ] @@ -1763,39 +1770,41 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + [[package]] name = "rustix" -version = "0.37.19" +version = "0.38.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acf8729d8542766f1b2cf77eb034d52f40d375bb8b615d0b147089946e16613d" +checksum = "72e572a5e8ca657d7366229cdde4bd14c4eb5499a9573d4d366fe1b599daa316" dependencies = [ - "bitflags", + "bitflags 2.4.1", "errno", - "io-lifetimes", "libc", "linux-raw-sys", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] -[[package]] -name = "rustversion" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f3208ce4d8448b3f3e7d168a73f5e0c43a61e32930de3bceeccedb388b6bf06" - [[package]] name = "ryu" -version = "1.0.13" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" +checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" [[package]] name = "safe-proc-macro2" -version = "1.0.36" +version = "1.0.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "814c536dcd27acf03296c618dab7ad62d28e70abd7ba41d3f34a2ce707a2c666" +checksum = "7fd85be67db87168aa3c13fd0da99f48f2ab005dccad5af5626138dc1df20eb6" dependencies = [ - "unicode-xid 0.2.4", + "unicode-ident", ] [[package]] @@ -1838,10 +1847,11 @@ dependencies = [ [[package]] name = "scale-info" -version = "2.7.0" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b569c32c806ec3abdf3b5869fb8bf1e0d275a7c1c9b0b05603d9464632649edf" +checksum = "7f7d66a1128282b7ef025a8ead62a4a9fcf017382ec53b8ffbf4d7bf77bd3c60" dependencies = [ + "bitvec", "cfg-if", "derive_more", "parity-scale-codec", @@ -1850,13 +1860,13 @@ dependencies = [ [[package]] name = "scale-info-derive" -version = "2.6.0" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53012eae69e5aa5c14671942a5dd47de59d4cdcff8532a6dd0e081faf1119482" +checksum = "abf2c68b89cafb3b8d918dd07b42be0da66ff202cf1155c5739a4e0c1ea0dc19" dependencies = [ "proc-macro-crate 1.3.1", - "proc-macro2 1.0.59", - "quote 1.0.28", + "proc-macro2 1.0.70", + "quote 1.0.33", "syn 1.0.109", ] @@ -1873,12 +1883,12 @@ dependencies = [ [[package]] name = "schemars" -version = "0.8.12" +version = "0.8.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02c613288622e5f0c3fdc5dbd4db1c5fbe752746b1d1a56a0630b78fd00de44f" +checksum = "45a28f4c49489add4ce10783f7911893516f15afe45d015608d41faca6bc4d29" dependencies = [ "dyn-clone", - "schemars_derive 0.8.12", + "schemars_derive 0.8.16", "serde", "serde_json", ] @@ -1889,29 +1899,29 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73ab7f0b9b64633747a68dce4ed6318bbf30e3befe67df7624ad83abb7295c09" dependencies = [ - "proc-macro2 1.0.59", - "quote 1.0.28", + "proc-macro2 1.0.70", + "quote 1.0.33", "serde_derive_internals 0.25.0", "syn 1.0.109", ] [[package]] name = "schemars_derive" -version = "0.8.12" +version = "0.8.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "109da1e6b197438deb6db99952990c7f959572794b80ff93707d55a232545e7c" +checksum = "c767fd6fa65d9ccf9cf026122c1b555f2ef9a4f0cea69da4d7dbc3e258d30967" dependencies = [ - "proc-macro2 1.0.59", - "quote 1.0.28", + "proc-macro2 1.0.70", + "quote 1.0.33", "serde_derive_internals 0.26.0", "syn 1.0.109", ] [[package]] name = "sec1" -version = "0.3.0" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3be24c1842290c45df0a7bf069e0c268a747ad05a192f2fd7dcfdbc1cba40928" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" dependencies = [ "base16ct", "der", @@ -1923,15 +1933,15 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.17" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" +checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" [[package]] name = "serde" -version = "1.0.163" +version = "1.0.193" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2113ab51b87a539ae008b5c6c02dc020ffa39afd2d83cffcb3f4eb2722cebec2" +checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" dependencies = [ "serde_derive", ] @@ -1956,22 +1966,22 @@ dependencies = [ [[package]] name = "serde_bytes" -version = "0.11.9" +version = "0.11.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "416bda436f9aab92e02c8e10d49a15ddd339cea90b6e340fe51ed97abb548294" +checksum = "ab33ec92f677585af6d88c65593ae2375adde54efdbf16d597f2cbc7a6d368ff" dependencies = [ "serde", ] [[package]] name = "serde_derive" -version = "1.0.163" +version = "1.0.193" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c805777e3930c8883389c602315a24224bcc738b63905ef87cd1420353ea93e" +checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" dependencies = [ - "proc-macro2 1.0.59", - "quote 1.0.28", - "syn 2.0.18", + "proc-macro2 1.0.70", + "quote 1.0.33", + "syn 2.0.40", ] [[package]] @@ -1980,8 +1990,8 @@ version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1dbab34ca63057a1f15280bdf3c39f2b1eb1b54c17e98360e511637aef7418c6" dependencies = [ - "proc-macro2 1.0.59", - "quote 1.0.28", + "proc-macro2 1.0.70", + "quote 1.0.33", "syn 1.0.109", ] @@ -1991,16 +2001,16 @@ version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85bf8229e7920a9f636479437026331ce11aa132b4dde37d121944a44d6e5f3c" dependencies = [ - "proc-macro2 1.0.59", - "quote 1.0.28", + "proc-macro2 1.0.70", + "quote 1.0.33", "syn 1.0.109", ] [[package]] name = "serde_json" -version = "1.0.96" +version = "1.0.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1" +checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" dependencies = [ "itoa", "ryu", @@ -2009,13 +2019,13 @@ dependencies = [ [[package]] name = "serde_repr" -version = "0.1.12" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcec881020c684085e55a25f7fd888954d56609ef363479dc5a1305eb0d40cab" +checksum = "3081f5ffbb02284dda55132aa26daecedd7372a42417bbbab6f14ab7d6bb9145" dependencies = [ - "proc-macro2 1.0.59", - "quote 1.0.28", - "syn 2.0.18", + "proc-macro2 1.0.70", + "quote 1.0.33", + "syn 2.0.40", ] [[package]] @@ -2033,9 +2043,9 @@ dependencies = [ [[package]] name = "sha2" -version = "0.10.6" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ "cfg-if", "cpufeatures", @@ -2054,9 +2064,9 @@ dependencies = [ [[package]] name = "sharded-slab" -version = "0.1.4" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" dependencies = [ "lazy_static", ] @@ -2066,6 +2076,12 @@ name = "signature" version = "1.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" + +[[package]] +name = "signature" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ "digest 0.10.7", "rand_core 0.6.4", @@ -2073,9 +2089,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.10.0" +version = "1.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" [[package]] name = "snafu" @@ -2100,9 +2116,9 @@ dependencies = [ [[package]] name = "spki" -version = "0.6.0" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" dependencies = [ "base64ct", "der", @@ -2114,25 +2130,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" -[[package]] -name = "strum" -version = "0.24.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" - -[[package]] -name = "strum_macros" -version = "0.24.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" -dependencies = [ - "heck", - "proc-macro2 1.0.59", - "quote 1.0.28", - "rustversion", - "syn 1.0.109", -] - [[package]] name = "subtle" version = "2.5.0" @@ -2162,7 +2159,7 @@ checksum = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5" dependencies = [ "proc-macro2 0.4.30", "quote 0.6.13", - "unicode-xid 0.1.0", + "unicode-xid", ] [[package]] @@ -2171,33 +2168,65 @@ version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ - "proc-macro2 1.0.59", - "quote 1.0.28", + "proc-macro2 1.0.70", + "quote 1.0.33", "unicode-ident", ] [[package]] name = "syn" -version = "2.0.18" +version = "2.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32d41677bcbe24c20c52e7c70b0d8db04134c5d1066bf98662e2871ad200ea3e" +checksum = "13fa70a4ee923979ffb522cacce59d34421ebdea5625e1073c4326ef9d2dd42e" dependencies = [ - "proc-macro2 1.0.59", - "quote 1.0.28", + "proc-macro2 1.0.70", + "quote 1.0.33", "unicode-ident", ] +[[package]] +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" + [[package]] name = "tempfile" -version = "3.5.0" +version = "3.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9fbec84f381d5795b08656e4912bec604d162bff9291d6189a78f4c8ab87998" +checksum = "7ef1adac450ad7f4b3c28589471ade84f25f731a7a0fe30d71dfa9f60fd808e5" dependencies = [ "cfg-if", "fastrand", "redox_syscall", "rustix", - "windows-sys 0.45.0", + "windows-sys 0.48.0", +] + +[[package]] +name = "tendermint" +version = "0.28.0" +source = "git+https://github.com/informalsystems/tendermint-rs?rev=e81f7bf23d63ffbcd242381d1ce5e35da3515ff1#e81f7bf23d63ffbcd242381d1ce5e35da3515ff1" +dependencies = [ + "bytes", + "digest 0.10.7", + "ed25519", + "flex-error", + "futures", + "num-traits", + "once_cell", + "prost", + "prost-types", + "serde", + "serde_bytes", + "serde_json", + "serde_repr", + "signature 1.6.4", + "subtle", + "subtle-encoding", + "tendermint-proto 0.28.0", + "time", + "zeroize", ] [[package]] @@ -2209,36 +2238,50 @@ dependencies = [ "bytes", "digest 0.10.7", "ed25519", - "ed25519-consensus", "flex-error", "futures", "num-traits", "once_cell", - "prost 0.11.9", + "prost", "prost-types", "serde", "serde_bytes", "serde_json", "serde_repr", - "sha2 0.10.6", - "signature", + "signature 1.6.4", "subtle", "subtle-encoding", - "tendermint-proto", + "tendermint-proto 0.29.1", "time", "zeroize", ] [[package]] name = "tendermint-light-client-verifier" -version = "0.29.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11c3dc3c75f7a5708ac0bf98374b2b1a2cf17b3a45ddfd5faab3c111aff7fc0e" +version = "0.28.0" +source = "git+https://github.com/informalsystems/tendermint-rs?rev=e81f7bf23d63ffbcd242381d1ce5e35da3515ff1#e81f7bf23d63ffbcd242381d1ce5e35da3515ff1" dependencies = [ "derive_more", "flex-error", "serde", - "tendermint", + "tendermint 0.28.0", + "time", +] + +[[package]] +name = "tendermint-proto" +version = "0.28.0" +source = "git+https://github.com/informalsystems/tendermint-rs?rev=e81f7bf23d63ffbcd242381d1ce5e35da3515ff1#e81f7bf23d63ffbcd242381d1ce5e35da3515ff1" +dependencies = [ + "bytes", + "flex-error", + "num-derive", + "num-traits", + "prost", + "prost-types", + "serde", + "serde_bytes", + "subtle-encoding", "time", ] @@ -2252,7 +2295,7 @@ dependencies = [ "flex-error", "num-derive", "num-traits", - "prost 0.11.9", + "prost", "prost-types", "serde", "serde_bytes", @@ -2262,13 +2305,24 @@ dependencies = [ [[package]] name = "test-log" -version = "0.2.11" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38f0c854faeb68a048f0f2dc410c5ddae3bf83854ef0e4977d58306a5edef50e" +checksum = "6159ab4116165c99fc88cce31f99fa2c9dbe08d3691cb38da02fc3b45f357d2b" dependencies = [ - "proc-macro2 1.0.59", - "quote 1.0.28", - "syn 1.0.109", + "env_logger", + "test-log-macros", + "tracing-subscriber", +] + +[[package]] +name = "test-log-macros" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ba277e77219e9eea169e8508942db1bf5d8a41ff2db9b20aab5a5aadc9fa25d" +dependencies = [ + "proc-macro2 1.0.70", + "quote 1.0.33", + "syn 2.0.40", ] [[package]] @@ -2277,34 +2331,33 @@ version = "0.1.0" dependencies = [ "common 0.1.0", "cosmwasm-std", - "cw-multi-test", "getrandom", "hex", "hex-literal 0.4.1", - "ibc-proto", - "prost 0.11.9", + "ibc-proto 0.26.0", + "prost", "serde", "serde_json", ] [[package]] name = "thiserror" -version = "1.0.40" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" +checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.40" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" +checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" dependencies = [ - "proc-macro2 1.0.59", - "quote 1.0.28", - "syn 2.0.18", + "proc-macro2 1.0.70", + "quote 1.0.33", + "syn 2.0.40", ] [[package]] @@ -2323,6 +2376,7 @@ version = "0.3.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cd0cbfecb4d19b5ea75bb31ad904eb5b9fa13f21079c3b92017ebdf4999a5890" dependencies = [ + "serde", "time-core", "time-macros", ] @@ -2343,25 +2397,27 @@ dependencies = [ ] [[package]] -name = "toml" -version = "0.5.11" +name = "toml_datetime" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" -dependencies = [ - "serde", -] +checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" [[package]] -name = "toml_datetime" -version = "0.6.2" +name = "toml_edit" +version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a76a9312f5ba4c2dec6b9161fdf25d87ad8a09256ccea5a556fef03c706a10f" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" +dependencies = [ + "indexmap", + "toml_datetime", + "winnow", +] [[package]] name = "toml_edit" -version = "0.19.10" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2380d56e8670370eee6566b0bfd4265f65b3f432e8c6d85623f728d4fa31f739" +checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338" dependencies = [ "indexmap", "toml_datetime", @@ -2370,20 +2426,19 @@ dependencies = [ [[package]] name = "tracing" -version = "0.1.37" +version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ - "cfg-if", "pin-project-lite", "tracing-core", ] [[package]] name = "tracing-core" -version = "0.1.31" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", "valuable", @@ -2391,12 +2446,12 @@ dependencies = [ [[package]] name = "tracing-log" -version = "0.1.3" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" dependencies = [ - "lazy_static", "log", + "once_cell", "tracing-core", ] @@ -2412,9 +2467,9 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.3.17" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30a651bc37f915e81f087d86e62a18eec5f79550c7faff886f7090b4ea757c77" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" dependencies = [ "matchers", "nu-ansi-term", @@ -2433,9 +2488,9 @@ dependencies = [ [[package]] name = "typenum" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "uint" @@ -2451,21 +2506,21 @@ dependencies = [ [[package]] name = "unicode-ident" -version = "1.0.9" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b15811caf2415fb889178633e7724bad2509101cde276048e013b9def5e51fa0" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] -name = "unicode-xid" -version = "0.1.0" +name = "unicode-segmentation" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" +checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" [[package]] name = "unicode-xid" -version = "0.2.4" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" +checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" [[package]] name = "valuable" @@ -2487,13 +2542,14 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "which" -version = "4.4.0" +version = "4.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2441c784c52b289a054b7201fc93253e288f094e2f4be9058343127c4226a269" +checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" dependencies = [ "either", - "libc", + "home", "once_cell", + "rustix", ] [[package]] @@ -2520,150 +2576,159 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows-sys" -version = "0.45.0" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets 0.42.2", + "windows-targets 0.48.5", ] [[package]] name = "windows-sys" -version = "0.48.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.48.0", + "windows-targets 0.52.0", ] [[package]] name = "windows-targets" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", ] [[package]] name = "windows-targets" -version = "0.48.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" +checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" dependencies = [ - "windows_aarch64_gnullvm 0.48.0", - "windows_aarch64_msvc 0.48.0", - "windows_i686_gnu 0.48.0", - "windows_i686_msvc 0.48.0", - "windows_x86_64_gnu 0.48.0", - "windows_x86_64_gnullvm 0.48.0", - "windows_x86_64_msvc 0.48.0", + "windows_aarch64_gnullvm 0.52.0", + "windows_aarch64_msvc 0.52.0", + "windows_i686_gnu 0.52.0", + "windows_i686_msvc 0.52.0", + "windows_x86_64_gnu 0.52.0", + "windows_x86_64_gnullvm 0.52.0", + "windows_x86_64_msvc 0.52.0", ] [[package]] name = "windows_aarch64_gnullvm" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" [[package]] name = "windows_aarch64_msvc" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.48.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" [[package]] name = "windows_i686_gnu" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.48.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" [[package]] name = "windows_i686_msvc" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.48.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" [[package]] name = "windows_x86_64_gnu" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.48.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" [[package]] name = "windows_x86_64_gnullvm" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.48.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" [[package]] name = "windows_x86_64_msvc" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.48.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" +checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "winnow" -version = "0.4.6" +version = "0.5.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61de7bac303dc551fe038e2b3cef0f571087a47571ea6e79a87692ac99b99699" +checksum = "b67b5f0a4e7a27a64c651977932b9dc5667ca7fc31ac44b03ed37a0cf42fdfff" dependencies = [ "memchr", ] +[[package]] +name = "wyz" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" +dependencies = [ + "tap", +] + [[package]] name = "zeroize" -version = "1.6.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a0956f1ba7c7909bfb66c2e9e4124ab6f6482560f6628b5aaeba39207c9aad9" +checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" dependencies = [ "zeroize_derive", ] @@ -2674,7 +2739,7 @@ version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ - "proc-macro2 1.0.59", - "quote 1.0.28", - "syn 2.0.18", + "proc-macro2 1.0.70", + "quote 1.0.33", + "syn 2.0.40", ] diff --git a/Cargo.toml b/Cargo.toml index 44513da23..fb7159241 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ members = [ "libraries/rust/common", ] -exclude = ["contracts/cosmwasm-vm/archway"] +exclude = ["contracts/cosmwasm-vm/archway","contracts/cosmwasm-vm/cw-integration"] [workspace.package] @@ -13,29 +13,40 @@ repository = "https://github.com/icon-project/ibc-integration.git" version="0.1.1" [workspace.dependencies] -cosmwasm-std = {version="1.2.2",default-features = false,features = ["iterator", "ibc3","staking"]} -cosmwasm-storage = "1.2.2" -cosmwasm-schema = "1.2.2" -schemars = "0.8.12" +cosmwasm-schema = {version="1.4.0",default-features = false} +cosmwasm-std = {version="1.4.0",default-features = false, features = ["ibc3"]} +schemars = {version="0.8.10",default-features = false} +serde = { version = "1.0.145", default-features = false, features = ["derive"] } +thiserror = { version = "1.0.31" } + cw-storage-plus = {git="https://github.com/icon-project/cw-storage-plus.git", branch="fix-raw"} -cw-xcall-lib={package="cw-xcall-lib", git="https://github.com/icon-project/xCall.git", tag="v0.1.0-alpha.5"} -cw-xcall = {package="cw-xcall", git="https://github.com/icon-project/xCall.git", tag="v0.1.0-alpha.5"} -cw-mock-dapp = { git="https://github.com/icon-project/xCall.git", tag="v0.1.0-alpha.5" } -cw-mock-dapp-multi = { git="https://github.com/icon-project/xCall.git", tag="v0.1.0-alpha.5" } -cw2 = "1.0.1" + +common = { path="./libraries/rust/common" } +cw-common = { path="./contracts/cosmwasm-vm/cw-common" } +cw-light-client-common= {path="./contracts/cosmwasm-vm/cw-light-client-common"} + + +cw-xcall-lib={package="cw-xcall-lib", git="https://github.com/icon-project/xCall.git", branch="main"} +cw-xcall = {package="cw-xcall", git="https://github.com/icon-project/xCall.git", branch="main"} +cw-mock-dapp = { git="https://github.com/icon-project/xCall.git", branch="main" } +cw-mock-dapp-multi = { git="https://github.com/icon-project/xCall.git", branch="main" } +cw2 = {version="1.0.1",default-features = false} ibc-proto = { version = "0.26.0", default-features = false} + prost = { version = "0.11.8", default-features = false,features=["prost-derive"]} serde-json-wasm = {version="0.5.0", default-features = false} serde_json = "1.0.96" -serde = { version = "1.0.154", default-features = false, features = ["derive"] } +#serde = { version = "1.0.154", default-features = false, features = ["derive"] } bytes = { version = "1.4.0", default-features = false } -thiserror = { version = "1.0.39" } +#thiserror = { version = "1.0.39" } hex ={ version = "0.4.3", default-features = false } +hex-literal={version ="*"} debug_print = "1.0.0" + [profile.release] opt-level = 'z' debug = false diff --git a/contracts/cosmwasm-vm/cw-common/Cargo.toml b/contracts/cosmwasm-vm/cw-common/Cargo.toml index 6b36c9903..4c54059f8 100644 --- a/contracts/cosmwasm-vm/cw-common/Cargo.toml +++ b/contracts/cosmwasm-vm/cw-common/Cargo.toml @@ -11,14 +11,14 @@ crate-type = ["cdylib", "rlib"] [dependencies] cosmwasm-schema = {workspace=true} -cosmwasm-std = {workspace=true, features=["ibc3"]} +cosmwasm-std = { workspace=true} serde = { workspace=true} cw-storage-plus = {workspace=true} serde_json = {workspace=true} hex-buffer-serde = "0.4.0" schemars = {workspace=true} hex = { workspace=true} -common = { path="../../../libraries/rust/common" } +common = { workspace=true } ibc-proto = { workspace=true} prost = { workspace=true} serde-json-wasm = {workspace=true} diff --git a/contracts/cosmwasm-vm/cw-common/src/utils.rs b/contracts/cosmwasm-vm/cw-common/src/utils.rs index c7f281884..6ac392795 100644 --- a/contracts/cosmwasm-vm/cw-common/src/utils.rs +++ b/contracts/cosmwasm-vm/cw-common/src/utils.rs @@ -4,7 +4,7 @@ macro_rules! cw_println { use cosmwasm_std::Api; let res = std::fmt::format(format_args!($($arg)*)); debug_print::debug_println!("{}",res); - $f.api.debug(&res); + $f.debug(&res); }}; } @@ -16,6 +16,6 @@ mod tests { fn test_print_macro() { let q = 10; let mut deps = mock_dependencies(); - cw_println!(deps.as_mut(), "hello {}", q); + cw_println!(deps.as_mut().api, "hello {}", q); } } diff --git a/contracts/cosmwasm-vm/cw-ibc-core/Cargo.toml b/contracts/cosmwasm-vm/cw-ibc-core/Cargo.toml index ae1e8cf5f..5e63e2744 100644 --- a/contracts/cosmwasm-vm/cw-ibc-core/Cargo.toml +++ b/contracts/cosmwasm-vm/cw-ibc-core/Cargo.toml @@ -41,8 +41,8 @@ sha2 = { version = "0.10.6", default-features = false } hex ={workspace=true } sha3 = { version = "0.10.6", default-features = false } bytes = { workspace=true } -common = { path="../../../libraries/rust/common", default-features = false } -cw-common = { path="../cw-common",default-features = false } +common = { workspace=true, default-features = false } +cw-common = { workspace=true,default-features = false } prost = { workspace=true} serde-json-wasm = {workspace=true} debug_print = {workspace=true} @@ -50,7 +50,7 @@ debug_print = {workspace=true} [dev-dependencies] getrandom = {version = "0.2", default-features = false, features = ["custom"]} -cw-multi-test = "0.16.4" +#cw-multi-test = "0.15.1" cw-icon-light-client = { path="../cw-icon-light-client",default-features = false } anyhow="1.0.71" test-utils={path="../../../libraries/rust/test-utils"} diff --git a/contracts/cosmwasm-vm/cw-ibc-core/src/contract.rs b/contracts/cosmwasm-vm/cw-ibc-core/src/contract.rs index fda115c85..b124752a5 100644 --- a/contracts/cosmwasm-vm/cw-ibc-core/src/contract.rs +++ b/contracts/cosmwasm-vm/cw-ibc-core/src/contract.rs @@ -61,7 +61,7 @@ impl<'a> CwIbcCoreContext<'a> { self.init_client_counter(deps.storage, u64::default())?; self.init_connection_counter(deps.storage, u64::default())?; self.set_owner(deps.storage, info.sender)?; - cw_println!(deps, "{:?}", info.funds); + cw_println!(deps.api, "{:?}", info.funds); Ok(Response::new().add_attribute("method", "instantiate")) } @@ -106,12 +106,12 @@ impl<'a> CwIbcCoreContext<'a> { self.register_client(deps, client_type, client_address) } CoreExecuteMsg::CreateClient { msg } => { - cw_println!(deps, "[IBCCore] CreateClient Called"); + cw_println!(deps.api, "[IBCCore] CreateClient Called"); let message: RawMsgCreateClient = Self::raw_from_hex(&msg)?; self.create_client(deps, info, env, message) } CoreExecuteMsg::UpdateClient { msg } => { - cw_println!(deps, "[IBCCore] UpdateClient Called"); + cw_println!(deps.api, "[IBCCore] UpdateClient Called"); let message: RawMsgUpdateClient = Self::raw_from_hex(&msg)?; self.update_client(deps, info, message) } @@ -122,58 +122,58 @@ impl<'a> CwIbcCoreContext<'a> { unimplemented!() } CoreExecuteMsg::ConnectionOpenInit { msg } => { - cw_println!(deps, "[IBCCore] Connection Open Init Called"); + cw_println!(deps.api, "[IBCCore] Connection Open Init Called"); let message: RawMsgConnectionOpenInit = Self::raw_from_hex(&msg)?; self.connection_open_init(deps, message) } CoreExecuteMsg::ConnectionOpenTry { msg } => { - cw_println!(deps, "[IBCCore] Connection Open Try Called"); + cw_println!(deps.api, "[IBCCore] Connection Open Try Called"); let message: RawMsgConnectionOpenTry = Self::raw_from_hex(&msg)?; self.connection_open_try(deps, info, env, message) } CoreExecuteMsg::ConnectionOpenAck { msg } => { - cw_println!(deps, "[IBCCore] Connection Open Ack Called"); + cw_println!(deps.api, "[IBCCore] Connection Open Ack Called"); let message: RawMsgConnectionOpenAck = Self::raw_from_hex(&msg)?; self.connection_open_ack(deps, info, env, message) } CoreExecuteMsg::ConnectionOpenConfirm { msg } => { - cw_println!(deps, "[IBCCore] Connection Open Confirm Called"); + cw_println!(deps.api, "[IBCCore] Connection Open Confirm Called"); let message: RawMsgConnectionOpenConfirm = Self::raw_from_hex(&msg)?; self.connection_open_confirm(deps, env, info, message) } CoreExecuteMsg::ChannelOpenInit { msg } => { - cw_println!(deps, "[IBCCore] Channel Open Init Called"); + cw_println!(deps.api, "[IBCCore] Channel Open Init Called"); let message = Self::raw_from_hex::(&msg)?; self.validate_channel_open_init(deps, info, &message) } CoreExecuteMsg::ChannelOpenTry { msg } => { - cw_println!(deps, "[IBCCore] Channel Open Try Called"); + cw_println!(deps.api, "[IBCCore] Channel Open Try Called"); let message: RawMsgChannelOpenTry = Self::raw_from_hex(&msg)?; self.validate_channel_open_try(deps, info, &message) } CoreExecuteMsg::ChannelOpenAck { msg } => { - cw_println!(deps, "[IBCCore] Channel Open Ack Called"); + cw_println!(deps.api, "[IBCCore] Channel Open Ack Called"); let message: RawMsgChannelOpenAck = Self::raw_from_hex(&msg)?; self.validate_channel_open_ack(deps, info, &message) } CoreExecuteMsg::ChannelOpenConfirm { msg } => { - cw_println!(deps, "[IBCCore] Channel Open Confirm Called"); + cw_println!(deps.api, "[IBCCore] Channel Open Confirm Called"); let message: RawMsgChannelOpenConfirm = Self::raw_from_hex(&msg)?; self.validate_channel_open_confirm(deps, info, &message) } CoreExecuteMsg::ChannelCloseInit { msg } => { - cw_println!(deps, "[IBCCore] Channel Close Init Called"); + cw_println!(deps.api, "[IBCCore] Channel Close Init Called"); let message: RawMsgChannelCloseInit = Self::raw_from_hex(&msg)?; self.validate_channel_close_init(deps, info, &message) } CoreExecuteMsg::ChannelCloseConfirm { msg } => { - cw_println!(deps, "[IBCCore] Channel Close Confirm Called"); + cw_println!(deps.api, "[IBCCore] Channel Close Confirm Called"); let message: RawMsgChannelCloseConfirm = Self::raw_from_hex(&msg)?; self.validate_channel_close_confirm(deps, info, &message) } CoreExecuteMsg::SendPacket { packet } => { - cw_println!(deps, "[IBCCore] Send Packet Called"); + cw_println!(deps.api, "[IBCCore] Send Packet Called"); let packet_bytes = packet.to_bytes().map_err(Into::::into)?; let packet: RawPacket = Message::decode(packet_bytes.as_slice()) .map_err(|error| ContractError::IbcDecodeError { error })?; @@ -181,18 +181,18 @@ impl<'a> CwIbcCoreContext<'a> { self.send_packet(deps, &env, info, packet) } CoreExecuteMsg::ReceivePacket { msg } => { - cw_println!(deps, "[IBCCore] Receive Packet Called"); + cw_println!(deps.api, "[IBCCore] Receive Packet Called"); let message = Self::raw_from_hex::(&msg)?; self.validate_receive_packet(deps, info, env, &message) } CoreExecuteMsg::AcknowledgementPacket { msg } => { - cw_println!(deps, "[IBCCore] Acknowledgement Packet Called"); + cw_println!(deps.api, "[IBCCore] Acknowledgement Packet Called"); let message = Self::raw_from_hex::(&msg)?; self.acknowledgement_packet_validate(deps, info, env, &message) } CoreExecuteMsg::TimeoutPacket { msg } => { - cw_println!(deps, "[IBCCore] Timeout Packet Called"); + cw_println!(deps.api, "[IBCCore] Timeout Packet Called"); let message = Self::raw_from_hex::(&msg)?; self.timeout_packet_validate( deps, @@ -202,7 +202,7 @@ impl<'a> CwIbcCoreContext<'a> { ) } CoreExecuteMsg::TimeoutOnClose { msg } => { - cw_println!(deps, "[IBCCore] Timeout On Close Called"); + cw_println!(deps.api, "[IBCCore] Timeout On Close Called"); let message = Self::raw_from_hex::(&msg)?; self.timeout_packet_validate( deps, @@ -212,7 +212,7 @@ impl<'a> CwIbcCoreContext<'a> { ) } CoreExecuteMsg::BindPort { port_id, address } => { - cw_println!(deps, "[IBCCore] Bind Port Called"); + cw_println!(deps.api, "[IBCCore] Bind Port Called"); let port_id = IbcPortId::from_str(&port_id).map_err(|error| { ContractError::IbcDecodeError { error: DecodeError::new(error.to_string()), @@ -232,7 +232,7 @@ impl<'a> CwIbcCoreContext<'a> { packet, acknowledgement, } => { - cw_println!(deps, "[IBCCore] Write Acknowledgement Called"); + cw_println!(deps.api, "[IBCCore] Write Acknowledgement Called"); let ack = acknowledgement.to_bytes()?; self.write_acknowledgement(deps, info, &env, packet, ack) } @@ -279,7 +279,7 @@ impl<'a> CwIbcCoreContext<'a> { let res = self .consensus_state_any(deps, &IbcClientId::from_str(&client_id).unwrap()) .map_err(|_e| { - cw_println!(deps, "{_e:?}"); + cw_println!(deps.api, "{_e:?}"); ContractError::InvalidClientId { client_id } }) .unwrap(); diff --git a/contracts/cosmwasm-vm/cw-ibc-core/src/ics02_client/handler.rs b/contracts/cosmwasm-vm/cw-ibc-core/src/ics02_client/handler.rs index b1bbdf5af..e2ee6c752 100644 --- a/contracts/cosmwasm-vm/cw-ibc-core/src/ics02_client/handler.rs +++ b/contracts/cosmwasm-vm/cw-ibc-core/src/ics02_client/handler.rs @@ -149,7 +149,7 @@ impl<'a> IbcClient for CwIbcCoreContext<'a> { let sub_msg: SubMsg = client.update_client(&client_id, &header)?; cw_println!( - deps, + deps.api, "Called Update Client On Lightclient for client id:{}", &message.client_id ); @@ -325,7 +325,7 @@ impl<'a> IbcClient for CwIbcCoreContext<'a> { cosmwasm_std::SubMsgResult::Ok(result) => match result.data { Some(data) => { let update_client_response: UpdateClientResponse = from_binary_response(&data)?; - cw_println!(deps, "Received Client Update Callback with data"); + cw_println!(deps.api, "Received Client Update Callback with data"); let client_id: ClientId = self.get_callback_data(deps.as_ref().storage, EXECUTE_UPDATE_CLIENT)?; self.clear_callback_data(deps.storage, EXECUTE_UPDATE_CLIENT); @@ -468,7 +468,7 @@ impl<'a> IbcClient for CwIbcCoreContext<'a> { let clinet_message = LightClientMessage::Misbehaviour { client_id: client_id.to_string(), - misbehaviour: to_vec(&message.misbehaviour)?, + misbehaviour: message.misbehaviour.unwrap().encode_to_vec(), }; let wasm_exec_message: CosmosMsg = CosmosMsg::Wasm(cosmwasm_std::WasmMsg::Execute { diff --git a/contracts/cosmwasm-vm/cw-ibc-core/src/ics03_connection/connection.rs b/contracts/cosmwasm-vm/cw-ibc-core/src/ics03_connection/connection.rs index 2c29ccef9..4385e4f7c 100644 --- a/contracts/cosmwasm-vm/cw-ibc-core/src/ics03_connection/connection.rs +++ b/contracts/cosmwasm-vm/cw-ibc-core/src/ics03_connection/connection.rs @@ -27,12 +27,8 @@ impl<'a> CwIbcCoreContext<'a> { conn_id: &ConnectionId, conn_end: &ConnectionEnd, ) -> Result<(), ContractError> { - let data = conn_end - .encode_vec() - .map_err(|error| ConnectionError::Other { - description: error.to_string(), - }) - .map_err(Into::::into)?; + let data = conn_end.encode_vec().unwrap(); + match self.ibc_store().connections().save(store, conn_id, &data) { Ok(_) => Ok(()), Err(error) => Err(ContractError::Std(error)), @@ -287,14 +283,7 @@ impl<'a> CwIbcCoreContext<'a> { ) -> Result<(), ContractError> { let connection_commit_key = commitment::connection_commitment_key(connection_id); - let connection_end_bytes = - connection_end - .encode_vec() - .map_err(|error| ContractError::IbcConnectionError { - error: ConnectionError::Other { - description: error.to_string(), - }, - })?; + let connection_end_bytes = connection_end.encode_vec().unwrap(); let commitment_bytes = keccak256(&connection_end_bytes).to_vec(); diff --git a/contracts/cosmwasm-vm/cw-ibc-core/src/ics03_connection/handler.rs b/contracts/cosmwasm-vm/cw-ibc-core/src/ics03_connection/handler.rs index c9172099a..e45b7d948 100644 --- a/contracts/cosmwasm-vm/cw-ibc-core/src/ics03_connection/handler.rs +++ b/contracts/cosmwasm-vm/cw-ibc-core/src/ics03_connection/handler.rs @@ -151,7 +151,7 @@ impl<'a> CwIbcCoreContext<'a> { env: Env, msg: RawMsgConnectionOpenAck, ) -> Result { - cw_println!(deps, "[ConnOpenAck]: Connection Open Ack"); + cw_println!(deps.api, "[ConnOpenAck]: Connection Open Ack"); let message_client_state = msg.client_state.ok_or(ContractError::IbcConnectionError { error: ConnectionError::MissingClientState, })?; @@ -161,13 +161,13 @@ impl<'a> CwIbcCoreContext<'a> { let message_version = to_ibc_version(msg.version)?; let host_height = self.host_height(&env)?; - cw_println!(deps, "[ConnOpenAck]: Host Height {:?}", host_height); + cw_println!(deps.api, "[ConnOpenAck]: Host Height {:?}", host_height); ensure_consensus_height_valid(&host_height, &consensus_height)?; - cw_println!(deps, "[ConnOpenAck]:Consensus Height Valid"); + cw_println!(deps.api, "[ConnOpenAck]:Consensus Height Valid"); self.validate_self_client(message_client_state.clone())?; - cw_println!(deps, "[ConnOpenAck]: Self Client Valid"); + cw_println!(deps.api, "[ConnOpenAck]: Self Client Valid"); let connection_id = to_ibc_connection_id(&msg.connection_id)?; let mut connection_end = self.connection_end(deps.storage, &connection_id)?; @@ -194,7 +194,7 @@ impl<'a> CwIbcCoreContext<'a> { }); } - cw_println!(deps, "[ConnOpenAck]: State Matched"); + cw_println!(deps.api, "[ConnOpenAck]: State Matched"); let consensus_state = self.consensus_state(deps.as_ref(), client_id, &proof_height)?; @@ -208,7 +208,7 @@ impl<'a> CwIbcCoreContext<'a> { connection_end.delay_period(), ); cw_println!( - deps, + deps.api, "[ConnOpenAck]: Expected conn end {:?}", expected_connection_end ); @@ -237,7 +237,7 @@ impl<'a> CwIbcCoreContext<'a> { to_vec(&counterparty_prefix)?, msg.proof_consensus, consensus_state_path_on_b, - consensus_state.clone().as_bytes(), + consensus_state.as_bytes(), ); let payload = VerifyConnectionPayload { client_id: client_id.to_string(), @@ -267,7 +267,7 @@ impl<'a> CwIbcCoreContext<'a> { )?; self.store_connection(deps.storage, &connection_id, &connection_end)?; - cw_println!(deps, "[ConnOpenAckReply]: Connection Stored"); + cw_println!(deps.api, "[ConnOpenAckReply]: Connection Stored"); self.update_connection_commitment(deps.storage, &connection_id, &connection_end)?; @@ -338,7 +338,7 @@ impl<'a> CwIbcCoreContext<'a> { let prefix = self.commitment_prefix(deps.as_ref(), &env); cw_println!( - deps, + deps.api, "prefix_on_b is {:?}", from_utf8(&prefix.clone().into_vec()).unwrap() ); @@ -354,21 +354,21 @@ impl<'a> CwIbcCoreContext<'a> { ); cw_println!( - deps, + deps.api, "[ConnOpenTry]: expected counterpart connection_end:{:?}", HexString::from_bytes(&expected_connection_end.encode_vec().unwrap()) ); let consensus_state = self.consensus_state(deps.as_ref(), &client_id, &proof_height)?; cw_println!( - deps, + deps.api, "[ConnOpenTry]: root: {:?} ", HexString::from_bytes(consensus_state.root().as_bytes()) ); let counterparty_connection_path = commitment::connection_path(&counterparty_connection_id.clone().unwrap()); cw_println!( - deps, + deps.api, "[ConnOpenTry]: connkey: {:?}", HexString::from_bytes(&counterparty_connection_path) ); @@ -378,18 +378,18 @@ impl<'a> CwIbcCoreContext<'a> { to_vec(&counterparty_prefix).map_err(ContractError::Std)?, message.proof_init, counterparty_connection_path, - expected_connection_end.encode_vec().unwrap().to_vec(), + expected_connection_end.encode_vec().unwrap(), ); // this is verifying tendermint client state and shouldn't have icon-client as an argument cw_println!( - deps, + deps.api, "[ConnOpenTry]: payload client state path {:?}", &counterparty_client_id ); let client_state_path = commitment::client_state_path(&counterparty_client_id); cw_println!( - deps, + deps.api, "[ConnOpenTry]: the clientstate value is {:?}", message_client_state.value ); @@ -429,7 +429,7 @@ impl<'a> CwIbcCoreContext<'a> { let connection_id = self.generate_connection_idenfier(deps.storage)?; cw_println!( - deps, + deps.api, "[ConnOpenTryReply]: connection id is{:?}", connection_id ); @@ -442,7 +442,7 @@ impl<'a> CwIbcCoreContext<'a> { message_delay_period, ); - cw_println!(deps, "[ConnOpenTryReply]: conn end{:?}", conn_end); + cw_println!(deps.api, "[ConnOpenTryReply]: conn end{:?}", conn_end); let event = create_connection_event( IbcEventType::OpenTryConnection, @@ -483,7 +483,7 @@ impl<'a> CwIbcCoreContext<'a> { _info: MessageInfo, msg: RawMsgConnectionOpenConfirm, ) -> Result { - cw_println!(deps, "[ConnOpenConfirm]: Connection Open Confirm"); + cw_println!(deps.api, "[ConnOpenConfirm]: Connection Open Confirm"); let proof_height = to_ibc_height(msg.proof_height.clone())?; @@ -500,7 +500,7 @@ impl<'a> CwIbcCoreContext<'a> { } let prefix = self.commitment_prefix(deps.as_ref(), &env); cw_println!( - deps, + deps.api, "[ConnOpenConfirm]: Our Connection {:?}", connection_end ); @@ -509,7 +509,11 @@ impl<'a> CwIbcCoreContext<'a> { let counterparty_client_id = counterparty.client_id(); let counterparty_prefix = counterparty.prefix(); let counterparty_conn_id = counterparty.connection_id().cloned(); - cw_println!(deps, "[ConnOpenConfirm]: CounterParty {:?}", &counterparty); + cw_println!( + deps.api, + "[ConnOpenConfirm]: CounterParty {:?}", + &counterparty + ); ensure_connection_state(&connection_id, &connection_end, &State::TryOpen)?; @@ -535,7 +539,7 @@ impl<'a> CwIbcCoreContext<'a> { client.verify_connection_open_confirm(deps.as_ref(), verify_connection_state, client_id)?; cw_println!( - deps, + deps.api, "[ConnOpenConfirmReply]: CounterParty {:?}", counterparty ); @@ -550,11 +554,11 @@ impl<'a> CwIbcCoreContext<'a> { )?; self.store_connection(deps.storage, &connection_id, &connection_end)?; - cw_println!(deps, "[ConnOpenConfirmReply]: Connection Stored"); + cw_println!(deps.api, "[ConnOpenConfirmReply]: Connection Stored"); self.update_connection_commitment(deps.storage, &connection_id, &connection_end)?; - cw_println!(deps, "[ConnOpenConfirmReply]: Commitment Stored Stored"); + cw_println!(deps.api, "[ConnOpenConfirmReply]: Commitment Stored Stored"); Ok(Response::new() .add_attribute("method", "execute_connection_open_confirm") diff --git a/contracts/cosmwasm-vm/cw-ibc-core/src/ics04_channel/handler.rs b/contracts/cosmwasm-vm/cw-ibc-core/src/ics04_channel/handler.rs index b7ac9b5e7..f38b0f434 100644 --- a/contracts/cosmwasm-vm/cw-ibc-core/src/ics04_channel/handler.rs +++ b/contracts/cosmwasm-vm/cw-ibc-core/src/ics04_channel/handler.rs @@ -64,7 +64,7 @@ impl<'a> ValidateChannel for CwIbcCoreContext<'a> { ) -> Result { // connection hops should be 1 cw_println!( - deps, + deps.api, "inside validate channel open init: input parameter: {:?}", message ); @@ -96,7 +96,7 @@ impl<'a> ValidateChannel for CwIbcCoreContext<'a> { let contract_address = self.lookup_modules(deps.storage, message.port_id.clone().as_bytes().to_vec())?; - cw_println!(deps, "contract address is : {:?} ", contract_address); + cw_println!(deps.api, "contract address is : {:?} ", contract_address); channel_end.state = State::Init; self.store_channel_end(deps.storage, &src_port, &src_channel, &channel_end)?; @@ -165,12 +165,12 @@ impl<'a> ValidateChannel for CwIbcCoreContext<'a> { }, }); } - cw_println!(deps, "Reached in channel open try"); + cw_println!(deps.api, "Reached in channel open try"); let connection_id = channel_end.connection_hops[0].clone(); let connection_end = self.connection_end(deps.storage, &connection_id)?; channel_open_try_msg_validate(&channel_end, &connection_end)?; - cw_println!(deps, "channel open try msg validate "); + cw_println!(deps.api, "channel open try msg validate "); let counter = self.channel_counter(deps.storage)?; let dest_channel = ChannelId::new(counter); // creating new channel_id @@ -180,7 +180,7 @@ impl<'a> ValidateChannel for CwIbcCoreContext<'a> { let source_channel = channel_end.remote.channel_id.clone().unwrap(); cw_println!( - deps, + deps.api, "stoed: channel id: {:?} portid :{:?} channel_end :{:?}", &dest_channel, &dest_port, @@ -209,7 +209,7 @@ impl<'a> ValidateChannel for CwIbcCoreContext<'a> { }); } - cw_println!(deps, "after frozen check"); + cw_println!(deps.api, "after frozen check"); let expected_channel_end = ChannelEnd::new( State::Init, *channel_end.ordering(), @@ -225,7 +225,7 @@ impl<'a> ValidateChannel for CwIbcCoreContext<'a> { proof_height: proof_height.to_string(), counterparty_prefix: prefix_on_a.clone().into_vec(), proof: message.proof_init.clone(), - root: consensus_state.clone().root().into_vec(), + root: consensus_state.root().into_vec(), counterparty_chan_end_path: chan_end_path_on_a, expected_counterparty_channel_end: vector, client_id: connection_end.client_id().to_string(), @@ -236,7 +236,7 @@ impl<'a> ValidateChannel for CwIbcCoreContext<'a> { client.verify_channel(deps.as_ref(), verify_channel_state)?; let contract_address = self.lookup_modules(deps.storage, dest_port.as_bytes().to_vec())?; - cw_println!(deps, "contract addres is {:?}", contract_address); + cw_println!(deps.api, "contract addres is {:?}", contract_address); channel_end.state = State::TryOpen; self.store_channel_end(deps.storage, &dest_port, &dest_channel, &channel_end)?; @@ -266,7 +266,7 @@ impl<'a> ValidateChannel for CwIbcCoreContext<'a> { let data = cw_common::xcall_connection_msg::ExecuteMsg::IbcChannelOpen { msg: sub_message }; let data = to_binary(&data).map_err(ContractError::Std)?; - cw_println!(deps, "after converting data to binary "); + cw_println!(deps.api, "after converting data to binary "); let on_chan_open_try = create_channel_submesssage( contract_address, @@ -356,7 +356,7 @@ impl<'a> ValidateChannel for CwIbcCoreContext<'a> { proof_height: proof_height.to_string(), counterparty_prefix: counterparty_prefix.clone().into_vec(), proof: message.proof_try.clone(), - root: consensus_state.clone().root().into_vec(), + root: consensus_state.root().into_vec(), counterparty_chan_end_path: chan_end_path_on_b, expected_counterparty_channel_end: vector, client_id: client_id.to_string(), diff --git a/contracts/cosmwasm-vm/cw-ibc-core/src/ics04_channel/packet/acknowledgement.rs b/contracts/cosmwasm-vm/cw-ibc-core/src/ics04_channel/packet/acknowledgement.rs index 789def45d..b23b0904e 100644 --- a/contracts/cosmwasm-vm/cw-ibc-core/src/ics04_channel/packet/acknowledgement.rs +++ b/contracts/cosmwasm-vm/cw-ibc-core/src/ics04_channel/packet/acknowledgement.rs @@ -38,7 +38,7 @@ impl<'a> CwIbcCoreContext<'a> { env: Env, msg: &RawMessageAcknowledgement, ) -> Result { - cw_println!(deps, "inside acknowledge packet validate "); + cw_println!(deps.api, "inside acknowledge packet validate "); let packet = msg.packet.clone().unwrap(); let src_port = to_ibc_port_id(&packet.source_port)?; let src_channel = to_ibc_channel_id(&packet.source_channel)?; @@ -58,7 +58,7 @@ impl<'a> CwIbcCoreContext<'a> { }, }); } - cw_println!(deps, "chan end on a state matched "); + cw_println!(deps.api, "chan end on a state matched "); let counterparty = Counterparty::new(dst_port.clone(), Some(dst_channel.clone())); if !chan_end_on_a.counterparty_matches(&counterparty) { @@ -69,7 +69,7 @@ impl<'a> CwIbcCoreContext<'a> { }, }); } - cw_println!(deps, "counterparty matched"); + cw_println!(deps.api, "counterparty matched"); let conn_id_on_a = &chan_end_on_a.connection_hops()[0]; let conn_end_on_a = self.connection_end(deps.storage, conn_id_on_a)?; @@ -87,13 +87,13 @@ impl<'a> CwIbcCoreContext<'a> { Sequence::from(packet.sequence), )?; cw_println!( - deps, + deps.api, "Commitment on a {:?}", hex::encode(commitment_on_a.clone()) ); cw_println!( - deps, + deps.api, "from packet the timeout height is :{:?}", packet_timeout_height ); @@ -103,7 +103,7 @@ impl<'a> CwIbcCoreContext<'a> { &packet_timestamp, ); cw_println!( - deps, + deps.api, "computed packet commitment {:?}", hex::encode(&compouted_packet_commitment) ); @@ -116,7 +116,7 @@ impl<'a> CwIbcCoreContext<'a> { }); } - cw_println!(deps, "packet commitment matched"); + cw_println!(deps.api, "packet commitment matched"); if let Order::Ordered = chan_end_on_a.ordering { let next_seq_ack = self.get_next_sequence_ack(deps.storage, &src_port, &src_channel)?; @@ -129,7 +129,7 @@ impl<'a> CwIbcCoreContext<'a> { }); } } - cw_println!(deps, "packet seq matched"); + cw_println!(deps.api, "packet seq matched"); let client_id_on_a = conn_end_on_a.client_id(); let client_state_on_a = self.client_state(deps.as_ref(), client_id_on_a)?; @@ -169,7 +169,7 @@ impl<'a> CwIbcCoreContext<'a> { )?; let acknowledgement = msg.acknowledgement.clone(); - cw_println!(deps, "after matching ackowledgement "); + cw_println!(deps.api, "after matching ackowledgement "); // Getting the module address for on packet timeout call let contract_address = self.lookup_modules(deps.storage, src_port.as_bytes().to_vec())?; @@ -231,7 +231,7 @@ impl<'a> CwIbcCoreContext<'a> { funds: vec![], }); cw_println!( - deps, + deps.api, "after creating client message {:?} ", create_client_message ); diff --git a/contracts/cosmwasm-vm/cw-ibc-core/src/ics04_channel/packet/receive_packet.rs b/contracts/cosmwasm-vm/cw-ibc-core/src/ics04_channel/packet/receive_packet.rs index 5a6959c21..d943adc38 100644 --- a/contracts/cosmwasm-vm/cw-ibc-core/src/ics04_channel/packet/receive_packet.rs +++ b/contracts/cosmwasm-vm/cw-ibc-core/src/ics04_channel/packet/receive_packet.rs @@ -55,7 +55,7 @@ impl<'a> CwIbcCoreContext<'a> { let channel_end = self.get_channel_end(deps.storage, &dst_port, &dst_channel)?; ensure_channel_state(&dst_channel, &channel_end, &State::Open)?; - cw_println!(deps, "validate recevie packet state_matched"); + cw_println!(deps.api, "validate recevie packet state_matched"); let counterparty = Counterparty::new(src_port.clone(), Some(src_channel.clone())); if !channel_end.counterparty_matches(&counterparty) { @@ -103,7 +103,7 @@ impl<'a> CwIbcCoreContext<'a> { }) .map_err(Into::::into)?; } - cw_println!(deps, "client state created ",); + cw_println!(deps.api, "client state created ",); let consensus_state_of_a_on_b = self.consensus_state(deps.as_ref(), client_id, &proof_height)?; @@ -114,13 +114,17 @@ impl<'a> CwIbcCoreContext<'a> { &packet_timeout_height, &packet_timestamp, ); - cw_println!(deps, "packet is -> {:?}", msg.packet); + cw_println!(deps.api, "packet is -> {:?}", msg.packet); cw_println!( - deps, + deps.api, "packet.data is -> {:?}", HexString::from_bytes(&packet.data) ); - cw_println!(deps, "expected commitement created {:?}", packet.sequence); + cw_println!( + deps.api, + "expected commitement created {:?}", + packet.sequence + ); let commitment_path_on_a = commitment::packet_commitment_path( &src_port, @@ -128,7 +132,7 @@ impl<'a> CwIbcCoreContext<'a> { Sequence::from(packet.sequence), ); - cw_println!(deps, "verify connection delay passed"); + cw_println!(deps.api, "verify connection delay passed"); let verify_packet_data = VerifyPacketData { height: proof_height.to_string(), prefix: connection_end.counterparty().prefix().clone().into_vec(), @@ -141,7 +145,7 @@ impl<'a> CwIbcCoreContext<'a> { let client = self.get_light_client(deps.as_ref().storage, client_id)?; client.verify_packet_data(deps.as_ref(), verify_packet_data, client_id)?; - cw_println!(deps, "before packet already received "); + cw_println!(deps.api, "before packet already received "); let port_id = packet.destination_port.clone(); let contract_address = self.lookup_modules(deps.storage, port_id.as_bytes().to_vec())?; @@ -197,7 +201,7 @@ impl<'a> CwIbcCoreContext<'a> { None, )?; - cw_println!(deps, "event recieve packet: {:?}", event_recieve_packet); + cw_println!(deps.api, "event recieve packet: {:?}", event_recieve_packet); let sub_msg: SubMsg = SubMsg::reply_on_success(receive_packet_message, VALIDATE_ON_PACKET_RECEIVE_ON_MODULE); diff --git a/contracts/cosmwasm-vm/cw-ibc-core/src/ics04_channel/packet/send_packet.rs b/contracts/cosmwasm-vm/cw-ibc-core/src/ics04_channel/packet/send_packet.rs index fca6ee1d0..ba36b74c5 100644 --- a/contracts/cosmwasm-vm/cw-ibc-core/src/ics04_channel/packet/send_packet.rs +++ b/contracts/cosmwasm-vm/cw-ibc-core/src/ics04_channel/packet/send_packet.rs @@ -45,7 +45,7 @@ impl<'a> CwIbcCoreContext<'a> { } let chan_end_on_a = self.get_channel_end(deps.storage, &src_port, &src_channel)?; - cw_println!(deps, "fetched channel_end"); + cw_println!(deps.api, "fetched channel_end"); if !chan_end_on_a.state_matches(&State::Open) { return Err(ContractError::IbcPacketError { @@ -55,7 +55,7 @@ impl<'a> CwIbcCoreContext<'a> { }, }); } - cw_println!(deps, " channel_end matched"); + cw_println!(deps.api, " channel_end matched"); let counterparty = Counterparty::new(dst_port.clone(), Some(dst_channel.clone())); if !chan_end_on_a.counterparty_matches(&counterparty) { @@ -66,7 +66,7 @@ impl<'a> CwIbcCoreContext<'a> { }, }); } - cw_println!(deps, " counterparty_matched"); + cw_println!(deps.api, " counterparty_matched"); let conn_id_on_a = &chan_end_on_a.connection_hops()[0]; let conn_end_on_a = self.connection_end(deps.storage, conn_id_on_a)?; @@ -89,11 +89,11 @@ impl<'a> CwIbcCoreContext<'a> { let counterparty_timestamp = to_ibc_timestamp(timestamp_at_height)?; // validate packet not expired before send self.validate_packet_not_expired(&packet, counterparty_height, counterparty_timestamp)?; - cw_println!(deps, " check pass: packet expired"); + cw_println!(deps.api, " check pass: packet expired"); let next_seq_send_on_a = self.get_next_sequence_send(deps.storage, &src_port, &src_channel)?; - cw_println!(deps, " fetched next seq send {:?}", next_seq_send_on_a); + cw_println!(deps.api, " fetched next seq send {:?}", next_seq_send_on_a); if Sequence::from(packet.sequence) != next_seq_send_on_a { return Err(ContractError::IbcPacketError { @@ -104,7 +104,7 @@ impl<'a> CwIbcCoreContext<'a> { }); } - cw_println!(deps, " packet seq and next seq matched"); + cw_println!(deps.api, " packet seq and next seq matched"); let packet_timeout_height = to_ibc_timeout_height(packet.timeout_height.clone())?; let packet_timestamp = to_ibc_timestamp(packet.timeout_timestamp)?; @@ -121,7 +121,7 @@ impl<'a> CwIbcCoreContext<'a> { &packet_timestamp, ), )?; - cw_println!(deps, " packet commitment stored"); + cw_println!(deps.api, " packet commitment stored"); let height = env.block.height; self.ibc_store().store_sent_packet( deps.storage, diff --git a/contracts/cosmwasm-vm/cw-ibc-core/src/ics04_channel/packet/timeout_on_close.rs b/contracts/cosmwasm-vm/cw-ibc-core/src/ics04_channel/packet/timeout_on_close.rs index 3361b71fa..348a6c0a3 100644 --- a/contracts/cosmwasm-vm/cw-ibc-core/src/ics04_channel/packet/timeout_on_close.rs +++ b/contracts/cosmwasm-vm/cw-ibc-core/src/ics04_channel/packet/timeout_on_close.rs @@ -121,7 +121,7 @@ impl<'a> CwIbcCoreContext<'a> { proof_height: proof_height.to_string(), counterparty_prefix: prefix_on_b.clone().into_vec(), proof: msg.proof_close.clone(), - root: consensus_state_of_b_on_a.clone().root().into_vec(), + root: consensus_state_of_b_on_a.root().into_vec(), counterparty_chan_end_path: chan_end_path_on_b, expected_counterparty_channel_end: vector.unwrap(), client_id: connection_end.client_id().to_string(), @@ -165,7 +165,7 @@ impl<'a> CwIbcCoreContext<'a> { verify_channel_state, next_seq_recv_verification_result, )?; - cw_println!(deps, "Light Client Validation Passed"); + cw_println!(deps.api, "Light Client Validation Passed"); if let Order::Ordered = channel_end.ordering { channel_end.state = State::Closed; diff --git a/contracts/cosmwasm-vm/cw-ibc-core/tests/channel/test_acknowledgement.rs b/contracts/cosmwasm-vm/cw-ibc-core/tests/channel/test_acknowledgement.rs index 68562708c..47dab0333 100644 --- a/contracts/cosmwasm-vm/cw-ibc-core/tests/channel/test_acknowledgement.rs +++ b/contracts/cosmwasm-vm/cw-ibc-core/tests/channel/test_acknowledgement.rs @@ -1,6 +1,9 @@ +use super::*; + +use cosmwasm_std::to_vec; use cw_ibc_core::conversions::to_ibc_channel_id; -use super::*; +use common::ibc::core::ics04_channel::commitment::AcknowledgementCommitment; #[test] fn test_acknowledgement_packet_validate_ordered() { @@ -26,7 +29,7 @@ fn test_acknowledgement_packet_validate_ordered() { mock_lightclient_query(test_context.mock_queries, &mut deps); let res = contract.acknowledgement_packet_validate(deps.as_mut(), info, env, &msg); - println!("{:?}", res); + println!("{res:?}"); assert!(res.is_ok()); } @@ -89,3 +92,157 @@ fn test_acknowledgement_packet_validate_fail_missing_channel() { .acknowledgement_packet_validate(deps.as_mut(), info, env, &msg) .unwrap(); } + +#[test] +#[should_panic(expected = "ChannelClosed")] +fn acknowledgement_packet_validate_fail_on_channel_close() { + let msg = get_dummy_raw_msg_acknowledgement(10); + let mut ctx = TestContext::for_acknowledge_packet(get_mock_env(), &msg); + let mut deps = deps(); + let contract = CwIbcCoreContext::new(); + let info = create_mock_info("channel-creater", "umlg", 2000); + + if let Some(chann_end) = &mut ctx.channel_end { + chann_end.state = State::Closed + } + + ctx.init_acknowledge_packet(deps.as_mut().storage, &contract); + mock_lightclient_query(ctx.mock_queries, &mut deps); + + contract + .acknowledgement_packet_validate(deps.as_mut(), info, ctx.env, &msg) + .unwrap(); +} + +#[test] +#[should_panic(expected = "InvalidPacketCounterparty")] +fn acknowledgement_packet_validate_fail_on_invalid_packet_counterparty() { + let mut msg = get_dummy_raw_msg_acknowledgement(10); + let mut ctx = TestContext::for_acknowledge_packet(get_mock_env(), &msg); + let mut deps = deps(); + let contract = CwIbcCoreContext::new(); + let info = create_mock_info("channel-creater", "umlg", 2000); + + ctx.init_acknowledge_packet(deps.as_mut().storage, &contract); + mock_lightclient_query(ctx.mock_queries, &mut deps); + + if let Some(packet) = &mut msg.packet { + packet.destination_port = "different_port".to_string(); + } + + contract + .acknowledgement_packet_validate(deps.as_mut(), info, ctx.env, &msg) + .unwrap(); +} + +#[test] +#[should_panic( + expected = "IbcPacketError { error: IncorrectPacketCommitment { sequence: Sequence(1) } }" +)] +fn acknowledgement_packet_validate_fail_for_incorrect_packet_commitment() { + let mut msg = get_dummy_raw_msg_acknowledgement(10); + let mut ctx = TestContext::for_acknowledge_packet(get_mock_env(), &msg); + let mut deps = deps(); + let contract = CwIbcCoreContext::new(); + let info = create_mock_info("channel-creater", "umlg", 2000); + + ctx.init_acknowledge_packet(deps.as_mut().storage, &contract); + mock_lightclient_query(ctx.mock_queries, &mut deps); + + if let Some(packet) = &mut msg.packet { + packet.timeout_height = Some(RawHeight { + revision_height: 100, + revision_number: 100, + }); + } + + contract + .acknowledgement_packet_validate(deps.as_mut(), info, ctx.env, &msg) + .unwrap(); +} + +#[test] +#[should_panic(expected = "InvalidPacketSequence")] +fn acknowledgement_packet_validate_fail_for_invalid_packet_sequence() { + let msg = get_dummy_raw_msg_acknowledgement(10); + let mut ctx = TestContext::for_acknowledge_packet(get_mock_env(), &msg); + let mut deps = deps(); + let contract = CwIbcCoreContext::new(); + let info = create_mock_info("channel-creater", "umlg", 2000); + + if let Some(chann_end) = &mut ctx.channel_end { + chann_end.ordering = Order::Ordered + } + + ctx.init_acknowledge_packet(deps.as_mut().storage, &contract); + mock_lightclient_query(ctx.mock_queries, &mut deps); + + let packet = msg.clone().packet.unwrap(); + let dest_port = to_ibc_port_id(&packet.source_port).unwrap(); + let dest_channel = to_ibc_channel_id(&packet.source_channel).unwrap(); + + contract + .store_next_sequence_ack( + deps.as_mut().storage, + &dest_port, + &dest_channel, + &Sequence::from_str("2").unwrap(), + ) + .unwrap(); + + contract + .acknowledgement_packet_validate(deps.as_mut(), info, ctx.env, &msg) + .unwrap(); +} + +#[test] +#[should_panic(expected = "FrozenClient")] +fn acknowledgement_packet_validate_fail_for_frozen_client() { + let msg = get_dummy_raw_msg_acknowledgement(10); + let mut ctx = TestContext::for_acknowledge_packet(get_mock_env(), &msg); + let mut deps = deps(); + let contract = CwIbcCoreContext::new(); + let info = create_mock_info("channel-creater", "umlg", 2000); + + if let Some(client_state) = &mut ctx.client_state { + client_state.frozen_height = 10 + } + + ctx.init_acknowledge_packet(deps.as_mut().storage, &contract); + mock_lightclient_query(ctx.mock_queries, &mut deps); + + contract + .acknowledgement_packet_validate(deps.as_mut(), info, ctx.env, &msg) + .unwrap(); +} + +#[test] +fn test_get_packet_acknowledgement() { + let ctx = TestContext::default(get_mock_env()); + let mut deps = deps(); + let contract = CwIbcCoreContext::new(); + + let sequence = Sequence::from_str("0").unwrap(); + let ack_commitment = AcknowledgementCommitment::from(to_vec("ack").unwrap()); + + contract + .store_packet_acknowledgement( + deps.as_mut().storage, + &ctx.port_id, + &ctx.channel_id, + sequence, + ack_commitment.clone(), + ) + .unwrap(); + + let res = contract + .get_packet_acknowledgement( + deps.as_ref().storage, + &ctx.port_id, + &ctx.channel_id, + sequence, + ) + .unwrap(); + + assert_eq!(ack_commitment, res); +} diff --git a/contracts/cosmwasm-vm/cw-ibc-core/tests/channel/test_channel_closeinit.rs b/contracts/cosmwasm-vm/cw-ibc-core/tests/channel/test_channel_closeinit.rs index ff00fa4ff..b2a9f224f 100644 --- a/contracts/cosmwasm-vm/cw-ibc-core/tests/channel/test_channel_closeinit.rs +++ b/contracts/cosmwasm-vm/cw-ibc-core/tests/channel/test_channel_closeinit.rs @@ -48,7 +48,7 @@ fn test_validate_close_init_channel() { info.funds, EXECUTE_ON_CHANNEL_CLOSE_INIT, ); - println!("{:?}", res); + println!("{res:?}"); assert!(res.is_ok()); assert_eq!(res.unwrap().messages[0], on_chan_open_init) } @@ -228,3 +228,24 @@ fn test_on_chan_close_init_submessage() { channel_close_init_validate.channel().order ); } + +#[test] +#[should_panic(expected = "ClientFrozen")] +fn fail_test_validate_chanel_close_init_for_frozen_client() { + let msg = get_dummy_raw_msg_chan_close_init(); + let mut ctx = TestContext::for_channel_close_init(get_mock_env(), &msg); + let mut deps = deps(); + let contract = CwIbcCoreContext::default(); + let info = create_mock_info("channel-creater", "umlg", 2000); + + if let Some(client_state) = &mut ctx.client_state { + client_state.frozen_height = 1 + } + + ctx.init_channel_close_init(deps.as_mut().storage, &contract); + mock_lightclient_query(ctx.mock_queries, &mut deps); + + contract + .validate_channel_close_init(deps.as_mut(), info, &msg) + .unwrap(); +} diff --git a/contracts/cosmwasm-vm/cw-ibc-core/tests/channel/test_close_confirm.rs b/contracts/cosmwasm-vm/cw-ibc-core/tests/channel/test_close_confirm.rs index 15b644f9b..9f56eceb6 100644 --- a/contracts/cosmwasm-vm/cw-ibc-core/tests/channel/test_close_confirm.rs +++ b/contracts/cosmwasm-vm/cw-ibc-core/tests/channel/test_close_confirm.rs @@ -126,7 +126,7 @@ fn test_validate_close_confirm_channel() { mock_lightclient_query(test_context.mock_queries, &mut deps); let res = contract.validate_channel_close_confirm(deps.as_mut(), info, &msg); - println!("{:?}", res); + println!("{res:?}"); assert!(res.is_ok()); assert_eq!( res.unwrap().messages[0].id, @@ -234,3 +234,24 @@ pub fn test_channel_close_confirm_validate_fail_connection_hops() { }; channel_close_confirm_validate(&channel_id, &channel_end).unwrap(); } + +#[test] +#[should_panic(expected = "FrozenClient")] +fn fail_test_validate_channel_close_confirm_for_frozen_client() { + let msg = get_dummy_raw_msg_chan_close_confirm(10); + let mut ctx = TestContext::for_channel_close_confirm(get_mock_env(), &msg); + let mut deps = deps(); + let contract = CwIbcCoreContext::default(); + let info = create_mock_info("channel-creater", "umlg", 2000); + + if let Some(client_state) = &mut ctx.client_state { + client_state.frozen_height = 1 + } + + ctx.init_channel_close_confirm(deps.as_mut().storage, &contract); + mock_lightclient_query(ctx.mock_queries, &mut deps); + + contract + .validate_channel_close_confirm(deps.as_mut(), info, &msg) + .unwrap(); +} diff --git a/contracts/cosmwasm-vm/cw-ibc-core/tests/channel/test_execution_channel.rs b/contracts/cosmwasm-vm/cw-ibc-core/tests/channel/test_execution_channel.rs index eda6319ab..29cd927c2 100644 --- a/contracts/cosmwasm-vm/cw-ibc-core/tests/channel/test_execution_channel.rs +++ b/contracts/cosmwasm-vm/cw-ibc-core/tests/channel/test_execution_channel.rs @@ -40,7 +40,7 @@ fn test_for_channel_open_init_execution_message() { msg: HexString::from_bytes(&msg.encode_to_vec()), }, ); - println!("{:?}", res); + println!("{res:?}"); assert!(res.is_ok()); assert_eq!(res.unwrap().messages[0].id, 41); } @@ -74,7 +74,7 @@ fn test_for_channel_open_try_execution_message() { msg: HexString::from_bytes(&msg.encode_to_vec()), }, ); - println!("{:?}", res); + println!("{res:?}"); assert!(res.is_ok()); assert_eq!(res.unwrap().messages[0].id, EXECUTE_ON_CHANNEL_OPEN_TRY); @@ -106,7 +106,7 @@ fn test_for_channel_open_ack_execution() { msg: HexString::from_bytes(&msg.encode_to_vec()), }, ); - println!("{:?}", res); + println!("{res:?}"); assert!(res.is_ok()); assert_eq!( @@ -147,7 +147,7 @@ fn test_for_channel_open_confirm() { msg: HexString::from_bytes(&msg.encode_to_vec()), }, ); - println!("{:?}", res); + println!("{res:?}"); assert!(res.is_ok()); assert_eq!( @@ -185,7 +185,7 @@ fn test_for_channel_close_init() { msg: HexString::from_bytes(&msg.encode_to_vec()), }, ); - println!("{:?}", res); + println!("{res:?}"); assert!(res.is_ok()); assert_eq!(res.as_ref().unwrap().messages[0].id, 45); @@ -216,7 +216,7 @@ fn test_for_channel_close_confirm() { msg: HexString::from_bytes(&msg.encode_to_vec()), }, ); - println!("{:?}", res); + println!("{res:?}"); assert!(res.is_ok()); assert_eq!( @@ -266,7 +266,7 @@ fn test_for_packet_send() { packet: HexString::from_bytes(&raw.encode_to_vec()), }, ); - println!("{:?},", res); + println!("{res:?},"); assert!(res.is_ok()); assert_eq!(res.as_ref().unwrap().attributes[0].value, "send_packet"); assert_eq!(res.unwrap().events[0].ty, "send_packet") @@ -298,7 +298,7 @@ fn test_for_recieve_packet() { msg: HexString::from_bytes(&msg.encode_to_vec()), }, ); - println!("{:?}", res); + println!("{res:?}"); assert!(res.is_ok()); assert_eq!( res.unwrap().messages[0].id, @@ -324,7 +324,7 @@ fn test_for_recieve_packet() { }), }; let response = contract.reply(deps.as_mut(), env, reply_message); - println!("{:?}", response); + println!("{response:?}"); assert!(response.is_ok()); assert_eq!(response.unwrap().events[0].ty, "write_acknowledgement"); } @@ -356,7 +356,7 @@ fn test_for_ack_execute() { msg: HexString::from_bytes(&msg.encode_to_vec()), }, ); - println!("{:?}", res); + println!("{res:?}"); assert!(res.is_ok()); assert_eq!( diff --git a/contracts/cosmwasm-vm/cw-ibc-core/tests/channel/test_handler.rs b/contracts/cosmwasm-vm/cw-ibc-core/tests/channel/test_handler.rs index b0226ec48..e58e7f8f3 100644 --- a/contracts/cosmwasm-vm/cw-ibc-core/tests/channel/test_handler.rs +++ b/contracts/cosmwasm-vm/cw-ibc-core/tests/channel/test_handler.rs @@ -1,5 +1,12 @@ use super::*; +use common::ibc::core::ics04_channel::channel::Order; +use common::ibc::core::ics24_host::identifier::PortId; + +use cw_ibc_core::ics03_connection::State as ConnectionState; +use cw_ibc_core::ics04_channel::{open_init, open_try}; +use cw_ibc_core::{context::CwIbcCoreContext, ConnectionEnd}; + #[test] #[should_panic(expected = "UndefinedConnectionCounterparty")] fn test_validate_open_try_channel_fail_missing_counterparty() { @@ -20,3 +27,110 @@ fn test_validate_open_try_channel_fail_missing_counterparty() { .validate_channel_open_try(deps.as_mut(), info, &raw) .unwrap(); } + +#[test] +#[should_panic(expected = "InvalidConnectionHopsLength")] +fn fail_test_validate_open_init_channel_on_invalid_connection_hops_length() { + let mut deps = deps(); + let contract = CwIbcCoreContext::default(); + let info = create_mock_info("channel-creater", "umlg", 2000); + + let mut raw_channel = get_dummy_raw_channel_end(Some(0)); + raw_channel.connection_hops = Vec::new(); + + let msg = RawMsgChannelOpenInit { + port_id: PortId::default().to_string(), + channel: Some(raw_channel), + signer: get_dummy_bech32_account(), + }; + contract + .validate_channel_open_init(deps.as_mut(), info, &msg) + .unwrap(); +} + +#[test] +#[should_panic(expected = "InvalidVersionLengthConnection")] +fn fail_channel_open_init_msg_validate_on_invalid_version_length_of_connection() { + let ctx = TestContext::default(get_mock_env()); + + let conn_end = ConnectionEnd::new( + ctx.connection_end().state.clone(), + ctx.client_id.clone(), + ctx.connection_end().counterparty().clone(), + Vec::new(), + ctx.connection_end().delay_period().clone(), + ); + open_init::channel_open_init_msg_validate(&ctx.channel_end(), conn_end).unwrap(); +} + +#[test] +#[should_panic(expected = "ChannelFeatureNotSupportedByConnection")] +fn fail_channel_open_init_msg_validate_on_channel_feature_not_supported() { + let mut ctx = TestContext::default(get_mock_env()); + if let Some(chann_end) = &mut ctx.channel_end { + chann_end.ordering = Order::None + } + + open_init::channel_open_init_msg_validate(&ctx.channel_end(), ctx.connection_end()).unwrap(); +} + +#[test] +#[should_panic(expected = "ConnectionNotOpen")] +fn fail_channel_open_try_msg_validate_on_invalid_connection_state() { + let mut ctx = TestContext::default(get_mock_env()); + if let Some(conn_end) = &mut ctx.connection_end { + conn_end.state = ConnectionState::Init; + } + + open_try::channel_open_try_msg_validate(&ctx.channel_end(), &ctx.connection_end()).unwrap(); +} + +#[test] +#[should_panic(expected = "ChannelFeatureNotSupportedByConnection")] +fn fail_channel_open_try_msg_validate_on_feature_not_supported() { + let mut ctx = TestContext::default(get_mock_env()); + if let Some(chann_end) = &mut ctx.channel_end { + chann_end.ordering = Order::None + } + + open_try::channel_open_try_msg_validate(&ctx.channel_end(), &ctx.connection_end()).unwrap(); +} + +#[test] +#[should_panic(expected = "ClientFrozen")] +fn fail_test_validate_open_init_channel_for_frozen_client() { + let mut ctx = TestContext::default(get_mock_env()); + let mut deps = deps(); + let contract = CwIbcCoreContext::default(); + let info = create_mock_info("channel-creater", "umlg", 2000); + + if let Some(client_state) = &mut ctx.client_state { + client_state.frozen_height = 1 + } + + ctx.init_channel_open_init(deps.as_mut().storage, &contract); + mock_lightclient_query(ctx.mock_queries, &mut deps); + + let msg = get_dummy_raw_msg_chan_open_init(Some(0)); + contract + .validate_channel_open_init(deps.as_mut(), info, &msg) + .unwrap(); +} + +#[test] +#[should_panic(expected = "InvalidConnectionHopsLength")] +fn fail_test_validate_open_try_channel_on_invalid_connection_hops_length() { + let mut deps = deps(); + let contract = CwIbcCoreContext::default(); + let info = create_mock_info("channel-creater", "umlg", 2000); + + let mut raw_channel = get_dummy_raw_channel_end(Some(0)); + raw_channel.connection_hops = Vec::new(); + + let mut msg = get_dummy_raw_msg_chan_open_try(0); + msg.channel = Some(raw_channel); + + contract + .validate_channel_open_try(deps.as_mut(), info, &msg) + .unwrap(); +} diff --git a/contracts/cosmwasm-vm/cw-ibc-core/tests/channel/test_open_ack.rs b/contracts/cosmwasm-vm/cw-ibc-core/tests/channel/test_open_ack.rs index a9994193a..e977e7d1b 100644 --- a/contracts/cosmwasm-vm/cw-ibc-core/tests/channel/test_open_ack.rs +++ b/contracts/cosmwasm-vm/cw-ibc-core/tests/channel/test_open_ack.rs @@ -1,5 +1,6 @@ use super::*; use cosmwasm_std::IbcChannel; +use cw_ibc_core::ics04_channel::open_ack; use cw_ibc_core::{ conversions::to_ibc_channel_id, @@ -54,7 +55,7 @@ fn test_validate_open_ack_channel() { mock_lightclient_query(test_context.mock_queries, &mut deps); let res = contract.validate_channel_open_ack(deps.as_mut(), info, &msg); - println!("{:?}", res); + println!("{res:?}"); assert!(res.is_ok()); assert_eq!( res.unwrap().messages[0].id, @@ -190,3 +191,88 @@ fn test_channel_open_try_validate() { let res = channel_open_try_msg_validate(&channel, &connection_end); assert!(res.is_ok()); } + +#[test] +#[should_panic(expected = "UnknownOrderType")] +fn fail_channel_open_ack_msg_validate_on_unknown_order() { + let mut ctx = TestContext::default(get_mock_env()); + if let Some(chann_end) = &mut ctx.channel_end { + chann_end.remote = common::ibc::core::ics04_channel::channel::Counterparty::default(); + chann_end.ordering = Order::None + } + + open_ack::on_chan_open_ack_submessage( + &ctx.channel_end(), + &ctx.port_id, + &ctx.channel_id, + &ctx.connection_id, + ) + .unwrap(); +} + +#[test] +fn test_channel_open_ack_msg_validate_on_ordered_type() { + let mut ctx = TestContext::default(get_mock_env()); + if let Some(chann_end) = &mut ctx.channel_end { + chann_end.remote = common::ibc::core::ics04_channel::channel::Counterparty::default(); + chann_end.ordering = Order::Ordered + } + + let res = Some( + open_ack::on_chan_open_ack_submessage( + &ctx.channel_end(), + &ctx.port_id, + &ctx.channel_id, + &ctx.connection_id, + ) + .unwrap(), + ); + + let res_exist = match res { + Some(_) => true, + None => false, + }; + assert_eq!(res_exist, true); +} + +#[test] +#[should_panic(expected = "FrozenClient")] +fn fail_test_validate_open_try_channel_for_frozen_client() { + let msg = get_dummy_raw_msg_chan_open_try(10); + let mut ctx = TestContext::for_channel_open_try(get_mock_env(), &msg); + let mut deps = deps(); + let contract = CwIbcCoreContext::default(); + let info = create_mock_info("channel-creater", "umlg", 2000); + + if let Some(client_state) = &mut ctx.client_state { + client_state.frozen_height = 1 + } + + ctx.init_channel_open_try(deps.as_mut().storage, &contract); + mock_lightclient_query(ctx.mock_queries, &mut deps); + + contract + .validate_channel_open_try(deps.as_mut(), info, &msg) + .unwrap(); +} + +#[test] +#[should_panic(expected = "FrozenClient")] +fn fail_test_validate_channel_open_ack_for_frozen_client() { + let msg = get_dummy_raw_msg_chan_open_ack(10); + let mut ctx = TestContext::for_channel_open_ack(get_mock_env(), &msg); + let mut deps = deps(); + let contract = CwIbcCoreContext::default(); + let info = create_mock_info("channel-creater", "umlg", 2000); + + if let Some(client_state) = &mut ctx.client_state { + client_state.frozen_height = 1 + } + + ctx.init_channel_open_ack(deps.as_mut().storage, &contract); + mock_lightclient_query(ctx.mock_queries, &mut deps); + + contract + .validate_channel_open_ack(deps.as_mut(), info, &msg) + .unwrap(); +} diff --git a/contracts/cosmwasm-vm/cw-ibc-core/tests/channel/test_open_confirm.rs b/contracts/cosmwasm-vm/cw-ibc-core/tests/channel/test_open_confirm.rs index e957ccde8..27d21e234 100644 --- a/contracts/cosmwasm-vm/cw-ibc-core/tests/channel/test_open_confirm.rs +++ b/contracts/cosmwasm-vm/cw-ibc-core/tests/channel/test_open_confirm.rs @@ -1,4 +1,5 @@ use cosmwasm_std::IbcChannel; +use cw_ibc_core::ics04_channel::open_confirm; use cw_ibc_core::{ conversions::to_ibc_channel_id, @@ -49,7 +50,7 @@ fn test_validate_open_confirm_channel() { mock_lightclient_query(test_context.mock_queries, &mut deps); let res = contract.validate_channel_open_confirm(deps.as_mut(), info, &msg); - println!("{:?}", res); + println!("{res:?}"); assert!(res.is_ok()); assert_eq!( res.unwrap().messages[0].id, @@ -139,3 +140,65 @@ pub fn test_on_chan_open_confirm_submessage() { assert_eq!(res.unwrap(), expected); } + +#[test] +#[should_panic(expected = "UnknownOrderType")] +fn fail_channel_open_confirm_msg_validate_on_unknown_order() { + let mut ctx = TestContext::default(get_mock_env()); + if let Some(chann_end) = &mut ctx.channel_end { + chann_end.remote = common::ibc::core::ics04_channel::channel::Counterparty::default(); + chann_end.ordering = Order::None + } + + open_confirm::on_chan_open_confirm_submessage( + &ctx.channel_end(), + &ctx.port_id, + &ctx.channel_id, + ) + .unwrap(); +} + +#[test] +fn test_channel_open_confirm_msg_validate_on_ordered_type() { + let mut ctx = TestContext::default(get_mock_env()); + if let Some(chann_end) = &mut ctx.channel_end { + chann_end.remote = common::ibc::core::ics04_channel::channel::Counterparty::default(); + chann_end.ordering = Order::Ordered + } + + let res = Some( + open_confirm::on_chan_open_confirm_submessage( + &ctx.channel_end(), + &ctx.port_id, + &ctx.channel_id, + ) + .unwrap(), + ); + + let res_exist = match res { + Some(_) => true, + None => false, + }; + assert_eq!(res_exist, true); +} + +#[test] +#[should_panic(expected = "FrozenClient")] +fn fail_test_validate_channel_open_confirm_for_frozen_client() { + let msg = get_dummy_raw_msg_chan_open_confirm(10); + let mut ctx = TestContext::for_channel_open_confirm(get_mock_env(), &msg); + let mut deps = deps(); + let contract = CwIbcCoreContext::default(); + let info = create_mock_info("channel-creater", "umlg", 2000); + + if let Some(client_state) = &mut ctx.client_state { + client_state.frozen_height = 1 + } + + ctx.init_channel_open_confirm(deps.as_mut().storage, &contract); + mock_lightclient_query(ctx.mock_queries, &mut deps); + + contract + .validate_channel_open_confirm(deps.as_mut(), info, &msg) + .unwrap(); +} diff --git a/contracts/cosmwasm-vm/cw-ibc-core/tests/channel/test_packet.rs b/contracts/cosmwasm-vm/cw-ibc-core/tests/channel/test_packet.rs index cbf0f2858..7970ffe50 100644 --- a/contracts/cosmwasm-vm/cw-ibc-core/tests/channel/test_packet.rs +++ b/contracts/cosmwasm-vm/cw-ibc-core/tests/channel/test_packet.rs @@ -234,3 +234,20 @@ fn test_packet_send_fails_on_timedout_timestamp() { .send_packet(deps.as_mut(), &mock_env(), info, packet) .unwrap(); } + +#[test] +#[should_panic(expected = "Unauthorized")] +fn test_send_packet_fail_for_unauthenticated_capability() { + let packet = get_dummy_raw_packet(110, Timestamp::default().nanoseconds()); + let mut ctx = TestContext::for_send_packet(get_mock_env(), &packet); + let mut deps = deps(); + let contract = CwIbcCoreContext::new(); + let info = create_mock_info("module", "test", 100); + + ctx.init_send_packet(deps.as_mut().storage, &contract); + mock_lightclient_query(ctx.mock_queries, &mut deps); + + contract + .send_packet(deps.as_mut(), &ctx.env, info, packet) + .unwrap(); +} diff --git a/contracts/cosmwasm-vm/cw-ibc-core/tests/channel/test_receive_packet.rs b/contracts/cosmwasm-vm/cw-ibc-core/tests/channel/test_receive_packet.rs index fb5e304c3..ee001072d 100644 --- a/contracts/cosmwasm-vm/cw-ibc-core/tests/channel/test_receive_packet.rs +++ b/contracts/cosmwasm-vm/cw-ibc-core/tests/channel/test_receive_packet.rs @@ -1,13 +1,14 @@ use common::ibc::core::ics03_connection::connection::State as ConnectionState; +use common::ibc::core::ics04_channel::commitment::AcknowledgementCommitment; use common::ibc::core::ics04_channel::packet::Receipt; +use common::ibc::core::ics04_channel::timeout::TimeoutHeight; use common::ibc::timestamp::Timestamp; +use cosmwasm_std::to_vec; use cw_common::raw_types::channel::RawMsgRecvPacket; use cw_common::types::Ack; -use cw_ibc_core::conversions::to_ibc_channel_id; - -use cw_ibc_core::conversions::to_ibc_port_id; +use cw_ibc_core::conversions::{to_ibc_channel_id, to_ibc_port_id, to_ibc_timeout_block}; use cw_ibc_core::VALIDATE_ON_PACKET_RECEIVE_ON_MODULE; @@ -269,6 +270,139 @@ fn test_receive_packet_no_op_on_packet_already_received() { .validate_receive_packet(deps.as_mut(), info, env, &msg) .unwrap(); } + +#[test] +fn test_is_packet_already_received_for_none_ordered_channel() { + let msg = get_dummy_raw_msg_recv_packet(10); + let mut ctx = TestContext::for_receive_packet(get_mock_env(), &msg); + let mut deps = deps(); + let contract = CwIbcCoreContext::new(); + + ctx.init_receive_packet(deps.as_mut().storage, &contract); + if let Some(channel_end) = &mut ctx.channel_end { + channel_end.ordering = Order::None; + } + + let packet = msg.packet.clone().unwrap(); + let des_port = to_ibc_port_id(&packet.destination_port).unwrap(); + let des_channel = to_ibc_channel_id(&packet.destination_channel).unwrap(); + + let res = contract + .is_packet_already_received( + deps.as_ref(), + &ctx.channel_end(), + &des_port, + &des_channel, + msg.packet.unwrap().sequence.into(), + ) + .unwrap(); + + assert_eq!(res, false) +} + +#[test] +#[should_panic( + expected = "InvalidPacketSequence { given_sequence: Sequence(1), next_sequence: Sequence(0) }" +)] +fn test_is_packet_already_received_fail_for_invalid_packet_sequence() { + let msg = get_dummy_raw_msg_recv_packet(10); + let mut ctx = TestContext::for_receive_packet(get_mock_env(), &msg); + let mut deps = deps(); + let contract = CwIbcCoreContext::new(); + + if let Some(channel_end) = &mut ctx.channel_end { + channel_end.ordering = Order::Ordered; + } + + let packet = msg.packet.clone().unwrap(); + let des_port = to_ibc_port_id(&packet.destination_port).unwrap(); + let des_channel = to_ibc_channel_id(&packet.destination_channel).unwrap(); + + contract + .store_next_sequence_recv( + deps.as_mut().storage, + &des_port, + &des_channel, + &Sequence::from(0), + ) + .unwrap(); + + contract + .is_packet_already_received( + deps.as_ref(), + &ctx.channel_end(), + &des_port, + &des_channel, + msg.packet.unwrap().sequence.into(), + ) + .unwrap(); +} + +#[test] +fn test_is_packet_already_received() { + let msg = get_dummy_raw_msg_recv_packet(10); + let mut ctx = TestContext::for_receive_packet(get_mock_env(), &msg); + let mut deps = deps(); + let contract = CwIbcCoreContext::new(); + + if let Some(channel_end) = &mut ctx.channel_end { + channel_end.ordering = Order::Ordered; + } + + let packet = msg.packet.clone().unwrap(); + let des_port = to_ibc_port_id(&packet.destination_port).unwrap(); + let des_channel = to_ibc_channel_id(&packet.destination_channel).unwrap(); + + contract + .store_next_sequence_recv( + deps.as_mut().storage, + &des_port, + &des_channel, + &Sequence::from(1), + ) + .unwrap(); + + let res = contract + .is_packet_already_received( + deps.as_ref(), + &ctx.channel_end(), + &des_port, + &des_channel, + msg.packet.unwrap().sequence.into(), + ) + .unwrap(); + + assert_eq!(res, false) +} + +#[test] +#[should_panic(expected = "{ error: AcknowledgementExists { sequence: Sequence(1) } }")] +fn fail_test_validate_write_acknowledgement() { + let msg = get_dummy_raw_msg_recv_packet(10); + let mut deps = deps(); + let contract = CwIbcCoreContext::new(); + + let packet = msg.packet.unwrap(); + let sequence = packet.sequence.into(); + let dest_port = to_ibc_port_id(&packet.destination_port).unwrap(); + let dest_channel = to_ibc_channel_id(&packet.destination_channel).unwrap(); + let ack_commitment = AcknowledgementCommitment::from(to_vec("0").unwrap()); + + contract + .store_packet_acknowledgement( + deps.as_mut().storage, + &dest_port, + &dest_channel, + sequence, + ack_commitment, + ) + .unwrap(); + + contract + .validate_write_acknowledgement(deps.as_mut().storage, &packet) + .unwrap(); +} + #[test] fn execute_receive_packet() { let contract = CwIbcCoreContext::default(); @@ -407,3 +541,14 @@ fn test_lookup_module_packet() { assert!(res.is_ok()); assert_eq!("contractaddress", res.unwrap()) } + +#[test] +fn test_timeout_height_to_str() { + let contract = CwIbcCoreContext::new(); + + let timeout_height = TimeoutHeight::from(mock_height(1, 1).unwrap()); + let timeout = to_ibc_timeout_block(&timeout_height); + + let res = contract.timeout_height_to_str(timeout); + assert_eq!(res, "1-1".to_string()) +} diff --git a/contracts/cosmwasm-vm/cw-ibc-core/tests/channel/test_timeout.rs b/contracts/cosmwasm-vm/cw-ibc-core/tests/channel/test_timeout.rs index 78ea42633..eb3b0f05f 100644 --- a/contracts/cosmwasm-vm/cw-ibc-core/tests/channel/test_timeout.rs +++ b/contracts/cosmwasm-vm/cw-ibc-core/tests/channel/test_timeout.rs @@ -1,3 +1,6 @@ +use common::icon::icon::proto::core::channel::channel::Order; + +use cw_common::types::TimeoutMsgType; use cw_ibc_core::{light_client::light_client::LightClient, VALIDATE_ON_PACKET_TIMEOUT_ON_MODULE}; use super::*; @@ -131,7 +134,9 @@ fn test_timeout_packet_validate_to_light_client() { mock_lightclient_query(test_context.mock_queries, &mut deps); - let res = contract.timeout_packet_validate_to_light_client(deps.as_mut(), info, env, msg); + let res = + contract.timeout_packet_validate(deps.as_mut(), env, info, TimeoutMsgType::Timeout(msg)); + println!("{res:?}"); assert!(res.is_ok()); assert_eq!( @@ -155,129 +160,12 @@ fn test_timeout_packet_fails_if_height_not_expired() { let mut test_context = TestContext::for_packet_timeout(env.clone(), &msg); test_context.init_timeout_packet(deps.as_mut().storage, &contract); - // let packet = &msg.packet.clone().unwrap(); - // let src_port = to_ibc_port_id(&packet.source_port).unwrap(); - // let src_channel = to_ibc_channel_id(&packet.source_channel).unwrap(); - - // let dst_port = to_ibc_port_id(&packet.destination_port).unwrap(); - // let dst_channel = to_ibc_channel_id(&packet.destination_channel).unwrap(); - - // let packet_timeout_height = to_ibc_timeout_height(packet.timeout_height.clone()).unwrap(); - // let packet_timestamp = to_ibc_timestamp(packet.timeout_timestamp).unwrap(); - // let packet_sequence = Sequence::from(packet.sequence); - // let proof_height = to_ibc_height(msg.proof_height.clone()).unwrap(); - // let _next_sequence_recv = Sequence::from(msg.next_sequence_recv); - - // let chan_end_on_a_ordered = ChannelEnd::new( - // State::Open, - // Order::Ordered, - // Counterparty::new(dst_port, Some(dst_channel)), - // vec![IbcConnectionId::default()], - // Version::new("ics20-1".to_string()), - // ); - // contract - // .store_channel_end( - // &mut deps.storage, - // &src_port.clone(), - // &src_channel.clone(), - // &chan_end_on_a_ordered, - // ) - // .unwrap(); - // let conn_prefix = common::ibc::core::ics23_commitment::commitment::CommitmentPrefix::try_from( - // "hello".to_string().as_bytes().to_vec(), - // ); - - // let conn_end_on_a = ConnectionEnd::new( - // ConnectionState::Open, - // ClientId::default(), - // ConnectionCounterparty::new( - // ClientId::default(), - // Some(ConnectionId::default()), - // conn_prefix.unwrap(), - // ), - // get_compatible_versions(), - // ZERO_DURATION, - // ); - // contract - // .store_connection( - // &mut deps.storage, - // &chan_end_on_a_ordered.connection_hops()[0].clone(), - // &conn_end_on_a, - // ) - // .unwrap(); - // let packet_commitment = - // compute_packet_commitment(&packet.data, &packet_timeout_height, &packet_timestamp); - - // contract - // .store_packet_commitment( - // &mut deps.storage, - // &src_port, - // &src_channel, - // packet_sequence, - // packet_commitment, - // ) - // .unwrap(); - - // let client_state: ClientState = get_dummy_client_state(); - - // let client = client_state.to_any().encode_to_vec(); - // contract - // .store_client_state( - // &mut deps.storage, - // &env, - // &IbcClientId::default(), - // client, - // client_state.get_keccak_hash().to_vec(), - // ) - // .unwrap(); - // let _client_type = IbcClientType::new("iconclient".to_string()); - - // let light_client = LightClient::new("lightclient".to_string()); - // contract - // .store_client_implementations( - // &mut deps.storage, - // &IbcClientId::default(), - // light_client.clone(), - // ) - // .unwrap(); - let timestamp_query = LightClient::get_timestamp_at_height_query(&IbcClientId::default(), proof_height).unwrap(); let mut mocks = test_context.mock_queries.clone(); mocks.insert(timestamp_query, to_binary(&0_u64).unwrap()); mock_lightclient_query(mocks, &mut deps); - // contract - // .bind_port(&mut deps.storage, &src_port, "moduleaddress".to_string()) - // .unwrap(); - - // let consenus_state: ConsensusState = common::icon::icon::lightclient::v1::ConsensusState { - // message_root: vec![1, 2, 3, 4], - // next_proof_context_hash: vec![1, 2, 3], - // } - // .try_into() - // .unwrap(); - - // let consenus_state_any = consenus_state.to_any().encode_to_vec(); - // contract - // .store_consensus_state( - // &mut deps.storage, - // &IbcClientId::default(), - // proof_height, - // consenus_state_any, - // consenus_state.get_keccak_hash().to_vec(), - // ) - // .unwrap(); - // let env = get_mock_env(); - // contract - // .ibc_store() - // .expected_time_per_block() - // .save(deps.as_mut().storage, &(env.block.time.seconds())) - // .unwrap(); - // let light_client = LightClient::new("lightclient".to_string()); - // contract - // .store_client_implementations(deps.as_mut().storage, &IbcClientId::default(), light_client) - // .unwrap(); contract .timeout_packet_validate_to_light_client(deps.as_mut(), info, env, msg) .unwrap(); @@ -298,91 +186,6 @@ fn test_timeout_packet_fails_if_timestamp_not_expired() { let mut test_context = TestContext::for_packet_timeout(env.clone(), &msg); test_context.init_timeout_packet(deps.as_mut().storage, &contract); - // let packet = &msg.packet.clone().unwrap(); - // let src_port = to_ibc_port_id(&packet.source_port).unwrap(); - // let src_channel = to_ibc_channel_id(&packet.source_channel).unwrap(); - - // let dst_port = to_ibc_port_id(&packet.destination_port).unwrap(); - // let dst_channel = to_ibc_channel_id(&packet.destination_channel).unwrap(); - - // let packet_timeout_height = to_ibc_timeout_height(packet.timeout_height.clone()).unwrap(); - // let packet_timestamp = to_ibc_timestamp(packet.timeout_timestamp).unwrap(); - // let packet_sequence = Sequence::from(packet.sequence); - // let proof_height = to_ibc_height(msg.proof_height.clone()).unwrap(); - // let _next_sequence_recv = Sequence::from(msg.next_sequence_recv); - - // let chan_end_on_a_ordered = ChannelEnd::new( - // State::Open, - // Order::Ordered, - // Counterparty::new(dst_port, Some(dst_channel)), - // vec![IbcConnectionId::default()], - // Version::new("ics20-1".to_string()), - // ); - // contract - // .store_channel_end( - // &mut deps.storage, - // &src_port.clone(), - // &src_channel.clone(), - // &chan_end_on_a_ordered, - // ) - // .unwrap(); - // let conn_prefix = common::ibc::core::ics23_commitment::commitment::CommitmentPrefix::try_from( - // "hello".to_string().as_bytes().to_vec(), - // ); - - // let conn_end_on_a = ConnectionEnd::new( - // ConnectionState::Open, - // ClientId::default(), - // ConnectionCounterparty::new( - // ClientId::default(), - // Some(ConnectionId::default()), - // conn_prefix.unwrap(), - // ), - // get_compatible_versions(), - // ZERO_DURATION, - // ); - // contract - // .store_connection( - // &mut deps.storage, - // &chan_end_on_a_ordered.connection_hops()[0].clone(), - // &conn_end_on_a, - // ) - // .unwrap(); - // let packet_commitment = - // compute_packet_commitment(&packet.data, &packet_timeout_height, &packet_timestamp); - - // contract - // .store_packet_commitment( - // &mut deps.storage, - // &src_port, - // &src_channel, - // packet_sequence, - // packet_commitment, - // ) - // .unwrap(); - - // let client_state: ClientState = get_dummy_client_state(); - - // let client = client_state.to_any().encode_to_vec(); - // contract - // .store_client_commitment( - // &mut deps.storage, - // &env, - // &IbcClientId::default(), - - // client_state.get_keccak_hash().to_vec(), - // ) - // .unwrap(); - // let _client_type = IbcClientType::new("iconclient".to_string()); - - // let light_client = LightClient::new("lightclient".to_string()); - // contract - // .store_client_implementations( - // &mut deps.storage, - // &IbcClientId::default(), - // light_client.clone(), - // ) - // .unwrap(); let timestamp_query = LightClient::get_timestamp_at_height_query(&IbcClientId::default(), proof_height).unwrap(); let mut mocks = test_context.mock_queries.clone(); @@ -393,38 +196,83 @@ fn test_timeout_packet_fails_if_timestamp_not_expired() { ); mock_lightclient_query(mocks, &mut deps); - // contract - // .bind_port(&mut deps.storage, &src_port, "moduleaddress".to_string()) - // .unwrap(); - - // let consenus_state: ConsensusState = common::icon::icon::lightclient::v1::ConsensusState { - // message_root: vec![1, 2, 3, 4], - // next_proof_context_hash: vec![1, 2, 3], - // } - // .try_into() - // .unwrap(); - - // let consenus_state_any = consenus_state.to_any().encode_to_vec(); - // contract - // .store_consensus_commitment( - // &mut deps.storage, - // &IbcClientId::default(), - // proof_height, - - // consenus_state.get_keccak_hash().to_vec(), - // ) - // .unwrap(); - // let env = get_mock_env(); - // contract - // .ibc_store() - // .expected_time_per_block() - // .save(deps.as_mut().storage, &(env.block.time.seconds())) - // .unwrap(); - // let light_client = LightClient::new("lightclient".to_string()); - // contract - // .store_client_implementations(deps.as_mut().storage, &IbcClientId::default(), light_client) - // .unwrap(); contract .timeout_packet_validate_to_light_client(deps.as_mut(), info, env, msg) .unwrap(); } + +#[test] +#[should_panic(expected = "ChannelClosed")] +fn test_timeout_packet_fails_for_closed_connection() { + let proof_height = 50; + let timeout_height = proof_height - 1; + let timeout_timestamp = 0; + let msg = get_dummy_raw_msg_timeout(proof_height, timeout_height, timeout_timestamp); + + let mut ctx = TestContext::for_packet_timeout(get_mock_env(), &msg); + let contract = CwIbcCoreContext::default(); + let mut deps = deps(); + let info = create_mock_info("channel-creater", "umlg", 20000000); + + if let Some(channel_end) = &mut ctx.channel_end { + channel_end.state = cw_ibc_core::ics04_channel::State::Closed; + } + + ctx.init_timeout_packet(deps.as_mut().storage, &contract); + mock_lightclient_query(ctx.mock_queries, &mut deps); + + contract + .timeout_packet_validate_to_light_client(deps.as_mut(), info, ctx.env, msg) + .unwrap(); +} + +#[test] +#[should_panic(expected = "InvalidPacketSequence")] +fn test_timeout_packet_fails_for_invalid_packet_sequence() { + let proof_height = 50; + let timeout_height = proof_height - 1; + let timeout_timestamp = 0; + let mut msg = get_dummy_raw_msg_timeout(proof_height, timeout_height, timeout_timestamp); + msg.next_sequence_recv = 20; + + let mut ctx = TestContext::for_packet_timeout(get_mock_env(), &msg); + let contract = CwIbcCoreContext::default(); + let mut deps = deps(); + let info = create_mock_info("channel-creater", "umlg", 20000000); + + if let Some(channel_end) = &mut ctx.channel_end { + channel_end.ordering = channel::Order::Ordered; + } + + ctx.init_timeout_packet(deps.as_mut().storage, &contract); + ctx.save_timestamp_at_height(proof_height, 0); + mock_lightclient_query(ctx.mock_queries, &mut deps); + + contract + .timeout_packet_validate_to_light_client(deps.as_mut(), info, ctx.env, msg) + .unwrap(); +} + +#[test] +fn test_timeout_packet_for_ordered_channel() { + let proof_height = 50; + let timeout_height = proof_height - 1; + let timeout_timestamp = 0; + let msg = get_dummy_raw_msg_timeout(proof_height, timeout_height, timeout_timestamp); + + let mut ctx = TestContext::for_packet_timeout(get_mock_env(), &msg); + let contract = CwIbcCoreContext::default(); + let mut deps = deps(); + let info = create_mock_info("channel-creater", "umlg", 20000000); + + if let Some(channel_end) = &mut ctx.channel_end { + channel_end.ordering = channel::Order::Ordered; + } + + ctx.init_timeout_packet(deps.as_mut().storage, &contract); + ctx.save_timestamp_at_height(proof_height, 0); + mock_lightclient_query(ctx.mock_queries, &mut deps); + + let res = contract.timeout_packet_validate_to_light_client(deps.as_mut(), info, ctx.env, msg); + assert!(res.is_ok()) +} diff --git a/contracts/cosmwasm-vm/cw-ibc-core/tests/channel/test_timeout_on_close.rs b/contracts/cosmwasm-vm/cw-ibc-core/tests/channel/test_timeout_on_close.rs index 9fff8a5dc..eb7c0a61d 100644 --- a/contracts/cosmwasm-vm/cw-ibc-core/tests/channel/test_timeout_on_close.rs +++ b/contracts/cosmwasm-vm/cw-ibc-core/tests/channel/test_timeout_on_close.rs @@ -1,3 +1,4 @@ +use cw_common::types::TimeoutMsgType; use cw_ibc_core::VALIDATE_ON_PACKET_TIMEOUT_ON_MODULE; use super::*; @@ -17,8 +18,12 @@ fn test_timeout_on_close_packet_validate_to_light_client() { mock_lightclient_query(test_context.mock_queries, &mut deps); - let res = - contract.timeout_on_close_packet_validate_to_light_client(deps.as_mut(), info, env, msg); + let res = contract.timeout_packet_validate( + deps.as_mut(), + env, + info, + TimeoutMsgType::TimeoutOnClose(msg), + ); print!("{:?}", res); assert!(res.is_ok()); assert_eq!( @@ -26,3 +31,129 @@ fn test_timeout_on_close_packet_validate_to_light_client() { VALIDATE_ON_PACKET_TIMEOUT_ON_MODULE ) } + +#[test] +#[should_panic(expected = "InvalidPacketCounterparty")] +fn test_timeout_on_close_packet_validate_to_light_client_fails_on_invalid_channel_counterparty() { + let height = 2; + let timeout_timestamp = 5; + let mut msg = get_dummy_raw_msg_timeout_on_close(height, timeout_timestamp); + + let mut ctx = TestContext::for_packet_timeout_on_close(get_mock_env(), &msg); + let contract = CwIbcCoreContext::default(); + let mut deps = deps(); + let info = create_mock_info("channel-creater", "umlg", 20000000); + + ctx.init_timeout_packet_on_close(deps.as_mut().storage, &contract); + mock_lightclient_query(ctx.mock_queries, &mut deps); + + if let Some(packet) = &mut msg.packet { + packet.destination_port = "different_port".to_string(); + } + + contract + .timeout_on_close_packet_validate_to_light_client(deps.as_mut(), info, ctx.env, msg) + .unwrap(); +} + +#[test] +#[should_panic( + expected = "IbcPacketError { error: IncorrectPacketCommitment { sequence: Sequence(1) } }" +)] +fn test_timeout_on_close_packet_validate_to_light_client_fails_on_incorrect_packet_commitment() { + let height = 2; + let timeout_timestamp = 5; + let mut msg = get_dummy_raw_msg_timeout_on_close(height, timeout_timestamp); + + let mut ctx = TestContext::for_packet_timeout_on_close(get_mock_env(), &msg); + let contract = CwIbcCoreContext::default(); + let mut deps = deps(); + let info = create_mock_info("channel-creater", "umlg", 20000000); + + ctx.init_timeout_packet_on_close(deps.as_mut().storage, &contract); + mock_lightclient_query(ctx.mock_queries, &mut deps); + + if let Some(packet) = &mut msg.packet { + packet.timeout_timestamp = 100; + } + + contract + .timeout_on_close_packet_validate_to_light_client(deps.as_mut(), info, ctx.env, msg) + .unwrap(); +} + +#[test] +#[should_panic(expected = "FrozenClient")] +fn test_timeout_on_close_packet_validate_to_light_client_fails_for_frozen_client() { + let height = 2; + let timeout_timestamp = 5; + let msg = get_dummy_raw_msg_timeout_on_close(height, timeout_timestamp); + + let mut ctx = TestContext::for_packet_timeout_on_close(get_mock_env(), &msg); + let contract = CwIbcCoreContext::default(); + let mut deps = deps(); + let info = create_mock_info("channel-creater", "umlg", 20000000); + + if let Some(client_state) = &mut ctx.client_state { + client_state.frozen_height = 10; + } + + ctx.init_timeout_packet_on_close(deps.as_mut().storage, &contract); + mock_lightclient_query(ctx.mock_queries, &mut deps); + + contract + .timeout_on_close_packet_validate_to_light_client(deps.as_mut(), info, ctx.env, msg) + .unwrap(); +} + +#[test] +#[should_panic(expected = "InvalidPacketSequence")] +fn test_timeout_on_close_packet_validate_to_light_client_fails_on_invalid_packet_sequence() { + let height = 2; + let timeout_timestamp = 5; + let mut msg = get_dummy_raw_msg_timeout_on_close(height, timeout_timestamp); + msg.next_sequence_recv = 2; + + let mut ctx = TestContext::for_packet_timeout_on_close(get_mock_env(), &msg); + let contract = CwIbcCoreContext::default(); + let mut deps = deps(); + let info = create_mock_info("channel-creater", "umlg", 20000000); + + if let Some(channel_end) = &mut ctx.channel_end { + channel_end.ordering = Order::Ordered; + } + + ctx.init_timeout_packet_on_close(deps.as_mut().storage, &contract); + mock_lightclient_query(ctx.mock_queries, &mut deps); + + contract + .timeout_on_close_packet_validate_to_light_client(deps.as_mut(), info, ctx.env, msg) + .unwrap(); +} + +#[test] +fn test_timeout_on_close_packet_validate_to_light_client_for_orderd_channel() { + let height = 2; + let timeout_timestamp = 5; + let msg = get_dummy_raw_msg_timeout_on_close(height, timeout_timestamp); + + let mut ctx = TestContext::for_packet_timeout_on_close(get_mock_env(), &msg); + let contract = CwIbcCoreContext::default(); + let mut deps = deps(); + let info = create_mock_info("channel-creater", "umlg", 20000000); + + if let Some(channel_end) = &mut ctx.channel_end { + channel_end.ordering = Order::Ordered; + } + + ctx.init_timeout_packet_on_close(deps.as_mut().storage, &contract); + mock_lightclient_query(ctx.mock_queries, &mut deps); + + let res = contract.timeout_on_close_packet_validate_to_light_client( + deps.as_mut(), + info, + ctx.env, + msg, + ); + assert!(res.is_ok()) +} diff --git a/contracts/cosmwasm-vm/cw-ibc-core/tests/channel/test_write_acknowledgement.rs b/contracts/cosmwasm-vm/cw-ibc-core/tests/channel/test_write_acknowledgement.rs index bec648c0c..49f720cdc 100644 --- a/contracts/cosmwasm-vm/cw-ibc-core/tests/channel/test_write_acknowledgement.rs +++ b/contracts/cosmwasm-vm/cw-ibc-core/tests/channel/test_write_acknowledgement.rs @@ -58,12 +58,7 @@ pub fn setup_test( ); contract - .store_channel_end( - &mut deps.storage, - &dst_port.clone(), - &dst_channel.clone(), - &chan_end_on_b, - ) + .store_channel_end(&mut deps.storage, &dst_port, &dst_channel, &chan_end_on_b) .unwrap(); let conn_id_on_b = &chan_end_on_b.connection_hops()[0]; contract @@ -137,7 +132,7 @@ fn test_write_acknowledgement() { test_context.init_receive_packet(deps.as_mut().storage, &contract); mock_lightclient_query(test_context.mock_queries, &mut deps); let res = contract.validate_receive_packet(deps.as_mut(), info, env.clone(), &msg); - println!("{:?}", res); + println!("{res:?}"); assert!(res.is_ok()); assert_eq!( res.unwrap().messages[0].id, @@ -178,7 +173,7 @@ pub fn test_write_acknowledgement_fails_unauthorized() { test_context.init_receive_packet(deps.as_mut().storage, &contract); mock_lightclient_query(test_context.mock_queries, &mut deps); let res = contract.validate_receive_packet(deps.as_mut(), info, env, &msg); - println!("{:?}", res); + println!("{res:?}"); assert!(res.is_ok()); assert_eq!( res.unwrap().messages[0].id, @@ -207,7 +202,7 @@ pub fn test_write_acknowledgement_fails_invalid_ack() { mock_lightclient_query(test_context.mock_queries, &mut deps); let res = contract.validate_receive_packet(deps.as_mut(), info, env, &msg); - println!("{:?}", res); + println!("{res:?}"); assert!(res.is_ok()); assert_eq!( res.unwrap().messages[0].id, @@ -238,7 +233,7 @@ pub fn test_write_acknowledgement_fails_invalid_channel_state() { test_context.init_receive_packet(deps.as_mut().storage, &contract); mock_lightclient_query(test_context.mock_queries.clone(), &mut deps); let res = contract.validate_receive_packet(deps.as_mut(), info, env, &msg); - println!("{:?}", res); + println!("{res:?}"); assert!(res.is_ok()); assert_eq!( res.unwrap().messages[0].id, diff --git a/contracts/cosmwasm-vm/cw-ibc-core/tests/setup.rs b/contracts/cosmwasm-vm/cw-ibc-core/tests/setup.rs index 5a08acf87..2a1bb77e0 100644 --- a/contracts/cosmwasm-vm/cw-ibc-core/tests/setup.rs +++ b/contracts/cosmwasm-vm/cw-ibc-core/tests/setup.rs @@ -34,8 +34,8 @@ use cosmwasm_std::{ mock_dependencies, mock_env, mock_info, MockApi, MockQuerier, MockStorage, MOCK_CONTRACT_ADDR, }, - to_binary, Addr, Binary, BlockInfo, ContractInfo, ContractResult, Empty, Env, IbcEndpoint, - MessageInfo, OwnedDeps, SystemResult, Timestamp, TransactionInfo, WasmQuery, + to_binary, Addr, Binary, BlockInfo, ContractInfo, ContractResult, DepsMut, Empty, Env, + IbcEndpoint, MessageInfo, OwnedDeps, SystemResult, Timestamp, TransactionInfo, WasmQuery, }; use common::{ @@ -580,6 +580,7 @@ use cw_common::ibc_types::IbcClientId; use cw_ibc_core::context::CwIbcCoreContext; use cw_ibc_core::ics04_channel::Counterparty; use cw_ibc_core::ics04_channel::State; +use cw_ibc_core::traits::IbcClient; use cw_ibc_core::ConnectionEnd; use cw_ibc_core::{compute_packet_commitment, ChannelEnd, Sequence}; use prost::Message; @@ -631,6 +632,7 @@ pub struct TestContext { pub module_address: Option, pub packet: Option, pub client_id: IbcClientId, + pub client_type: ClientType, pub connection_id: ConnectionId, pub env: Env, pub height: Height, @@ -653,6 +655,7 @@ impl TestContext { port_id: PortId::default(), channel_id: ChannelId::default(), lightclient: Some(LightClient::new("lightclient".to_string())), + client_type: ClientType::new("iconclient".to_string()), packet: None, mock_queries: HashMap::::new(), module_address: Some(Addr::unchecked("moduleaddress")), @@ -831,6 +834,13 @@ impl TestContext { ctx } + pub fn for_client_state(env: Env) -> Self { + let mut ctx = TestContext::default(env); + ctx.client_id = ClientId::from_str("iconclient-0").unwrap(); + + ctx + } + fn setup_channel_end( mut ctx: TestContext, state: State, @@ -1029,6 +1039,31 @@ impl TestContext { self.save_consensus_state(storage, self.client_state.clone().unwrap().latest_height); } + pub fn init_connection_delay( + &mut self, + storage: &mut dyn Storage, + contract: &CwIbcCoreContext, + ) { + contract + .store_last_processed_on(storage, &self.env, &self.client_id) + .unwrap(); + } + + pub fn init_client_state(&mut self, deps: DepsMut, contract: &CwIbcCoreContext) { + self.init_context(deps.storage, &contract); + self.save_consensus_state( + deps.storage, + self.client_state.clone().unwrap().latest_height, + ); + contract.init_client_counter(deps.storage, 0).unwrap(); + self.save_client_commitment( + deps.storage, + &contract, + &self.client_state.clone().unwrap().encode_to_vec(), + ); + self.save_register_client(deps, &contract); + } + pub fn save_next_sequence_send(&self, storage: &mut dyn Storage, contract: &CwIbcCoreContext) { if let Some(packet) = self.packet.clone() { contract @@ -1081,6 +1116,42 @@ impl TestContext { } } + pub fn save_connection_to_client( + &self, + storage: &mut dyn Storage, + contract: &CwIbcCoreContext, + ) { + contract + .store_connection_to_client(storage, &self.client_id, &self.connection_id) + .unwrap(); + } + + pub fn save_client_commitment( + &self, + storage: &mut dyn Storage, + contract: &CwIbcCoreContext, + client_state_hash: &Vec, + ) { + contract + .store_client_commitment( + storage, + &self.env, + &self.client_id, + client_state_hash.clone(), + ) + .unwrap(); + } + + pub fn save_register_client(&self, deps: DepsMut, contract: &CwIbcCoreContext) { + if let Some(lightclient) = self.lightclient.clone() { + let addr = Addr::unchecked(lightclient.get_address()); + + contract + .register_client(deps, self.client_type.clone(), addr) + .unwrap(); + } + } + pub fn save_channel_end(&self, storage: &mut dyn Storage, contract: &CwIbcCoreContext) { if let Some(channel_end) = self.channel_end.clone() { contract diff --git a/contracts/cosmwasm-vm/cw-ibc-core/tests/test_channel.rs b/contracts/cosmwasm-vm/cw-ibc-core/tests/test_channel.rs index 082d5a003..08e8e6f2e 100644 --- a/contracts/cosmwasm-vm/cw-ibc-core/tests/test_channel.rs +++ b/contracts/cosmwasm-vm/cw-ibc-core/tests/test_channel.rs @@ -2,7 +2,7 @@ use std::collections::HashMap; use std::{str::FromStr, time::Duration}; use common::traits::AnyTypes; -use cosmwasm_std::testing::mock_env; +use cosmwasm_std::testing::{mock_dependencies, mock_env}; use cosmwasm_std::{ to_binary, Addr, Event, IbcEndpoint, IbcPacket, IbcPacketReceiveMsg, IbcTimeout, IbcTimeoutBlock, Reply, SubMsgResponse, SubMsgResult, @@ -19,17 +19,13 @@ use common::ibc::{ events::IbcEventType, }; use cw_common::ibc_types::{IbcClientId, IbcConnectionId, IbcPortId}; -use cw_common::raw_types::channel::RawPacket; +use cw_common::raw_types::channel::*; use cw_common::raw_types::to_raw_packet; use cw_ibc_core::conversions::{to_ibc_channel, to_ibc_channel_id, to_ibc_height, to_ibc_port_id}; -use cw_ibc_core::ics04_channel::open_init::{ - create_channel_submesssage, on_chan_open_init_submessage, -}; - use cw_ibc_core::ics04_channel::{ - create_channel_event, create_packet_event, EXECUTE_ON_CHANNEL_OPEN_INIT, + create_channel_event, create_packet_event, open_init, EXECUTE_ON_CHANNEL_OPEN_INIT, EXECUTE_ON_CHANNEL_OPEN_TRY, }; use cw_ibc_core::light_client::light_client::LightClient; @@ -517,7 +513,7 @@ fn test_validate_open_init_channel() { let res = contract.validate_channel_open_init(deps.as_mut(), info.clone(), &raw); - let expected = on_chan_open_init_submessage( + let expected = open_init::on_chan_open_init_submessage( &test_context.channel_end(), &test_context.port_id, &test_context.channel_id, @@ -525,14 +521,14 @@ fn test_validate_open_init_channel() { ); let data = cw_common::ibc_dapp_msg::ExecuteMsg::IbcChannelOpen { msg: expected }; let data = to_binary(&data).unwrap(); - let on_chan_open_init = create_channel_submesssage( + let on_chan_open_init = open_init::create_channel_submesssage( "moduleaddress".to_string(), data, info.funds, EXECUTE_ON_CHANNEL_OPEN_INIT, ); - println!("{:?}", res); + println!("{res:?}"); assert!(res.is_ok()); assert_eq!(res.unwrap().messages[0], on_chan_open_init) @@ -667,3 +663,46 @@ fn test_get_channel_fail() { ctx.get_channel_end(mock_deps.as_ref().storage, &port_id, &channel_id) .unwrap(); } + +#[test] +#[should_panic(expected = "ChannelNotFound")] +fn fail_test_channel_end_not_found() { + let ctx = TestContext::default(get_mock_env()); + let deps = mock_dependencies(); + let contract = CwIbcCoreContext::new(); + + contract + .channel_end(deps.as_ref().storage, &ctx.port_id, &ctx.channel_id) + .unwrap(); +} + +#[test] +#[should_panic(expected = "InvalidEventType")] +fn fail_create_channel_event() { + let ctx = TestContext::default(get_mock_env()); + + create_channel_event( + IbcEventType::AppModule, + &ctx.port_id.to_string(), + &ctx.channel_id.to_string(), + &ctx.channel_end(), + ) + .unwrap(); +} + +#[test] +#[should_panic(expected = "InvalidEventType")] +fn fail_create_packet_event() { + let ctx = TestContext::default(get_mock_env()); + + let packet = get_dummy_raw_packet(10, 1); + + create_packet_event( + IbcEventType::CreateClient, + &packet, + &Order::Unordered, + &ctx.connection_id, + Some(Vec::new()), + ) + .unwrap(); +} diff --git a/contracts/cosmwasm-vm/cw-ibc-core/tests/test_client.rs b/contracts/cosmwasm-vm/cw-ibc-core/tests/test_client.rs index 7340eacb9..e6d422990 100644 --- a/contracts/cosmwasm-vm/cw-ibc-core/tests/test_client.rs +++ b/contracts/cosmwasm-vm/cw-ibc-core/tests/test_client.rs @@ -1,20 +1,23 @@ pub mod setup; -use std::collections::HashMap; use std::str::FromStr; +use cosmwasm_std::Timestamp; +use std::time::Duration; + use common::client_state::{get_default_icon_client_state, IClientState}; use common::ibc::{signer::Signer, Height}; use common::icon::icon::lightclient::v1::{ClientState, ConsensusState}; use common::traits::AnyTypes; use common::utils::keccak256; -use cosmwasm_std::testing::mock_env; -use cosmwasm_std::{to_binary, Addr, Binary, Event, Reply, SubMsgResponse}; +use cosmwasm_std::testing::{mock_dependencies, mock_env}; +use cosmwasm_std::{to_binary, to_vec, Addr, Event, Reply, SubMsgResponse}; use cw_common::client_response::{ - CreateClientResponse, MisbehaviourResponse, UpdateClientResponse, UpgradeClientResponse, + MisbehaviourResponse, UpdateClientResponse, UpgradeClientResponse, }; +use cw_common::commitment; use cw_common::raw_types::client::{ RawMsgCreateClient, RawMsgSubmitMisbehaviour, RawMsgUpdateClient, RawMsgUpgradeClient, }; @@ -23,6 +26,7 @@ use cw_common::raw_types::Any; use common::ibc::core::ics02_client::client_type::ClientType; use common::ibc::core::ics24_host::identifier::ClientId; use common::ibc::mock::header::MockHeader; +use cw_ibc_core::conversions::{to_ibc_client_id, to_ibc_connection_id}; use cw_ibc_core::light_client::light_client::LightClient; use cw_ibc_core::{ context::CwIbcCoreContext, @@ -32,7 +36,7 @@ use cw_ibc_core::{ }, traits::IbcClient, }; -use cw_ibc_core::{EXECUTE_CREATE_CLIENT, EXECUTE_UPDATE_CLIENT, EXECUTE_UPGRADE_CLIENT}; +use cw_ibc_core::{EXECUTE_UPDATE_CLIENT, EXECUTE_UPGRADE_CLIENT}; use prost::Message; use setup::*; @@ -243,35 +247,17 @@ fn check_for_genereted_client_id_event() { #[test] fn check_for_create_client_message() { + let mut ctx = TestContext::for_client_state(get_mock_env()); let mut deps = deps(); let contract = CwIbcCoreContext::default(); let info = create_mock_info("alice", "umlg", 2000); - contract - .init_client_counter(deps.as_mut().storage, 0) - .unwrap(); - - let client_state: ClientState = get_dummy_client_state(); - - let consenus_state: ConsensusState = common::icon::icon::lightclient::v1::ConsensusState { - message_root: "message_root".as_bytes().to_vec(), - next_proof_context_hash: vec![1, 2, 3, 4], - } - .try_into() - .unwrap(); - - let client_type = ClientType::new("iconclient".to_string()); - let light_client = Addr::unchecked("lightclient"); - contract - .register_client(deps.as_mut(), client_type, light_client) - .unwrap(); - - let signer = Signer::from_str("new_signer").unwrap(); + ctx.init_client_state(deps.as_mut(), &contract); let create_client_message = RawMsgCreateClient { - client_state: Some(client_state.to_any()), - consensus_state: Some(consenus_state.to_any()), - signer: signer.to_string(), + client_state: Some(ctx.client_state.unwrap().to_any()), + consensus_state: Some(ctx.consensus_state.unwrap().to_any()), + signer: "new_signer".to_string(), }; let response = contract @@ -279,155 +265,54 @@ fn check_for_create_client_message() { .unwrap(); assert_eq!(response.messages[0].id, 21); - assert_eq!(response.attributes[1].value, "create_client"); } #[test] fn check_for_client_state_from_storage() { + let mut ctx = TestContext::for_client_state(get_mock_env()); let mut deps = deps(); let contract = CwIbcCoreContext::default(); let info = create_mock_info("alice", "umlg", 2000); - let client_type = ClientType::new("iconclient".to_string()); - let client_id = ClientId::new(client_type.clone(), 0).unwrap(); - let mut test_context = TestContext::default(mock_env()); - test_context.client_id = client_id; - test_context.init_context(deps.as_mut().storage, &contract); - contract - .init_client_counter(deps.as_mut().storage, 0) - .unwrap(); - - let client_state: ClientState = test_context.client_state.clone().unwrap(); - let consenus_state: ConsensusState = test_context.consensus_state.clone().unwrap(); - let light_client = Addr::unchecked("lightclient"); - contract - .register_client(deps.as_mut(), client_type.clone(), light_client) - .unwrap(); + ctx.init_client_state(deps.as_mut(), &contract); - let signer = Signer::from_str("new_signer").unwrap(); + let client_state: ClientState = ctx.client_state.clone().unwrap(); + let consenus_state: ConsensusState = ctx.consensus_state.clone().unwrap(); let create_client_message = RawMsgCreateClient { client_state: Some(client_state.to_any()), consensus_state: Some(consenus_state.to_any()), - signer: signer.to_string(), + signer: "new_signer".to_string(), }; contract .create_client(deps.as_mut(), info, mock_env(), create_client_message) .unwrap(); - let mock_reponse_data = CreateClientResponse::new( - client_type.as_str().to_string(), - "10-15".to_string(), - keccak256(&client_state.encode_to_vec()).to_vec(), - keccak256(&consenus_state.encode_to_vec()).to_vec(), - client_state.to_any().encode_to_vec(), - consenus_state.to_any().encode_to_vec(), - ); - - let mock_data_binary = to_binary(&mock_reponse_data).unwrap(); - - let event = Event::new("empty"); - - let _reply_message = Reply { - id: EXECUTE_CREATE_CLIENT, - result: cosmwasm_std::SubMsgResult::Ok(SubMsgResponse { - events: vec![event], - data: Some(mock_data_binary), - }), - }; - - mock_lightclient_query(test_context.mock_queries, &mut deps); - - let client_id = - common::ibc::core::ics24_host::identifier::ClientId::from_str("iconclient-0").unwrap(); - - let client_state = contract.client_state(deps.as_ref(), &client_id).unwrap(); + mock_lightclient_query(ctx.mock_queries, &mut deps); + let client_state = contract + .client_state(deps.as_ref(), &ctx.client_id) + .unwrap(); assert_eq!(client_state.client_type().as_str(), "iconclient"); } #[test] fn check_for_consensus_state_from_storage() { + let mut ctx = TestContext::for_client_state(get_mock_env()); let mut deps = deps(); let contract = CwIbcCoreContext::default(); - let info = create_mock_info("alice", "umlg", 2000); - contract - .init_client_counter(deps.as_mut().storage, 0) - .unwrap(); - - let client_state: ClientState = get_dummy_client_state(); - - let consenus_state: ConsensusState = common::icon::icon::lightclient::v1::ConsensusState { - message_root: vec![1, 2, 3, 4], - next_proof_context_hash: vec![1, 2, 3, 4], - } - .try_into() - .unwrap(); - - let client_type = ClientType::new("iconclient".to_string()); - let light_client = Addr::unchecked("lightclient"); - contract - .register_client(deps.as_mut(), client_type.clone(), light_client) - .unwrap(); + ctx.init_client_state(deps.as_mut(), &contract); + mock_lightclient_query(ctx.mock_queries, &mut deps); - let signer = Signer::from_str("new_signer").unwrap(); - - let create_client_message = RawMsgCreateClient { - client_state: Some(client_state.to_any()), - consensus_state: Some(consenus_state.to_any()), - signer: signer.to_string(), - }; - - contract - .create_client(deps.as_mut(), info, mock_env(), create_client_message) - .unwrap(); - - let mock_reponse_data = CreateClientResponse::new( - client_type.as_str().to_string(), - client_state.latest_height().to_string(), - keccak256(&client_state.encode_to_vec()).to_vec(), - keccak256(&consenus_state.encode_to_vec()).to_vec(), - client_state.to_any().encode_to_vec(), - consenus_state.to_any().encode_to_vec(), - ); - - let mock_data_binary = to_binary(&mock_reponse_data).unwrap(); - - let event = Event::new("empty"); - - let _reply_message = Reply { - id: EXECUTE_CREATE_CLIENT, - result: cosmwasm_std::SubMsgResult::Ok(SubMsgResponse { - events: vec![event], - data: Some(mock_data_binary), - }), - }; - let client_id = - common::ibc::core::ics24_host::identifier::ClientId::from_str("iconclient-0").unwrap(); - - let mut query_map = HashMap::::new(); - query_map = mock_consensus_state_query( - query_map, - &client_id, - &consenus_state, - client_state.latest_height, - ); - mock_lightclient_query(query_map, &mut deps); - - // contract - // .execute_create_client_reply(deps.as_mut(), get_mock_env(), reply_message) - // .unwrap(); - - let height = client_state.latest_height(); - - let consensus_state_result = contract.consensus_state(deps.as_ref(), &client_id, &height); + let height = &ctx.client_state.unwrap().latest_height(); + let consensus_state_result = contract.consensus_state(deps.as_ref(), &ctx.client_id, &height); assert!(consensus_state_result.is_ok()); assert_eq!( - [1, 2, 3, 4], + "message_root".as_bytes().to_vec(), consensus_state_result.unwrap().root().as_bytes() ) } @@ -435,71 +320,39 @@ fn check_for_consensus_state_from_storage() { #[test] #[should_panic(expected = "InvalidNextClientSequence")] fn fails_on_create_client_message_without_proper_initialisation() { + let ctx = TestContext::for_client_state(get_mock_env()); let mut deps = deps(); let contract = CwIbcCoreContext::default(); let info = create_mock_info("alice", "umlg", 2000); - let client_state: ClientState = get_dummy_client_state(); - - let consenus_state: ConsensusState = common::icon::icon::lightclient::v1::ConsensusState { - message_root: "message_root".as_bytes().to_vec(), - next_proof_context_hash: vec![1, 2, 3, 4], - } - .try_into() - .unwrap(); - - let client_type = ClientType::new("iconclient".to_string()); - let light_client = Addr::unchecked("lightclient"); - contract - .register_client(deps.as_mut(), client_type, light_client) - .unwrap(); - - let signer = Signer::from_str("new_signer").unwrap(); - - let create_client_message = RawMsgCreateClient { - client_state: Some(client_state.to_any()), - consensus_state: Some(consenus_state.to_any()), - signer: signer.to_string(), + let msg = RawMsgCreateClient { + client_state: Some(ctx.client_state.unwrap().to_any()), + consensus_state: Some(ctx.consensus_state.unwrap().to_any()), + signer: "new_signer".to_string(), }; - contract - .create_client(deps.as_mut(), info, mock_env(), create_client_message) + .create_client(deps.as_mut(), info, mock_env(), msg) .unwrap(); } #[test] fn check_for_update_client_message() { + let mut ctx = TestContext::for_client_state(get_mock_env()); let mut deps = deps(); let contract = CwIbcCoreContext::default(); let info = create_mock_info("alice", "umlg", 2000); - contract - .init_client_counter(deps.as_mut().storage, 0) - .unwrap(); + let client_state: ClientState = ctx.client_state.clone().unwrap(); + let consenus_state: ConsensusState = ctx.consensus_state.clone().unwrap(); + ctx.init_client_state(deps.as_mut(), &contract); - let client_state: ClientState = get_dummy_client_state(); - - let consenus_state: ConsensusState = common::icon::icon::lightclient::v1::ConsensusState { - message_root: "message_root".as_bytes().to_vec(), - next_proof_context_hash: vec![1, 2, 3, 4], - } - .try_into() - .unwrap(); - - let client_type = ClientType::new("iconclient".to_string()); - let light_client = Addr::unchecked("lightclient"); - contract - .register_client(deps.as_mut(), client_type, light_client) - .unwrap(); - - let signer = Signer::from_str("new_signer").unwrap(); + mock_lightclient_query(ctx.mock_queries, &mut deps); let create_client_message = RawMsgCreateClient { client_state: Some(client_state.to_any()), consensus_state: Some(consenus_state.to_any()), - signer: signer.to_string(), + signer: "signer".to_string(), }; - let response = contract .create_client( deps.as_mut(), @@ -509,19 +362,8 @@ fn check_for_update_client_message() { ) .unwrap(); assert_eq!(response.messages[0].id, 21); - let client_id = ClientId::from_str("iconclient-0").unwrap(); - let mut query_map = HashMap::::new(); - query_map = mock_consensus_state_query( - query_map, - &client_id, - &consenus_state, - client_state.latest_height().revision_height(), - ); - query_map = mock_client_state_query(query_map, &client_id, &client_state); - mock_lightclient_query(query_map, &mut deps); assert_eq!(response.attributes[1].value, "create_client"); - let client_id = ClientId::from_str("iconclient-0").unwrap(); let msg = RawMsgCreateClient { client_state: Some(client_state.to_any()), @@ -532,33 +374,28 @@ fn check_for_update_client_message() { .create_client(deps.as_mut(), info.clone(), mock_env(), msg) .unwrap(); - let client_state: ClientState = get_dummy_client_state(); - let update_client_message = RawMsgUpdateClient { - client_id: client_id.to_string(), + client_id: ctx.client_id.to_string(), header: Some(client_state.to_any()), - signer: signer.to_string(), + signer: "signer".to_string(), }; - let result = contract .update_client(deps.as_mut(), info, update_client_message) .unwrap(); - assert_eq!(client_id.as_str(), result.attributes[1].value); + assert_eq!(ctx.client_id.as_str(), result.attributes[1].value); let mock_reponse_data = UpdateClientResponse::new( "10-15".to_string(), - client_id.as_str().to_string(), + ctx.client_id.as_str().to_string(), keccak256(&client_state.encode_to_vec()).to_vec(), keccak256(&consenus_state.encode_to_vec()).to_vec(), client_state.encode_to_vec(), consenus_state.encode_to_vec(), ); - let mock_data_binary = to_binary(&mock_reponse_data).unwrap(); let event = Event::new("empty"); - let reply_message = Reply { id: EXECUTE_UPDATE_CLIENT, result: cosmwasm_std::SubMsgResult::Ok(SubMsgResponse { @@ -575,11 +412,8 @@ fn check_for_update_client_message() { let result = update_response.unwrap(); assert_eq!("execute_update_client_reply", result.attributes[0].value); - assert_eq!("10-15", result.attributes[1].value); - assert_eq!("update_client", result.events[0].ty); - assert_eq!("iconclient-0", result.events[0].attributes[0].value) } @@ -607,6 +441,31 @@ fn fails_on_updating_non_existing_client() { .unwrap(); } +#[test] +#[should_panic( + expected = "IbcClientError { error: ClientFrozen { client_id: ClientId(\"iconclient-0\") } }" +)] +fn fails_update_client_for_frozen_client() { + let mut ctx = TestContext::for_client_state(get_mock_env()); + let mut deps = mock_dependencies(); + let contract = CwIbcCoreContext::new(); + let info = create_mock_info("alice", "umlg", 2000); + + if let Some(client_state) = &mut ctx.client_state { + client_state.frozen_height = 10; + } + + ctx.init_client_state(deps.as_mut(), &contract); + mock_lightclient_query(ctx.mock_queries, &mut deps); + + let msg = RawMsgUpdateClient { + client_id: ctx.client_id.to_string(), + header: Some(get_dummy_client_state().to_any()), + signer: "new_signer".to_string(), + }; + contract.update_client(deps.as_mut(), info, msg).unwrap(); +} + #[test] #[should_panic(expected = "IbcClientError { error: Other { description: \"response_error\" } }")] fn fails_on_error_ressponse() { @@ -624,60 +483,20 @@ fn fails_on_error_ressponse() { #[test] fn check_for_upgrade_client() { + let mut ctx = TestContext::for_client_state(get_mock_env()); let mut deps = deps(); - - let info = create_mock_info("alice", "umlg", 2000); - let env = get_mock_env(); - let contract = CwIbcCoreContext::default(); + let info = create_mock_info("alice", "umlg", 2000); - contract - .init_client_counter(deps.as_mut().storage, 0) - .unwrap(); - - contract - .ibc_store() - .expected_time_per_block() - .save(deps.as_mut().storage, &(env.block.time.seconds())) - .unwrap(); - - let client_type = ClientType::new("iconclient".to_string()); - let light_client = Addr::unchecked("lightclient"); - - contract - .register_client(deps.as_mut(), client_type.clone(), light_client) - .unwrap(); - - let client_state = ClientState { - trusting_period: 2000000000, - ..get_dummy_client_state() - }; - - let consenus_state: ConsensusState = common::icon::icon::lightclient::v1::ConsensusState { - message_root: "message_root".as_bytes().to_vec(), - next_proof_context_hash: vec![1, 2, 3, 4], + if let Some(client_state) = &mut ctx.client_state { + client_state.trusting_period = 2000000000; } - .try_into() - .unwrap(); - - let mock_reponse_data = CreateClientResponse::new( - client_type.as_str().to_string(), - "0-100".to_string(), - keccak256(&client_state.encode_to_vec()).to_vec(), - keccak256(&consenus_state.encode_to_vec()).to_vec(), - client_state.to_any().encode_to_vec(), - consenus_state.to_any().encode_to_vec(), - ); - let _mock_data_binary = to_binary(&mock_reponse_data).unwrap(); + let client_state = ctx.client_state.clone().unwrap(); + let consenus_state: ConsensusState = ctx.consensus_state.clone().unwrap(); + ctx.init_client_state(deps.as_mut(), &contract); - let _event = Event::new("empty"); - - let client_id = ClientId::from_str("iconclient-0").unwrap(); - let mut query_map = HashMap::::new(); - query_map = mock_consensus_state_query(query_map, &client_id, &consenus_state, 100); - query_map = mock_client_state_query(query_map, &client_id, &client_state); - mock_lightclient_query(query_map, &mut deps); + mock_lightclient_query(ctx.mock_queries, &mut deps); let msg = RawMsgCreateClient { client_state: Some(client_state.to_any()), @@ -688,30 +507,17 @@ fn check_for_upgrade_client() { .create_client(deps.as_mut(), info.clone(), mock_env(), msg) .unwrap(); - let upgrade_client_state = ClientState { - trusting_period: 2000000000, - ..get_dummy_client_state() - } - .to_any(); - - let upgrade_consenus_state: Any = common::icon::icon::lightclient::v1::ConsensusState { - message_root: "message_root_new".as_bytes().to_vec(), - next_proof_context_hash: vec![1, 2, 3, 4], - } - .to_any(); - let signer = Signer::from_str("new_signer").unwrap(); - let upgrdade_client_message = RawMsgUpgradeClient { - client_id: client_id.to_string(), - client_state: upgrade_client_state.into(), - consensus_state: upgrade_consenus_state.into(), + client_id: ctx.client_id.to_string(), + client_state: Some(client_state.to_any()), + consensus_state: Some(consenus_state.to_any()), proof_upgrade_client: get_dummy_merkle_proof().encode_to_vec(), proof_upgrade_consensus_state: get_dummy_merkle_proof().encode_to_vec(), - signer: signer.to_string(), + signer: "new_signer".to_string(), }; let result = contract - .upgrade_client(deps.as_mut(), info, env, upgrdade_client_message) + .upgrade_client(deps.as_mut(), info, ctx.env, upgrdade_client_message) .unwrap(); assert_eq!("upgrade_client", result.attributes[0].value) @@ -720,52 +526,13 @@ fn check_for_upgrade_client() { #[test] #[should_panic(expected = "IbcClientError { error: HeaderNotWithinTrustPeriod")] fn fails_on_upgrade_client_invalid_trusting_period() { + let mut ctx = TestContext::for_client_state(get_mock_env()); let mut deps = deps(); - - let info = create_mock_info("alice", "umlg", 2000); - let env = get_mock_env(); - let contract = CwIbcCoreContext::default(); + let info = create_mock_info("alice", "umlg", 2000); - contract - .init_client_counter(deps.as_mut().storage, 0) - .unwrap(); - - contract - .ibc_store() - .expected_time_per_block() - .save(deps.as_mut().storage, &(env.block.time.seconds())) - .unwrap(); - - let client_type = ClientType::new("iconclient".to_string()); - let light_client = Addr::unchecked("lightclient"); - - contract - .register_client(deps.as_mut(), client_type, light_client) - .unwrap(); - let client_state: ClientState = get_dummy_client_state(); - - let consenus_state: ConsensusState = common::icon::icon::lightclient::v1::ConsensusState { - message_root: "message_root".as_bytes().to_vec(), - next_proof_context_hash: vec![1, 2, 3, 4], - } - .try_into() - .unwrap(); - - let client_id = ClientId::from_str("iconclient-0").unwrap(); - let mut query_map = HashMap::::new(); - query_map = mock_consensus_state_query(query_map, &client_id, &consenus_state, 100); - query_map = mock_client_state_query(query_map, &client_id, &client_state); - mock_lightclient_query(query_map, &mut deps); - - let msg = RawMsgCreateClient { - client_state: Some(client_state.to_any()), - consensus_state: Some(consenus_state.to_any()), - signer: "signer".to_string(), - }; - contract - .create_client(deps.as_mut(), info.clone(), mock_env(), msg) - .unwrap(); + ctx.init_client_state(deps.as_mut(), &contract); + mock_lightclient_query(ctx.mock_queries, &mut deps); let upgrade_client_state: Any = common::icon::icon::lightclient::v1::ClientState { trusting_period: 200000000, @@ -776,224 +543,140 @@ fn fails_on_upgrade_client_invalid_trusting_period() { ..get_default_icon_client_state() } .to_any(); - let upgrade_consenus_state: Any = common::icon::icon::lightclient::v1::ConsensusState { - message_root: "message_root_new".as_bytes().to_vec(), - next_proof_context_hash: vec![1, 2, 3, 4], - } - .to_any(); - let signer = Signer::from_str("new_signer").unwrap(); let upgrdade_client_message = RawMsgUpgradeClient { - client_id: client_id.to_string(), + client_id: ctx.client_id.to_string(), client_state: upgrade_client_state.into(), - consensus_state: upgrade_consenus_state.into(), + consensus_state: Some(ctx.consensus_state.unwrap().to_any()), proof_upgrade_client: get_dummy_merkle_proof().encode_to_vec(), proof_upgrade_consensus_state: get_dummy_merkle_proof().encode_to_vec(), - signer: signer.to_string(), + signer: "new_signer".to_string(), }; - contract - .upgrade_client(deps.as_mut(), info, env, upgrdade_client_message) + .upgrade_client(deps.as_mut(), info, ctx.env, upgrdade_client_message) .unwrap(); } #[test] -#[should_panic( - expected = " IbcClientError { error: ClientFrozen { client_id: ClientId(\"iconclient-0\") } }" -)] -fn fails_on_upgrade_client_frozen_client() { +#[should_panic(expected = "InvalidConsensusStateTimestamp")] +fn fails_on_upgrade_client_invalid_consensus_state_timestamp() { + let mut ctx = TestContext::default(get_mock_env()); let mut deps = deps(); - + let contract = CwIbcCoreContext::default(); let info = create_mock_info("alice", "umlg", 2000); - let env = get_mock_env(); - let contract = CwIbcCoreContext::default(); + let block_time = Duration::from_secs(1); + ctx.env.block.time = Timestamp::from_nanos(block_time.as_nanos() as u64); - contract - .init_client_counter(deps.as_mut().storage, 0) - .unwrap(); + ctx.init_client_state(deps.as_mut(), &contract); + mock_lightclient_query(ctx.mock_queries, &mut deps); + let upgrdade_client_message = RawMsgUpgradeClient { + client_id: ctx.client_id.to_string(), + client_state: Some(ctx.client_state.unwrap().to_any()), + consensus_state: Some(ctx.consensus_state.unwrap().to_any()), + proof_upgrade_client: get_dummy_merkle_proof().encode_to_vec(), + proof_upgrade_consensus_state: get_dummy_merkle_proof().encode_to_vec(), + signer: "signer".to_string(), + }; contract - .ibc_store() - .expected_time_per_block() - .save(deps.as_mut().storage, &(env.block.time.seconds())) + .upgrade_client(deps.as_mut(), info, ctx.env, upgrdade_client_message) .unwrap(); +} - let client_type = ClientType::new("iconclient".to_string()); - let light_client = Addr::unchecked("lightclient"); - - contract - .register_client(deps.as_mut(), client_type.clone(), light_client) - .unwrap(); - let client_id = ClientId::from_str("iconclient-0").unwrap(); - let client_state = ClientState { - frozen_height: 3, - ..get_dummy_client_state() - }; +#[test] +#[should_panic( + expected = " IbcClientError { error: ClientFrozen { client_id: ClientId(\"iconclient-0\") } }" +)] +fn fails_on_upgrade_client_frozen_client() { + let mut ctx = TestContext::for_client_state(get_mock_env()); + let mut deps = deps(); + let info = create_mock_info("alice", "umlg", 2000); + let contract = CwIbcCoreContext::default(); - let consenus_state: ConsensusState = common::icon::icon::lightclient::v1::ConsensusState { - message_root: "message_root".as_bytes().to_vec(), - next_proof_context_hash: vec![1, 2, 3, 4], + if let Some(client_state) = &mut ctx.client_state { + client_state.frozen_height = 3; } - .try_into() - .unwrap(); - let mut query_map = HashMap::::new(); - query_map = mock_consensus_state_query( - query_map, - &client_id, - &consenus_state, - client_state.latest_height().revision_height(), - ); - query_map = mock_client_state_query(query_map, &client_id, &client_state); - mock_lightclient_query(query_map, &mut deps); - let _mock_reponse_data = CreateClientResponse::new( - client_type.as_str().to_string(), - "0-100".to_string(), - keccak256(&client_state.encode_to_vec()).to_vec(), - keccak256(&consenus_state.encode_to_vec()).to_vec(), - client_state.to_any().encode_to_vec(), - consenus_state.to_any().encode_to_vec(), - ); + ctx.init_client_state(deps.as_mut(), &contract); + let client_state = ctx.client_state.clone().unwrap(); + let consensus_state: ConsensusState = ctx.consensus_state.clone().unwrap(); + + mock_lightclient_query(ctx.mock_queries, &mut deps); - let client_id = ClientId::from_str("iconclient-0").unwrap(); let msg = RawMsgCreateClient { client_state: Some(client_state.to_any()), - consensus_state: Some(consenus_state.to_any()), + consensus_state: Some(consensus_state.to_any()), signer: "signer".to_string(), }; contract .create_client(deps.as_mut(), info.clone(), mock_env(), msg) .unwrap(); - let upgrade_client_state: Any = common::icon::icon::lightclient::v1::ClientState { - trusting_period: 200000000, - frozen_height: 0, - max_clock_drift: 5, - latest_height: 100, - - ..get_default_icon_client_state() - } - .to_any(); - - let upgrade_consenus_state: Any = common::icon::icon::lightclient::v1::ConsensusState { - message_root: "message_root_new".as_bytes().to_vec(), - next_proof_context_hash: vec![1, 2, 3, 4], - } - .to_any(); - let signer = Signer::from_str("new_signer").unwrap(); - let upgrdade_client_message = RawMsgUpgradeClient { - client_id: client_id.to_string(), - client_state: upgrade_client_state.into(), - consensus_state: upgrade_consenus_state.into(), + client_id: ctx.client_id.to_string(), + client_state: Some(client_state.to_any()), + consensus_state: Some(consensus_state.to_any()), proof_upgrade_client: get_dummy_merkle_proof().encode_to_vec(), proof_upgrade_consensus_state: get_dummy_merkle_proof().encode_to_vec(), - signer: signer.to_string(), + signer: "new_signer".to_string(), }; contract - .upgrade_client(deps.as_mut(), info, env, upgrdade_client_message) + .upgrade_client(deps.as_mut(), info, ctx.env, upgrdade_client_message) .unwrap(); } #[test] fn check_for_execute_upgrade_client() { + let mut ctx = TestContext::for_client_state(get_mock_env()); let mut deps = deps(); - let info = create_mock_info("alice", "umlg", 2000); - let env = get_mock_env(); - let contract = CwIbcCoreContext::default(); - contract - .init_client_counter(deps.as_mut().storage, 0) - .unwrap(); - - contract - .ibc_store() - .expected_time_per_block() - .save(deps.as_mut().storage, &(env.block.time.seconds())) - .unwrap(); - - let client_type = ClientType::new("iconclient".to_string()); - let light_client = Addr::unchecked("lightclient"); - - contract - .register_client(deps.as_mut(), client_type, light_client) - .unwrap(); - - let client_state = ClientState { - trusting_period: 2000000000, - ..get_dummy_client_state() - }; - - let consenus_state: ConsensusState = common::icon::icon::lightclient::v1::ConsensusState { - message_root: "message_root".as_bytes().to_vec(), - next_proof_context_hash: vec![1, 2, 3, 4], + if let Some(client_state) = &mut ctx.client_state { + client_state.trusting_period = 2000000000; } - .try_into() - .unwrap(); - let client_id = ClientId::from_str("iconclient-0").unwrap(); - let mut query_map = HashMap::::new(); - query_map = mock_consensus_state_query( - query_map, - &client_id, - &consenus_state, - client_state.latest_height().revision_height(), - ); - query_map = mock_client_state_query(query_map, &client_id, &client_state); - mock_lightclient_query(query_map, &mut deps); + let client_state = ctx.client_state.clone().unwrap(); + let consensus_state: ConsensusState = ctx.consensus_state.clone().unwrap(); + ctx.init_client_state(deps.as_mut(), &contract); + + mock_lightclient_query(ctx.mock_queries, &mut deps); let msg = RawMsgCreateClient { client_state: Some(client_state.to_any()), - consensus_state: Some(consenus_state.to_any()), + consensus_state: Some(consensus_state.to_any()), signer: "signer".to_string(), }; contract .create_client(deps.as_mut(), info.clone(), mock_env(), msg) .unwrap(); - let upgrade_client_state = ClientState { - trusting_period: 2000000000, - ..get_dummy_client_state() - } - .to_any(); - - let upgrade_consenus_state: Any = common::icon::icon::lightclient::v1::ConsensusState { - message_root: "message_root_new".as_bytes().to_vec(), - next_proof_context_hash: vec![1, 2, 3, 4], - } - .to_any(); - let signer = Signer::from_str("new_signer").unwrap(); - let upgrdade_client_message = RawMsgUpgradeClient { - client_id: client_id.to_string(), - client_state: upgrade_client_state.clone().into(), - consensus_state: upgrade_consenus_state.clone().into(), + client_id: ctx.client_id.to_string(), + client_state: Some(client_state.clone().to_any()), + consensus_state: Some(consensus_state.clone().to_any()), proof_upgrade_client: get_dummy_merkle_proof().encode_to_vec(), proof_upgrade_consensus_state: get_dummy_merkle_proof().encode_to_vec(), - signer: signer.to_string(), + signer: "new_signer".to_string(), }; contract - .upgrade_client(deps.as_mut(), info, env, upgrdade_client_message) + .upgrade_client(deps.as_mut(), info, ctx.env, upgrdade_client_message) .unwrap(); let upgrade_client_response = UpgradeClientResponse::new( - keccak256(&upgrade_client_state.value).to_vec(), - upgrade_client_state.encode_to_vec(), - keccak256(&upgrade_consenus_state.value).to_vec(), - upgrade_consenus_state.encode_to_vec(), - client_id.to_string(), + keccak256(&client_state.encode_to_vec()).to_vec(), + client_state.encode_to_vec(), + keccak256(&consensus_state.encode_to_vec()).to_vec(), + consensus_state.encode_to_vec(), + ctx.client_id.to_string(), "0-100".to_string(), ); - let mock_data_binary = to_binary(&upgrade_client_response).unwrap(); - let event = Event::new("empty"); - + let mock_data_binary = to_binary(&upgrade_client_response).unwrap(); let reply_message = Reply { id: EXECUTE_UPGRADE_CLIENT, result: cosmwasm_std::SubMsgResult::Ok(SubMsgResponse { @@ -1007,7 +690,6 @@ fn check_for_execute_upgrade_client() { .unwrap(); assert_eq!("iconclient-0", result.attributes[1].value); - assert_eq!("upgrade_client", result.events[0].ty) } @@ -1016,48 +698,27 @@ fn check_for_execute_upgrade_client() { expected = "IbcValidationError { error: InvalidLength { id: \"hello\", length: 5, min: 9, max: 64 } }" )] fn fails_on_invalid_client_identifier_on_execute_upgrade_client() { + let mut ctx = TestContext::for_client_state(get_mock_env()); let mut deps = deps(); - - let env = get_mock_env(); - let contract = CwIbcCoreContext::default(); - contract - .init_client_counter(deps.as_mut().storage, 0) - .unwrap(); - - contract - .ibc_store() - .expected_time_per_block() - .save(deps.as_mut().storage, &(env.block.time.seconds())) - .unwrap(); - - let upgrade_client_state: ClientState = ClientState { - trusting_period: 2000000000, - ..get_dummy_client_state() - }; - - let upgrade_consenus_state: ConsensusState = - common::icon::icon::lightclient::v1::ConsensusState { - message_root: "message_root_new".as_bytes().to_vec(), - next_proof_context_hash: vec![1, 2, 3, 4], - } - .try_into() - .unwrap(); + ctx.init_client_state(deps.as_mut(), &contract); let upgrade_client_response = UpgradeClientResponse::new( - upgrade_client_state.get_keccak_hash().to_vec(), - upgrade_client_state.encode_to_vec(), - upgrade_consenus_state.get_keccak_hash().to_vec(), - upgrade_consenus_state.encode_to_vec(), + ctx.client_state.clone().unwrap().get_keccak_hash().to_vec(), + ctx.client_state.unwrap().encode_to_vec(), + ctx.consensus_state + .clone() + .unwrap() + .get_keccak_hash() + .to_vec(), + ctx.consensus_state.unwrap().encode_to_vec(), "hello".to_string(), "0-100".to_string(), ); - let mock_data_binary = to_binary(&upgrade_client_response).unwrap(); - let event = Event::new("empty"); - + let mock_data_binary = to_binary(&upgrade_client_response).unwrap(); let reply_message = Reply { id: EXECUTE_UPGRADE_CLIENT, result: cosmwasm_std::SubMsgResult::Ok(SubMsgResponse { @@ -1074,29 +735,18 @@ fn fails_on_invalid_client_identifier_on_execute_upgrade_client() { #[test] #[should_panic(expected = "IbcClientError { error: Other { description: \"UnknownResponse\" } }")] fn fails_on_unknown_response_on_execute_upgrade_client() { + let mut ctx = TestContext::for_client_state(get_mock_env()); let mut deps = deps(); - - let env = get_mock_env(); - let contract = CwIbcCoreContext::default(); - contract - .init_client_counter(deps.as_mut().storage, 0) - .unwrap(); - - contract - .ibc_store() - .expected_time_per_block() - .save(deps.as_mut().storage, &(env.block.time.seconds())) - .unwrap(); + ctx.init_client_state(deps.as_mut(), &contract); let reply_message = Reply { id: EXECUTE_UPGRADE_CLIENT, result: cosmwasm_std::SubMsgResult::Err("UnknownResponse".to_string()), }; - contract - .execute_upgrade_client_reply(deps.as_mut(), get_mock_env(), reply_message) + .execute_upgrade_client_reply(deps.as_mut(), ctx.env, reply_message) .unwrap(); } @@ -1105,24 +755,11 @@ fn fails_on_unknown_response_on_execute_upgrade_client() { expected = "IbcClientError { error: Other { description: \"Invalid Response Data\" } }" )] fn fails_on_null_response_data_on_execute_upgrade_client() { + let ctx = TestContext::for_client_state(get_mock_env()); let mut deps = deps(); - - let env = get_mock_env(); - let contract = CwIbcCoreContext::default(); - contract - .init_client_counter(deps.as_mut().storage, 0) - .unwrap(); - - contract - .ibc_store() - .expected_time_per_block() - .save(deps.as_mut().storage, &(env.block.time.seconds())) - .unwrap(); - let event = Event::new("empty"); - let reply_message = Reply { id: EXECUTE_UPGRADE_CLIENT, result: cosmwasm_std::SubMsgResult::Ok(SubMsgResponse { @@ -1132,7 +769,7 @@ fn fails_on_null_response_data_on_execute_upgrade_client() { }; contract - .execute_upgrade_client_reply(deps.as_mut(), get_mock_env(), reply_message) + .execute_upgrade_client_reply(deps.as_mut(), ctx.env, reply_message) .unwrap(); } @@ -1141,55 +778,36 @@ fn fails_on_null_response_data_on_execute_upgrade_client() { expected = "IbcClientError { error: Other { description: \"Client Implementation Already Exist\" } }" )] fn fails_on_storing_already_registered_client_into_registry() { - let mut mock_deps = deps(); + let mut ctx = TestContext::for_client_state(get_mock_env()); + let mut deps = deps(); let contract = CwIbcCoreContext::default(); - let client_type = ClientType::new("new_client_type".to_string()); - let light_client_address = "light-client".to_string(); - contract - .store_client_into_registry( - mock_deps.as_mut().storage, - client_type.clone(), - light_client_address.clone(), - ) - .unwrap(); + ctx.init_client_state(deps.as_mut(), &contract); + + let lightclient = ctx.lightclient.unwrap().get_address(); let result = contract - .get_client_from_registry(mock_deps.as_ref().storage, client_type.clone()) + .get_client_from_registry(deps.as_ref().storage, ctx.client_type.clone()) .unwrap(); - - assert_eq!(light_client_address, result); + assert_eq!(lightclient, result); contract - .register_client( - mock_deps.as_mut(), - client_type, - Addr::unchecked(light_client_address), - ) + .register_client(deps.as_mut(), ctx.client_type, Addr::unchecked(lightclient)) .unwrap(); } #[test] fn success_on_getting_client() { - let mut mock_deps = deps(); + let mut ctx = TestContext::for_client_state(get_mock_env()); + let mut deps = deps(); let contract = CwIbcCoreContext::default(); - let client_type = ClientType::new("new_client_type".to_string()); - let client_id = ClientId::new(client_type, 0).unwrap(); - - let client_address = LightClient::new("newclientaddress".to_string()); - contract - .store_client_implementations( - mock_deps.as_mut().storage, - &client_id, - client_address.clone(), - ) - .unwrap(); + ctx.init_client_state(deps.as_mut(), &contract); let result = contract - .get_light_client(mock_deps.as_ref().storage, &client_id) + .get_light_client(deps.as_ref().storage, &ctx.client_id) .unwrap(); - assert_eq!(result, client_address) + assert_eq!(result, ctx.lightclient.unwrap()) } #[test] @@ -1208,71 +826,106 @@ fn fails_on_getting_client_empty_client() { } #[test] -fn success_on_getting_client_state() { - let mut deps = deps(); - let contract = CwIbcCoreContext::default(); - let info = create_mock_info("alice", "umlg", 2000); +fn test_get_commitment() { + let ctx = TestContext::default(mock_env()); + let mut deps = mock_dependencies(); + let contract = CwIbcCoreContext::new(); - contract - .init_client_counter(deps.as_mut().storage, 0) + let client_state_hash = to_vec(&ctx.client_state.clone().unwrap()).unwrap(); + let client_key = commitment::client_state_commitment_key(&ctx.client_id); + + ctx.save_client_commitment(deps.as_mut().storage, &contract, &client_state_hash); + + let res = contract + .get_commitment(deps.as_ref().storage, client_key) .unwrap(); + assert_eq!(res, client_state_hash); +} - let client_state: ClientState = get_dummy_client_state(); +#[test] +#[should_panic(expected = "InvalidCommitmentKey")] +fn fail_test_get_commitment() { + let ctx = TestContext::default(mock_env()); + let mut deps = mock_dependencies(); + let contract = CwIbcCoreContext::new(); + let client_state_hash = to_vec(&get_dummy_client_state()).unwrap(); - let consenus_state: ConsensusState = get_dummy_consensus_state(); + ctx.save_client_commitment(deps.as_mut().storage, &contract, &client_state_hash); - let client_type = ClientType::new("iconclient".to_string()); - let light_client = Addr::unchecked("lightclient"); - contract - .register_client(deps.as_mut(), client_type.clone(), light_client) + let rand_client = to_ibc_client_id("randclient").unwrap(); + let client_key = commitment::client_state_commitment_key(&rand_client); + + let res = contract + .get_commitment(deps.as_ref().storage, client_key) .unwrap(); + assert_eq!(res, client_state_hash); +} - let signer = Signer::from_str("new_signer").unwrap(); +#[test] +fn test_get_connection() { + let ctx = TestContext::default(mock_env()); + let mut deps = mock_dependencies(); + let contract = CwIbcCoreContext::new(); - let create_client_message = RawMsgCreateClient { - client_state: Some(client_state.to_any()), - consensus_state: Some(consenus_state.to_any()), - signer: signer.to_string(), - }; + ctx.save_connection(deps.as_mut().storage, &contract); + + let res = contract.get_connection(deps.as_ref().storage, &ctx.connection_id); + assert!(res.is_ok()); +} + +#[test] +#[should_panic(expected = "InvalidConnectiontId { connection_id: \"ibcconnection\" }")] +fn fail_test_get_connection() { + let ctx = TestContext::default(mock_env()); + let mut deps = mock_dependencies(); + let contract = CwIbcCoreContext::new(); + + ctx.save_connection(deps.as_mut().storage, &contract); + + let connection_id = to_ibc_connection_id("ibcconnection").unwrap(); contract - .create_client(deps.as_mut(), info, mock_env(), create_client_message) + .get_connection(deps.as_ref().storage, &connection_id) .unwrap(); +} - let mock_reponse_data = CreateClientResponse::new( - client_type.as_str().to_string(), - "10-15".to_string(), - keccak256(&client_state.encode_to_vec()).to_vec(), - keccak256(&consenus_state.encode_to_vec()).to_vec(), - client_state.to_any().encode_to_vec(), - consenus_state.to_any().encode_to_vec(), - ); +#[test] +fn test_client_state_any() { + let mut ctx = TestContext::for_client_state(mock_env()); + let mut deps = mock_dependencies(); + let contract = CwIbcCoreContext::new(); - let mock_data_binary = to_binary(&mock_reponse_data).unwrap(); + ctx.init_client_state(deps.as_mut(), &contract); + mock_lightclient_query(ctx.mock_queries, &mut deps); - let event = Event::new("empty"); + let res = contract + .client_state_any(deps.as_ref(), &ctx.client_id) + .unwrap(); + assert_eq!(res, ctx.client_state.unwrap().to_any()); +} - let _reply_message = Reply { - id: EXECUTE_CREATE_CLIENT, - result: cosmwasm_std::SubMsgResult::Ok(SubMsgResponse { - events: vec![event], - data: Some(mock_data_binary), - }), - }; +#[test] +fn success_on_getting_client_state() { + let mut ctx = TestContext::for_client_state(mock_env()); + let mut deps = deps(); + let contract = CwIbcCoreContext::default(); + let info = create_mock_info("alice", "umlg", 2000); - let client_id = ClientId::from_str("iconclient-0").unwrap(); + ctx.init_client_state(deps.as_mut(), &contract); - let mut query_map = HashMap::::new(); - query_map = mock_consensus_state_query( - query_map, - &client_id, - &consenus_state, - client_state.latest_height().revision_height(), - ); - query_map = mock_client_state_query(query_map, &client_id, &client_state); - mock_lightclient_query(query_map, &mut deps); + let create_client_message = RawMsgCreateClient { + client_state: Some(ctx.client_state.unwrap().to_any()), + consensus_state: Some(ctx.consensus_state.unwrap().to_any()), + signer: "new_signer".to_string(), + }; + contract + .create_client(deps.as_mut(), info, mock_env(), create_client_message) + .unwrap(); - let state = contract.client_state(deps.as_ref(), &client_id).unwrap(); + mock_lightclient_query(ctx.mock_queries, &mut deps); + let state = contract + .client_state(deps.as_ref(), &ctx.client_id) + .unwrap(); assert_eq!(None, state.frozen_height()) } @@ -1291,112 +944,68 @@ fn fails_on_getting_client_state() { #[test] fn success_on_misbehaviour_validate() { + let mut ctx = TestContext::for_client_state(get_mock_env()); let mut deps = deps(); let contract = CwIbcCoreContext::default(); let info = create_mock_info("alice", "umlg", 2000); - contract - .init_client_counter(deps.as_mut().storage, 10) - .unwrap(); - let client_state: ClientState = get_dummy_client_state(); + ctx.init_client_state(deps.as_mut(), &contract); - let client_id = ClientId::from_str("iconlightclient-10").unwrap(); - - contract - .store_client_implementations( - deps.as_mut().storage, - &client_id, - LightClient::new("clientaddress".to_string()), - ) - .unwrap(); - - contract - .store_client_commitment( - deps.as_mut().storage, - &get_mock_env(), - &client_id, - client_state.get_keccak_hash().to_vec(), - ) - .unwrap(); let height = mock_height(10, 15).unwrap(); let mock_header = MockHeader::new(height); let misbehaviour = common::ibc::mock::misbehaviour::Misbehaviour { - client_id: to_mock_client_id(&client_id), + client_id: to_mock_client_id(&ctx.client_id), header1: mock_header, header2: mock_header, }; let misbehaviour: Any = misbehaviour.into(); let misbehaviour_message = RawMsgSubmitMisbehaviour { - client_id: client_id.to_string(), + client_id: ctx.client_id.to_string(), misbehaviour: Some(misbehaviour), signer: get_dummy_account_id().to_string(), }; - let mut query_map = HashMap::::new(); - query_map = mock_client_state_query(query_map, &client_id, &client_state); - mock_lightclient_query(query_map, &mut deps); + mock_lightclient_query(ctx.mock_queries, &mut deps); let result = contract.misbehaviour(deps.as_mut(), info, misbehaviour_message); - assert!(result.is_ok()) } #[test] #[should_panic( - expected = "IbcClientError { error: ClientFrozen { client_id: ClientId(\"iconlightclient-10\") } }" + expected = "IbcClientError { error: ClientFrozen { client_id: ClientId(\"default-0\") } }" )] fn fails_on_frozen_client_on_misbehaviour_validate() { + let mut ctx = TestContext::default(get_mock_env()); let mut deps = deps(); let contract = CwIbcCoreContext::default(); let info = create_mock_info("alice", "umlg", 2000); - contract - .init_client_counter(deps.as_mut().storage, 10) - .unwrap(); - let client_state = ClientState { - frozen_height: 10, - ..get_dummy_client_state() - }; + if let Some(client_state) = &mut ctx.client_state { + client_state.frozen_height = 10; + } - let client_id = ClientId::from_str("iconlightclient-10").unwrap(); + ctx.init_client_state(deps.as_mut(), &contract); - contract - .store_client_implementations( - deps.as_mut().storage, - &client_id, - LightClient::new("clientaddress".to_string()), - ) - .unwrap(); - - contract - .store_client_commitment( - deps.as_mut().storage, - &get_mock_env(), - &client_id, - client_state.get_keccak_hash().to_vec(), - ) - .unwrap(); let height = mock_height(10, 15).unwrap(); let mock_header = MockHeader::new(height); let misbehaviour: Any = common::ibc::mock::misbehaviour::Misbehaviour { - client_id: to_mock_client_id(&client_id), + client_id: to_mock_client_id(&ctx.client_id), header1: mock_header, header2: mock_header, } .into(); let misbehaviour_message = RawMsgSubmitMisbehaviour { - client_id: client_id.to_string(), + client_id: ctx.client_id.to_string(), misbehaviour: misbehaviour.into(), signer: get_dummy_account_id().to_string(), }; - let mut query_map = HashMap::::new(); - query_map = mock_client_state_query(query_map, &client_id, &client_state); - mock_lightclient_query(query_map, &mut deps); + mock_lightclient_query(ctx.mock_queries, &mut deps); contract .misbehaviour(deps.as_mut(), info, misbehaviour_message) diff --git a/contracts/cosmwasm-vm/cw-ibc-core/tests/test_connection.rs b/contracts/cosmwasm-vm/cw-ibc-core/tests/test_connection.rs index 0ce552cca..e7646f470 100644 --- a/contracts/cosmwasm-vm/cw-ibc-core/tests/test_connection.rs +++ b/contracts/cosmwasm-vm/cw-ibc-core/tests/test_connection.rs @@ -1,5 +1,5 @@ -use std::collections::HashMap; - +use cosmwasm_std::Timestamp; +use std::str::FromStr; use std::time::Duration; pub mod setup; @@ -11,15 +11,11 @@ use common::icon::icon::lightclient::v1::ClientState; use common::traits::AnyTypes; use cosmwasm_std::testing::mock_dependencies; use cosmwasm_std::testing::mock_env; -use cosmwasm_std::to_binary; -use cosmwasm_std::Binary; use cosmwasm_std::Addr; use cw_common::get_address_storage_prefix; -use cw_common::raw_types::connection::RawMsgConnectionOpenInit; - use cw_ibc_core::context::CwIbcCoreContext; use cw_ibc_core::conversions::to_ibc_client_id; @@ -29,8 +25,6 @@ use cw_ibc_core::ics03_connection::event::CONN_ID_ATTRIBUTE_KEY; use cw_ibc_core::ics03_connection::event::COUNTERPARTY_CLIENT_ID_ATTRIBUTE_KEY; use cw_ibc_core::ics03_connection::event::COUNTERPARTY_CONN_ID_ATTRIBUTE_KEY; -//use cw_ibc_core::ics03_connection::event::create_open_init_event; - use common::ibc::core::ics03_connection::connection::Counterparty; use common::ibc::core::ics03_connection::connection::State; use common::ibc::core::ics03_connection::version::get_compatible_versions; @@ -39,7 +33,7 @@ use common::ibc::core::ics23_commitment::commitment::CommitmentPrefix; use common::ibc::core::ics24_host::identifier::ConnectionId; use common::ibc::events::IbcEventType; use cw_common::ibc_types::IbcClientId; -use cw_ibc_core::light_client::light_client::LightClient; +use cw_ibc_core::validations::ensure_consensus_height_valid; use cw_ibc_core::ConnectionEnd; use prost::Message; use setup::*; @@ -184,39 +178,136 @@ fn test_commitment_prefix() { #[test] fn connection_open_init() { let mut deps = deps(); + let contract = CwIbcCoreContext::new(); + + let msg = get_dummy_raw_msg_conn_open_init(); + let mut ctx = TestContext::for_connection_open_init(get_mock_env(), &msg); + ctx.init_connection_open_init(deps.as_mut().storage, &contract); - let res_msg = RawMsgConnectionOpenInit { - client_id: "iconclient-0".to_string(), - counterparty: Some(get_dummy_raw_counterparty(None)), - version: None, - delay_period: 0, - signer: get_dummy_bech32_account(), - }; - let client_id = to_ibc_client_id(&res_msg.client_id).unwrap(); + mock_lightclient_query(ctx.mock_queries, &mut deps); + let res = contract.connection_open_init(deps.as_mut(), msg); + assert!(res.is_ok()); +} + +#[test] +#[should_panic(expected = "ClientFrozen")] +fn fail_connection_open_init_for_frozen_client() { + let mut deps = deps(); let contract = CwIbcCoreContext::new(); - let client_state: ClientState = get_dummy_client_state(); + + let msg = get_dummy_raw_msg_conn_open_init(); + let mut ctx = TestContext::for_connection_open_init(get_mock_env(), &msg); + if let Some(client_state) = &mut ctx.client_state { + client_state.frozen_height = 1; + } + + ctx.init_connection_open_init(deps.as_mut().storage, &contract); + mock_lightclient_query(ctx.mock_queries, &mut deps); + + contract.connection_open_init(deps.as_mut(), msg).unwrap(); +} + +#[test] +#[should_panic(expected = "IbcConnectionError { error: EmptyVersions }")] +fn fail_connection_open_init_for_incompatible_version() { + let mut deps = deps(); + let contract = CwIbcCoreContext::new(); + + let mut msg = get_dummy_raw_msg_conn_open_init(); + if let Some(version) = &mut msg.version { + version.identifier = "2".to_string() + } + + let mut ctx = TestContext::for_connection_open_init(get_mock_env(), &msg); + ctx.init_connection_open_init(deps.as_mut().storage, &contract); + mock_lightclient_query(ctx.mock_queries, &mut deps); + + contract.connection_open_init(deps.as_mut(), msg).unwrap(); +} + +#[test] +#[should_panic(expected = "ClientFrozen")] +fn fail_connection_open_ack_for_frozen_client() { + let mut deps = deps(); + let contract = CwIbcCoreContext::new(); + let info = create_mock_info("alice", "umlg", 2000); + + let msg = get_dummy_raw_msg_conn_open_ack(10, 10); + let mut ctx = TestContext::for_connection_open_ack(get_mock_env(), &msg); + if let Some(client_state) = &mut ctx.client_state { + client_state.frozen_height = 10; + } + + ctx.init_connection_open_ack(deps.as_mut().storage, &contract); + mock_lightclient_query(ctx.mock_queries, &mut deps); + contract - .store_client_implementations( - deps.as_mut().storage, - &client_id, - LightClient::new("lightclient".to_string()), - ) + .connection_open_ack(deps.as_mut(), info, ctx.env, msg) .unwrap(); +} + +#[test] +#[should_panic(expected = "ConnectionMismatch")] +fn fail_connection_open_ack_for_mismatch_connection_version() { + let mut deps = deps(); + let contract = CwIbcCoreContext::new(); + let info = create_mock_info("alice", "umlg", 2000); + + let mut msg = get_dummy_raw_msg_conn_open_ack(10, 10); + if let Some(version) = &mut msg.version { + version.identifier = "2".to_string(); + } - let cl = client_state.to_any().encode_to_vec(); - let mut query_map = HashMap::::new(); - let client_state_query = LightClient::build_client_state_query(&client_id).unwrap(); - query_map.insert(client_state_query, to_binary(&cl).unwrap()); + let mut ctx = TestContext::for_connection_open_ack(get_mock_env(), &msg); + ctx.init_connection_open_ack(deps.as_mut().storage, &contract); + mock_lightclient_query(ctx.mock_queries, &mut deps); - mock_lightclient_query(query_map, &mut deps); contract - .connection_next_sequence_init(&mut deps.storage, u64::default()) + .connection_open_ack(deps.as_mut(), info, ctx.env, msg) .unwrap(); +} - let res = contract.connection_open_init(deps.as_mut(), res_msg); - println!("{:?}", res); - assert!(res.is_ok()); +#[test] +#[should_panic(expected = "ClientFrozen")] +fn fail_connection_open_try_for_frozen_client() { + let mut deps = mock_dependencies(); + let contract = CwIbcCoreContext::new(); + let info = create_mock_info("alice", "umlg", 2000); + + let msg = get_dummy_raw_msg_conn_open_try(10, 10); + let mut ctx = TestContext::for_connection_open_try(get_mock_env(), &msg); + if let Some(client_state) = &mut ctx.client_state { + client_state.frozen_height = 10; + } + + ctx.init_connection_open_init(deps.as_mut().storage, &contract); + mock_lightclient_query(ctx.mock_queries, &mut deps); + + contract + .connection_open_try(deps.as_mut(), info, ctx.env, msg.clone()) + .unwrap(); +} + +#[test] +#[should_panic(expected = "ClientFrozen")] +fn fail_connection_open_confirm_for_frozen_client() { + let mut deps = mock_dependencies(); + let contract = CwIbcCoreContext::new(); + let info = create_mock_info("alice", "umlg", 2000); + + let msg = get_dummy_raw_msg_conn_open_confirm(); + let mut ctx = TestContext::for_connection_open_confirm(get_mock_env(), &msg); + if let Some(client_state) = &mut ctx.client_state { + client_state.frozen_height = 1; + } + + ctx.init_connection_open_confirm(deps.as_mut().storage, &contract); + mock_lightclient_query(ctx.mock_queries, &mut deps); + + contract + .connection_open_confirm(deps.as_mut(), ctx.env, info, msg) + .unwrap(); } #[test] @@ -224,13 +315,7 @@ fn connection_open_init() { fn test_validate_open_init_connection_fail() { let mut deps = deps(); let contract = CwIbcCoreContext::default(); - let message = RawMsgConnectionOpenInit { - client_id: "client_id_on_a".to_string(), - counterparty: Some(get_dummy_raw_counterparty(None)), - version: None, - delay_period: 0, - signer: get_dummy_bech32_account(), - }; + let message = get_dummy_raw_msg_conn_open_init(); contract .connection_open_init(deps.as_mut(), message) @@ -239,57 +324,53 @@ fn test_validate_open_init_connection_fail() { #[test] fn create_connection_open_init_event() { - let connection_id = ConnectionId::new(10); - let client_id = ClientId::default(); - let counterparty_client_id = ClientId::default(); + let ctx_a = TestContext::default(get_mock_env()); + let ctx_b = TestContext::default(get_mock_env()); + let event = create_connection_event( IbcEventType::OpenInitConnection, - &connection_id, - &client_id, - &counterparty_client_id, + &ctx_a.connection_id, + &ctx_b.client_id, + &ctx_b.client_id, None, ) .unwrap(); assert_eq!(IbcEventType::OpenInitConnection.as_str(), event.ty); - assert_eq!("connection-10", event.attributes[0].value); + assert_eq!("connection-0", event.attributes[0].value); assert_eq!("default-0", event.attributes[1].value); assert_eq!("default-0", event.attributes[2].value); } #[test] fn create_connection_open_ack_event() { - let connection_id = ConnectionId::new(10); - let client_id = ClientId::default(); - let counterparty_client_id = ClientId::default(); - let counterparty_connection_id = ConnectionId::new(20); + let ctx_a = TestContext::default(get_mock_env()); + let ctx_b = TestContext::default(get_mock_env()); let event = create_connection_event( IbcEventType::OpenAckConnection, - &connection_id, - &client_id, - &counterparty_client_id, - Some(counterparty_connection_id), + &ctx_a.connection_id, + &ctx_a.client_id, + &ctx_b.client_id, + Some(ctx_b.connection_id), ) .unwrap(); assert_eq!(IbcEventType::OpenAckConnection.as_str(), event.ty); - assert_eq!("connection-10", event.attributes[0].value); + assert_eq!("connection-0", event.attributes[0].value); assert_eq!("default-0", event.attributes[1].value); - assert_eq!("connection-20", event.attributes[3].value); + assert_eq!("connection-0", event.attributes[3].value); } #[test] fn create_connection_open_try_event() { - let connection_id = ConnectionId::new(10); - let client_id = ClientId::default(); - let counterparty_client_id = ClientId::default(); - let counterparty_connection_id = ConnectionId::new(20); + let ctx_a = TestContext::default(get_mock_env()); + let ctx_b = TestContext::default(get_mock_env()); let event = create_connection_event( IbcEventType::OpenTryConnection, - &connection_id, - &client_id, - &counterparty_client_id, - Some(counterparty_connection_id), + &ctx_a.connection_id, + &ctx_b.client_id, + &ctx_b.client_id, + Some(ctx_b.connection_id), ) .unwrap(); assert_eq!(IbcEventType::OpenTryConnection.as_str(), event.ty); @@ -297,21 +378,36 @@ fn create_connection_open_try_event() { #[test] fn create_conection_open_confirm_event() { - let connection_id_on_b = ConnectionId::new(10); - let client_id_on_b = ClientId::default(); - let counterparty_connection_id_on_a = ConnectionId::new(2); - let counterparty_client_id_on_a = ClientId::default(); + let ctx_a = TestContext::default(get_mock_env()); + let ctx_b = TestContext::default(get_mock_env()); + let event = create_connection_event( IbcEventType::OpenConfirmConnection, - &connection_id_on_b, - &client_id_on_b, - &counterparty_client_id_on_a, - Some(counterparty_connection_id_on_a), + &ctx_a.connection_id, + &ctx_a.client_id, + &ctx_b.client_id, + Some(ctx_b.connection_id), ) .unwrap(); assert_eq!(IbcEventType::OpenConfirmConnection.as_str(), event.ty); - assert_eq!("connection-10", event.attributes[0].value); + assert_eq!("connection-0", event.attributes[0].value); +} + +#[test] +#[should_panic(expected = "InvalidEventType")] +fn fail_create_connection_event() { + let ctx_a = TestContext::default(get_mock_env()); + let ctx_b = TestContext::default(get_mock_env()); + + create_connection_event( + IbcEventType::Timeout, + &ctx_a.connection_id, + &ctx_a.client_id, + &ctx_b.client_id, + None, + ) + .unwrap(); } #[test] @@ -450,7 +546,7 @@ fn connection_open_ack_validate() { mock_lightclient_query(test_context.mock_queries, &mut deps); let res = contract.connection_open_ack(deps.as_mut(), info, env, message); - println!("{:?}", res); + println!("{res:?}"); assert!(res.is_ok()) } @@ -465,12 +561,6 @@ fn connection_validate_delay() { .store_last_processed_on(deps.as_mut().storage, &env, conn_end.client_id()) .unwrap(); - contract - .ibc_store() - .expected_time_per_block() - .save(deps.as_mut().storage, &(env.block.time.seconds())) - .unwrap(); - let result = contract.verify_connection_delay_passed(&deps.storage, env, packet_proof_height, conn_end); assert!(result.is_ok()) @@ -491,16 +581,79 @@ fn connection_validate_delay_fails() { } #[test] -fn test_block_delay() { - let mut deps = deps(); - let env = get_mock_env(); - let delay_time = Duration::new(1, 1); +#[should_panic(expected = "overflow")] +fn fail_verify_connection_delay_passed_on_timestamp_overflow() { + let mut ctx = TestContext::default(get_mock_env()); + let mut deps = mock_dependencies(); let contract = CwIbcCoreContext::new(); + + ctx.env.block.time = Timestamp::from_seconds(u64::MAX); + contract - .ibc_store() - .expected_time_per_block() - .save(deps.as_mut().storage, &(env.block.time.seconds())) + .store_last_processed_on(deps.as_mut().storage, &ctx.env, &ctx.client_id) + .unwrap(); + + contract + .verify_connection_delay_passed( + deps.as_ref().storage, + ctx.env, + mock_height(1, 1).unwrap(), + ctx.connection_end.unwrap(), + ) .unwrap(); +} + +#[test] +#[should_panic(expected = "NotEnoughTimeElapsed")] +fn fail_verify_connection_delay_passed_on_not_enough_time_elapsed() { + let mut ctx = TestContext::default(get_mock_env()); + let mut deps = mock_dependencies(); + let contract = CwIbcCoreContext::new(); + + contract + .store_last_processed_on(deps.as_mut().storage, &ctx.env, &ctx.client_id) + .unwrap(); + + ctx.env.block.time = Timestamp::from_nanos(10); + + contract + .verify_connection_delay_passed( + deps.as_ref().storage, + ctx.env, + mock_height(1, 1).unwrap(), + ctx.connection_end.unwrap(), + ) + .unwrap(); +} + +#[test] +#[should_panic(expected = "NotEnoughBlocksElapsed")] +fn fail_verify_connection_delay_passed_on_not_enough_block_elapsed() { + let mut ctx = TestContext::default(get_mock_env()); + let mut deps = mock_dependencies(); + let contract = CwIbcCoreContext::new(); + + contract + .store_last_processed_on(deps.as_mut().storage, &ctx.env, &ctx.client_id) + .unwrap(); + + ctx.env.block.height = 12344; + + contract + .verify_connection_delay_passed( + deps.as_ref().storage, + ctx.env, + mock_height(1, 1).unwrap(), + ctx.connection_end.unwrap(), + ) + .unwrap(); +} + +#[test] +fn test_block_delay() { + let delay_time = Duration::new(1, 1); + let contract = CwIbcCoreContext::new(); + let result = contract.calc_block_delay(&delay_time); assert_eq!(1, result) } @@ -589,13 +742,7 @@ fn connection_open_confirm_validate_fails_of_connection_state_mismatch() { fn connection_check_open_init_validate_fails() { let mut deps = deps(); - let mut message = RawMsgConnectionOpenInit { - client_id: "client_id_on_a".to_string(), - counterparty: Some(get_dummy_raw_counterparty(None)), - version: None, - delay_period: 0, - signer: get_dummy_bech32_account(), - }; + let mut message = get_dummy_raw_msg_conn_open_init(); let contract = CwIbcCoreContext::new(); let mut test_context = TestContext::for_connection_open_init(mock_env(), &message); @@ -614,13 +761,7 @@ fn connection_check_open_init_validate_fails() { fn connection_open_init_fails_of_clientstate() { let mut deps = deps(); - let message = RawMsgConnectionOpenInit { - client_id: "client_id_on_a".to_string(), - counterparty: Some(get_dummy_raw_counterparty(None)), - version: None, - delay_period: 0, - signer: get_dummy_bech32_account(), - }; + let message = get_dummy_raw_msg_conn_open_init(); let client_id = ClientId::default(); let contract = CwIbcCoreContext::new(); @@ -651,13 +792,7 @@ fn connection_open_init_fails_of_clientstate() { fn connection_open_init_validate_invalid_client_id() { let mut deps = deps(); let contract = CwIbcCoreContext::new(); - let mut message = RawMsgConnectionOpenInit { - client_id: "client_id_on_a".to_string(), - counterparty: Some(get_dummy_raw_counterparty(None)), - version: None, - delay_period: 0, - signer: get_dummy_bech32_account(), - }; + let mut message = get_dummy_raw_msg_conn_open_init(); let mut test_context = TestContext::for_connection_open_init(mock_env(), &message); test_context.init_context(deps.as_mut().storage, &contract); mock_lightclient_query(test_context.mock_queries, &mut deps); @@ -695,30 +830,26 @@ fn test_update_connection_commitment() { #[test] fn test_check_connection() { + let ctx = TestContext::default(get_mock_env()); let mut deps = deps(); - let commitment_prefix = - common::ibc::core::ics23_commitment::commitment::CommitmentPrefix::try_from( - "hello".to_string().as_bytes().to_vec(), - ); - let counter_party = Counterparty::new(IbcClientId::default(), None, commitment_prefix.unwrap()); - let conn_end = ConnectionEnd::new( - State::Open, - IbcClientId::default(), - counter_party, - vec![Version::default()], - Duration::default(), - ); - let client_id = ClientId::default(); - let conn_id = ConnectionId::new(5); let contract = CwIbcCoreContext::new(); + + let res = contract.check_for_connection(&mut deps.storage, &ctx.client_id); + assert!(res.is_ok()); +} + +#[test] +#[should_panic(expected = "IbcConnectionError { error: ConnectionExists(\"connection-0\") }")] +fn fail_check_for_connection_on_connection_exist() { + let ctx = TestContext::default(get_mock_env()); + let mut deps = mock_dependencies(); + let contract = CwIbcCoreContext::new(); + + ctx.save_connection_to_client(deps.as_mut().storage, &contract); + contract - .store_connection(deps.as_mut().storage, &conn_id, &conn_end) - .unwrap(); - contract - .connection_end(deps.as_ref().storage, &conn_id) + .check_for_connection(deps.as_ref().storage, &ctx.client_id) .unwrap(); - let res = contract.check_for_connection(&mut deps.storage, &client_id); - assert!(res.is_ok()); } #[test] @@ -737,13 +868,7 @@ fn test_connection_seq_on_a_fails_without_initialising() { fn connection_open_init_fails() { let mut deps = deps(); - let message = RawMsgConnectionOpenInit { - client_id: "client_id_on_a".to_string(), - counterparty: Some(get_dummy_raw_counterparty(None)), - version: None, - delay_period: 0, - signer: get_dummy_bech32_account(), - }; + let message = get_dummy_raw_msg_conn_open_init(); let contract = CwIbcCoreContext::new(); let client_state: ClientState = get_dummy_client_state(); @@ -769,9 +894,6 @@ fn connection_open_ack_validate_fails_of_connection_mismatch() { let info = create_mock_info("alice", "umlg", 2000); let env = get_mock_env(); let contract = CwIbcCoreContext::default(); - contract - .connection_next_sequence_init(&mut deps.storage, u128::default().try_into().unwrap()) - .unwrap(); let message = get_dummy_raw_msg_conn_open_ack(10, 10); let mut test_context = TestContext::for_connection_open_ack(env.clone(), &message); @@ -785,3 +907,13 @@ fn connection_open_ack_validate_fails_of_connection_mismatch() { .connection_open_ack(deps.as_mut(), info, env, message) .unwrap(); } + +#[test] +#[should_panic(expected = "InvalidConsensusHeight")] +fn test_ensure_consensus_height_valid() { + ensure_consensus_height_valid( + &common::ibc::core::ics02_client::height::Height::from_str("10-10").unwrap(), + &common::ibc::core::ics02_client::height::Height::from_str("11-11").unwrap(), + ) + .unwrap() +} diff --git a/contracts/cosmwasm-vm/cw-ibc-core/tests/test_host.rs b/contracts/cosmwasm-vm/cw-ibc-core/tests/test_host.rs index 4e1806966..ab42ce1a9 100644 --- a/contracts/cosmwasm-vm/cw-ibc-core/tests/test_host.rs +++ b/contracts/cosmwasm-vm/cw-ibc-core/tests/test_host.rs @@ -136,6 +136,16 @@ fn test_set_expected_time_per_block() { assert!(result.is_ok()) } +#[test] +fn test_calc_block_delay_with_zero_deplay_period_time() { + let contract = CwIbcCoreContext::default(); + + let delay_period_time = Duration::from_secs(0); + let res = contract.calc_block_delay(&delay_period_time); + + assert_eq!(res, 0); +} + #[test] fn test_get_expected_time_per_block() { let mut deps = deps(); diff --git a/contracts/cosmwasm-vm/cw-ibc-core/tests/test_port.rs b/contracts/cosmwasm-vm/cw-ibc-core/tests/test_port.rs index 87ce22efd..6331b5ed4 100644 --- a/contracts/cosmwasm-vm/cw-ibc-core/tests/test_port.rs +++ b/contracts/cosmwasm-vm/cw-ibc-core/tests/test_port.rs @@ -13,7 +13,7 @@ fn test_store_module_by_port() { let module_id = common::ibc::core::ics26_routing::context::ModuleId::from_str("contractaddress").unwrap(); let port_id = PortId::default(); - ctx.store_module_by_port(&mut deps.storage, &port_id.clone(), module_id.clone()) + ctx.store_module_by_port(&mut deps.storage, &port_id, module_id.clone()) .unwrap(); let result = ctx.lookup_module_by_port(&mut deps.storage, &port_id); @@ -94,3 +94,17 @@ fn channel_capability_path() { assert!(result.is_ok()); assert_eq!("ports/defaultPort/channels/channel-0", result.unwrap()) } + +#[test] +fn test_get_all_ports() { + let mut deps = deps(); + let ctx = CwIbcCoreContext::default(); + let address = "contractaddress".to_string(); + let port_id = PortId::default(); + + ctx.bind_port(&mut deps.storage, &port_id.clone(), address.clone()) + .unwrap(); + + let res: Result, cosmwasm_std::StdError> = ctx.get_all_ports(&deps.storage); + assert_eq!(res.unwrap(), vec![port_id.as_str().to_string()]); +} diff --git a/contracts/cosmwasm-vm/cw-icon-light-client/Cargo.toml b/contracts/cosmwasm-vm/cw-icon-light-client/Cargo.toml index ce374c189..49db039dd 100644 --- a/contracts/cosmwasm-vm/cw-icon-light-client/Cargo.toml +++ b/contracts/cosmwasm-vm/cw-icon-light-client/Cargo.toml @@ -33,7 +33,7 @@ optimize = """docker run --rm -v "$(pwd)":/code \ [dependencies] cosmwasm-schema = {workspace=true} cosmwasm-std = {workspace=true} -cosmwasm-storage = {workspace=true} +#cosmwasm-storage = {workspace=true} cw-storage-plus = {workspace=true} cw2 = {workspace=true} schemars = {workspace=true} @@ -43,8 +43,9 @@ sha2 = { version = "0.10.6", default-features = false } hex ={workspace=true } sha3 = { version = "0.10.6", default-features = false } bytes = { workspace=true } -common = { path="../../../libraries/rust/common", default-features = false } -cw-common = { path="../cw-common",default-features = false } +common = { workspace=true, default-features = false } +cw-common = { workspace=true,default-features = false } +cw-light-client-common = { workspace=true, default-features = false } prost = { workspace=true} serde-json-wasm = {workspace=true} debug_print = {workspace=true} diff --git a/contracts/cosmwasm-vm/cw-icon-light-client/src/constants.rs b/contracts/cosmwasm-vm/cw-icon-light-client/src/constants.rs deleted file mode 100644 index d8d080dae..000000000 --- a/contracts/cosmwasm-vm/cw-icon-light-client/src/constants.rs +++ /dev/null @@ -1,9 +0,0 @@ -use common::icon::icon::lightclient::v1::TrustLevel; - -pub const CLIENT_STATE_HASH: &str = "client_state_hash"; -pub const CONSENSUS_STATE_HASH: &str = "consensus_state_hash"; -pub const HEIGHT: &str = "height"; -pub const TRUST_LEVEL: TrustLevel = TrustLevel { - numerator: 2, - denominator: 3, -}; diff --git a/contracts/cosmwasm-vm/cw-icon-light-client/src/state.rs b/contracts/cosmwasm-vm/cw-icon-light-client/src/context.rs similarity index 75% rename from contracts/cosmwasm-vm/cw-icon-light-client/src/state.rs rename to contracts/cosmwasm-vm/cw-icon-light-client/src/context.rs index c0a65dd11..a6100b4e9 100644 --- a/contracts/cosmwasm-vm/cw-icon-light-client/src/state.rs +++ b/contracts/cosmwasm-vm/cw-icon-light-client/src/context.rs @@ -8,22 +8,20 @@ use cosmwasm_std::DepsMut; use cosmwasm_std::Env; use cosmwasm_std::Storage; -use cw_storage_plus::{Item, Map}; +use cw_light_client_common::traits::IQueryHandler; use debug_print::debug_eprintln; +use crate::constants::CLIENT_STATES; +use crate::constants::CONFIG; +use crate::constants::CONSENSUS_STATES; +use crate::constants::PROCESSED_HEIGHTS; +use crate::constants::PROCESSED_TIMES; +use crate::query_handler::QueryHandler; use prost::Message; -use crate::query_handler::QueryHandler; use crate::traits::Config; use crate::traits::IContext; use crate::ContractError; -type ClientId = String; -pub const CLIENT_STATES: Map> = Map::new("CLIENT_STATES"); -pub const CONSENSUS_STATES: Map<(ClientId, u64), Vec> = Map::new("CONSENSUS_STATES"); -pub const PROCESSED_TIMES: Map<(ClientId, u64), u64> = Map::new("PROCESSED_TIMES"); -pub const PROCESSED_HEIGHTS: Map<(ClientId, u64), u64> = Map::new("PROCESSED_HEIGHTS"); - -pub const CONFIG: Item = Item::new("CONFIG"); pub struct CwContext<'a> { pub storage: &'a mut dyn Storage, @@ -42,8 +40,7 @@ impl<'a> CwContext<'a> { } impl<'a> IContext for CwContext<'a> { - type Error = ContractError; - fn get_client_state(&self, client_id: &str) -> Result { + fn get_client_state(&self, client_id: &str) -> Result { QueryHandler::get_client_state(self.storage, client_id) } @@ -51,7 +48,7 @@ impl<'a> IContext for CwContext<'a> { &mut self, client_id: &str, state: ClientState, - ) -> Result<(), Self::Error> { + ) -> Result<(), ContractError> { let data = state.encode_to_vec(); CLIENT_STATES .save(self.storage, client_id.to_string(), &data) @@ -62,7 +59,7 @@ impl<'a> IContext for CwContext<'a> { &self, client_id: &str, height: u64, - ) -> Result { + ) -> Result { QueryHandler::get_consensus_state(self.storage, client_id, height) } @@ -71,14 +68,14 @@ impl<'a> IContext for CwContext<'a> { client_id: &str, height: u64, state: ConsensusState, - ) -> Result<(), Self::Error> { + ) -> Result<(), ContractError> { let data = state.encode_to_vec(); CONSENSUS_STATES .save(self.storage, (client_id.to_string(), height), &data) .map_err(|_e| ContractError::FailedToSaveClientState) } - fn get_timestamp_at_height(&self, client_id: &str, height: u64) -> Result { + fn get_timestamp_at_height(&self, client_id: &str, height: u64) -> Result { QueryHandler::get_timestamp_at_height(self.storage, client_id, height) } @@ -100,11 +97,11 @@ impl<'a> IContext for CwContext<'a> { .map(|addr| addr.to_vec()) } - fn get_config(&self) -> Result { + fn get_config(&self) -> Result { QueryHandler::get_config(self.storage) } - fn insert_config(&mut self, config: &Config) -> Result<(), Self::Error> { + fn insert_config(&mut self, config: &Config) -> Result<(), ContractError> { CONFIG .save(self.storage, config) .map_err(|_e| ContractError::FailedToSaveConfig) @@ -114,7 +111,7 @@ impl<'a> IContext for CwContext<'a> { &mut self, client_id: &str, height: u64, - ) -> Result<(), Self::Error> { + ) -> Result<(), ContractError> { let time = self.env.block.time.nanos(); PROCESSED_TIMES .save(self.storage, (client_id.to_string(), height), &time) @@ -125,7 +122,7 @@ impl<'a> IContext for CwContext<'a> { &mut self, client_id: &str, height: u64, - ) -> Result<(), Self::Error> { + ) -> Result<(), ContractError> { let block_height = self.env.block.height; PROCESSED_HEIGHTS .save(self.storage, (client_id.to_string(), height), &block_height) @@ -144,7 +141,7 @@ impl<'a> IContext for CwContext<'a> { &self, client_id: &str, height: u64, - ) -> Result { + ) -> Result { QueryHandler::get_processed_time_at_height(self.storage, client_id, height) } @@ -152,18 +149,18 @@ impl<'a> IContext for CwContext<'a> { &self, client_id: &str, height: u64, - ) -> Result { + ) -> Result { QueryHandler::get_processed_blocknumber_at_height(self.storage, client_id, height) } - fn ensure_ibc_host(&self, caller: cosmwasm_std::Addr) -> Result<(), Self::Error> { + fn ensure_ibc_host(&self, caller: &cosmwasm_std::Addr) -> Result<(), ContractError> { let config = self.get_config()?; - if caller != config.ibc_host { + if *caller != config.ibc_host { return Err(ContractError::Unauthorized {}); } Ok(()) } - fn ensure_owner(&self, caller: cosmwasm_std::Addr) -> Result<(), Self::Error> { + fn ensure_owner(&self, caller: cosmwasm_std::Addr) -> Result<(), ContractError> { let config = self.get_config()?; debug_eprintln!("owner {:?} caller {}", config.owner, caller.to_string()); if caller != config.owner { @@ -171,6 +168,9 @@ impl<'a> IContext for CwContext<'a> { } Ok(()) } + fn api(&self) -> &dyn Api { + self.api + } } #[cfg(test)] @@ -189,6 +189,7 @@ mod tests { use cw_common::raw_types::Any; use hex_literal::hex; use prost::Message; + use test_utils::get_test_headers; use test_utils::get_test_signed_headers; @@ -369,6 +370,18 @@ mod tests { assert_eq!(address, hex::encode(result.unwrap())); } + #[test] + fn test_recover_signer_for_none_value() { + let mut deps = mock_dependencies(); + let context = CwContext::new(deps.as_mut(), mock_env()); + + let msg = keccak256(b"test message"); + let signature = hex!("c8b2b5eeb7b5462ce6d3bdf1648cd8eae2"); + + let result = context.recover_signer(msg.as_slice(), &signature); + assert!(result.is_none()); + } + #[test] fn test_cwcontext_recover_signer_relay_data() { let mut deps = mock_dependencies(); @@ -491,4 +504,134 @@ mod tests { assert_eq!(mock_env().block.height, loaded); Ok(()) } + + #[test] + fn test_ensure_owner() { + let mut deps = mock_dependencies(); + let config = Config::default(); + let mut contract = CwContext::new(deps.as_mut(), mock_env()); + + contract.insert_config(&config).unwrap(); + + let res = contract.ensure_owner(Addr::unchecked("test")); + assert!(res.is_ok()) + } + + #[test] + #[should_panic(expected = "Unauthorized")] + fn test_ensure_owner_unauthorized() { + let mut deps = mock_dependencies(); + let config = Config::default(); + let mut contract = CwContext::new(deps.as_mut(), mock_env()); + + contract.insert_config(&config).unwrap(); + + contract + .ensure_owner(Addr::unchecked("regular_user")) + .unwrap() + } + + #[test] + #[should_panic(expected = "Unauthorized")] + fn test_ensure_host_unauthorized() { + let mut deps = mock_dependencies(); + let config = Config::default(); + let mut contract = CwContext::new(deps.as_mut(), mock_env()); + + contract.insert_config(&config).unwrap(); + + contract + .ensure_ibc_host(&Addr::unchecked("regular_host")) + .unwrap() + } + + #[test] + fn test_get_current_block_time() { + let mut deps = mock_dependencies(); + let contract = CwContext::new(deps.as_mut(), mock_env()); + + let res = contract.get_current_block_time(); + assert_eq!(res, contract.env.block.time.nanos()); + } + + #[test] + fn test_get_current_block_height() { + let mut deps = mock_dependencies(); + let contract = CwContext::new(deps.as_mut(), mock_env()); + + let res = contract.get_current_block_height(); + assert_eq!(res, contract.env.block.height); + } + + #[test] + fn test_get_processed_time_at_height() { + let mut deps = mock_dependencies(); + let mut contract = CwContext::new(deps.as_mut(), mock_env()); + + let height = 2; + let client_id = "test_client"; + + contract + .insert_timestamp_at_height(client_id, height) + .unwrap(); + + let res = contract + .get_processed_time_at_height(client_id, height) + .unwrap(); + + assert_eq!(res, contract.env.block.time.nanos()) + } + + #[test] + #[should_panic(expected = "ProcessedTimeNotFound")] + fn fail_test_get_processed_time_at_height() { + let mut deps = mock_dependencies(); + let mut contract = CwContext::new(deps.as_mut(), mock_env()); + + let height = 2; + let client_id = "test_client"; + + contract + .insert_timestamp_at_height(client_id, height) + .unwrap(); + + contract.get_processed_time_at_height(client_id, 3).unwrap(); + } + + #[test] + fn test_get_processed_block_number_at_height() { + let mut deps = mock_dependencies(); + let mut contract = CwContext::new(deps.as_mut(), mock_env()); + + let height = 2; + let client_id = "test_client"; + + contract + .insert_blocknumber_at_height(client_id, height) + .unwrap(); + + let res = contract + .get_processed_block_at_height(client_id, height) + .unwrap(); + + assert_eq!(res, contract.env.block.height) + } + + #[test] + #[should_panic(expected = "ProcessedHeightNotFound")] + fn fail_test_get_processed_block_number_at_height() { + let mut deps = mock_dependencies(); + let mut contract = CwContext::new(deps.as_mut(), mock_env()); + + let height = 2; + let client_id = "test_client"; + + contract + .insert_blocknumber_at_height(client_id, height) + .unwrap(); + + contract + .get_processed_block_at_height(client_id, 3) + .unwrap(); + } } diff --git a/contracts/cosmwasm-vm/cw-icon-light-client/src/contract.rs b/contracts/cosmwasm-vm/cw-icon-light-client/src/contract.rs index 92728e03a..845d87a21 100644 --- a/contracts/cosmwasm-vm/cw-icon-light-client/src/contract.rs +++ b/contracts/cosmwasm-vm/cw-icon-light-client/src/contract.rs @@ -4,6 +4,7 @@ use common::traits::AnyTypes; use cosmwasm_schema::cw_serde; use cw_common::ibc_types::IbcHeight; use cw_common::to_checked_address; +use cw_light_client_common::traits::IQueryHandler; #[cfg(feature = "mock")] use crate::mock_client::MockClient; @@ -21,10 +22,10 @@ use cw_common::raw_types::Any; use cw_common::types::VerifyChannelState; use crate::constants::{CLIENT_STATE_HASH, CONSENSUS_STATE_HASH, HEIGHT}; -use crate::error::ContractError; +use crate::context::CwContext; use crate::light_client::IconClient; -use crate::state::CwContext; use crate::traits::{Config, IContext, ILightClient}; +use crate::ContractError; use cw_common::client_msg::{ ExecuteMsg, InstantiateMsg, LightClientPacketMessage, QueryMsg, VerifyClientConsensusState, VerifyClientFullState, VerifyConnectionState, @@ -539,20 +540,21 @@ mod tests { use common::icon::icon::types::v1::{BtpHeader, SignedHeader}; use cosmwasm_std::{ testing::{mock_dependencies, mock_env, mock_info, MockApi, MockQuerier, MockStorage}, - Addr, OwnedDeps, Response, + to_binary, Addr, OwnedDeps, Response, }; use cw2::get_contract_version; - use cw_common::raw_types::Any; + use cw_common::{client_msg::QueryMsg, raw_types::Any}; use test_utils::{get_test_headers, get_test_signed_headers, to_attribute_map}; use crate::{ constants::{CLIENT_STATE_HASH, CONSENSUS_STATE_HASH}, - contract::to_height_u64, + contract::{ensure_owner, query, to_height_u64}, query_handler::QueryHandler, ContractError, }; use common::traits::AnyTypes; use cw_common::client_msg::ExecuteMsg; + use cw_light_client_common::traits::IQueryHandler; use prost::Message; use super::{execute, instantiate, Config, InstantiateMsg, CONTRACT_NAME, CONTRACT_VERSION}; @@ -878,4 +880,130 @@ mod tests { Err(ContractError::HeightAlreadyUpdated { height: 82873 }) ); } + + #[test] + fn test_query_client_state() { + let start_header = &get_test_headers()[0]; + let client_id = "test_client".to_string(); + let deps = init_client(&client_id, start_header, None); + + let msg = QueryMsg::GetClientState { + client_id: client_id.clone(), + }; + let res = query(deps.as_ref(), mock_env(), msg).unwrap(); + + let state = + QueryHandler::get_client_state_any(deps.as_ref().storage, client_id.as_str()).unwrap(); + assert_eq!(res, to_binary(&state).unwrap()); + } + + #[test] + fn test_query_consensus_state() { + let start_header = &get_test_headers()[0]; + let client_id = "test_client".to_string(); + let deps = init_client(&client_id, start_header, None); + + let msg = QueryMsg::GetConsensusState { + client_id: client_id.clone(), + height: start_header.main_height, + }; + let res = query(deps.as_ref(), mock_env(), msg).unwrap(); + + let state = QueryHandler::get_consensus_state_any( + deps.as_ref().storage, + client_id.as_str(), + start_header.main_height, + ) + .unwrap(); + assert_eq!(res, to_binary(&state).unwrap()); + } + + #[test] + fn test_query_latest_height() { + let start_header = &get_test_headers()[0]; + let client_id = "test_client".to_string(); + let deps = init_client(&client_id, start_header, None); + + let msg = QueryMsg::GetLatestHeight { + client_id: client_id.clone(), + }; + let res = query(deps.as_ref(), mock_env(), msg).unwrap(); + + let height = + QueryHandler::get_latest_height(deps.as_ref().storage, client_id.as_str()).unwrap(); + assert_eq!(res, to_binary(&height).unwrap()); + } + + #[test] + fn test_query_latest_consensus_state() { + let start_header = &get_test_headers()[0]; + let client_id = "test_client".to_string(); + let deps = init_client(&client_id, start_header, None); + + let msg = QueryMsg::GetLatestConsensusState { + client_id: client_id.clone(), + }; + let res = query(deps.as_ref(), mock_env(), msg).unwrap(); + + let state = + QueryHandler::get_latest_consensus_state(deps.as_ref().storage, client_id.as_str()) + .unwrap(); + assert_eq!(res, to_binary(&state).unwrap()); + } + + #[test] + #[should_panic(expected = "ClientStateNotFound(\"another_client\")")] + fn test_query_latest_consensus_state_fail() { + let start_header = &get_test_headers()[0]; + let client_id = "test_client".to_string(); + let deps = init_client(&client_id, start_header, None); + + let msg = QueryMsg::GetLatestConsensusState { + client_id: "another_client".to_string(), + }; + query(deps.as_ref(), mock_env(), msg).unwrap(); + } + + #[test] + fn test_query_previous_consensus_state() { + let start_header = &get_test_headers()[0]; + let client_id = "test_client".to_string(); + let deps = init_client(&client_id, start_header, None); + + let msg = QueryMsg::GetPreviousConsensusState { + client_id: client_id.clone(), + height: start_header.main_height, + }; + let res = query(deps.as_ref(), mock_env(), msg).unwrap(); + + let state = QueryHandler::get_previous_consensus( + deps.as_ref().storage, + start_header.main_height, + client_id, + ) + .unwrap(); + assert_eq!(res, to_binary(&state).unwrap()); + } + + #[test] + fn test_ensure_owner() { + let start_header = &get_test_headers()[0]; + let client_id = "test_client".to_string(); + let deps = init_client(&client_id, start_header, None); + let info = mock_info(SENDER, &[]); + + let res = ensure_owner(deps.as_ref(), &info); + assert!(res.is_ok()) + } + + #[test] + #[should_panic(expected = "Unauthorized")] + fn test_ensure_owner_unauthorized() { + let start_header = &get_test_headers()[0]; + let client_id = "test_client".to_string(); + let deps = init_client(&client_id, start_header, None); + let info = mock_info("not_owner", &[]); + + ensure_owner(deps.as_ref(), &info).unwrap() + } } diff --git a/contracts/cosmwasm-vm/cw-icon-light-client/src/lib.rs b/contracts/cosmwasm-vm/cw-icon-light-client/src/lib.rs index ef02fd1dc..8a234d3f8 100644 --- a/contracts/cosmwasm-vm/cw-icon-light-client/src/lib.rs +++ b/contracts/cosmwasm-vm/cw-icon-light-client/src/lib.rs @@ -1,11 +1,13 @@ -mod constants; +pub use cw_light_client_common::constants; +pub mod context; pub mod contract; -mod error; -pub mod light_client; +pub mod query_handler; + +pub use cw_light_client_common::light_client; + #[cfg(feature = "mock")] pub mod mock_client; -pub mod query_handler; -pub mod state; -mod traits; -pub use crate::error::ContractError; +pub use cw_light_client_common::traits; + +pub use cw_light_client_common::error::ContractError; diff --git a/contracts/cosmwasm-vm/cw-icon-light-client/src/query_handler.rs b/contracts/cosmwasm-vm/cw-icon-light-client/src/query_handler.rs index 9a578442a..eab204504 100644 --- a/contracts/cosmwasm-vm/cw-icon-light-client/src/query_handler.rs +++ b/contracts/cosmwasm-vm/cw-icon-light-client/src/query_handler.rs @@ -1,263 +1,12 @@ -use std::marker::PhantomData; - -use crate::{ - state::{CLIENT_STATES, CONFIG, CONSENSUS_STATES, PROCESSED_HEIGHTS, PROCESSED_TIMES}, - traits::Config, - ContractError, -}; -use common::{ - icon::icon::{ - lightclient::v1::{ClientState, ConsensusState}, - types::v1::MerkleNode, - }, - traits::AnyTypes, - utils::{calculate_root, keccak256}, -}; -use cosmwasm_std::{Deps, Order, StdResult, Storage}; -use cw_common::{cw_println, hex_string::HexString}; -use cw_storage_plus::Bound; - -use prost::Message; - -pub struct QueryHandler {} - -impl QueryHandler { - pub fn get_consensus_state( - storage: &dyn Storage, - client_id: &str, - height: u64, - ) -> Result { - let data = CONSENSUS_STATES - .load(storage, (client_id.to_string(), height)) - .map_err(|_e| ContractError::ConsensusStateNotFound { - height, - client_id: client_id.to_string(), - })?; - let state = ConsensusState::decode(data.as_slice()).map_err(ContractError::DecodeError)?; - Ok(state) - } - - pub fn get_latest_consensus_state( - storage: &dyn Storage, - client_id: &str, - ) -> Result { - let state = CLIENT_STATES - .load(storage, client_id.to_string()) - .map_err(ContractError::Std)?; - let client_state = - ClientState::decode(state.as_slice()).map_err(ContractError::DecodeError)?; - - let consensus_state = - QueryHandler::get_consensus_state(storage, client_id, client_state.latest_height)?; - Ok(consensus_state) - } - - pub fn get_timestamp_at_height( - storage: &dyn Storage, - client_id: &str, - height: u64, - ) -> Result { - PROCESSED_TIMES - .load(storage, (client_id.to_string(), height)) - .map_err(|_e| ContractError::TimestampNotFound { - height, - client_id: client_id.to_string(), - }) - } - - pub fn get_client_state( - storage: &dyn Storage, - client_id: &str, - ) -> Result { - let data = CLIENT_STATES - .load(storage, client_id.to_string()) - .map_err(|_e| ContractError::ClientStateNotFound(client_id.to_string()))?; - let state = ClientState::decode(data.as_slice()).map_err(ContractError::DecodeError)?; - Ok(state) - } - - pub fn get_config(storage: &dyn Storage) -> Result { - CONFIG - .load(storage) - .map_err(|_e| ContractError::ConfigNotFound) - } - - pub fn get_client_state_any( - storage: &dyn Storage, - client_id: &str, - ) -> Result, ContractError> { - let state = Self::get_client_state(storage, client_id)?; - let any_state = state.to_any(); - Ok(any_state.encode_to_vec()) - } - - pub fn get_consensus_state_any( - storage: &dyn Storage, - client_id: &str, - height: u64, - ) -> Result, ContractError> { - let state = Self::get_consensus_state(storage, client_id, height)?; - let any_state = state.to_any(); - Ok(any_state.encode_to_vec()) - } - - pub fn get_latest_height(storage: &dyn Storage, client_id: &str) -> Result { - let state = Self::get_client_state(storage, client_id)?; - - Ok(state.latest_height) - } - - pub fn get_processed_time_at_height( - storage: &dyn Storage, - client_id: &str, - height: u64, - ) -> Result { - PROCESSED_TIMES - .load(storage, (client_id.to_string(), height)) - .map_err(|_e| ContractError::ProcessedTimeNotFound { - client_id: client_id.to_string(), - height, - }) - } - pub fn get_processed_blocknumber_at_height( - storage: &dyn Storage, - client_id: &str, - height: u64, - ) -> Result { - PROCESSED_HEIGHTS - .load(storage, (client_id.to_string(), height)) - .map_err(|_e| ContractError::ProcessedHeightNotFound { - client_id: client_id.to_string(), - height, - }) - } - - /** - * @dev verifyMembership is a generic proof verification method which verifies a proof of the existence of a value at a given CommitmentPath at the specified height. - * The caller is expected to construct the full CommitmentPath from a CommitmentPrefix and a standardized path (as defined in ICS 24). - */ - pub fn verify_membership( - deps: Deps, - client_id: &str, - height: u64, - _delay_time_period: u64, - _delay_block_period: u64, - proof: &[MerkleNode], - value: &[u8], - path: &[u8], - ) -> Result { - cw_println!( - deps, - "[LightClient]: Path Bytes {:?}", - HexString::from_bytes(path) - ); - cw_println!( - deps, - "[LightClient]: Value Bytes {:?}", - HexString::from_bytes(value) - ); - let path = keccak256(path).to_vec(); - cw_println!(deps, "[LightClient]: client id is: {:?}", client_id); - - let state = Self::get_client_state(deps.storage, client_id)?; - - if state.frozen_height != 0 && height > state.frozen_height { - return Err(ContractError::ClientStateFrozen(state.frozen_height)); - } - - let mut value_hash = value.to_vec(); - if !value.is_empty() { - value_hash = keccak256(value).to_vec(); - } - - // let _ = - // self.validate_delay_args(client_id, height, delay_time_period, delay_block_period)?; - let consensus_state: ConsensusState = - Self::get_consensus_state(deps.storage, client_id, height)?; - cw_println!( - deps, - "[LightClient]: Path Hash {:?}", - HexString::from_bytes(&path) - ); - cw_println!( - deps, - "[LightClient]: Value Hash {:?}", - HexString::from_bytes(&value_hash) - ); - let leaf = keccak256(&[path, value_hash].concat()); - cw_println!( - deps, - "[LightClient]: Leaf Value {:?}", - HexString::from_bytes(&leaf) - ); - - let message_root = calculate_root(leaf, proof); - cw_println!( - deps, - "[LightClient]: Stored Message Root {:?} ", - hex::encode(consensus_state.message_root.clone()) - ); - cw_println!( - deps, - "[LightClient]: Calculated Message Root : {:?}", - HexString::from_bytes(&message_root) - ); - if consensus_state.message_root != message_root { - return Err(ContractError::InvalidMessageRoot(hex::encode(message_root))); - } - - Ok(true) - } - - /** - * @dev verifyNonMembership is a generic proof verification method which verifies the absence of a given CommitmentPath at a specified height. - * The caller is expected to construct the full CommitmentPath from a CommitmentPrefix and a standardized path (as defined in ICS 24). - */ - pub fn verify_non_membership( - deps: Deps, - client_id: &str, - height: u64, - delay_time_period: u64, - delay_block_period: u64, - proof: &[MerkleNode], - path: &[u8], - ) -> Result { - Self::verify_membership( - deps, - client_id, - height, - delay_time_period, - delay_block_period, - proof, - &[], - path, - ) - } - - pub fn get_previous_consensus( - storage: &dyn Storage, - height: u64, - client_id: String, - ) -> Result, ContractError> { - let key = (client_id, height); - let bound = Bound::Exclusive::<(String, u64)>((key, PhantomData)); - - let result = CONSENSUS_STATES - .range(storage, None, Some(bound), Order::Descending) - .take(1) - .collect::)>>>() - .map_err(ContractError::Std)?; - - let keys = result.into_iter().map(|t| t.0 .1).collect::>(); - Ok(keys) - } -} +use cw_light_client_common::traits::IQueryHandler; +pub struct QueryHandler; +impl IQueryHandler for QueryHandler {} #[cfg(test)] mod tests { use cosmwasm_std::testing::MockStorage; - use crate::state::CONSENSUS_STATES; + use crate::{constants::CONSENSUS_STATES, query_handler::IQueryHandler}; use super::QueryHandler; diff --git a/contracts/cosmwasm-vm/cw-icon-light-client/src/traits.rs b/contracts/cosmwasm-vm/cw-icon-light-client/src/traits.rs deleted file mode 100644 index a5946d480..000000000 --- a/contracts/cosmwasm-vm/cw-icon-light-client/src/traits.rs +++ /dev/null @@ -1,134 +0,0 @@ -use common::icon::icon::lightclient::v1::ClientState; -use common::icon::icon::lightclient::v1::ConsensusState; - -use common::icon::icon::types::v1::SignedHeader; -use cosmwasm_std::Addr; - -use serde::Deserialize; -use serde::Serialize; - -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct ConsensusStateUpdate { - // commitment for updated consensusState - pub consensus_state_commitment: [u8; 32], - pub client_state_commitment: [u8; 32], - pub consensus_state_bytes: Vec, - pub client_state_bytes: Vec, - // updated height - pub height: u64, -} - -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] -pub struct Config { - pub owner: Addr, - pub ibc_host: Addr, -} - -impl Config { - pub fn new(owner: Addr, ibc_host: Addr) -> Self { - Self { owner, ibc_host } - } -} - -impl Default for Config { - fn default() -> Self { - Self { - owner: Addr::unchecked("test"), - ibc_host: Addr::unchecked("ibc_host"), - } - } -} - -pub trait ILightClient { - type Error; - /** - * @dev createClient creates a new client with the given state. - * If succeeded, it returns a commitment for the initial state. - */ - fn create_client( - &mut self, - caller: Addr, - client_id: &str, - client_state: ClientState, - consensus_state: ConsensusState, - ) -> Result; - - /** - * @dev updateClient updates the client corresponding to `clientId`. - * If succeeded, it returns a commitment for the updated state. - * If there are no updates for consensus state, this function should returns an empty array as `updates`. - * - * NOTE: updateClient is intended to perform the followings: - * 1. verify a given client message(e.g. header) - * 2. check misbehaviour such like duplicate block height - * 3. if misbehaviour is found, update state accordingly and return - * 4. update state(s) with the client message - * 5. persist the state(s) on the host - */ - fn update_client( - &mut self, - caller: Addr, - client_id: &str, - header: SignedHeader, - ) -> Result; -} - -pub trait IStoreReader {} -pub trait IContext { - type Error; - - fn get_client_state(&self, client_id: &str) -> Result; - - fn insert_client_state( - &mut self, - client_id: &str, - state: ClientState, - ) -> Result<(), Self::Error>; - - fn get_consensus_state( - &self, - client_id: &str, - height: u64, - ) -> Result; - fn insert_consensus_state( - &mut self, - client_id: &str, - height: u64, - state: ConsensusState, - ) -> Result<(), Self::Error>; - - fn get_timestamp_at_height(&self, client_id: &str, height: u64) -> Result; - fn insert_timestamp_at_height( - &mut self, - client_id: &str, - height: u64, - ) -> Result<(), Self::Error>; - fn insert_blocknumber_at_height( - &mut self, - client_id: &str, - height: u64, - ) -> Result<(), Self::Error>; - - fn recover_signer(&self, msg: &[u8], signature: &[u8]) -> Option<[u8; 20]>; - fn recover_icon_signer(&self, msg: &[u8], signature: &[u8]) -> Option>; - - fn get_config(&self) -> Result; - - fn insert_config(&mut self, config: &Config) -> Result<(), Self::Error>; - - fn get_current_block_time(&self) -> u64; - fn get_current_block_height(&self) -> u64; - fn get_processed_time_at_height( - &self, - client_id: &str, - height: u64, - ) -> Result; - fn get_processed_block_at_height( - &self, - client_id: &str, - height: u64, - ) -> Result; - - fn ensure_owner(&self, caller: Addr) -> Result<(), Self::Error>; - fn ensure_ibc_host(&self, caller: Addr) -> Result<(), Self::Error>; -} diff --git a/contracts/cosmwasm-vm/cw-integration/Cargo.toml b/contracts/cosmwasm-vm/cw-integration/Cargo.toml index e0e9e449e..667c4c92c 100644 --- a/contracts/cosmwasm-vm/cw-integration/Cargo.toml +++ b/contracts/cosmwasm-vm/cw-integration/Cargo.toml @@ -9,10 +9,9 @@ edition = "2021" [dependencies] cosmwasm-schema = {workspace=true} cosmwasm-std = {workspace=true} -cosmwasm-storage = {workspace=true} cw-storage-plus = {workspace=true} -cw-common={path="../cw-common"} -common = { path="../../../libraries/rust/common", default-features = false } +cw-common={workspace=true} +common = { workspace=true, default-features = false } ibc = { version = "0.32.0", default-features = false, features = ["parity-scale-codec", "mocks-no-std", "serde"]} prost = { workspace=true} strum="*" @@ -20,7 +19,7 @@ strum_macros = "0.24" [dev-dependencies] hex = "0.4.3" -cw-multi-test = "0.16.4" +cw-multi-test = "0.15.1" cw-xcall-ibc-connection = { path="../cw-xcall-ibc-connection" } cw-mock-ibc-core = { path="../cw-mock-ibc-core" } cw-mock-dapp = { workspace=true} @@ -29,7 +28,6 @@ cw-icon-light-client = { path="../cw-icon-light-client" } cw-ibc-core={path="../cw-ibc-core"} cw-xcall-lib={workspace=true} cw-xcall = {workspace=true} -#cw-xcall={path="../cw-xcall"} anyhow="*" test-utils={path="../../../libraries/rust/test-utils"} diff --git a/contracts/cosmwasm-vm/cw-integration/tests/setup.rs b/contracts/cosmwasm-vm/cw-integration/tests/setup.rs index b36db7d9d..ab28a107b 100644 --- a/contracts/cosmwasm-vm/cw-integration/tests/setup.rs +++ b/contracts/cosmwasm-vm/cw-integration/tests/setup.rs @@ -3,10 +3,11 @@ use std::{collections::HashMap, str::FromStr}; use cosmwasm_std::{ coins, testing::{mock_dependencies, mock_info, MockApi, MockQuerier, MockStorage}, - Addr, Empty, IbcEndpoint, MessageInfo, OwnedDeps, + Addr, Attribute, Empty, Event, IbcEndpoint, MessageInfo, OwnedDeps, }; +use cw_common::ibc_types::IbcEventType; use cw_integration::TestSteps; -use cw_multi_test::{App, Contract, ContractWrapper, Executor}; +use cw_multi_test::{App, AppResponse, Contract, ContractWrapper, Executor}; use cw_xcall_ibc_connection::state::IbcConfig; use test_utils::{IntegrationData, RawPayload}; @@ -355,3 +356,28 @@ pub fn setup_context(data: Option) -> TestContext { caller: None, } } + +pub fn get_event(res: &AppResponse, event: &str) -> Option> { + let event = res + .events + .iter() + .filter(|e| e.ty == event) + .collect::>(); + if !event.is_empty() { + let map = to_attribute_map(&event[0].attributes); + return Some(map); + } + None +} + +pub fn get_event_name(event_type: IbcEventType) -> String { + format!("wasm-{}", event_type.as_str()) +} + +pub fn to_attribute_map(attrs: &Vec) -> HashMap { + let mut map = HashMap::new(); + for attr in attrs { + map.insert(attr.key.clone(), attr.value.clone()); + } + map +} diff --git a/contracts/cosmwasm-vm/cw-integration/tests/test_host_lightclient.rs b/contracts/cosmwasm-vm/cw-integration/tests/test_host_lightclient.rs index 578da82cf..219e42077 100644 --- a/contracts/cosmwasm-vm/cw-integration/tests/test_host_lightclient.rs +++ b/contracts/cosmwasm-vm/cw-integration/tests/test_host_lightclient.rs @@ -18,7 +18,9 @@ use setup::{ init_xcall_app_contract, init_xcall_ibc_connection_contract, setup_context, TestContext, COUNTERPARTY_NID, PORT, }; -use test_utils::{get_event, get_event_name, load_raw_payloads}; +use test_utils::load_raw_payloads; + +use crate::setup::{get_event, get_event_name}; fn setup_test(payload_file: &str) -> TestContext { let integration_data = load_raw_payloads(payload_file); @@ -440,7 +442,7 @@ fn test_icon_to_arcway_handshake() -> TestContext { assert!(response.is_ok()); println!("Create Client OK"); let client_id = get_client_id(&response.unwrap()); - println!("Clientid is {}", client_id); + println!("Clientid is {client_id}"); let result = call_connection_open_try(&mut ctx); println!("Conn Open Try Ok {:?}", &result); @@ -494,7 +496,7 @@ fn test_archway_to_icon_handshake() -> TestContext { assert!(response.is_ok()); println!("Create Client OK"); let client_id = get_client_id(&response.unwrap()); - println!("Clientid is {}", client_id); + println!("Clientid is {client_id}"); let result = call_connection_open_init(&mut ctx); diff --git a/contracts/cosmwasm-vm/cw-integration/tests/test_xcall_connection.rs b/contracts/cosmwasm-vm/cw-integration/tests/test_xcall_connection.rs index dbf2c5a29..22fc8c648 100644 --- a/contracts/cosmwasm-vm/cw-integration/tests/test_xcall_connection.rs +++ b/contracts/cosmwasm-vm/cw-integration/tests/test_xcall_connection.rs @@ -11,8 +11,8 @@ use setup::{ init_mock_ibc_core_contract, init_xcall_app_contract, init_xcall_ibc_connection_contract, TestContext, }; -use test_utils::get_event; +use crate::setup::get_event; use crate::setup::setup_context; const MOCK_CONTRACT_TO_ADDR: &str = "cosmoscontract"; @@ -71,7 +71,7 @@ fn send_packet_success() { let src = ctx.get_xcall_ibc_connection().to_string(); let result = call_send_call_message( &mut ctx, - &format!("nid/{}", MOCK_CONTRACT_TO_ADDR), + &format!("nid/{MOCK_CONTRACT_TO_ADDR}"), vec![src], vec!["somedestination".to_string()], vec![1, 2, 3], diff --git a/contracts/cosmwasm-vm/cw-light-client-common/Cargo.toml b/contracts/cosmwasm-vm/cw-light-client-common/Cargo.toml new file mode 100644 index 000000000..58064b40f --- /dev/null +++ b/contracts/cosmwasm-vm/cw-light-client-common/Cargo.toml @@ -0,0 +1,27 @@ +[package] +name = "cw-light-client-common" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +cosmwasm-schema = {workspace=true} +cosmwasm-std = {workspace=true} +#cosmwasm-storage = {workspace=true} +cw-storage-plus ={workspace=true} +thiserror = { workspace=true} +prost = { workspace=true} +hex ={workspace=true } +schemars = {workspace=true} +serde = { workspace=true} +serde-json-wasm = {workspace=true} +debug_print = {workspace=true} +cw-common = { workspace=true,default-features = false } +common = { workspace=true, default-features = false } + +[dev-dependencies] +cosmwasm = "0.7.2" +hex-literal="*" +test-utils={path="../../../libraries/rust/test-utils"} +getrandom = {version = "0.2", default-features = false, features = ["custom"]} diff --git a/contracts/cosmwasm-vm/cw-light-client-common/src/constants.rs b/contracts/cosmwasm-vm/cw-light-client-common/src/constants.rs new file mode 100644 index 000000000..dea925e03 --- /dev/null +++ b/contracts/cosmwasm-vm/cw-light-client-common/src/constants.rs @@ -0,0 +1,20 @@ +use common::icon::icon::lightclient::v1::TrustLevel; +use cw_storage_plus::{Item, Map}; + +use crate::traits::Config; +type ClientId = String; + +pub const CLIENT_STATE_HASH: &str = "client_state_hash"; +pub const CONSENSUS_STATE_HASH: &str = "consensus_state_hash"; +pub const HEIGHT: &str = "height"; +pub const TRUST_LEVEL: TrustLevel = TrustLevel { + numerator: 2, + denominator: 3, +}; + +pub const CLIENT_STATES: Map> = Map::new("CLIENT_STATES"); +pub const CONSENSUS_STATES: Map<(ClientId, u64), Vec> = Map::new("CONSENSUS_STATES"); +pub const PROCESSED_TIMES: Map<(ClientId, u64), u64> = Map::new("PROCESSED_TIMES"); +pub const PROCESSED_HEIGHTS: Map<(ClientId, u64), u64> = Map::new("PROCESSED_HEIGHTS"); + +pub const CONFIG: Item = Item::new("CONFIG"); diff --git a/contracts/cosmwasm-vm/cw-icon-light-client/src/error.rs b/contracts/cosmwasm-vm/cw-light-client-common/src/error.rs similarity index 98% rename from contracts/cosmwasm-vm/cw-icon-light-client/src/error.rs rename to contracts/cosmwasm-vm/cw-light-client-common/src/error.rs index f12ea8a82..42dd53a55 100644 --- a/contracts/cosmwasm-vm/cw-icon-light-client/src/error.rs +++ b/contracts/cosmwasm-vm/cw-light-client-common/src/error.rs @@ -83,6 +83,9 @@ pub enum ContractError { #[error("Height {height:?} already updated ")] HeightAlreadyUpdated { height: u64 }, + + #[error("{error:?}")] + OtherError { error: String }, } impl From for ContractError { diff --git a/contracts/cosmwasm-vm/cw-light-client-common/src/lib.rs b/contracts/cosmwasm-vm/cw-light-client-common/src/lib.rs new file mode 100644 index 000000000..216812fb3 --- /dev/null +++ b/contracts/cosmwasm-vm/cw-light-client-common/src/lib.rs @@ -0,0 +1,5 @@ +pub mod constants; +pub mod error; +pub mod light_client; +pub mod traits; +pub use crate::error::ContractError; diff --git a/contracts/cosmwasm-vm/cw-icon-light-client/src/light_client.rs b/contracts/cosmwasm-vm/cw-light-client-common/src/light_client.rs similarity index 89% rename from contracts/cosmwasm-vm/cw-icon-light-client/src/light_client.rs rename to contracts/cosmwasm-vm/cw-light-client-common/src/light_client.rs index c24fc45ee..12b6ae694 100644 --- a/contracts/cosmwasm-vm/cw-icon-light-client/src/light_client.rs +++ b/contracts/cosmwasm-vm/cw-light-client-common/src/light_client.rs @@ -1,5 +1,4 @@ use crate::constants::TRUST_LEVEL; -use crate::state::CwContext; use crate::traits::{ConsensusStateUpdate, IContext, ILightClient}; use crate::ContractError; use common::icon::icon::lightclient::v1::ConsensusState; @@ -11,12 +10,12 @@ use cosmwasm_std::Addr; use cw_common::cw_println; use prost::Message; -pub struct IconClient<'a> { - context: CwContext<'a>, +pub struct IconClient { + context: C, } -impl<'a> IconClient<'a> { - pub fn new(context: CwContext<'a>) -> Self { +impl IconClient { + pub fn new(context: C) -> Self { Self { context } } pub fn has_quorum_of(n_validators: u64, votes: u64, trust_level: &TrustLevel) -> bool { @@ -36,7 +35,7 @@ impl<'a> IconClient<'a> { .get_network_type_section_decision_hash(&state.src_network_id, state.network_type_id); cw_println!( - self.context, + self.context.api(), "network type section decision hash {}", hex::encode(decision) ); @@ -64,7 +63,7 @@ impl<'a> IconClient<'a> { } } if !Self::has_quorum_of(num_validators, votes, trust_level) { - cw_println!(self.context, "Insuffcient Quorom detected"); + cw_println!(self.context.api(), "Insuffcient Quorom detected"); return Err(ContractError::InSuffcientQuorum); } Ok(true) @@ -85,11 +84,11 @@ impl<'a> IconClient<'a> { .get_processed_block_at_height(client_id, height)?; let current_time = self.context.get_current_block_time(); let current_height = self.context.get_current_block_height(); - if !current_time >= (processed_time + delay_time) { + if current_time < (processed_time + delay_time) { return Err(ContractError::NotEnoughtTimeElapsed); } - if !current_height >= (processed_height + delay_block) { + if current_height < (processed_height + delay_block) { return Err(ContractError::NotEnoughtBlocksElapsed); } @@ -97,7 +96,7 @@ impl<'a> IconClient<'a> { } } -impl ILightClient for IconClient<'_> { +impl ILightClient for IconClient { type Error = crate::ContractError; fn create_client( @@ -107,7 +106,7 @@ impl ILightClient for IconClient<'_> { client_state: ClientState, consensus_state: ConsensusState, ) -> Result { - self.context.ensure_ibc_host(caller)?; + self.context.ensure_ibc_host(&caller)?; let exists = self.context.get_client_state(client_id).is_ok(); if exists { return Err(ContractError::ClientStateAlreadyExists( @@ -122,7 +121,7 @@ impl ILightClient for IconClient<'_> { consensus_state.clone(), )?; cw_println!( - self.context, + self.context.api(), "[CreateClient]: create client called with id {}", client_id ); @@ -142,6 +141,43 @@ impl ILightClient for IconClient<'_> { client_id: &str, signed_header: SignedHeader, ) -> Result { + self.verify_header(&caller, client_id, &signed_header)?; + + let mut state = self.context.get_client_state(client_id)?; + let btp_header = signed_header.header.clone().unwrap(); + + if state.latest_height < btp_header.main_height { + state.latest_height = btp_header.main_height; + } + + let consensus_state = btp_header.to_consensus_state(); + self.context.insert_client_state(client_id, state.clone())?; + self.context.insert_consensus_state( + client_id, + btp_header.main_height, + consensus_state.clone(), + )?; + self.context + .insert_timestamp_at_height(client_id, btp_header.main_height)?; + self.context + .insert_blocknumber_at_height(client_id, btp_header.main_height)?; + let commitment = keccak256(&consensus_state.encode_to_vec()); + + Ok(ConsensusStateUpdate { + consensus_state_commitment: commitment, + client_state_commitment: keccak256(&state.encode_to_vec()), + client_state_bytes: state.encode_to_vec(), + consensus_state_bytes: consensus_state.encode_to_vec(), + height: btp_header.main_height, + }) + } + + fn verify_header( + &mut self, + caller: &Addr, + client_id: &str, + signed_header: &SignedHeader, + ) -> Result<(), Self::Error> { self.context.ensure_ibc_host(caller)?; let btp_header = signed_header.header.clone().unwrap(); if self @@ -154,7 +190,7 @@ impl ILightClient for IconClient<'_> { }); } - let mut state = self.context.get_client_state(client_id)?; + let state = self.context.get_client_state(client_id)?; if signed_header.trusted_height > btp_header.main_height { return Err(ContractError::UpdateBlockOlderThanTrustedHeight); @@ -197,29 +233,6 @@ impl ILightClient for IconClient<'_> { &signed_header.current_validators, )?; - if state.latest_height < btp_header.main_height { - state.latest_height = btp_header.main_height; - } - - let consensus_state = btp_header.to_consensus_state(); - self.context.insert_client_state(client_id, state.clone())?; - self.context.insert_consensus_state( - client_id, - btp_header.main_height, - consensus_state.clone(), - )?; - self.context - .insert_timestamp_at_height(client_id, btp_header.main_height)?; - self.context - .insert_blocknumber_at_height(client_id, btp_header.main_height)?; - let commitment = keccak256(&consensus_state.encode_to_vec()); - - Ok(ConsensusStateUpdate { - consensus_state_commitment: commitment, - client_state_commitment: keccak256(&state.encode_to_vec()), - client_state_bytes: state.encode_to_vec(), - consensus_state_bytes: consensus_state.encode_to_vec(), - height: btp_header.main_height, - }) + Ok(()) } } diff --git a/contracts/cosmwasm-vm/cw-light-client-common/src/traits/context.rs b/contracts/cosmwasm-vm/cw-light-client-common/src/traits/context.rs new file mode 100644 index 000000000..1a7c26e4b --- /dev/null +++ b/contracts/cosmwasm-vm/cw-light-client-common/src/traits/context.rs @@ -0,0 +1,80 @@ +use crate::ContractError; +use common::icon::icon::lightclient::v1::ClientState; +use common::icon::icon::lightclient::v1::ConsensusState; +use common::utils::keccak256; +use cosmwasm_std::Addr; +use cosmwasm_std::Api; + +use super::*; +pub trait IContext { + fn get_client_state(&self, client_id: &str) -> Result; + + fn insert_client_state( + &mut self, + client_id: &str, + state: ClientState, + ) -> Result<(), ContractError>; + + fn get_consensus_state( + &self, + client_id: &str, + height: u64, + ) -> Result; + fn insert_consensus_state( + &mut self, + client_id: &str, + height: u64, + state: ConsensusState, + ) -> Result<(), ContractError>; + + fn get_timestamp_at_height(&self, client_id: &str, height: u64) -> Result; + fn insert_timestamp_at_height( + &mut self, + client_id: &str, + height: u64, + ) -> Result<(), ContractError>; + fn insert_blocknumber_at_height( + &mut self, + client_id: &str, + height: u64, + ) -> Result<(), ContractError>; + + fn recover_signer(&self, msg: &[u8], signature: &[u8]) -> Option<[u8; 20]> { + if signature.len() != 65 { + return None; + } + let mut rs = [0u8; 64]; + rs[..].copy_from_slice(&signature[..64]); + let v = signature[64]; + let pubkey = self.api().secp256k1_recover_pubkey(msg, &rs, v).unwrap(); + let pubkey_hash = keccak256(&pubkey[1..]); + let address: Option<[u8; 20]> = pubkey_hash.as_slice()[12..].try_into().ok(); + address + } + + fn recover_icon_signer(&self, msg: &[u8], signature: &[u8]) -> Option> { + self.recover_signer(msg, signature) + .map(|addr| addr.to_vec()) + } + + fn get_config(&self) -> Result; + + fn insert_config(&mut self, config: &Config) -> Result<(), ContractError>; + + fn get_current_block_time(&self) -> u64; + fn get_current_block_height(&self) -> u64; + fn get_processed_time_at_height( + &self, + client_id: &str, + height: u64, + ) -> Result; + fn get_processed_block_at_height( + &self, + client_id: &str, + height: u64, + ) -> Result; + + fn ensure_owner(&self, caller: Addr) -> Result<(), ContractError>; + fn ensure_ibc_host(&self, caller: &Addr) -> Result<(), ContractError>; + fn api(&self) -> &dyn Api; +} diff --git a/contracts/cosmwasm-vm/cw-light-client-common/src/traits/light_client.rs b/contracts/cosmwasm-vm/cw-light-client-common/src/traits/light_client.rs new file mode 100644 index 000000000..f91d606cc --- /dev/null +++ b/contracts/cosmwasm-vm/cw-light-client-common/src/traits/light_client.rs @@ -0,0 +1,46 @@ +use common::icon::icon::lightclient::v1::ClientState; +use common::icon::icon::lightclient::v1::ConsensusState; +use common::icon::icon::types::v1::SignedHeader; +use cosmwasm_std::Addr; + +use super::*; +pub trait ILightClient { + type Error; + /** + * @dev createClient creates a new client with the given state. + * If succeeded, it returns a commitment for the initial state. + */ + fn create_client( + &mut self, + caller: Addr, + client_id: &str, + client_state: ClientState, + consensus_state: ConsensusState, + ) -> Result; + + /** + * @dev updateClient updates the client corresponding to `clientId`. + * If succeeded, it returns a commitment for the updated state. + * If there are no updates for consensus state, this function should returns an empty array as `updates`. + * + * NOTE: updateClient is intended to perform the followings: + * 1. verify a given client message(e.g. header) + * 2. check misbehaviour such like duplicate block height + * 3. if misbehaviour is found, update state accordingly and return + * 4. update state(s) with the client message + * 5. persist the state(s) on the host + */ + fn update_client( + &mut self, + caller: Addr, + client_id: &str, + header: SignedHeader, + ) -> Result; + + fn verify_header( + &mut self, + caller: &Addr, + client_id: &str, + header: &SignedHeader, + ) -> Result<(), Self::Error>; +} diff --git a/contracts/cosmwasm-vm/cw-light-client-common/src/traits/mod.rs b/contracts/cosmwasm-vm/cw-light-client-common/src/traits/mod.rs new file mode 100644 index 000000000..34c64057b --- /dev/null +++ b/contracts/cosmwasm-vm/cw-light-client-common/src/traits/mod.rs @@ -0,0 +1,44 @@ +pub mod context; +pub mod light_client; +pub mod query_handler; + +pub use context::IContext; +pub use light_client::ILightClient; +pub use query_handler::IQueryHandler; + +use cosmwasm_std::Addr; + +use serde::Deserialize; +use serde::Serialize; + +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct ConsensusStateUpdate { + // commitment for updated consensusState + pub consensus_state_commitment: [u8; 32], + pub client_state_commitment: [u8; 32], + pub consensus_state_bytes: Vec, + pub client_state_bytes: Vec, + // updated height + pub height: u64, +} + +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] +pub struct Config { + pub owner: Addr, + pub ibc_host: Addr, +} + +impl Config { + pub fn new(owner: Addr, ibc_host: Addr) -> Self { + Self { owner, ibc_host } + } +} + +impl Default for Config { + fn default() -> Self { + Self { + owner: Addr::unchecked("test"), + ibc_host: Addr::unchecked("ibc_host"), + } + } +} diff --git a/contracts/cosmwasm-vm/cw-light-client-common/src/traits/query_handler.rs b/contracts/cosmwasm-vm/cw-light-client-common/src/traits/query_handler.rs new file mode 100644 index 000000000..3d9e2e2c2 --- /dev/null +++ b/contracts/cosmwasm-vm/cw-light-client-common/src/traits/query_handler.rs @@ -0,0 +1,251 @@ +use common::icon::icon::lightclient::v1::ClientState; +use common::icon::icon::lightclient::v1::ConsensusState; +use common::icon::icon::types::v1::MerkleNode; +use common::utils::calculate_root; +use common::utils::keccak256; + +use cosmwasm_std::Deps; +use cosmwasm_std::Order; +use cosmwasm_std::StdResult; +use cosmwasm_std::Storage; +use cw_common::cw_println; +use cw_common::hex_string::HexString; +use cw_storage_plus::Bound; +use std::marker::PhantomData; + +use super::*; +use crate::constants::CLIENT_STATES; +use crate::constants::CONFIG; +use crate::constants::CONSENSUS_STATES; +use crate::constants::PROCESSED_HEIGHTS; +use crate::constants::PROCESSED_TIMES; +use crate::ContractError; +use common::traits::AnyTypes; +use prost::Message; +pub trait IQueryHandler { + fn get_consensus_state( + storage: &dyn Storage, + client_id: &str, + height: u64, + ) -> Result { + let data = CONSENSUS_STATES + .load(storage, (client_id.to_string(), height)) + .map_err(|_e| ContractError::ConsensusStateNotFound { + height, + client_id: client_id.to_string(), + })?; + let state = ConsensusState::decode(data.as_slice()).map_err(ContractError::DecodeError)?; + Ok(state) + } + + fn get_client_state( + storage: &dyn Storage, + client_id: &str, + ) -> Result { + let data = CLIENT_STATES + .load(storage, client_id.to_string()) + .map_err(|_e| ContractError::ClientStateNotFound(client_id.to_string()))?; + let state = ClientState::decode(data.as_slice()).map_err(ContractError::DecodeError)?; + Ok(state) + } + + fn get_latest_consensus_state( + storage: &dyn Storage, + client_id: &str, + ) -> Result { + let latest_height = Self::get_latest_height(storage, client_id)?; + + let consensus_state = Self::get_consensus_state(storage, client_id, latest_height)?; + Ok(consensus_state) + } + + fn get_timestamp_at_height( + storage: &dyn Storage, + client_id: &str, + height: u64, + ) -> Result { + PROCESSED_TIMES + .load(storage, (client_id.to_string(), height)) + .map_err(|_e| ContractError::TimestampNotFound { + height, + client_id: client_id.to_string(), + }) + } + + fn get_config(storage: &dyn Storage) -> Result { + CONFIG + .load(storage) + .map_err(|_e| ContractError::ConfigNotFound) + } + + fn get_client_state_any( + storage: &dyn Storage, + client_id: &str, + ) -> Result, ContractError> { + let state = Self::get_client_state(storage, client_id)?; + let any_state = state.to_any(); + Ok(any_state.encode_to_vec()) + } + + fn get_consensus_state_any( + storage: &dyn Storage, + client_id: &str, + height: u64, + ) -> Result, ContractError> { + let state = Self::get_consensus_state(storage, client_id, height)?; + let any_state = state.to_any(); + Ok(any_state.encode_to_vec()) + } + + fn get_latest_height(storage: &dyn Storage, client_id: &str) -> Result { + let state = Self::get_client_state(storage, client_id)?; + + Ok(state.latest_height) + } + + fn get_processed_time_at_height( + storage: &dyn Storage, + client_id: &str, + height: u64, + ) -> Result { + PROCESSED_TIMES + .load(storage, (client_id.to_string(), height)) + .map_err(|_e| ContractError::ProcessedTimeNotFound { + client_id: client_id.to_string(), + height, + }) + } + fn get_processed_blocknumber_at_height( + storage: &dyn Storage, + client_id: &str, + height: u64, + ) -> Result { + PROCESSED_HEIGHTS + .load(storage, (client_id.to_string(), height)) + .map_err(|_e| ContractError::ProcessedHeightNotFound { + client_id: client_id.to_string(), + height, + }) + } + + /** + * @dev verifyMembership is a generic proof verification method which verifies a proof of the existence of a value at a given CommitmentPath at the specified height. + * The caller is expected to construct the full CommitmentPath from a CommitmentPrefix and a standardized path (as defined in ICS 24). + */ + fn verify_membership( + deps: Deps, + client_id: &str, + height: u64, + _delay_time_period: u64, + _delay_block_period: u64, + proof: &[MerkleNode], + value: &[u8], + path: &[u8], + ) -> Result { + let client_state = Self::get_client_state(deps.storage, client_id)?; + let consensus_state: ConsensusState = + Self::get_consensus_state(deps.storage, client_id, height)?; + cw_println!( + deps.api, + "[LightClient]: Path Bytes {:?}", + HexString::from_bytes(path) + ); + cw_println!( + deps.api, + "[LightClient]: Value Bytes {:?}", + HexString::from_bytes(value) + ); + let path = keccak256(path).to_vec(); + cw_println!(deps.api, "[LightClient]: client id is: {:?}", client_id); + + if client_state.frozen_height != 0 && height > client_state.frozen_height { + return Err(ContractError::ClientStateFrozen(client_state.frozen_height)); + } + cw_println!(deps.api, "[LightClient]: value is: {:?}", value); + + let mut value_hash = value.to_vec(); + if !value.is_empty() { + value_hash = keccak256(value).to_vec(); + } + + // let _ = + // self.validate_delay_args(client_id, height, delay_time_period, delay_block_period)?; + + cw_println!( + deps.api, + "[LightClient]: Path Hash {:?}", + HexString::from_bytes(&path) + ); + cw_println!( + deps.api, + "[LightClient]: Value Hash {:?}", + HexString::from_bytes(&value_hash) + ); + let leaf = keccak256(&[path, value_hash].concat()); + cw_println!( + deps.api, + "[LightClient]: Leaf Value {:?}", + HexString::from_bytes(&leaf) + ); + + let message_root = calculate_root(leaf, proof); + cw_println!( + deps.api, + "[LightClient]: Stored Message Root {:?} ", + hex::encode(consensus_state.message_root.clone()) + ); + cw_println!( + deps.api, + "[LightClient]: Calculated Message Root : {:?}", + HexString::from_bytes(&message_root) + ); + if consensus_state.message_root != message_root { + return Err(ContractError::InvalidMessageRoot(hex::encode(message_root))); + } + + Ok(true) + } + + /** + * @dev verifyNonMembership is a generic proof verification method which verifies the absence of a given CommitmentPath at a specified height. + * The caller is expected to construct the full CommitmentPath from a CommitmentPrefix and a standardized path (as defined in ICS 24). + */ + fn verify_non_membership( + deps: Deps, + client_id: &str, + height: u64, + delay_time_period: u64, + delay_block_period: u64, + proof: &[MerkleNode], + path: &[u8], + ) -> Result { + Self::verify_membership( + deps, + client_id, + height, + delay_time_period, + delay_block_period, + proof, + &[], + path, + ) + } + + fn get_previous_consensus( + storage: &dyn Storage, + height: u64, + client_id: String, + ) -> Result, ContractError> { + let key = (client_id, height); + let bound = Bound::Exclusive::<(String, u64)>((key, PhantomData)); + + let result = CONSENSUS_STATES + .range(storage, None, Some(bound), Order::Descending) + .take(1) + .collect::)>>>() + .map_err(ContractError::Std)?; + + let keys = result.into_iter().map(|t| t.0 .1).collect::>(); + Ok(keys) + } +} diff --git a/contracts/cosmwasm-vm/cw-mock-ibc-connection/Cargo.toml b/contracts/cosmwasm-vm/cw-mock-ibc-connection/Cargo.toml index 663b58271..53abc4b3f 100644 --- a/contracts/cosmwasm-vm/cw-mock-ibc-connection/Cargo.toml +++ b/contracts/cosmwasm-vm/cw-mock-ibc-connection/Cargo.toml @@ -32,14 +32,14 @@ optimize = """docker run --rm -v "$(pwd)":/code \ [dependencies] cosmwasm-schema = {workspace=true} cosmwasm-std = {workspace=true} -cosmwasm-storage = {workspace=true} +#cosmwasm-storage = {workspace=true} cw-storage-plus = {workspace=true} cw2 = {workspace=true} schemars = {workspace=true} serde = { workspace=true} thiserror = { workspace=true} -common = { path="../../../libraries/rust/common" } -cw-common = { path="../cw-common" } +common = { workspace=true } +cw-common = { workspace=true } hex={workspace=true} debug_print={workspace=true} cw-xcall-lib={workspace=true} diff --git a/contracts/cosmwasm-vm/cw-mock-ibc-core/Cargo.toml b/contracts/cosmwasm-vm/cw-mock-ibc-core/Cargo.toml index 4fda9910c..c8ec2bfe0 100644 --- a/contracts/cosmwasm-vm/cw-mock-ibc-core/Cargo.toml +++ b/contracts/cosmwasm-vm/cw-mock-ibc-core/Cargo.toml @@ -42,16 +42,16 @@ optimize = """docker run --rm -v "$(pwd)":/code \ [dependencies] cosmwasm-schema = {workspace=true} cosmwasm-std = {workspace=true} -cosmwasm-storage = {workspace=true} +#cosmwasm-storage = {workspace=true} cw-storage-plus = {workspace=true} cw2 = {workspace=true} schemars = {workspace=true} serde = { workspace=true} thiserror = { workspace=true} -cw-common = { path="../cw-common" } -common = { path="../../../libraries/rust/common", default-features = false } +cw-common = { workspace=true } +common = { workspace=true, default-features = false } hex={workspace=true} -cw-xcall={package="cw-xcall", git="https://github.com/icon-project/xCall.git", branch="main"} +cw-xcall={workspace=true} [dev-dependencies] getrandom = {version = "0.2", default-features = false, features = ["custom"]} diff --git a/contracts/cosmwasm-vm/cw-mock-ibc-dapp/Cargo.toml b/contracts/cosmwasm-vm/cw-mock-ibc-dapp/Cargo.toml index d4d0783c3..7806be807 100644 --- a/contracts/cosmwasm-vm/cw-mock-ibc-dapp/Cargo.toml +++ b/contracts/cosmwasm-vm/cw-mock-ibc-dapp/Cargo.toml @@ -32,14 +32,14 @@ optimize = """docker run --rm -v "$(pwd)":/code \ [dependencies] cosmwasm-schema = {workspace=true} cosmwasm-std = {workspace=true} -cosmwasm-storage = {workspace=true} +#cosmwasm-storage = {workspace=true} cw-storage-plus = {workspace=true} cw2 = {workspace=true} schemars = {workspace=true} serde = { workspace=true} thiserror = { workspace=true} -common = { path="../../../libraries/rust/common" } -cw-common = { path="../cw-common" } +common = { workspace=true } +cw-common = { workspace=true } hex={workspace=true} debug_print={workspace=true} diff --git a/contracts/cosmwasm-vm/cw-mock-ibc-dapp/src/admin.rs b/contracts/cosmwasm-vm/cw-mock-ibc-dapp/src/admin.rs index abf96249b..50a2b3c50 100644 --- a/contracts/cosmwasm-vm/cw-mock-ibc-dapp/src/admin.rs +++ b/contracts/cosmwasm-vm/cw-mock-ibc-dapp/src/admin.rs @@ -95,10 +95,8 @@ impl<'a> CwIbcConnection<'a> { return Err(ContractError::AdminAddressCannotBeNull {}); } - if !new_admin.to_string().chars().all(|x| x.is_alphanumeric()) { - return Err(ContractError::InvalidAddress { - address: new_admin.to_string(), - }); + if !new_admin.chars().all(|x| x.is_alphanumeric()) { + return Err(ContractError::InvalidAddress { address: new_admin }); } self.ensure_owner(store, &info)?; diff --git a/contracts/cosmwasm-vm/cw-mock-ibc-dapp/src/ibc_host.rs b/contracts/cosmwasm-vm/cw-mock-ibc-dapp/src/ibc_host.rs index 32061da31..553bb6b44 100644 --- a/contracts/cosmwasm-vm/cw-mock-ibc-dapp/src/ibc_host.rs +++ b/contracts/cosmwasm-vm/cw-mock-ibc-dapp/src/ibc_host.rs @@ -114,7 +114,7 @@ mod tests { let packet = RawPacket::default(); let res = connection.call_host_send_message(deps.as_mut(), info, packet.clone()); - println!("{:?}", res); + println!("{res:?}"); assert!(res.is_ok()); let expected_ibc_host = connection diff --git a/contracts/cosmwasm-vm/cw-wasm-light-client/.cargo/config b/contracts/cosmwasm-vm/cw-wasm-light-client/.cargo/config new file mode 100644 index 000000000..af5698e58 --- /dev/null +++ b/contracts/cosmwasm-vm/cw-wasm-light-client/.cargo/config @@ -0,0 +1,4 @@ +[alias] +wasm = "build --release --lib --target wasm32-unknown-unknown" +unit-test = "test --lib" +schema = "run --bin schema" diff --git a/contracts/cosmwasm-vm/cw-wasm-light-client/Cargo.toml b/contracts/cosmwasm-vm/cw-wasm-light-client/Cargo.toml new file mode 100644 index 000000000..aa13afc14 --- /dev/null +++ b/contracts/cosmwasm-vm/cw-wasm-light-client/Cargo.toml @@ -0,0 +1,70 @@ +[package] +name = "cw-wasm-light-client" +version = "0.1.0" +authors.workspace = true +edition = "2021" + +exclude = [ + # Those files are rust-optimizer artifacts. You might want to commit them for convenience but they should not be part of the source code publication. + "contract.wasm", + "hash.txt", +] + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[lib] +crate-type = ["cdylib", "rlib"] + +[features] +default = [] +# for more explicit tests, cargo test --features=backtraces +backtraces = ["cosmwasm-std/backtraces"] +# use library feature to disable all instantiate/execute/query exports +library = [] +mock=[] + +[package.metadata.scripts] +optimize = """docker run --rm -v "$(pwd)":/code \ + --mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target \ + --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ + cosmwasm/rust-optimizer:0.12.10 +""" + +[dependencies] +cosmwasm-schema = "1.1.3" +cosmwasm-std = { workspace=true} +schemars = "0.8.10" +serde = { version = "1.0.145", default-features = false, features = ["derive"] } +thiserror = { version = "1.0.31" } +cw2 = {workspace=true,default-features = false} +sha2 = { version = "0.10.6", default-features = false } +hex ={workspace=true } +sha3 = { version = "0.10.6", default-features = false } +bytes = { workspace=true } +common = { workspace=true } +cw-light-client-common = { path="../cw-light-client-common",default-features = false } +cw-common = { workspace=true } +prost = { workspace=true} +serde-json-wasm = {workspace=true} +ibc-proto={git="https://github.com/ComposableFi/composable-ibc.git",default-features = false,features = ["json-schema"] } +ibc={git="https://github.com/ComposableFi/composable-ibc.git",default-features = false,branch="master"} +ics07-tendermint-cw={git="https://github.com/ComposableFi/composable-ibc.git",default-features = false,features=["library","rust-crypto"],branch="master"} +debug_print = {workspace=true} +base64 = { version = "0.13", default-features = false, features = ["alloc"] } +ics08-wasm={ git="https://github.com/ComposableFi/composable-ibc.git",default-features = false, features=["cosmwasm"],branch="master"} +tendermint-proto = { git = "https://github.com/informalsystems/tendermint-rs", rev = "e81f7bf23d63ffbcd242381d1ce5e35da3515ff1", default-features = false } +[dev-dependencies] +cosmwasm = "0.7.2" +hex-literal="*" +test-utils={path="../../../libraries/rust/test-utils"} +getrandom = {version = "0.2", default-features = false, features = ["custom"]} + +[profile.release] +# Do not perform backtrace for panic on release builds. +panic = 'abort' +# Perform optimizations on all codegen units. +codegen-units = 1 +# Optimize for size. +opt-level = 'z' # or 'z' to optimize "aggressively" for size +# Enable link time optimization. +lto = true diff --git a/contracts/cosmwasm-vm/cw-wasm-light-client/README.md b/contracts/cosmwasm-vm/cw-wasm-light-client/README.md new file mode 100644 index 000000000..f786a4758 --- /dev/null +++ b/contracts/cosmwasm-vm/cw-wasm-light-client/README.md @@ -0,0 +1,7 @@ +## Wasm LightClient +Implementation of icon lightclient compatible with ics-08 standard. +Since the centauri chain currently does not support features like "staking" in wasm build, we need to disable "ibc3" feature flag in comswasm-std dependency before building it. We cant build entire workspace because other projects depend on "ibc3" feature being enabled, so we have to do standalone build for wasm lightclient. +We can build the lightclient using following command +` +cargo build -p cw-wasm-light-client --release --target wasm32-unknown-unknown +` diff --git a/contracts/cosmwasm-vm/cw-wasm-light-client/src/constants.rs b/contracts/cosmwasm-vm/cw-wasm-light-client/src/constants.rs new file mode 100644 index 000000000..623173c7d --- /dev/null +++ b/contracts/cosmwasm-vm/cw-wasm-light-client/src/constants.rs @@ -0,0 +1 @@ +pub const CLIENT_ID: &str = "08-iconwasm-0"; diff --git a/contracts/cosmwasm-vm/cw-wasm-light-client/src/context.rs b/contracts/cosmwasm-vm/cw-wasm-light-client/src/context.rs new file mode 100644 index 000000000..09e5a3d0c --- /dev/null +++ b/contracts/cosmwasm-vm/cw-wasm-light-client/src/context.rs @@ -0,0 +1,164 @@ +use cosmwasm_std::{Api, Env, Storage}; + +use crate::query_handler::QueryHandler; +use cw_light_client_common::traits::IQueryHandler; +use cw_light_client_common::{ + constants::{PROCESSED_HEIGHTS, PROCESSED_TIMES}, + traits::IContext, + ContractError, +}; + +use crate::utils::{ + get_client_state_key, get_consensus_state_key, to_ibc_height, to_wasm_client_state, + to_wasm_consensus_state, +}; +pub struct CwContext<'a> { + pub storage: &'a mut dyn Storage, + pub api: &'a dyn Api, + pub env: Env, +} + +impl<'a> CwContext<'a> { + pub fn new(deps_mut: cosmwasm_std::DepsMut<'a>, env: Env) -> Self { + Self { + storage: deps_mut.storage, + api: deps_mut.api, + env, + } + } +} + +impl<'a> IContext for CwContext<'a> { + fn get_client_state( + &self, + client_id: &str, + ) -> Result< + common::icon::icon::lightclient::v1::ClientState, + cw_light_client_common::ContractError, + > { + QueryHandler::get_client_state(self.storage, client_id) + } + + fn insert_client_state( + &mut self, + client_id: &str, + client_state: common::icon::icon::lightclient::v1::ClientState, + ) -> Result<(), cw_light_client_common::ContractError> { + let old_state = self + .storage + .get(&get_client_state_key()) + .ok_or(ContractError::ClientStateNotFound(client_id.to_string()))?; + let new_state = to_wasm_client_state(client_state, old_state)?; + self.storage.set(&get_client_state_key(), &new_state); + Ok(()) + } + + fn get_consensus_state( + &self, + client_id: &str, + height: u64, + ) -> Result< + common::icon::icon::lightclient::v1::ConsensusState, + cw_light_client_common::ContractError, + > { + QueryHandler::get_consensus_state(self.storage, client_id, height) + } + + fn insert_consensus_state( + &mut self, + _client_id: &str, + height: u64, + consensus_state: common::icon::icon::lightclient::v1::ConsensusState, + ) -> Result<(), cw_light_client_common::ContractError> { + let ibc_height = to_ibc_height(height); + let wasm_consensus_state = to_wasm_consensus_state(consensus_state); + self.storage + .set(&get_consensus_state_key(ibc_height), &wasm_consensus_state); + Ok(()) + } + + fn get_timestamp_at_height( + &self, + client_id: &str, + height: u64, + ) -> Result { + QueryHandler::get_processed_time_at_height(self.storage, client_id, height) + } + + fn insert_timestamp_at_height( + &mut self, + client_id: &str, + height: u64, + ) -> Result<(), ContractError> { + let time = self.env.block.time.nanos(); + PROCESSED_TIMES + .save(self.storage, (client_id.to_string(), height), &time) + .map_err(|_e| ContractError::FailedToSaveProcessedTime) + } + + fn insert_blocknumber_at_height( + &mut self, + client_id: &str, + height: u64, + ) -> Result<(), ContractError> { + let block_height = self.env.block.height; + PROCESSED_HEIGHTS + .save(self.storage, (client_id.to_string(), height), &block_height) + .map_err(|_e| ContractError::FailedToSaveProcessedTime) + } + + fn get_config( + &self, + ) -> Result { + unimplemented!() + } + + fn insert_config( + &mut self, + _config: &cw_light_client_common::traits::Config, + ) -> Result<(), cw_light_client_common::ContractError> { + unimplemented!() + } + + fn get_current_block_time(&self) -> u64 { + self.env.block.time.nanos() + } + + fn get_current_block_height(&self) -> u64 { + self.env.block.height + } + + fn get_processed_time_at_height( + &self, + client_id: &str, + height: u64, + ) -> Result { + QueryHandler::get_processed_time_at_height(self.storage, client_id, height) + } + + fn get_processed_block_at_height( + &self, + client_id: &str, + height: u64, + ) -> Result { + QueryHandler::get_processed_blocknumber_at_height(self.storage, client_id, height) + } + + fn ensure_owner( + &self, + _caller: cosmwasm_std::Addr, + ) -> Result<(), cw_light_client_common::ContractError> { + unimplemented!() + } + + fn ensure_ibc_host( + &self, + _caller: &cosmwasm_std::Addr, + ) -> Result<(), cw_light_client_common::ContractError> { + Ok(()) + } + + fn api(&self) -> &dyn Api { + self.api + } +} diff --git a/contracts/cosmwasm-vm/cw-wasm-light-client/src/contract.rs b/contracts/cosmwasm-vm/cw-wasm-light-client/src/contract.rs new file mode 100644 index 000000000..0db608e0c --- /dev/null +++ b/contracts/cosmwasm-vm/cw-wasm-light-client/src/contract.rs @@ -0,0 +1,233 @@ +use common::traits::AnyTypes; + +use cosmwasm_schema::cw_serde; +use cw_common::cw_println; + +use cw_light_client_common::traits::IQueryHandler; + +use crate::constants::CLIENT_ID; +#[cfg(feature = "mock")] +use crate::mock_client::MockClient; +use crate::query_handler::QueryHandler; + +use common::icon::icon::types::v1::{MerkleProofs, SignedHeader}; + +#[cfg(not(feature = "library"))] +use cosmwasm_std::entry_point; +use cosmwasm_std::{to_binary, Binary, Deps, DepsMut, Env, MessageInfo, Response, StdResult}; +use cw2::set_contract_version; + +use cw_common::raw_types::Any; + +use crate::context::CwContext; +use crate::light_client::IconClient; +use crate::msg::{ContractResult, ExecuteMsg, InstantiateMsg, QueryMsg, QueryResponse}; +use crate::traits::{IContext, ILightClient}; +use crate::ContractError; +use prost::Message; + +// version info for migration info +const CONTRACT_NAME: &str = "crates.io:cw-icon-light-client"; +const CONTRACT_VERSION: &str = env!("CARGO_PKG_VERSION"); + +#[cfg_attr(not(feature = "library"), entry_point)] +pub fn instantiate( + deps: DepsMut, + env: Env, + _info: MessageInfo, + _msg: InstantiateMsg, +) -> Result { + set_contract_version(deps.storage, CONTRACT_NAME, CONTRACT_VERSION) + .map_err(|_e| ContractError::FailedToInitContract)?; + + let mut context = CwContext::new(deps, env); + cw_println!(context.api(), "[WasmClient]: Contract Init Called"); + let client_state = context.get_client_state(CLIENT_ID)?; + context.insert_blocknumber_at_height(CLIENT_ID, client_state.latest_height)?; + context.insert_timestamp_at_height(CLIENT_ID, client_state.latest_height)?; + cw_println!(context.api(), "[WasmClient]: Contract Init Complete"); + + Ok(Response::default()) +} + +#[cfg_attr(not(feature = "library"), entry_point)] +pub fn execute( + deps_mut: DepsMut, + env: Env, + info: MessageInfo, + msg: ExecuteMsg, +) -> Result { + let data = process_message(deps_mut, env, info, msg)?; + let mut response = Response::default(); + response.data = Some(data); + Ok(response) +} + +fn process_message( + deps_mut: DepsMut, + env: Env, + info: MessageInfo, + msg: ExecuteMsg, +) -> Result { + cw_println!( + deps_mut.api, + "[WasmClient]: Contract Execute Called with {:?}", + msg + ); + match msg { + ExecuteMsg::VerifyMembership(mut msg) => { + cw_println!(deps_mut.api, "[WasmClient]: Verify Membership called"); + let height = msg.height.revision_height; + // "empty" is sent by relayer because native IBC doesnt support empty proofs. + if msg.proof == "empty".as_bytes() { + msg.proof = vec![]; + } + let client_id = CLIENT_ID; + let proofs_decoded = + MerkleProofs::decode(msg.proof.as_slice()).map_err(ContractError::DecodeError)?; + cw_println!( + deps_mut.api, + "[WasmClient]: Contract Execute Called with Path {:?}", + msg.path.key_path + ); + let fullpath = msg.path.key_path[1].clone(); + cw_println!(deps_mut.api, "[WasmClient]: Full Path is {:?}", fullpath); + let path = fullpath.as_bytes().to_vec(); + let (skip, value) = unwrap_any_type(deps_mut.as_ref(), &msg.value); + cw_println!(deps_mut.api, "[WasmClient]: Full Value is {:?}", &value); + // in case of consensusstate we skip verification since its not viable for icon chain. + if skip { + return to_binary(&ContractResult::success()).map_err(ContractError::Std); + } + + QueryHandler::verify_membership( + deps_mut.as_ref(), + client_id, + height, + msg.delay_time_period, + msg.delay_block_period, + &proofs_decoded.proofs, + &value, + &path, + )?; + + cw_println!(deps_mut.api, "[WasmClient]: Verify Membership Complete"); + + Ok(to_binary(&ContractResult::success()).map_err(ContractError::Std)?) + } + ExecuteMsg::VerifyNonMembership(msg) => { + cw_println!(deps_mut.api, "[WasmClient]: Verify Non Membership Called"); + let height = msg.height.revision_height; + let client_id = CLIENT_ID; + let proofs_decoded = + MerkleProofs::decode(msg.proof.as_slice()).map_err(ContractError::DecodeError)?; + let path = hex::decode(msg.path.key_path.join("")).unwrap(); + + QueryHandler::verify_non_membership( + deps_mut.as_ref(), + client_id, + height, + msg.delay_time_period, + msg.delay_block_period, + &proofs_decoded.proofs, + &path, + )?; + cw_println!(deps_mut.api, "[WasmClient]: Verify Non Membership Complete"); + + Ok(to_binary(&ContractResult::success()).map_err(ContractError::Std)?) + } + ExecuteMsg::VerifyClientMessage(msg) => match msg.client_message { + crate::msg::ClientMessageRaw::Header(wasmheader) => { + let context = CwContext::new(deps_mut, env); + + cw_println!(context.api(), "[WasmClient]: Verify Clientmessage called"); + let mut client = IconClient::new(context); + let header_any = Any::decode(&*wasmheader.data).unwrap(); + let header = + SignedHeader::from_any(header_any).map_err(ContractError::DecodeError)?; + client.verify_header(&info.sender, CLIENT_ID, &header)?; + Ok(to_binary(&ContractResult::success()).map_err(ContractError::Std)?) + } + crate::msg::ClientMessageRaw::Misbehaviour(_) => { + Ok(to_binary(&ContractResult::success()).map_err(ContractError::Std)?) + } + }, + ExecuteMsg::UpdateState(msg) => { + cw_println!(deps_mut.api, "Received Header {:?}", &msg); + + match msg.client_message { + crate::msg::ClientMessageRaw::Header(wasmheader) => { + let context = CwContext::new(deps_mut, env); + let mut client = IconClient::new(context); + let header_any = Any::decode(&*wasmheader.data).unwrap(); + let header = + SignedHeader::from_any(header_any).map_err(ContractError::DecodeError)?; + client.update_client(info.sender, CLIENT_ID, header)?; + Ok(to_binary(&ContractResult::success()).map_err(ContractError::Std)?) + } + crate::msg::ClientMessageRaw::Misbehaviour(_) => { + Ok(to_binary(&ContractResult::success()).map_err(ContractError::Std)?) + } + } + } + ExecuteMsg::UpdateStateOnMisbehaviour(_) => { + Ok(to_binary(&ContractResult::success()).map_err(ContractError::Std)?) + } + ExecuteMsg::VerifyUpgradeAndUpdateState(_msg) => { + todo!() + } + ExecuteMsg::CheckSubstituteAndUpdateState(_msg) => { + todo!() + } + ExecuteMsg::CheckForMisbehaviour(_msg) => { + let mut result = ContractResult::success(); + result.found_misbehaviour = false; + Ok(to_binary(&result).map_err(ContractError::Std)?) + } + } +} + +#[cfg_attr(not(feature = "library"), entry_point)] +pub fn query(deps: Deps, _env: Env, msg: QueryMsg) -> StdResult { + match msg { + QueryMsg::ClientTypeMsg(_) => todo!(), + QueryMsg::GetLatestHeightsMsg(_) => todo!(), + QueryMsg::ExportMetadata(msg) => { + cw_println!(deps.api, "Export metadata called {:?}", &msg); + let res = QueryHandler::get_genesis_metadata(deps.storage, CLIENT_ID); + to_binary(&QueryResponse::genesis_metadata(res.ok())) + } + QueryMsg::Status(msg) => { + cw_println!(deps.api, "Export metadata called {:?}", &msg); + QueryHandler::get_client_status(deps) + } + QueryMsg::GetClientState {} => { + to_binary(&QueryHandler::get_client_state(deps.storage, CLIENT_ID).unwrap()) + } + } +} + +pub fn unwrap_any_type(_deps: Deps, value: &[u8]) -> (bool, Vec) { + let any_result = Any::decode(value); + match any_result { + Ok(any) => { + let type_url = any.type_url.to_string(); + match type_url.as_ref() { + "/ibc.lightclients.tendermint.v1.ClientState" => (false, any.value), + "/ibc.lightclients.tendermint.v1.ConsensusState" => (true, any.value), + _ => (false, value.to_vec()), + } + } + Err(_e) => (false, value.to_vec()), + } +} + +#[cw_serde] +pub struct MigrateMsg {} + +#[cfg_attr(not(feature = "library"), entry_point)] +pub fn migrate(deps: DepsMut, _env: Env, _msg: MigrateMsg) -> Result { + set_contract_version(deps.storage, CONTRACT_NAME, CONTRACT_VERSION) + .map_err(ContractError::Std)?; + Ok(Response::default().add_attribute("migrate", "successful")) +} diff --git a/contracts/cosmwasm-vm/cw-wasm-light-client/src/lib.rs b/contracts/cosmwasm-vm/cw-wasm-light-client/src/lib.rs new file mode 100644 index 000000000..654f11ee7 --- /dev/null +++ b/contracts/cosmwasm-vm/cw-wasm-light-client/src/lib.rs @@ -0,0 +1,16 @@ +mod context; +pub mod contract; + +pub mod msg; +pub mod query_handler; +pub mod utils; +pub use cw_light_client_common::light_client; + +pub use cw_light_client_common::traits; + +pub use cw_light_client_common::error::ContractError; +extern crate alloc; +extern crate core; +pub type Bytes = Vec; + +pub mod constants; diff --git a/contracts/cosmwasm-vm/cw-wasm-light-client/src/msg.rs b/contracts/cosmwasm-vm/cw-wasm-light-client/src/msg.rs new file mode 100644 index 000000000..0b6703a1c --- /dev/null +++ b/contracts/cosmwasm-vm/cw-wasm-light-client/src/msg.rs @@ -0,0 +1,233 @@ +use cosmwasm_schema::cw_serde; + +use ics07_tendermint_cw::ics23::FakeInner; +use ics08_wasm::{ + client_message::Header as WasmHeader, client_state::ClientState as WasmClientState, + consensus_state::ConsensusState as WasmConsensusState, +}; + +use serde::{Deserializer, Serializer}; + +#[cw_serde] +pub struct HeightRaw { + pub revision_number: u64, + + pub revision_height: u64, +} + +struct Base64; + +impl Base64 { + pub fn serialize(v: &[u8], serializer: S) -> Result { + base64::serialize(v, serializer) + } + + pub fn deserialize<'de, D: Deserializer<'de>>(deserializer: D) -> Result, D::Error> { + base64::deserialize(deserializer) + } +} + +pub mod base64 { + use alloc::{string::String, vec::Vec}; + + use serde::{Deserialize, Deserializer, Serialize, Serializer}; + + pub fn serialize(v: &[u8], serializer: S) -> Result { + let mut buf = String::new(); + base64::encode_config_buf(v, base64::STANDARD, &mut buf); + + String::serialize(&buf, serializer) + } + + pub fn deserialize<'de, D: Deserializer<'de>>(deserializer: D) -> Result, D::Error> { + let base64 = String::deserialize(deserializer)?; + + let mut buf = Vec::new(); + base64::decode_config_buf(base64.as_bytes(), base64::STANDARD, &mut buf) + .map_err(serde::de::Error::custom)?; + + Ok(buf) + } +} + +#[cw_serde] +pub struct GenesisMetadata { + pub key: Vec, + pub value: Vec, +} + +#[cw_serde] +pub struct QueryResponse { + pub status: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub genesis_metadata: Option>, +} + +impl QueryResponse { + pub fn status(status: String) -> Self { + Self { + status, + genesis_metadata: None, + } + } + + pub fn genesis_metadata(genesis_metadata: Option>) -> Self { + Self { + status: "".to_string(), + genesis_metadata, + } + } +} + +#[cw_serde] +pub struct ContractResult { + pub is_valid: bool, + pub error_msg: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub data: Option>, + pub found_misbehaviour: bool, +} +#[allow(dead_code)] +impl ContractResult { + pub fn success() -> Self { + Self { + is_valid: true, + error_msg: "".to_string(), + data: None, + found_misbehaviour: false, + } + } + + pub fn error(msg: String) -> Self { + Self { + is_valid: false, + error_msg: msg, + data: None, + found_misbehaviour: false, + } + } + + pub fn misbehaviour(mut self, found: bool) -> Self { + self.found_misbehaviour = found; + self + } + + pub fn data(mut self, data: Vec) -> Self { + self.data = Some(data); + self + } +} + +#[cw_serde] +pub struct InstantiateMsg {} + +#[cw_serde] +pub enum ExecuteMsg { + VerifyMembership(VerifyMembershipMsgRaw), + VerifyNonMembership(VerifyNonMembershipMsgRaw), + VerifyClientMessage(VerifyClientMessageRaw), + CheckForMisbehaviour(CheckForMisbehaviourMsgRaw), + UpdateStateOnMisbehaviour(UpdateStateOnMisbehaviourMsgRaw), + UpdateState(UpdateStateMsgRaw), + CheckSubstituteAndUpdateState(CheckSubstituteAndUpdateStateMsg), + VerifyUpgradeAndUpdateState(VerifyUpgradeAndUpdateStateMsgRaw), +} + +#[cw_serde] +pub enum QueryMsg { + ClientTypeMsg(ClientTypeMsg), + GetLatestHeightsMsg(GetLatestHeightsMsg), + ExportMetadata(ExportMetadataMsg), + Status(StatusMsg), + GetClientState {}, +} + +#[cw_serde] +pub struct ClientTypeMsg {} + +#[cw_serde] +pub struct GetLatestHeightsMsg {} + +#[cw_serde] +pub struct StatusMsg {} + +#[cw_serde] +pub struct ExportMetadataMsg {} + +#[cw_serde] +pub struct MerklePath { + pub key_path: Vec, +} + +#[cw_serde] +pub struct VerifyMembershipMsgRaw { + #[schemars(with = "String")] + #[serde(with = "Base64", default)] + pub proof: Vec, + pub path: MerklePath, + #[schemars(with = "String")] + #[serde(with = "Base64", default)] + pub value: Vec, + pub height: HeightRaw, + pub delay_block_period: u64, + pub delay_time_period: u64, +} + +#[cw_serde] +pub struct VerifyNonMembershipMsgRaw { + #[schemars(with = "String")] + #[serde(with = "Base64", default)] + pub proof: Vec, + pub path: MerklePath, + pub height: HeightRaw, + pub delay_block_period: u64, + pub delay_time_period: u64, +} + +#[cw_serde] +pub struct WasmMisbehaviour { + #[schemars(with = "String")] + #[serde(with = "Base64", default)] + pub data: Vec, +} + +#[cw_serde] +pub enum ClientMessageRaw { + Header(WasmHeader), + Misbehaviour(WasmMisbehaviour), +} + +#[cw_serde] +pub struct VerifyClientMessageRaw { + pub client_message: ClientMessageRaw, +} + +#[cw_serde] +pub struct CheckForMisbehaviourMsgRaw { + pub client_message: ClientMessageRaw, +} + +#[cw_serde] +pub struct UpdateStateOnMisbehaviourMsgRaw { + pub client_message: ClientMessageRaw, +} + +#[cw_serde] +pub struct UpdateStateMsgRaw { + pub client_message: ClientMessageRaw, +} + +#[cw_serde] +pub struct CheckSubstituteAndUpdateStateMsg {} + +#[cw_serde] +pub struct VerifyUpgradeAndUpdateStateMsgRaw { + pub upgrade_client_state: WasmClientState, + pub upgrade_consensus_state: WasmConsensusState, + #[schemars(with = "String")] + #[serde(with = "Base64", default)] + pub proof_upgrade_client: Vec, + #[schemars(with = "String")] + #[serde(with = "Base64", default)] + pub proof_upgrade_consensus_state: Vec, +} diff --git a/contracts/cosmwasm-vm/cw-wasm-light-client/src/query_handler.rs b/contracts/cosmwasm-vm/cw-wasm-light-client/src/query_handler.rs new file mode 100644 index 000000000..438780465 --- /dev/null +++ b/contracts/cosmwasm-vm/cw-wasm-light-client/src/query_handler.rs @@ -0,0 +1,101 @@ +use cosmwasm_std::{to_binary, Binary, Deps, Order, StdResult}; +use cw_light_client_common::{constants::PROCESSED_HEIGHTS, traits::IQueryHandler, ContractError}; +use ibc::Height; + +use crate::{ + constants::CLIENT_ID, + msg::{GenesisMetadata, QueryResponse}, + utils::{ + decode_client_state, decode_consensus_state, get_client_state_key, get_consensus_state_key, + to_ibc_height, + }, +}; + +pub struct QueryHandler; + +impl QueryHandler { + pub fn processed_time_key(height: &Height, prefix: &mut Vec) -> Vec { + prefix.append(&mut "consensusStates/".to_string().into_bytes()); + prefix.append(&mut format!("{height}").into_bytes()); + prefix.append(&mut "/processedTime".to_string().into_bytes()); + prefix.clone() + } + + pub fn processed_height_key(height: &Height, prefix: &mut Vec) -> Vec { + prefix.append(&mut "consensusStates/".to_string().into_bytes()); + prefix.append(&mut format!("{height}").into_bytes()); + prefix.append(&mut "/processedHeight".to_string().into_bytes()); + prefix.clone() + } + pub fn get_genesis_metadata( + storage: &dyn cosmwasm_std::Storage, + client_id: &str, + ) -> Result, ContractError> { + let heights = PROCESSED_HEIGHTS + .prefix(client_id.to_string()) + .keys(storage, None, None, Order::Ascending) + .collect::>>() + .unwrap(); + let mut gm: Vec = Vec::::new(); + for h in heights { + let processed_height = + Self::get_processed_blocknumber_at_height(storage, client_id, h)?; + let processed_time = Self::get_processed_time_at_height(storage, client_id, h)?; + let ibc_height = to_ibc_height(h); + let processed_height_key = Self::processed_height_key(&ibc_height, &mut Vec::new()); + let processed_time_key = Self::processed_time_key(&ibc_height, &mut Vec::new()); + gm.push(GenesisMetadata { + key: processed_height_key.clone(), + value: processed_height.to_be_bytes().to_vec(), + }); + + gm.push(GenesisMetadata { + key: processed_time_key.clone(), + value: processed_time.to_be_bytes().to_vec(), + }); + } + Ok(gm) + } + + pub fn get_client_status(deps: Deps) -> StdResult { + let client_state = QueryHandler::get_client_state(deps.storage, CLIENT_ID); + if client_state.is_err() { + return to_binary(&QueryResponse::status("Unknown".to_string())); + } + let client_state = client_state.unwrap(); + if client_state.frozen_height > 0 { + return to_binary(&QueryResponse::status("Frozen".to_string())); + } + + to_binary(&QueryResponse::status("Active".to_string())) + } +} +impl IQueryHandler for QueryHandler { + fn get_client_state( + storage: &dyn cosmwasm_std::Storage, + client_id: &str, + ) -> Result< + common::icon::icon::lightclient::v1::ClientState, + cw_light_client_common::ContractError, + > { + let any_bytes = storage + .get(&get_client_state_key()) + .ok_or(ContractError::ClientStateNotFound(client_id.to_string()))?; + decode_client_state(&any_bytes) + } + + fn get_consensus_state( + storage: &dyn cosmwasm_std::Storage, + client_id: &str, + height: u64, + ) -> Result { + let ibc_height = to_ibc_height(height); + let any_bytes = storage.get(&get_consensus_state_key(ibc_height)).ok_or( + ContractError::ConsensusStateNotFound { + height, + client_id: client_id.to_string(), + }, + )?; + decode_consensus_state(&any_bytes) + } +} diff --git a/contracts/cosmwasm-vm/cw-wasm-light-client/src/utils.rs b/contracts/cosmwasm-vm/cw-wasm-light-client/src/utils.rs new file mode 100644 index 000000000..e08845dee --- /dev/null +++ b/contracts/cosmwasm-vm/cw-wasm-light-client/src/utils.rs @@ -0,0 +1,99 @@ +use common::icon::icon::types::v1::SignedHeader; +use common::{ + consensus_state::IConsensusState, + icon::icon::lightclient::v1::{ClientState, ConsensusState}, + traits::AnyTypes, +}; +use cw_common::raw_types::Any; +use cw_light_client_common::ContractError; +use ibc::Height; +use ics07_tendermint_cw::ics23::FakeInner; +use ics08_wasm::client_message::Header as WasmHeader; +use ics08_wasm::client_state::ClientState as WasmClientState; +use prost::Message; +use tendermint_proto::Protobuf; +pub fn get_consensus_state_key(height: Height) -> Vec { + [ + "consensusStates/".to_string().into_bytes(), + format!("{height}").into_bytes(), + ] + .concat() +} + +pub fn get_client_state_key() -> Vec { + "clientState".to_string().into_bytes() +} + +pub fn to_wasm_client_state( + client_state: ClientState, + old_wasm_state: Vec, +) -> Result, ContractError> { + let any = any_from_byte(&old_wasm_state)?; + let mut wasm_client_state = WasmClientState::::decode_vec( + &any.value, + ) + .map_err(|e| ContractError::OtherError { + error: e.to_string(), + })?; + wasm_client_state.data = client_state.to_any().encode_to_vec(); + wasm_client_state.latest_height = to_ibc_height(client_state.latest_height); + let vec1 = wasm_client_state.to_any().encode_to_vec(); + Ok(vec1) +} + +pub fn to_wasm_consensus_state(consensus_state: ConsensusState) -> Vec { + let wasm_consensus_state = ics08_wasm::consensus_state::ConsensusState { + data: consensus_state.to_any().encode_to_vec(), + timestamp: consensus_state.timestamp().nanoseconds(), + inner: Box::new(FakeInner), + }; + wasm_consensus_state.to_any().encode_to_vec() +} + +pub fn decode_client_state(data: &[u8]) -> Result { + let any = Any::decode(data).map_err(ContractError::DecodeError)?; + let wasm_state = + ics08_wasm::client_state::ClientState::::decode_vec( + &any.value, + ) + .map_err(|e| ContractError::OtherError { + error: e.to_string(), + })?; + let any = Any::decode(&*wasm_state.data).map_err(ContractError::DecodeError)?; + let state = ClientState::from_any(any).map_err(ContractError::DecodeError)?; + Ok(state) +} + +pub fn decode_consensus_state(value: &[u8]) -> Result { + let any = Any::decode(&mut &*value).map_err(ContractError::DecodeError)?; + let wasm_consensus_state = + ics08_wasm::consensus_state::ConsensusState::::decode_vec(&any.value).map_err( + |e| ContractError::OtherError { + error: e.to_string(), + }, + )?; + let any = + Any::decode(&mut &wasm_consensus_state.data[..]).map_err(ContractError::DecodeError)?; + let any_consensus_state = ConsensusState::from_any(any).map_err(ContractError::DecodeError)?; + Ok(any_consensus_state) +} + +pub fn to_ibc_height(height: u64) -> Height { + Height::new(1, height) +} + +pub fn any_from_byte(bytes: &[u8]) -> Result { + let any = Any::decode(bytes).map_err(ContractError::DecodeError)?; + Ok(any) +} + +pub fn to_wasm_header(signed_header: &SignedHeader) -> WasmHeader { + let header_any: Any = signed_header.to_any(); + let block_height = signed_header.header.clone().unwrap().main_height; + + WasmHeader:: { + inner: Box::new(FakeInner), + data: header_any.encode_to_vec(), + height: to_ibc_height(block_height), + } +} diff --git a/contracts/cosmwasm-vm/cw-wasm-light-client/tests/setup.rs b/contracts/cosmwasm-vm/cw-wasm-light-client/tests/setup.rs new file mode 100644 index 000000000..5a7c1e976 --- /dev/null +++ b/contracts/cosmwasm-vm/cw-wasm-light-client/tests/setup.rs @@ -0,0 +1,126 @@ +use common::{icon::icon::types::v1::BtpHeader, traits::AnyTypes}; +use cosmwasm_std::Storage; +#[cfg(test)] +use cosmwasm_std::{ + coins, + testing::{ + mock_dependencies, mock_env, mock_info, MockApi, MockQuerier, MockStorage, + MOCK_CONTRACT_ADDR, + }, + Addr, BlockInfo, ContractInfo, Empty, Env, MessageInfo, OwnedDeps, Timestamp, TransactionInfo, +}; + +use cw_wasm_light_client::utils::{ + get_client_state_key, get_consensus_state_key, to_ibc_height, to_wasm_consensus_state, +}; +use ics07_tendermint_cw::ics23::FakeInner; +use prost::Message; + +pub struct MockEnvBuilder { + env: Env, +} + +impl MockEnvBuilder { + pub fn new() -> MockEnvBuilder { + MockEnvBuilder { + env: Env { + block: BlockInfo { + height: 0, + time: Timestamp::from_nanos(0), + chain_id: "".to_string(), + }, + transaction: None, + contract: ContractInfo { + address: Addr::unchecked("input"), + }, + }, + } + } + pub fn add_block(mut self, block: BlockInfo) -> MockEnvBuilder { + self.env.block = block; + self + } + + pub fn add_txn_info(mut self, txn_info: Option) -> MockEnvBuilder { + self.env.transaction = txn_info; + self + } + + pub fn add_contract_info(mut self, contract_info: ContractInfo) -> MockEnvBuilder { + self.env.contract = contract_info; + self + } + + pub fn build(self) -> Env { + Env { + block: self.env.block, + transaction: self.env.transaction, + contract: self.env.contract, + } + } +} + +pub fn create_mock_info(creator: &str, denom: &str, amount: u128) -> MessageInfo { + let funds = coins(amount, denom); + mock_info(creator, &funds) +} + +pub fn deps() -> OwnedDeps { + mock_dependencies() +} + +#[test] +fn test() { + let mock = mock_env(); + + let block_info = BlockInfo { + height: 12_345, + time: Timestamp::from_nanos(1_571_797_419_879_305_533), + chain_id: "cosmos-testnet-14002".to_string(), + }; + + let transaction = Some(TransactionInfo { index: 3 }); + let contract = ContractInfo { + address: Addr::unchecked(MOCK_CONTRACT_ADDR), + }; + + let mock_env: Env = MockEnvBuilder::new() + .add_block(block_info) + .add_txn_info(transaction) + .add_contract_info(contract) + .build(); + + assert_eq!(mock, mock_env) +} + +#[derive(Default)] +pub struct TestContext {} + +impl TestContext { + pub fn init(&self, storage: &mut dyn Storage, header: &BtpHeader) { + let client_state = header.to_client_state(1000000, 0); + let consensus_state = header.to_consensus_state(); + let client_key = get_client_state_key(); + let consensus_key = get_consensus_state_key(to_ibc_height(client_state.latest_height)); + let client_state_any = client_state.to_any(); + + let wasm_client = ics08_wasm::client_state::ClientState:: { + data: client_state_any.encode_to_vec(), + code_id: vec![1], + latest_height: to_ibc_height(client_state.latest_height), + inner: Box::new(FakeInner), + _phantom: std::marker::PhantomData, + }; + let wasm_any_bytes = wasm_client.to_any().encode_to_vec(); + + storage.set(&client_key, &wasm_any_bytes); + + let wasm_consensus = to_wasm_consensus_state(consensus_state); + + storage.set(&consensus_key, &wasm_consensus) + } + + pub fn for_instantiate() -> TestContext { + TestContext::default() + } +} diff --git a/contracts/cosmwasm-vm/cw-wasm-light-client/tests/test_execute.rs b/contracts/cosmwasm-vm/cw-wasm-light-client/tests/test_execute.rs new file mode 100644 index 000000000..29451ef94 --- /dev/null +++ b/contracts/cosmwasm-vm/cw-wasm-light-client/tests/test_execute.rs @@ -0,0 +1,49 @@ +use crate::setup::TestContext; +use common::icon::icon::types::v1::SignedHeader; +use cosmwasm_std::{ + testing::{mock_dependencies, mock_env, mock_info}, + Coin, +}; + +use cw_wasm_light_client::{ + constants::CLIENT_ID, + contract::execute, + msg::{ExecuteMsg, UpdateStateMsgRaw}, + query_handler::QueryHandler, +}; +use cw_wasm_light_client::{traits::IQueryHandler, utils::to_wasm_header}; + +use test_utils::{get_test_headers, get_test_signed_headers}; +mod setup; + +#[test] +pub fn test_update_success() { + let mut deps = mock_dependencies(); + let _env = mock_env(); + let info = mock_info("sender", &[Coin::new(100, "test")]); + let header = &get_test_headers()[0]; + let context = TestContext::for_instantiate(); + context.init(deps.as_mut().storage, header); + + let signed_header: &SignedHeader = &get_test_signed_headers()[1].clone(); + let block_height = signed_header.header.clone().unwrap().main_height; + let wasm_header = to_wasm_header(signed_header); + + let msg = ExecuteMsg::UpdateState(UpdateStateMsgRaw { + client_message: cw_wasm_light_client::msg::ClientMessageRaw::Header(wasm_header), + }); + let _result = execute(deps.as_mut(), mock_env(), info, msg).unwrap(); + + let updated_client_state = + QueryHandler::get_client_state(deps.as_ref().storage, CLIENT_ID).unwrap(); + + assert_eq!(updated_client_state.latest_height, block_height); + + let consensus_state = + QueryHandler::get_consensus_state(deps.as_ref().storage, CLIENT_ID, block_height).unwrap(); + + assert_eq!( + consensus_state.message_root, + signed_header.header.clone().unwrap().message_root + ) +} diff --git a/contracts/cosmwasm-vm/cw-wasm-light-client/tests/test_instantiate.rs b/contracts/cosmwasm-vm/cw-wasm-light-client/tests/test_instantiate.rs new file mode 100644 index 000000000..8c2db05c2 --- /dev/null +++ b/contracts/cosmwasm-vm/cw-wasm-light-client/tests/test_instantiate.rs @@ -0,0 +1,38 @@ +use cosmwasm_std::{ + testing::{mock_dependencies, mock_env, mock_info}, + Coin, +}; +use cw_wasm_light_client::contract::instantiate; +use cw_wasm_light_client::msg::InstantiateMsg; +use test_utils::get_test_headers; + +use crate::setup::TestContext; +mod setup; + +#[test] +pub fn instantiate_success() { + let mut deps = mock_dependencies(); + let env = mock_env(); + let info = mock_info("sender", &[Coin::new(100, "test")]); + let header = &get_test_headers()[0]; + let context = TestContext::for_instantiate(); + context.init(deps.as_mut().storage, header); + let msg = InstantiateMsg {}; + let result = instantiate(deps.as_mut(), env, info, msg); + println!("{result:?}"); + assert!(result.is_ok()) +} + +#[test] +#[should_panic(expected = " ClientStateNotFound(\"08-iconwasm-0\")")] +pub fn instantiate_fails_on_uninitialized_storage() { + let mut deps = mock_dependencies(); + let env = mock_env(); + let info = mock_info("sender", &[Coin::new(100, "test")]); + let _header = &get_test_headers()[0]; + let _context = TestContext::for_instantiate(); + + let msg = InstantiateMsg {}; + let result = instantiate(deps.as_mut(), env, info, msg); + result.unwrap(); +} diff --git a/contracts/cosmwasm-vm/cw-xcall-ibc-connection/Cargo.toml b/contracts/cosmwasm-vm/cw-xcall-ibc-connection/Cargo.toml index f0ce8c480..0d8999b46 100644 --- a/contracts/cosmwasm-vm/cw-xcall-ibc-connection/Cargo.toml +++ b/contracts/cosmwasm-vm/cw-xcall-ibc-connection/Cargo.toml @@ -32,14 +32,14 @@ optimize = """docker run --rm -v "$(pwd)":/code \ [dependencies] cosmwasm-schema = {workspace=true} cosmwasm-std = {workspace=true} -cosmwasm-storage = {workspace=true} +#cosmwasm-storage = {workspace=true} cw-storage-plus = {workspace=true} cw2 = {workspace=true} schemars = {workspace=true} serde = { workspace=true} thiserror = { workspace=true} -common = { path="../../../libraries/rust/common" } -cw-common = { path="../cw-common" } +common = { workspace=true } +cw-common = { workspace=true } hex={workspace=true} debug_print={workspace=true} cw-xcall-lib={workspace=true} diff --git a/contracts/cosmwasm-vm/cw-xcall-ibc-connection/src/assertion.rs b/contracts/cosmwasm-vm/cw-xcall-ibc-connection/src/assertion.rs index 809702ba0..646134e47 100644 --- a/contracts/cosmwasm-vm/cw-xcall-ibc-connection/src/assertion.rs +++ b/contracts/cosmwasm-vm/cw-xcall-ibc-connection/src/assertion.rs @@ -145,3 +145,104 @@ impl<'a> CwIbcConnection<'a> { Ok(()) } } + +#[cfg(test)] +mod test { + use crate::state::CwIbcConnection; + use cosmwasm_std::{ + testing::{mock_dependencies, mock_info}, + Addr, + }; + + #[test] + fn test_ensure_length() { + let contract = CwIbcConnection::new(); + + let res = contract.ensure_data_length(20 as usize); + assert!(res.is_ok()) + } + + #[test] + #[should_panic(expected = "MaxDataSizeExceeded")] + fn test_ensure_length_fail() { + let contract = CwIbcConnection::new(); + + contract.ensure_data_length(u64::MAX as usize).unwrap(); + } + + #[test] + fn test_ensure_rollback_length() { + let contract = CwIbcConnection::new(); + + let rollback_size: Vec = Vec::new(); + let res = contract.ensure_rollback_length(&rollback_size); + assert!(res.is_ok()) + } + + #[test] + #[should_panic(expected = "MaxRollbackSizeExceeded")] + fn test_ensure_rollback_length_fail() { + let contract = CwIbcConnection::new(); + + let rollback_size: Vec = vec![0; 2048]; + contract.ensure_rollback_length(&rollback_size).unwrap() + } + + #[test] + fn test_ensure_owner() { + let mut deps = mock_dependencies(); + let contract = CwIbcConnection::new(); + let info = mock_info("owner", &[]); + + contract + .add_owner(deps.as_mut().storage, Addr::unchecked("owner")) + .unwrap(); + + let res = contract.ensure_owner(deps.as_ref().storage, &info).unwrap(); + assert_eq!(res, ()) + } + + #[test] + #[should_panic(expected = "Unauthorized")] + fn test_ensure_owner_fail() { + let mut deps = mock_dependencies(); + let contract = CwIbcConnection::new(); + let info = mock_info("owner", &[]); + + contract + .add_owner(deps.as_mut().storage, Addr::unchecked("test_owner")) + .unwrap(); + + contract.ensure_owner(deps.as_ref().storage, &info).unwrap(); + } + + #[test] + #[should_panic(expected = "OnlyIbcHandler")] + fn test_ensure_xcall_handler_fail() { + let mut deps = mock_dependencies(); + let contract = CwIbcConnection::new(); + + contract + .set_xcall_host(deps.as_mut().storage, Addr::unchecked("xcall_host")) + .unwrap(); + + contract + .ensure_xcall_handler(deps.as_ref().storage, Addr::unchecked("ibc_host")) + .unwrap() + } + + #[test] + #[should_panic(expected = "OnlyIbcHandler")] + fn test_ensure_ibc_handler_fail() { + let mut deps = mock_dependencies(); + let contract = CwIbcConnection::new(); + + contract + .set_ibc_host(deps.as_mut().storage, Addr::unchecked("ibc_host")) + .unwrap(); + + contract + .ensure_ibc_handler(deps.as_ref().storage, Addr::unchecked("xcall_host")) + .unwrap() + } +} diff --git a/contracts/cosmwasm-vm/cw-xcall-ibc-connection/src/contract.rs b/contracts/cosmwasm-vm/cw-xcall-ibc-connection/src/contract.rs index cbabc216c..8a0524332 100644 --- a/contracts/cosmwasm-vm/cw-xcall-ibc-connection/src/contract.rs +++ b/contracts/cosmwasm-vm/cw-xcall-ibc-connection/src/contract.rs @@ -445,14 +445,14 @@ impl<'a> CwIbcConnection<'a> { deps: DepsMut, msg: CwChannelOpenMsg, ) -> Result { - cw_println!(deps, "[IbcConnection]: Called On channel open"); + cw_println!(deps.api, "[IbcConnection]: Called On channel open"); println!("{msg:?}"); let channel = msg.channel(); let ibc_endpoint = channel.endpoint.clone(); check_order(&channel.order)?; - cw_println!(deps, "[IbcConnection]: check order pass"); + cw_println!(deps.api, "[IbcConnection]: check order pass"); self.setup_channel(deps, channel.clone())?; @@ -483,16 +483,16 @@ impl<'a> CwIbcConnection<'a> { msg: CwChannelConnectMsg, ) -> Result { let channel = msg.channel(); - cw_println!(deps, "[IBCConnection]: channel connect called"); + cw_println!(deps.api, "[IBCConnection]: channel connect called"); check_order(&channel.order)?; - cw_println!(deps, "[IBCConnection]: check order pass"); + cw_println!(deps.api, "[IBCConnection]: check order pass"); if let Some(counter_version) = msg.counterparty_version() { check_version(counter_version)?; } - cw_println!(deps, "[IBCConnection]: check version passed"); + cw_println!(deps.api, "[IBCConnection]: check version passed"); self.setup_channel(deps, channel.clone())?; Ok(Response::new() @@ -668,7 +668,7 @@ impl<'a> CwIbcConnection<'a> { let our_port = self.get_port(deps.storage)?; cw_println!( - deps, + deps.api, "[IBCConnection]: Check if ports match : {:?} vs {:?}", our_port, source.port_id @@ -681,7 +681,11 @@ impl<'a> CwIbcConnection<'a> { self.get_counterparty_nid(deps.storage, &channel.connection_id, &destination.port_id)?; let connection_config = self.get_connection_config(deps.storage, &channel.connection_id)?; let ibc_config = IbcConfig::new(source, destination); - cw_println!(deps, "[IBCConnection]: save ibc config is {:?}", ibc_config); + cw_println!( + deps.api, + "[IBCConnection]: save ibc config is {:?}", + ibc_config + ); self.store_ibc_config(deps.storage, &nid, &ibc_config)?; @@ -695,7 +699,7 @@ impl<'a> CwIbcConnection<'a> { }, )?; - cw_println!(deps, "[IBCConnection]: Channel Config Stored"); + cw_println!(deps.api, "[IBCConnection]: Channel Config Stored"); Ok(()) } diff --git a/contracts/cosmwasm-vm/cw-xcall-ibc-connection/src/fee.rs b/contracts/cosmwasm-vm/cw-xcall-ibc-connection/src/fee.rs index c61dc0786..d7cf9d6f8 100644 --- a/contracts/cosmwasm-vm/cw-xcall-ibc-connection/src/fee.rs +++ b/contracts/cosmwasm-vm/cw-xcall-ibc-connection/src/fee.rs @@ -54,3 +54,62 @@ impl<'a> CwIbcConnection<'a> { self.get_unclaimed_packet_fee(store, &nid, &address) } } + +#[cfg(test)] +mod test { + use cosmwasm_std::testing::{mock_dependencies, mock_info}; + use cosmwasm_std::Response; + use cw_xcall_lib::network_address::NetId; + + use super::CwIbcConnection; + + #[test] + #[should_panic(expected = "NoFeesAccrued")] + fn test_claim_fees_on_zero_unclaimed_fee() { + let mut deps = mock_dependencies(); + let contract = CwIbcConnection::new(); + let info = mock_info("relayer", &[]); + + let nid = NetId::from("default".to_string()); + + contract + .claim_fees(deps.as_mut(), info, nid, "relayer".to_string()) + .unwrap(); + } + + #[test] + fn test_set_fee() { + let mut deps = mock_dependencies(); + let contract = CwIbcConnection::new(); + + let nid = NetId::from("default".to_string()); + + let res = contract + .set_fee(deps.as_mut().storage, nid, 1_000, 1_000) + .unwrap(); + + assert_eq!(res, Response::new()) + } + + #[test] + fn test_reset_unclaimed_ack_fees() { + let mut deps = mock_dependencies(); + let contract = CwIbcConnection::new(); + + let nid = NetId::from("default".to_string()); + + contract + .add_unclaimed_ack_fees(deps.as_mut().storage, &nid, 1, 10) + .unwrap(); + + let ack_fee = contract.get_unclaimed_ack_fee(deps.as_ref().storage, nid.as_str(), 1); + assert_eq!(ack_fee, 10); + + contract + .reset_unclaimed_ack_fees(deps.as_mut().storage, nid.as_str(), 1) + .unwrap(); + + let ack_fee = contract.get_unclaimed_ack_fee(deps.as_ref().storage, nid.as_str(), 1); + assert_eq!(ack_fee, 0) + } +} diff --git a/contracts/cosmwasm-vm/cw-xcall-ibc-connection/src/ibc.rs b/contracts/cosmwasm-vm/cw-xcall-ibc-connection/src/ibc.rs index 3c3434557..e5da1f74d 100644 --- a/contracts/cosmwasm-vm/cw-xcall-ibc-connection/src/ibc.rs +++ b/contracts/cosmwasm-vm/cw-xcall-ibc-connection/src/ibc.rs @@ -129,7 +129,7 @@ pub fn ibc_packet_receive( ) -> Result { let call_service = CwIbcConnection::default(); let _channel = msg.packet.dest.channel_id.clone(); - cw_println!(deps, "[IBCConnection]: Packet Received"); + cw_println!(deps.api, "[IBCConnection]: Packet Received"); let result = call_service.do_packet_receive(deps, msg.packet, msg.relayer); match result { diff --git a/contracts/cosmwasm-vm/cw-xcall-ibc-connection/src/ibc_host.rs b/contracts/cosmwasm-vm/cw-xcall-ibc-connection/src/ibc_host.rs index a398bb44b..a156f293c 100644 --- a/contracts/cosmwasm-vm/cw-xcall-ibc-connection/src/ibc_host.rs +++ b/contracts/cosmwasm-vm/cw-xcall-ibc-connection/src/ibc_host.rs @@ -62,7 +62,10 @@ impl<'a> CwIbcConnection<'a> { gas_limit: None, reply_on: cosmwasm_std::ReplyOn::Always, }; - cw_println!(deps, "{LOG_PREFIX} Packet Forwarded To IBCHost {ibc_host} "); + cw_println!( + deps.api, + "{LOG_PREFIX} Packet Forwarded To IBCHost {ibc_host} " + ); Ok(submessage) } @@ -150,7 +153,7 @@ mod tests { let packet = RawPacket::default(); let res = connection.call_host_send_message(deps.as_mut(), packet.clone()); - println!("{:?}", res); + println!("{res:?}"); assert!(res.is_ok()); let expected_ibc_host = connection diff --git a/contracts/cosmwasm-vm/cw-xcall-ibc-connection/src/receive_packet.rs b/contracts/cosmwasm-vm/cw-xcall-ibc-connection/src/receive_packet.rs index 5841606ca..4782a7024 100644 --- a/contracts/cosmwasm-vm/cw-xcall-ibc-connection/src/receive_packet.rs +++ b/contracts/cosmwasm-vm/cw-xcall-ibc-connection/src/receive_packet.rs @@ -52,7 +52,7 @@ impl<'a> CwIbcConnection<'a> { self.store_incoming_packet(deps.storage, &channel, sn, packet)?; } } - cw_println!(deps, "[IBCConnection]: forwarding to xcall"); + cw_println!(deps.api, "[IBCConnection]: forwarding to xcall"); let data = n_message.data; let xcall_submessage = self.call_xcall_handle_message(deps.storage, &nid, data)?; diff --git a/contracts/cosmwasm-vm/cw-xcall-ibc-connection/tests/setup.rs b/contracts/cosmwasm-vm/cw-xcall-ibc-connection/tests/setup.rs index fe8ca92fa..75c6c402c 100644 --- a/contracts/cosmwasm-vm/cw-xcall-ibc-connection/tests/setup.rs +++ b/contracts/cosmwasm-vm/cw-xcall-ibc-connection/tests/setup.rs @@ -1,10 +1,23 @@ +use cw_xcall_lib::network_address::NetId; +use std::str::FromStr; + use cosmwasm_std::{ coins, testing::{ mock_dependencies, mock_env, mock_info, MockApi, MockQuerier, MockStorage, MOCK_CONTRACT_ADDR, }, - Addr, BlockInfo, ContractInfo, Empty, Env, MessageInfo, OwnedDeps, Timestamp, TransactionInfo, + to_binary, Addr, BlockInfo, ContractInfo, DepsMut, Empty, Env, Event, IbcChannel, IbcEndpoint, + IbcPacket, IbcTimeout, IbcTimeoutBlock, MessageInfo, OwnedDeps, Storage, SubMsgResponse, + Timestamp, TransactionInfo, +}; + +use cw_xcall_ibc_connection::{ + state::{CwIbcConnection, IbcConfig}, + types::{ + channel_config::ChannelConfig, config::Config, connection_config::ConnectionConfig, + network_fees::NetworkFees, + }, }; pub struct MockEnvBuilder { @@ -83,3 +96,214 @@ fn test() { assert_ne!(mock, mock_env_builder) } + +pub fn get_dummy_sub_msg_res() -> SubMsgResponse { + SubMsgResponse { + events: vec![Event::new("empty")], + data: Some(to_binary("data").unwrap()), + } +} + +pub fn get_dummy_endpoints() -> (IbcEndpoint, IbcEndpoint) { + let endpoint = IbcEndpoint { + port_id: "port_src".to_owned(), + channel_id: "channel_src".to_owned(), + }; + + let counterparty_endpoint = IbcEndpoint { + port_id: "port_dst".to_owned(), + channel_id: "channel_dst".to_owned(), + }; + + (endpoint, counterparty_endpoint) +} + +pub fn get_dummy_channel() -> IbcChannel { + let (endpoint, counterparty_endpoint) = get_dummy_endpoints(); + + IbcChannel::new( + endpoint, + counterparty_endpoint, + cosmwasm_std::IbcOrder::Unordered, + "ics20-1".to_owned(), + "connection_0".to_owned(), + ) +} + +pub fn get_dummy_channel_config() -> ChannelConfig { + ChannelConfig { + client_id: "default_0".to_owned(), + timeout_height: 100, + counterparty_nid: NetId::from_str("nid").unwrap(), + } +} + +pub fn get_dummy_connection_config() -> ConnectionConfig { + ConnectionConfig { + client_id: "default_0".to_owned(), + timeout_height: 100, + } +} + +pub fn get_dummy_ibc_config() -> IbcConfig { + let (src, dst) = get_dummy_endpoints(); + IbcConfig::new(src, dst) +} + +pub fn get_dummy_network_fees() -> NetworkFees { + NetworkFees { + ack_fee: 0, + send_packet_fee: 0, + } +} + +pub fn get_dummy_ibc_packet() -> IbcPacket { + let (src, dst) = get_dummy_endpoints(); + let timeout = IbcTimeout::with_block(IbcTimeoutBlock { + revision: 0, + height: 0, + }); + IbcPacket::new(to_binary(&vec![0]).unwrap(), src, dst, 0, timeout) +} + +pub struct TestContext { + pub network_id: NetId, + pub client_id: String, + pub connection_id: String, + pub info: MessageInfo, + pub channel: IbcChannel, + pub env: Env, + pub packet: Option, +} + +impl TestContext { + pub fn default() -> Self { + Self { + network_id: NetId::from_str("nid").unwrap(), + client_id: "default_0".to_owned(), + connection_id: "connection_0".to_owned(), + info: mock_info("owner", &[]), + channel: get_dummy_channel(), + env: mock_env(), + packet: None, + } + } + + pub fn for_packet_ack(packet: &IbcPacket) -> Self { + let mut ctx = TestContext::default(); + ctx.packet = Some(packet.clone()); + + ctx + } + + pub fn for_packet_timeout(packet: &IbcPacket) -> Self { + let mut ctx = TestContext::default(); + ctx.packet = Some(packet.clone()); + + ctx + } + + pub fn init_context(&self, storage: &mut dyn Storage, contract: &CwIbcConnection) { + self.add_owner(storage, contract); + self.update_admin(storage, contract); + self.store_ibc_host(storage, contract); + self.store_xcall_host(storage, contract); + self.store_config(storage, contract); + self.store_connection_config(storage, contract); + self.store_channel_config(storage, contract); + self.store_network_fees(storage, contract); + self.store_ibc_config(storage, contract); + } + + pub fn init_channel_open(&self, deps: DepsMut, contract: &CwIbcConnection) { + self.init_context(deps.storage, &contract); + + self.store_counterparty_nid(deps.storage, contract); + self.configure_connection(deps, &contract); + } + + pub fn init_channel_connect(&self, deps: DepsMut, contract: &CwIbcConnection) { + self.init_context(deps.storage, &contract); + + self.store_counterparty_nid(deps.storage, contract); + self.configure_connection(deps, &contract); + } + + pub fn add_owner(&self, storage: &mut dyn Storage, contract: &CwIbcConnection) { + let _res = contract + .add_owner(storage, self.info.sender.clone()) + .unwrap(); + } + + pub fn update_admin(&self, storage: &mut dyn Storage, contract: &CwIbcConnection) { + let _res = contract + .update_admin(storage, self.info.sender.clone()) + .unwrap(); + } + + pub fn store_ibc_host(&self, storage: &mut dyn Storage, contract: &CwIbcConnection) { + contract + .set_ibc_host(storage, Addr::unchecked("ibc_host")) + .unwrap() + } + + pub fn store_xcall_host(&self, storage: &mut dyn Storage, contract: &CwIbcConnection) { + contract + .set_xcall_host(storage, Addr::unchecked("xcall_host")) + .unwrap() + } + + pub fn store_config(&self, storage: &mut dyn Storage, contract: &CwIbcConnection) { + let config = Config { + port_id: "port_src".to_owned(), + denom: "arch".to_owned(), + }; + contract.store_config(storage, &config).unwrap() + } + + pub fn store_channel_config(&self, storage: &mut dyn Storage, contract: &CwIbcConnection) { + contract + .store_channel_config(storage, "channel_src", &get_dummy_channel_config()) + .unwrap() + } + + pub fn store_connection_config(&self, storage: &mut dyn Storage, contract: &CwIbcConnection) { + contract + .store_connection_config(storage, &self.connection_id, &get_dummy_connection_config()) + .unwrap() + } + + pub fn store_ibc_config(&self, storage: &mut dyn Storage, contract: &CwIbcConnection) { + let ibc_config = get_dummy_ibc_config(); + contract + .store_ibc_config(storage, &self.network_id, &ibc_config) + .unwrap(); + } + + pub fn store_network_fees(&self, storage: &mut dyn Storage, contract: &CwIbcConnection) { + contract + .store_network_fees(storage, self.network_id.clone(), &get_dummy_network_fees()) + .unwrap() + } + + pub fn store_counterparty_nid(&self, storage: &mut dyn Storage, contract: &CwIbcConnection) { + contract + .store_counterparty_nid(storage, &self.connection_id, "port_dst", &self.network_id) + .unwrap() + } + + pub fn configure_connection(&self, deps: DepsMut, contract: &CwIbcConnection) { + let config = get_dummy_connection_config(); + + contract + .configure_connection( + deps, + self.connection_id.clone(), + "port_dst".to_string(), + self.network_id.clone(), + config.client_id, + config.timeout_height, + ) + .unwrap() + } +} diff --git a/contracts/cosmwasm-vm/cw-xcall-ibc-connection/tests/test_admin.rs b/contracts/cosmwasm-vm/cw-xcall-ibc-connection/tests/test_admin.rs index 752b429e6..6d5264d55 100644 --- a/contracts/cosmwasm-vm/cw-xcall-ibc-connection/tests/test_admin.rs +++ b/contracts/cosmwasm-vm/cw-xcall-ibc-connection/tests/test_admin.rs @@ -9,69 +9,38 @@ use setup::*; #[test] #[should_panic(expected = "OnlyAdmin")] fn update_admin_unauthorzied() { - let mut mock_deps = deps(); - - let mock_info = create_mock_info(&alice().to_string(), "umlg", 2000); - + let ctx = TestContext::default(); + let mut deps = deps(); let contract = CwIbcConnection::default(); - contract - .add_owner(mock_deps.as_mut().storage, mock_info.sender) - .unwrap(); - - contract - .update_admin( - mock_deps.as_mut().storage, - Addr::unchecked(Addr::unchecked(admin_one().to_string())), - ) - .unwrap(); - - let result = contract.query_admin(mock_deps.as_ref().storage).unwrap(); + ctx.init_context(deps.as_mut().storage, &contract); - assert_eq!(result, Addr::unchecked(admin_one().to_string())); + let result = contract.query_admin(deps.as_ref().storage).unwrap(); + assert_eq!(result, ctx.info.sender); - let mock_info = create_mock_info(&bob().to_string(), "umlg", 2000); + let info = create_mock_info(&bob().to_string(), "umlg", 2000); let execute_msg = ExecuteMsg::SetAdmin { address: admin_one().to_string(), }; - execute(mock_deps.as_mut(), mock_env(), mock_info, execute_msg).unwrap(); + execute(deps.as_mut(), mock_env(), info, execute_msg).unwrap(); } #[test] fn update_admin() { - let mut mock_deps = deps(); - - let mock_info = create_mock_info(&admin_one().to_string(), "umlg", 2000); - + let ctx = TestContext::default(); + let mut deps = deps(); let contract = CwIbcConnection::default(); - contract - .add_owner(mock_deps.as_mut().storage, mock_info.sender) - .unwrap(); - - contract - .update_admin( - mock_deps.as_mut().storage, - Addr::unchecked(admin_one().to_string()), - ) - .unwrap(); - - let result = contract.query_admin(mock_deps.as_ref().storage).unwrap(); - - assert_eq!(result, Addr::unchecked(admin_one().to_string())); - - let mock_info = create_mock_info(&admin_one().to_string(), "umlg", 2000); + ctx.init_context(deps.as_mut().storage, &contract); let execute_msg = ExecuteMsg::SetAdmin { address: admin_two().to_string(), }; + execute(deps.as_mut(), mock_env(), ctx.info, execute_msg).unwrap(); - execute(mock_deps.as_mut(), mock_env(), mock_info, execute_msg).unwrap(); - - let result = contract.query_admin(mock_deps.as_ref().storage).unwrap(); - + let result = contract.query_admin(deps.as_ref().storage).unwrap(); assert_eq!(result, admin_two().to_string()); } @@ -91,22 +60,17 @@ fn query_admin() { #[test] #[should_panic(expected = "InvalidAddress { address: \"*************\"")] fn add_invalid_char_as_admin() { - let mut mock_deps = deps(); - - let mock_info = create_mock_info(&alice().to_string(), "umlg", 2000); - let mock_env = mock_env(); - + let ctx = TestContext::default(); + let mut deps = deps(); let mut contract = CwIbcConnection::default(); - contract - .update_admin(mock_deps.as_mut().storage, mock_info.clone().sender) - .unwrap(); + ctx.init_context(deps.as_mut().storage, &contract); contract .execute( - mock_deps.as_mut(), - mock_env, - mock_info, + deps.as_mut(), + ctx.env, + ctx.info, cw_common::xcall_connection_msg::ExecuteMsg::SetAdmin { address: "*************".into(), }, @@ -119,22 +83,17 @@ fn add_invalid_char_as_admin() { expected = "Std(GenericErr { msg: \"Invalid input: human address too short for this mock implementation (must be >= 3).\" })" )] fn validate_address_add_admin_size_lessthan_3() { - let mut mock_deps = deps(); - - let mock_info = create_mock_info(&alice().to_string(), "umlg", 2000); - let mock_env = mock_env(); - + let ctx = TestContext::default(); + let mut deps = deps(); let mut contract = CwIbcConnection::default(); - contract - .update_admin(mock_deps.as_mut().storage, mock_info.clone().sender) - .unwrap(); + ctx.init_context(deps.as_mut().storage, &contract); contract .execute( - mock_deps.as_mut(), - mock_env, - mock_info, + deps.as_mut(), + ctx.env, + ctx.info, cw_common::xcall_connection_msg::ExecuteMsg::SetAdmin { address: "sm".into(), }, @@ -147,22 +106,17 @@ fn validate_address_add_admin_size_lessthan_3() { expected = "Std(GenericErr { msg: \"Invalid input: human address too long for this mock implementation (must be <= 90).\" })" )] fn validate_address_add_admin_size_more_than_45() { - let mut mock_deps = deps(); - - let mock_info = create_mock_info(&alice().to_string(), "umlg", 2000); - let mock_env = mock_env(); - + let ctx = TestContext::default(); + let mut deps = deps(); let mut contract = CwIbcConnection::default(); - contract - .update_admin(mock_deps.as_mut().storage, mock_info.clone().sender) - .unwrap(); + ctx.init_context(deps.as_mut().storage, &contract); contract .execute( - mock_deps.as_mut(), - mock_env, - mock_info, + deps.as_mut(), + ctx.env, + ctx.info, cw_common::xcall_connection_msg::ExecuteMsg::SetAdmin { address: "eddiuo6lbp05golmz3rb5n7hbi4c5hhyh0rb1w6cslyjt5mhwd0chn3x254lyorpx4dzvrvsc9h2em44be2rj193dwe".into(), }, @@ -173,30 +127,17 @@ fn validate_address_add_admin_size_more_than_45() { #[test] #[should_panic(expected = "InvalidAddress { address: \"new_addmin!@234\" }")] fn update_admin_fails() { - let mut mock_deps = deps(); - - let mock_info = create_mock_info(&admin_one().to_string(), "umlg", 2000); - + let ctx = TestContext::default(); + let mut deps = deps(); let contract = CwIbcConnection::default(); - contract - .update_admin( - mock_deps.as_mut().storage, - Addr::unchecked(admin_one().to_string()), - ) - .unwrap(); - - let result = contract.query_admin(mock_deps.as_ref().storage).unwrap(); - - assert_eq!(result, Addr::unchecked(admin_one().to_string())); + ctx.init_context(deps.as_mut().storage, &contract); let execute_msg = ExecuteMsg::SetAdmin { address: "new_addmin!@234".into(), }; + execute(deps.as_mut(), mock_env(), ctx.info, execute_msg).unwrap(); - execute(mock_deps.as_mut(), mock_env(), mock_info, execute_msg).unwrap(); - - let result = contract.query_admin(mock_deps.as_ref().storage).unwrap(); - + let result = contract.query_admin(deps.as_ref().storage).unwrap(); assert_eq!(result, admin_two().to_string()); } diff --git a/contracts/cosmwasm-vm/cw-xcall-ibc-connection/tests/test_call_service.rs b/contracts/cosmwasm-vm/cw-xcall-ibc-connection/tests/test_call_service.rs index 2a72ef4ed..fe520ccb1 100644 --- a/contracts/cosmwasm-vm/cw-xcall-ibc-connection/tests/test_call_service.rs +++ b/contracts/cosmwasm-vm/cw-xcall-ibc-connection/tests/test_call_service.rs @@ -2,14 +2,19 @@ mod account; mod setup; use cosmwasm_std::{ testing::{mock_env, MOCK_CONTRACT_ADDR}, - Addr, + Addr, Reply, SubMsgResult, }; -use cw_xcall_ibc_connection::{instantiate, msg::InstantiateMsg, state::CwIbcConnection}; +use cw_xcall_ibc_connection::{ + instantiate, migrate, + msg::InstantiateMsg, + reply, + state::{CwIbcConnection, XCALL_HANDLE_ERROR_REPLY_ID}, + MigrateMsg, +}; use setup::*; #[test] - fn proper_instantiate() { let mut mock_deps = deps(); let mock_info = create_mock_info(MOCK_CONTRACT_ADDR, "umlg", 2000); @@ -35,3 +40,27 @@ fn proper_instantiate() { assert_eq!(MOCK_CONTRACT_ADDR, owner) } + +#[test] +fn test_reply() { + let ctx = TestContext::default(); + let mut deps = deps(); + + let sub_msg_res = get_dummy_sub_msg_res(); + let msg = Reply { + id: XCALL_HANDLE_ERROR_REPLY_ID, + result: SubMsgResult::Ok(sub_msg_res), + }; + + let res = reply(deps.as_mut(), ctx.env, msg); + assert!(res.is_ok()) +} + +#[test] +fn test_migrate() { + let ctx = TestContext::default(); + let mut deps = deps(); + + let res = migrate(deps.as_mut(), ctx.env, MigrateMsg {}).unwrap(); + assert_eq!(res.attributes[0].value, "successful") +} diff --git a/contracts/cosmwasm-vm/cw-xcall-ibc-connection/tests/test_ibc.rs b/contracts/cosmwasm-vm/cw-xcall-ibc-connection/tests/test_ibc.rs new file mode 100644 index 000000000..748e4101f --- /dev/null +++ b/contracts/cosmwasm-vm/cw-xcall-ibc-connection/tests/test_ibc.rs @@ -0,0 +1,84 @@ +pub mod setup; + +use cosmwasm_std::{ + to_binary, Addr, Binary, Ibc3ChannelOpenResponse, IbcAcknowledgement, IbcChannelCloseMsg, + IbcChannelConnectMsg, IbcChannelOpenMsg, IbcPacketAckMsg, +}; + +use cw_common::types::Ack; +use cw_xcall_ibc_connection::ibc::*; +use cw_xcall_ibc_connection::state::CwIbcConnection; + +use setup::*; + +#[test] +fn test_ibc_channel_open() { + let ctx = TestContext::default(); + let mut deps = deps(); + let contract = CwIbcConnection::default(); + + ctx.init_channel_open(deps.as_mut(), &contract); + + let msg = IbcChannelOpenMsg::OpenInit { + channel: ctx.channel, + }; + let res = ibc_channel_open(deps.as_mut(), ctx.env, msg).unwrap(); + let expected_res = Some(Ibc3ChannelOpenResponse { + version: IBC_VERSION.to_string(), + }); + + assert_eq!(res, expected_res); +} + +#[test] +fn test_ibc_channel_connect() { + let ctx = TestContext::default(); + let mut deps = deps(); + let contract = CwIbcConnection::default(); + + ctx.init_channel_connect(deps.as_mut(), &contract); + + let msg = IbcChannelConnectMsg::OpenAck { + channel: ctx.channel, + counterparty_version: IBC_VERSION.to_string(), + }; + let res = ibc_channel_connect(deps.as_mut(), ctx.env, msg).unwrap(); + assert_eq!(res.attributes[0].value, "on_channel_connect"); +} + +#[test] +fn test_channel_close_confirm() { + let ctx = TestContext::default(); + let mut deps = deps(); + let contract = CwIbcConnection::default(); + + ctx.init_context(deps.as_mut().storage, &contract); + + let msg = IbcChannelCloseMsg::CloseConfirm { + channel: ctx.channel, + }; + let res = ibc_channel_close(deps.as_mut(), ctx.env, msg).unwrap(); + assert_eq!(res.attributes[0].value, "ibc_channel_close") +} + +#[test] +fn test_ibc_packet_ack() { + let packet = get_dummy_ibc_packet(); + let ctx = TestContext::for_packet_ack(&packet); + + let mut deps = deps(); + let contract = CwIbcConnection::default(); + + ctx.init_context(deps.as_mut().storage, &contract); + + let ack = IbcAcknowledgement::new( + to_binary(&Ack::Result( + Binary::from_base64("aGVsbG8gd29ybGQ=").unwrap(), + )) + .unwrap(), + ); + + let msg = IbcPacketAckMsg::new(ack, packet, Addr::unchecked("relayer")); + let res = ibc_packet_ack(deps.as_mut(), ctx.env, msg); + assert!(res.is_ok()); +} diff --git a/contracts/cosmwasm-vm/cw-xcall-ibc-connection/tests/test_ibc_functions.rs b/contracts/cosmwasm-vm/cw-xcall-ibc-connection/tests/test_ibc_functions.rs index 7f6ac411e..45d362dce 100644 --- a/contracts/cosmwasm-vm/cw-xcall-ibc-connection/tests/test_ibc_functions.rs +++ b/contracts/cosmwasm-vm/cw-xcall-ibc-connection/tests/test_ibc_functions.rs @@ -10,7 +10,7 @@ use cosmwasm_std::{ use cw_common::from_binary_response; use cw_common::types::Ack; -use cw_xcall_ibc_connection::ack::{on_ack_failure, on_ack_success}; +use cw_xcall_ibc_connection::ack::{make_ack_success, on_ack_failure, on_ack_success}; use cw_xcall_ibc_connection::types::config::Config; use cw_xcall_lib::network_address::{NetId, NetworkAddress}; @@ -24,192 +24,196 @@ pub mod account; use account::admin_one; use account::alice; -use cosmwasm_std::from_binary; +use cosmwasm_std::{from_binary, IbcChannelCloseMsg, IbcPacketTimeoutMsg, Reply, SubMsgResult}; use cw_common::xcall_connection_msg::{ExecuteMsg, QueryMsg}; use cw_xcall::types::message::CSMessage; use cw_xcall::types::request::CSMessageRequest; -use cw_xcall_ibc_connection::state::CwIbcConnection; +use cw_xcall_ibc_connection::state::{ + CwIbcConnection, ACK_FAILURE_ID, HOST_SEND_MESSAGE_REPLY_ID, + HOST_WRITE_ACKNOWLEDGEMENT_REPLY_ID, XCALL_HANDLE_ERROR_REPLY_ID, + XCALL_HANDLE_MESSAGE_REPLY_ID, +}; + +use cosmwasm_std::IbcOrder; #[test] #[cfg(not(feature = "native_ibc"))] #[should_panic(expected = "OrderedChannel")] fn fails_on_open_channel_open_init_ordered_channel() { + let ctx = TestContext::default(); let mut deps = deps(); - - let mock_env = mock_env(); - let mock_info = create_mock_info("alice", "umlg", 2000); - let mut contract = CwIbcConnection::default(); + let info = create_mock_info("ibc_host", "umlg", 2000); - let src = IbcEndpoint { - port_id: "our-port".to_string(), - channel_id: "channel-1".to_string(), - }; - let dst = IbcEndpoint { - port_id: "their-port".to_string(), - channel_id: "channel-3".to_string(), - }; + ctx.init_context(deps.as_mut().storage, &contract); + + let mut channel = get_dummy_channel(); + channel.order = IbcOrder::Ordered; let execute_msg = ExecuteMsg::IbcChannelOpen { - msg: OpenInit { - channel: IbcChannel::new( - src, - dst, - cosmwasm_std::IbcOrder::Ordered, - "xcall-1", - "newconnection", - ), - }, + msg: OpenInit { channel }, }; contract - .set_ibc_host(deps.as_mut().storage, Addr::unchecked(alice().as_str())) - .unwrap(); - - contract - .execute(deps.as_mut(), mock_env, mock_info, execute_msg) + .execute(deps.as_mut(), ctx.env, info, execute_msg) .unwrap(); } #[test] #[cfg(not(feature = "native_ibc"))] fn success_on_open_channel_open_init_unordered_channel() { - use cw_xcall_ibc_connection::{state::CwIbcConnection, types::config::Config}; - + let ctx = TestContext::default(); let mut deps = deps(); - - let mock_env = mock_env(); - let mock_info = create_mock_info("alice", "umlg", 2000); - let mut contract = CwIbcConnection::default(); + let info = create_mock_info("ibc_host", "umlg", 2000); - let src = IbcEndpoint { - port_id: "our-port".to_string(), - channel_id: "channel-1".to_string(), - }; - let dst = IbcEndpoint { - port_id: "their-port".to_string(), - channel_id: "channel-3".to_string(), - }; - - contract - .store_config( - deps.as_mut().storage, - &Config { - port_id: "our-port".to_string(), - denom: "arch".to_string(), - }, - ) - .unwrap(); - - let connection_id = "newconnection".to_string(); + ctx.init_channel_open(deps.as_mut(), &contract); let execute_msg = ExecuteMsg::IbcChannelOpen { msg: OpenInit { - channel: IbcChannel::new( - src, - dst.clone(), - cosmwasm_std::IbcOrder::Unordered, - "ics20-1", - &connection_id, - ), + channel: ctx.channel, }, }; - - contract - .configure_connection( - deps.as_mut(), - connection_id, - dst.port_id, - NetId::from("nid".to_string()), - "client-id".to_string(), - 100, - ) - .unwrap(); - contract - .set_ibc_host(deps.as_mut().storage, Addr::unchecked(alice().as_str())) - .unwrap(); - - let result = contract.execute(deps.as_mut(), mock_env, mock_info, execute_msg); - println!("{:?}", result); - + let result = contract.execute(deps.as_mut(), ctx.env, info, execute_msg); assert!(result.is_ok()) } #[test] #[cfg(not(feature = "native_ibc"))] -fn get_ibc_config_after_setup() { - use cw_common::xcall_connection_msg::ConfigResponse; - use cw_xcall_ibc_connection::{state::CwIbcConnection, types::config::Config}; +fn test_query_get_ibc_config() { + let ctx = TestContext::default(); + let mut deps = deps(); + let contract = CwIbcConnection::default(); + ctx.init_context(deps.as_mut().storage, &contract); + + let query = QueryMsg::GetIbcConfig { + nid: ctx.network_id.clone(), + }; + let response = contract.query(deps.as_ref(), ctx.env, query); + assert!(response.is_ok()); + + let ibc_config = contract + .get_ibc_config(deps.as_ref().storage, &ctx.network_id) + .unwrap(); + assert_eq!(ibc_config.sequence(), 0); + assert_eq!(ibc_config.next_sequence(), Some(1)) +} + +#[test] +fn test_execute_set_xcall_host() { + let ctx = TestContext::default(); let mut deps = deps(); + let contract = CwIbcConnection::default(); - let mock_env = mock_env(); - let mock_info = create_mock_info("alice", "umlg", 2000); + ctx.init_context(deps.as_mut().storage, &contract); + + let address = "xcall".to_string(); + let msg = ExecuteMsg::SetXCallHost { + address: address.clone(), + }; + let res = execute(deps.as_mut(), ctx.env, ctx.info, msg); + assert!(res.is_ok()); + let xcall_host = contract.get_xcall_host(deps.as_ref().storage).unwrap(); + assert_eq!(xcall_host.to_string(), address) +} + +#[test] +fn test_execute_configure_connection() { + let ctx = TestContext::default(); + let mut deps = deps(); let mut contract = CwIbcConnection::default(); - let src = IbcEndpoint { - port_id: "our-port".to_string(), - channel_id: "channel-1".to_string(), + ctx.init_context(deps.as_mut().storage, &contract); + + let msg = ExecuteMsg::ConfigureConnection { + connection_id: ctx.connection_id, + counterparty_port_id: "port_dst".to_owned(), + counterparty_nid: ctx.network_id, + client_id: ctx.client_id, + timeout_height: 100, }; - let dst = IbcEndpoint { - port_id: "their-port".to_string(), - channel_id: "channel-3".to_string(), + let res = contract.execute(deps.as_mut(), ctx.env, ctx.info, msg); + assert!(res.is_ok()) +} + +#[test] +fn test_execute_override_connection() { + let ctx = TestContext::default(); + let mut deps = deps(); + let mut contract = CwIbcConnection::default(); + + ctx.init_channel_open(deps.as_mut(), &contract); + + let msg = ExecuteMsg::OverrideConnection { + connection_id: ctx.connection_id.clone(), + counterparty_port_id: "counterparty_port".to_owned(), + counterparty_nid: NetId::from_str("new_nid").unwrap(), + client_id: ctx.client_id, + timeout_height: 200, }; + let res = contract.execute(deps.as_mut(), ctx.env, ctx.info, msg); + assert!(res.is_ok()); - contract - .store_config( - deps.as_mut().storage, - &Config { - port_id: "our-port".to_string(), - denom: "arch".to_string(), - }, + let counterparty_nid = contract + .get_counterparty_nid( + deps.as_ref().storage, + &ctx.connection_id, + "counterparty_port", ) .unwrap(); + assert_eq!(counterparty_nid.as_str(), "new_nid") +} - let connection_id = "newconnection".to_string(); +#[test] +fn test_execute_set_fee() { + let ctx = TestContext::default(); + let mut deps = deps(); + let contract = CwIbcConnection::default(); - let execute_msg = ExecuteMsg::IbcChannelOpen { - msg: OpenInit { - channel: IbcChannel::new( - src.clone(), - dst.clone(), - cosmwasm_std::IbcOrder::Unordered, - "ics20-1", - &connection_id, - ), - }, + ctx.init_channel_open(deps.as_mut(), &contract); + + let msg = ExecuteMsg::SetFees { + nid: ctx.network_id, + packet_fee: 10, + ack_fee: 10, }; + let res = execute(deps.as_mut(), ctx.env, ctx.info, msg); + assert!(res.is_ok()) +} - contract - .configure_connection( - deps.as_mut(), - connection_id, - dst.port_id.clone(), - NetId::from("nid".to_string()), - "client-id".to_string(), - 100, - ) - .unwrap(); - contract - .set_ibc_host(deps.as_mut().storage, Addr::unchecked(alice().as_str())) - .unwrap(); +#[test] +fn test_query_get_fee() { + let ctx = TestContext::default(); + let mut deps = deps(); + let contract = CwIbcConnection::default(); - let result = contract.execute(deps.as_mut(), mock_env.clone(), mock_info, execute_msg); + ctx.init_channel_open(deps.as_mut(), &contract); - assert!(result.is_ok()); + let msg = QueryMsg::GetFee { + nid: ctx.network_id, + response: true, + }; + let res = query(deps.as_ref(), ctx.env, msg).unwrap(); + let fee: u128 = from_binary(&res).unwrap(); + assert_eq!(fee, 0) +} - let query = QueryMsg::GetIbcConfig { - nid: NetId::from("nid".to_string()), - }; - let response = contract.query(deps.as_ref(), mock_env, query); - let config: ConfigResponse = from_binary(&response.unwrap()).unwrap(); - assert_eq!(config.channel_id, src.channel_id); - assert_eq!(config.port, src.port_id); - assert_eq!(config.destination_channel_id, dst.channel_id); - assert_eq!(config.destination_port_id, dst.port_id); - assert_eq!(config.light_client_id, "client-id"); - assert_eq!(config.timeout_height, 100); +#[test] +fn test_query_get_unclaimed_fee() { + let ctx = TestContext::default(); + let mut deps = deps(); + let contract = CwIbcConnection::default(); + + ctx.init_channel_open(deps.as_mut(), &contract); + + let msg = QueryMsg::GetUnclaimedFee { + nid: ctx.network_id, + relayer: "crly".to_owned(), + }; + let res = query(deps.as_ref(), ctx.env, msg).unwrap(); + let fee: u128 = from_binary(&res).unwrap(); + assert_eq!(fee, 0) } #[test] @@ -282,71 +286,47 @@ fn success_on_open_channel_open_try_valid_version() { #[test] #[cfg(not(feature = "native_ibc"))] fn success_on_ibc_channel_connect() { - use std::str::FromStr; - - use cw_xcall_lib::network_address::NetId; - + let ctx = TestContext::default(); let mut deps = deps(); + let mut contract = CwIbcConnection::default(); + let info = create_mock_info("ibc_host", "umlg", 2000); - let mock_env = mock_env(); - let mock_info = create_mock_info("alice", "umlg", 2000); + ctx.init_channel_connect(deps.as_mut(), &contract); - let mut contract = CwIbcConnection::default(); - let src = IbcEndpoint { - port_id: "our-port".to_string(), - channel_id: "channel-1".to_string(), - }; - let dst = IbcEndpoint { - port_id: "their-port".to_string(), - channel_id: "channel-3".to_string(), - }; - let connection_id = "newconnection"; - let execute_message = ExecuteMsg::IbcChannelConnect { + let msg = ExecuteMsg::IbcChannelConnect { msg: OpenAck { - channel: IbcChannel::new( - src.clone(), - dst.clone(), - cosmwasm_std::IbcOrder::Unordered, - "ics20-1", - connection_id, - ), + channel: ctx.channel.clone(), counterparty_version: "ics20-1".to_owned(), }, }; - contract - .set_ibc_host(deps.as_mut().storage, Addr::unchecked(alice().as_str())) - .unwrap(); - contract - .store_config( - deps.as_mut().storage, - &Config { - port_id: "our-port".to_string(), - denom: "arch".to_string(), - }, - ) - .unwrap(); - contract - .configure_connection( - deps.as_mut(), - "newconnection".to_string(), - dst.port_id, - NetId::from("btp".to_string()), - "client-id".to_string(), - 100, - ) - .unwrap(); - - let result = contract - .execute(deps.as_mut(), mock_env, mock_info, execute_message) - .unwrap(); - assert_eq!("on_channel_connect", result.attributes[0].value); + let res = contract.execute(deps.as_mut(), ctx.env, info, msg).unwrap(); + assert_eq!("on_channel_connect", res.attributes[0].value); let ibc_config = contract - .get_ibc_config(deps.as_ref().storage, &NetId::from_str("btp").unwrap()) + .get_ibc_config(deps.as_ref().storage, &ctx.network_id) .unwrap(); + assert_eq!( + ibc_config.src_endpoint().port_id, + ctx.channel.endpoint.port_id.as_str() + ) +} - assert_eq!(ibc_config.src_endpoint().port_id, src.port_id.as_str()) +#[test] +fn test_execute_channel_close_init() { + let ctx = TestContext::default(); + let mut deps = deps(); + let contract = CwIbcConnection::default(); + + ctx.init_context(deps.as_mut().storage, &contract); + + let msg = ExecuteMsg::IbcChannelClose { + msg: IbcChannelCloseMsg::CloseInit { + channel: ctx.channel, + }, + }; + let res = execute(deps.as_mut(), ctx.env, ctx.info, msg).unwrap(); + assert_eq!(res.attributes[0].value, "ibc_channel_close") } #[test] @@ -685,20 +665,22 @@ fn success_receive_packet_for_call_message_request() { .unwrap(); let result = contract.execute(mock_deps.as_mut(), mock_env, mock_info, execute_message); - println!("{:?}", result); + println!("{result:?}"); assert!(result.is_ok()); } #[test] #[cfg(not(feature = "native_ibc"))] -fn _on_ack_packet() { - use cw_xcall_lib::network_address::{NetId, NetworkAddress}; - - let mut mock_deps = deps(); - let mock_info = create_mock_info("alice", "umlg", 2000); - let mock_env = mock_env(); +fn on_ack_packet() { + let packet = get_dummy_ibc_packet(); + let ctx = TestContext::for_packet_ack(&packet); + let mut deps = deps(); + let info = create_mock_info("ibc_host", "umlg", 2000); let mut contract = CwIbcConnection::default(); + + ctx.init_context(deps.as_mut().storage, &contract); + let ack = IbcAcknowledgement::new( to_binary(&Ack::Result( Binary::from_base64("aGVsbG8gd29ybGQ=").unwrap(), @@ -706,57 +688,10 @@ fn _on_ack_packet() { .unwrap(), ); - let timeout_block = IbcTimeoutBlock { - revision: 0, - height: 0, - }; - let timeout = IbcTimeout::with_block(timeout_block); - let src = IbcEndpoint { - port_id: "our-port".to_string(), - channel_id: "channel-1".to_string(), - }; - - let dst = IbcEndpoint { - port_id: "their-port".to_string(), - channel_id: "channel-3".to_string(), - }; - - let data = CSMessageRequest::new( - NetworkAddress::new("nid", mock_info.sender.as_str()), - Addr::unchecked("alice"), - 1, - false, - vec![1, 2, 3], - vec![], - ); - contract - .set_ibc_host( - mock_deps.as_mut().storage, - Addr::unchecked(alice().as_str()), - ) - .unwrap(); - let channel = src.channel_id.clone(); - contract - .set_xcall_host(mock_deps.as_mut().storage, Addr::unchecked("xcall-host")) - .unwrap(); - - let channel_config = ChannelConfig { - client_id: "client_id".to_string(), - timeout_height: 100, - counterparty_nid: NetId::from("nid".to_string()), - }; - contract - .store_channel_config(mock_deps.as_mut().storage, &channel, &channel_config) - .unwrap(); - let message: CSMessage = data.try_into().unwrap(); - - let packet = IbcPacket::new(to_binary(&message).unwrap(), src, dst, 0, timeout); - let ack_packet = IbcPacketAckMsg::new(ack, packet, Addr::unchecked("relayer")); - let execute_message = ExecuteMsg::IbcPacketAck { msg: ack_packet }; - - let result = contract.execute(mock_deps.as_mut(), mock_env, mock_info, execute_message); + let msg = ExecuteMsg::IbcPacketAck { msg: ack_packet }; + let result = contract.execute(deps.as_mut(), ctx.env, info, msg); assert!(result.is_ok()); } @@ -1190,7 +1125,7 @@ fn test_handle_response() { }, ); - println!("{:?}", res); + println!("{res:?}"); assert!(res.is_ok()) } @@ -1263,3 +1198,171 @@ fn test_call_message_from_raw_message() { ); assert_eq!(expected_data, cs_message_request) } + +#[test] +fn test_make_ack_success() { + let res = make_ack_success(); + + let res_bytes: Vec = res.into(); + let res_str = String::from_utf8(res_bytes).unwrap(); + + assert_eq!(res_str, "{\"result\":\"MQ==\"}") +} + +#[test] +#[should_panic(expected = "ReplyError { code: 1, msg: \"Unknown\" }")] +fn test_xcall_handle_message_reply_fail() { + let ctx = TestContext::default(); + let mut deps = deps(); + let contract = CwIbcConnection::new(); + + let msg = Reply { + id: XCALL_HANDLE_MESSAGE_REPLY_ID, + result: SubMsgResult::Err("Unknown".to_string()), + }; + + contract.reply(deps.as_mut(), ctx.env, msg).unwrap(); +} + +#[test] +fn test_xcall_handle_error_reply() { + let ctx = TestContext::default(); + let mut deps = deps(); + let contract = CwIbcConnection::new(); + + let sub_msg_reply = get_dummy_sub_msg_res(); + let msg = Reply { + id: XCALL_HANDLE_ERROR_REPLY_ID, + result: SubMsgResult::Ok(sub_msg_reply), + }; + + let res = contract.reply(deps.as_mut(), ctx.env, msg).unwrap(); + assert_eq!(res.attributes[0].value, "call_message"); + assert_eq!(res.attributes[1].value, "xcall_handle_error_reply") +} + +#[test] +#[should_panic(expected = "ReplyError { code: 2, msg: \"Unknown\" }")] +fn test_xcall_handle_error_reply_fail() { + let ctx = TestContext::default(); + let mut deps = deps(); + let contract = CwIbcConnection::new(); + + let msg = Reply { + id: XCALL_HANDLE_ERROR_REPLY_ID, + result: SubMsgResult::Err("Unknown".to_string()), + }; + + contract.reply(deps.as_mut(), ctx.env, msg).unwrap(); +} + +#[test] +fn test_host_send_message_reply() { + let ctx = TestContext::default(); + let mut deps = deps(); + let contract = CwIbcConnection::new(); + + let sub_msg_reply = get_dummy_sub_msg_res(); + let msg = Reply { + id: HOST_SEND_MESSAGE_REPLY_ID, + result: SubMsgResult::Ok(sub_msg_reply), + }; + + let res = contract.reply(deps.as_mut(), ctx.env, msg).unwrap(); + assert_eq!(res.attributes[0].value, "call_message"); + assert_eq!(res.attributes[1].value, "reply_forward_host") +} + +#[test] +#[should_panic(expected = "ReplyError { code: 4, msg: \"Unknown\" }")] +fn test_host_send_message_reply_fail() { + let ctx = TestContext::default(); + let mut deps = deps(); + let contract = CwIbcConnection::new(); + + let msg = Reply { + id: HOST_SEND_MESSAGE_REPLY_ID, + result: SubMsgResult::Err("Unknown".to_string()), + }; + + contract.reply(deps.as_mut(), ctx.env, msg).unwrap(); +} + +#[test] +fn test_host_write_acknowledgement_reply() { + let ctx = TestContext::default(); + let mut deps = deps(); + let contract = CwIbcConnection::new(); + + let sub_msg_reply = get_dummy_sub_msg_res(); + let msg = Reply { + id: HOST_WRITE_ACKNOWLEDGEMENT_REPLY_ID, + result: SubMsgResult::Ok(sub_msg_reply), + }; + + let res = contract.reply(deps.as_mut(), ctx.env, msg).unwrap(); + assert_eq!(res.attributes[0].value, "call_message"); + assert_eq!(res.attributes[1].value, "reply_write_acknowledgement") +} + +#[test] +#[should_panic(expected = "ReplyError { code: 3, msg: \"Unknown\" }")] +fn test_host_write_acknowledgement_reply_fail() { + let ctx = TestContext::default(); + let mut deps = deps(); + let contract = CwIbcConnection::new(); + + let msg = Reply { + id: HOST_WRITE_ACKNOWLEDGEMENT_REPLY_ID, + result: SubMsgResult::Err("Unknown".to_string()), + }; + + contract.reply(deps.as_mut(), ctx.env, msg).unwrap(); +} + +#[test] +fn test_reply_ack_on_error() { + let ctx = TestContext::default(); + let mut deps = deps(); + let contract = CwIbcConnection::new(); + + let sub_msg_reply = get_dummy_sub_msg_res(); + let msg = Reply { + id: ACK_FAILURE_ID, + result: SubMsgResult::Ok(sub_msg_reply), + }; + + let res = contract.reply(deps.as_mut(), ctx.env, msg); + assert!(res.is_ok()) +} + +#[test] +fn test_reply_ack_on_error_fail() { + let ctx = TestContext::default(); + let mut deps = deps(); + let contract = CwIbcConnection::new(); + + let msg = Reply { + id: ACK_FAILURE_ID, + result: SubMsgResult::Err("Unknown".to_string()), + }; + + let res = contract.reply(deps.as_mut(), ctx.env, msg); + assert!(res.is_ok()) +} + +#[test] +#[should_panic(expected = "ReplyError { code: 9, msg: \"Unknown\" }")] +fn test_reply_fail_for_invalid_id() { + let ctx = TestContext::default(); + let mut deps = deps(); + let contract = CwIbcConnection::new(); + + let invalid_reply_id = 9; + let msg = Reply { + id: invalid_reply_id, + result: SubMsgResult::Err("Unknown".to_string()), + }; + + contract.reply(deps.as_mut(), ctx.env, msg).unwrap(); +} diff --git a/contracts/cosmwasm-vm/cw-xcall-ibc-connection/tests/test_owner.rs b/contracts/cosmwasm-vm/cw-xcall-ibc-connection/tests/test_owner.rs index 2d4bb0257..005ad0b03 100644 --- a/contracts/cosmwasm-vm/cw-xcall-ibc-connection/tests/test_owner.rs +++ b/contracts/cosmwasm-vm/cw-xcall-ibc-connection/tests/test_owner.rs @@ -2,14 +2,13 @@ mod account; mod setup; use account::*; +use cosmwasm_std::Addr; use cw_xcall_ibc_connection::state::CwIbcConnection; use setup::*; #[test] fn add_owner() { let mut mock_deps = deps(); - let mock_info = create_mock_info(&alice().to_string(), "umlg", 2000); - let contract = CwIbcConnection::default(); contract @@ -17,17 +16,31 @@ fn add_owner() { .unwrap(); let result = contract.query_owner(mock_deps.as_ref().storage).unwrap(); - assert_eq!(result, mock_info.sender.to_string()) } +#[test] +fn test_add_owner() { + let mut deps = deps(); + let contract = CwIbcConnection::default(); + + contract + .add_owner(deps.as_mut().storage, Addr::unchecked("owner")) + .unwrap(); + + let owner = Addr::unchecked("new_owner"); + let res = contract.add_owner(deps.as_mut().storage, owner.clone()); + assert!(res.is_ok()); + + let expected_owner = contract.query_owner(deps.as_ref().storage).unwrap(); + assert_eq!(owner, expected_owner) +} + #[test] #[should_panic(expected = "OwnerAlreadyExist")] fn add_existing_owner() { let mut mock_deps = deps(); - let mock_info = create_mock_info(&alice().to_string(), "umlg", 2000); - let contract = CwIbcConnection::default(); contract @@ -35,7 +48,6 @@ fn add_existing_owner() { .unwrap(); let result = contract.query_owner(mock_deps.as_ref().storage).unwrap(); - assert_eq!(result, mock_info.sender.to_string()); contract diff --git a/contracts/javascore/ibc/src/main/java/ibc/ics04/channel/IBCPacket.java b/contracts/javascore/ibc/src/main/java/ibc/ics04/channel/IBCPacket.java index 2a134411d..539b53c24 100644 --- a/contracts/javascore/ibc/src/main/java/ibc/ics04/channel/IBCPacket.java +++ b/contracts/javascore/ibc/src/main/java/ibc/ics04/channel/IBCPacket.java @@ -231,9 +231,10 @@ public void _requestTimeout(MsgRequestTimeoutPacket msg) { boolean heightTimeout = revisionHeight.compareTo(BigInteger.ZERO) > 0 && BigInteger.valueOf(Context.getBlockHeight()) .compareTo(revisionHeight) >= 0; - boolean timeTimeout = packet.getTimeoutTimestamp().compareTo(BigInteger.ZERO) > 0 + BigInteger timeoutTimestamp = packet.getTimeoutTimestamp(); + boolean timeTimeout = timeoutTimestamp.compareTo(BigInteger.ZERO) > 0 && BigInteger.valueOf(Context.getBlockTimestamp()) - .compareTo(packet.getTimeoutTimestamp()) < 0; + .compareTo(timeoutTimestamp) >= 0; Context.require(heightTimeout || timeTimeout, "Packet has not yet timed out"); byte[] commitmentPath = IBCCommitment.packetCommitmentPath(packet.getSourcePort(), diff --git a/contracts/javascore/ibc/src/test/java/ibc/ics04/channel/PacketTest.java b/contracts/javascore/ibc/src/test/java/ibc/ics04/channel/PacketTest.java index a40a30f11..9c8d20efa 100644 --- a/contracts/javascore/ibc/src/test/java/ibc/ics04/channel/PacketTest.java +++ b/contracts/javascore/ibc/src/test/java/ibc/ics04/channel/PacketTest.java @@ -541,7 +541,7 @@ void requestTimeout_UnOrdered() { packet.invoke(owner, "setChannel", portId, channelId, baseChannel); Height timeoutHeight = new Height(); timeoutHeight.setRevisionHeight(BigInteger.valueOf(sm.getBlock().getHeight())); - MsgRequestTimeoutPacket timeoutPacket=new MsgRequestTimeoutPacket(); + MsgRequestTimeoutPacket timeoutPacket = new MsgRequestTimeoutPacket(); basePacket.setTimeoutHeight(timeoutHeight); basePacket.setTimeoutTimestamp(BigInteger.valueOf(sm.getBlock().getTimestamp())); byte[] commitmentPath = IBCCommitment.packetReceiptCommitmentKey(basePacket.getSourcePort(), @@ -563,7 +563,7 @@ void requestTimeout_Ordered() { packet.invoke(owner, "setChannel", portId, channelId, baseChannel); Height timeoutHeight = new Height(); timeoutHeight.setRevisionHeight(BigInteger.valueOf(sm.getBlock().getHeight())); - MsgRequestTimeoutPacket timeoutPacket=new MsgRequestTimeoutPacket(); + MsgRequestTimeoutPacket timeoutPacket = new MsgRequestTimeoutPacket(); basePacket.setTimeoutHeight(timeoutHeight); basePacket.setTimeoutTimestamp(BigInteger.valueOf(sm.getBlock().getTimestamp())); byte[] commitmentPath = IBCCommitment.nextSequenceRecvCommitmentKey(basePacket.getSourcePort(), @@ -579,6 +579,67 @@ void requestTimeout_Ordered() { ByteUtil.join(commitmentPath, Proto.encodeFixed64(basePacket.getSequence(), false))); } + @Test + void requestTimeout_timestamp() { + // Arrange + baseChannel.setOrdering(Channel.Order.ORDER_UNORDERED); + packet.invoke(owner, "setChannel", portId, channelId, baseChannel); + MsgRequestTimeoutPacket timeoutPacket = new MsgRequestTimeoutPacket(); + basePacket.setTimeoutTimestamp(BigInteger.valueOf(sm.getBlock().getTimestamp())); + byte[] commitmentPath = IBCCommitment.packetReceiptCommitmentKey(basePacket.getSourcePort(), + basePacket.getSourceChannel(), basePacket.getSequence()); + timeoutPacket.setPacket(basePacket.encode()); + timeoutPacket.setProofHeight(new byte[0]); + timeoutPacket.setProof(new byte[0]); + // Act + packet.invoke(owner, "_requestTimeout", timeoutPacket); + + // Assert + verify(packetSpy).sendBTPMessage(clientId, commitmentPath); + } + + @Test + void requestTimeout_NotYetTimedOut_Timestamp() { + // Arrange + baseChannel.setOrdering(Channel.Order.ORDER_UNORDERED); + packet.invoke(owner, "setChannel", portId, channelId, baseChannel); + MsgRequestTimeoutPacket timeoutPacket = new MsgRequestTimeoutPacket(); + basePacket.setTimeoutTimestamp(BigInteger.valueOf(sm.getBlock().getTimestamp()).multiply(BigInteger.TWO)); + byte[] commitmentPath = IBCCommitment.packetReceiptCommitmentKey(basePacket.getSourcePort(), + basePacket.getSourceChannel(), basePacket.getSequence()); + timeoutPacket.setPacket(basePacket.encode()); + timeoutPacket.setProofHeight(new byte[0]); + timeoutPacket.setProof(new byte[0]); + String expectedErrorMessage = "Packet has not yet timed out"; + + // Act + Executable beforeTimeout = () -> packet.invoke(owner, "_requestTimeout", timeoutPacket); + AssertionError e = assertThrows(AssertionError.class, beforeTimeout); + assertTrue(e.getMessage().contains(expectedErrorMessage)); + } + + @Test + void requestTimeout_NotYetTimedOut_Height() { + // Arrange + baseChannel.setOrdering(Channel.Order.ORDER_UNORDERED); + packet.invoke(owner, "setChannel", portId, channelId, baseChannel); + Height timeoutHeight = new Height(); + timeoutHeight.setRevisionHeight(BigInteger.valueOf(sm.getBlock().getHeight()).multiply(BigInteger.TWO)); + MsgRequestTimeoutPacket timeoutPacket = new MsgRequestTimeoutPacket(); + basePacket.setTimeoutHeight(timeoutHeight); + byte[] commitmentPath = IBCCommitment.packetReceiptCommitmentKey(basePacket.getSourcePort(), + basePacket.getSourceChannel(), basePacket.getSequence()); + timeoutPacket.setPacket(basePacket.encode()); + timeoutPacket.setProofHeight(new byte[0]); + timeoutPacket.setProof(new byte[0]); + String expectedErrorMessage = "Packet has not yet timed out"; + + // Act + Executable beforeTimeout = () -> packet.invoke(owner, "_requestTimeout", timeoutPacket); + AssertionError e = assertThrows(AssertionError.class, beforeTimeout); + assertTrue(e.getMessage().contains(expectedErrorMessage)); + } + @Test void timeoutPacket_unOrdered() { // Arrange diff --git a/docs/adr/ICON_IBC.md b/docs/adr/ICON_IBC.md index ee82cbdfd..8356d75cc 100644 --- a/docs/adr/ICON_IBC.md +++ b/docs/adr/ICON_IBC.md @@ -34,10 +34,24 @@ func updateConnectionCommitment(connection): sendBTPMessage(join(clientKey, clientState)); sendBTPMessage(join(consensusKey, latestConsensusState)); sendBTPMessage(join(connectionKey, connection)) -} + ``` During connection establishment all self client validation is skipped, and will have to be done manually when opening a new channel. +### Manual connection verification +(These steps can be omitted if the connection was established by a relay that you trust) +To verify that a counterparty has stored the correct clientState or consensus state, find the latest BTP block that should be on the client and compare that to what is on the light client. +Easiest way is to manually verify it on the counterparty client by fetching the client or consensus state directly from the client. But can also be proved through verifyMembership on the lightClient on ICON. + +A btp block can be fetched [Block](https://github.com/icon-project/goloop/blob/master/doc/btp2_extension.md) GET request. +Which can then be compared with the states in the light client: +``` +GetConsensusState { client_id: String, height: u64 }, +#[returns(Vec)] +GetLatestConsensusState { client_id: String }, +#[returns(Vec)] +GetClientState { client_id: String }, +``` ## ICS-04 For BTP blocks and the ICON lightclient we have two restrictions: diff --git a/libraries/rust/common/src/ibc/core/ics02_client/client_message.rs b/libraries/rust/common/src/ibc/core/ics02_client/client_message.rs new file mode 100644 index 000000000..1f0a4af68 --- /dev/null +++ b/libraries/rust/common/src/ibc/core/ics02_client/client_message.rs @@ -0,0 +1,34 @@ +// Copyright 2022 ComposableFi +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use prost::alloc::vec::Vec; + +/// Abstract of consensus state update information +pub trait ClientMessage: Clone + core::fmt::Debug + Send + Sync { + fn downcast(self) -> Option + where + Self: 'static, + { + ::downcast_ref(&self).cloned() + } + + fn wrap(sub_state: &dyn core::any::Any) -> Option + where + Self: 'static, + { + sub_state.downcast_ref::().cloned() + } + + fn encode_to_vec(&self) -> Result, prost::EncodeError>; +} diff --git a/libraries/rust/common/src/ibc/core/ics02_client/mod.rs b/libraries/rust/common/src/ibc/core/ics02_client/mod.rs index b1dd7ca94..7fd50537f 100644 --- a/libraries/rust/common/src/ibc/core/ics02_client/mod.rs +++ b/libraries/rust/common/src/ibc/core/ics02_client/mod.rs @@ -1,4 +1,5 @@ //! ICS 02: Client implementation for verifying remote IBC-enabled chains. +pub mod client_message; pub mod client_state; pub mod client_type; pub mod consensus_state; diff --git a/libraries/rust/common/src/ibc/core/ics23_commitment/merkle.rs b/libraries/rust/common/src/ibc/core/ics23_commitment/merkle.rs index f2500f260..682678c5d 100644 --- a/libraries/rust/common/src/ibc/core/ics23_commitment/merkle.rs +++ b/libraries/rust/common/src/ibc/core/ics23_commitment/merkle.rs @@ -4,15 +4,12 @@ use tendermint::merkle::proof::ProofOps as TendermintProof; use ibc_proto::ibc::core::commitment::v1::MerklePath; use ibc_proto::ibc::core::commitment::v1::MerkleProof as RawMerkleProof; use ibc_proto::ibc::core::commitment::v1::MerkleRoot; -use ics23::commitment_proof::Proof; -use ics23::{ - calculate_existence_root, verify_membership, verify_non_membership, CommitmentProof, - NonExistenceProof, -}; + +use ics23::CommitmentProof; use crate::ibc::core::ics23_commitment::commitment::{CommitmentPrefix, CommitmentRoot}; use crate::ibc::core::ics23_commitment::error::CommitmentError; -use crate::ibc::core::ics23_commitment::specs::ProofSpecs; +// use crate::ibc::core::ics23_commitment::specs::ProofSpecs; pub fn apply_prefix(prefix: &CommitmentPrefix, mut path: Vec) -> MerklePath { let mut key_path: Vec = vec![format!("{prefix:?}")]; @@ -67,193 +64,6 @@ impl From for RawMerkleProof { } } -impl MerkleProof { - pub fn verify_membership( - &self, - specs: &ProofSpecs, - root: MerkleRoot, - keys: MerklePath, - value: Vec, - start_index: usize, - ) -> Result<(), CommitmentError> { - // validate arguments - if self.proofs.is_empty() { - return Err(CommitmentError::EmptyMerkleProof); - } - if root.hash.is_empty() { - return Err(CommitmentError::EmptyMerkleRoot); - } - let num = self.proofs.len(); - let ics23_specs = Vec::::from(specs.clone()); - if ics23_specs.len() != num { - return Err(CommitmentError::NumberOfSpecsMismatch); - } - if keys.key_path.len() != num { - return Err(CommitmentError::NumberOfKeysMismatch); - } - if value.is_empty() { - return Err(CommitmentError::EmptyVerifiedValue); - } - - let mut subroot = value.clone(); - let mut value = value; - // keys are represented from root-to-leaf - for ((proof, spec), key) in self - .proofs - .iter() - .zip(ics23_specs.iter()) - .zip(keys.key_path.iter().rev()) - .skip(start_index) - { - match &proof.proof { - Some(Proof::Exist(existence_proof)) => { - subroot = - calculate_existence_root::(existence_proof) - .map_err(|_| CommitmentError::InvalidMerkleProof)?; - - if !verify_membership::( - proof, - spec, - &subroot, - key.as_bytes(), - &value, - ) { - return Err(CommitmentError::VerificationFailure); - } - value = subroot.clone(); - } - _ => return Err(CommitmentError::InvalidMerkleProof), - } - } - - if root.hash != subroot { - return Err(CommitmentError::VerificationFailure); - } - - Ok(()) - } - - pub fn verify_non_membership( - &self, - specs: &ProofSpecs, - root: MerkleRoot, - keys: MerklePath, - ) -> Result<(), CommitmentError> { - // validate arguments - if self.proofs.is_empty() { - return Err(CommitmentError::EmptyMerkleProof); - } - if root.hash.is_empty() { - return Err(CommitmentError::EmptyMerkleRoot); - } - let num = self.proofs.len(); - let ics23_specs = Vec::::from(specs.clone()); - if ics23_specs.len() != num { - return Err(CommitmentError::NumberOfSpecsMismatch); - } - if keys.key_path.len() != num { - return Err(CommitmentError::NumberOfKeysMismatch); - } - - // verify the absence of key in lowest subtree - let proof = self - .proofs - .get(0) - .ok_or(CommitmentError::InvalidMerkleProof)?; - let spec = ics23_specs - .get(0) - .ok_or(CommitmentError::InvalidMerkleProof)?; - // keys are represented from root-to-leaf - let key = keys - .key_path - .get(num - 1) - .ok_or(CommitmentError::InvalidMerkleProof)?; - match &proof.proof { - Some(Proof::Nonexist(non_existence_proof)) => { - let subroot = calculate_non_existence_root(non_existence_proof)?; - - if !verify_non_membership::( - proof, - spec, - &subroot, - key.as_bytes(), - ) { - return Err(CommitmentError::VerificationFailure); - } - - // verify membership proofs starting from index 1 with value = subroot - self.verify_membership(specs, root, keys, subroot, 1) - } - _ => Err(CommitmentError::InvalidMerkleProof), - } - } -} - -// TODO move to ics23 -fn calculate_non_existence_root(proof: &NonExistenceProof) -> Result, CommitmentError> { - if let Some(left) = &proof.left { - calculate_existence_root::(left) - .map_err(|_| CommitmentError::InvalidMerkleProof) - } else if let Some(right) = &proof.right { - calculate_existence_root::(right) - .map_err(|_| CommitmentError::InvalidMerkleProof) - } else { - Err(CommitmentError::InvalidMerkleProof) - } -} - -// Merkle Proof serialization notes: -// "Proof" id currently defined in a number of forms and included in a number of places -// - TmProof: in tendermint-rs/src/merkle/proof.rs:Proof -// - RawProofOps: in tendermint-proto/tendermint.crypto.rs:ProofOps -// - RawMerkleProof: in ibc-proto/ibc.core.commitment.v1.rs:MerkleProof -// - structure that includes a RawProofOps in its only `proof` field. -// #[derive(Clone, PartialEq, ::prost::Message)] -// pub struct MerkleProof { -// #[prost(message, optional, tag="1")] -// pub proof: ::core::option::Option<::tendermint_proto::crypto::ProofOps>, -// } -// - Vec: RawMerkleProof is not explicitly used but, serialized as Vec, it is -// included in all handshake messages that require proofs (i.e. all except the two `OpenInit`), -// and also in all queries that require proofs -// - MerkleProof: Domain type for RawMerkleProof, currently not used and identical to RawMerkleProof. -// This will change with verification implementation. -// - CommitmentProof: Defined in ibc-rs as Vec and currently used in all its messages -// -// Here are a couple of flows that illustrate the different conversions: -// IBC Messages and Handlers: sink happens in the handle verification -// Vec -> CommitmentProof -> RawMerkleProof -> MerkleProof -// -// Relayer: from the proof in the query response to the proof being included in a message -// TmProof -> RawProofOps => RawMerkleProof -> MerkleProof -> verify() -// -> MerkleProof -> RawMerkleProof -> CommitmentProof -> Vec -// Note: current implementation for ^ is simplified since verification is not yet implemented: -// TmProof -> RawProofOps => RawMerkleProof -> CommitmentProof -> Vec -// -// Implementations of (de)serializers and conversions: -// - commitment.rs: -// Vec <-> CommitmentProof -// CommitmentProof <-> RawMerkleProof -// - merkle.rs: -// RawMerkleProof <-> MerkleProof -// - tendermint-rs/src/merkle/proof.rs: -// TmProof <-> RawProofOps -// - cosmos.rs:abci_query() converts from query proof to Merkle proof: -// RawProofOps => RawMerkleProof -// -// impl TryFrom for MerkleProof { -// type Error = Error; -// fn try_from(value: RawMerkleProof) -> Result { -// Ok(MerkleProof { proof: value.proofs.into_iter().map(|v| v.into()).collect() }) -// } -// } -// -// impl From for RawMerkleProof { -// fn from(value: MerkleProof) -> Self { -// RawMerkleProof { proof: value.proof } -// } -// } - pub fn convert_tm_to_ics_merkle_proof( tm_proof: &TendermintProof, ) -> Result { diff --git a/libraries/rust/common/src/ibc/core/ics23_commitment/mod.rs b/libraries/rust/common/src/ibc/core/ics23_commitment/mod.rs index ecffa81d6..fc4c1217e 100644 --- a/libraries/rust/common/src/ibc/core/ics23_commitment/mod.rs +++ b/libraries/rust/common/src/ibc/core/ics23_commitment/mod.rs @@ -4,4 +4,4 @@ pub mod commitment; pub mod error; pub mod merkle; -pub mod specs; +//pub mod specs; diff --git a/libraries/rust/common/src/ibc/mock/client_state.rs b/libraries/rust/common/src/ibc/mock/client_state.rs index caf4dddcb..b3c386882 100644 --- a/libraries/rust/common/src/ibc/mock/client_state.rs +++ b/libraries/rust/common/src/ibc/mock/client_state.rs @@ -143,8 +143,7 @@ impl From for Any { fn from(client_state: MockClientState) -> Self { Any { type_url: MOCK_CLIENT_STATE_TYPE_URL.to_string(), - value: Protobuf::::encode_vec(&client_state) - .expect("encoding to `Any` from `MockClientState`"), + value: Protobuf::::encode_vec(&client_state).unwrap(), } } } diff --git a/libraries/rust/common/src/ibc/mock/consensus_state.rs b/libraries/rust/common/src/ibc/mock/consensus_state.rs index ba37195c9..e344b19fa 100644 --- a/libraries/rust/common/src/ibc/mock/consensus_state.rs +++ b/libraries/rust/common/src/ibc/mock/consensus_state.rs @@ -89,8 +89,7 @@ impl From for Any { fn from(consensus_state: MockConsensusState) -> Self { Any { type_url: MOCK_CONSENSUS_STATE_TYPE_URL.to_string(), - value: Protobuf::::encode_vec(&consensus_state) - .expect("encoding to `Any` from `MockConsensusState`"), + value: Protobuf::::encode_vec(&consensus_state).unwrap(), } } } diff --git a/libraries/rust/common/src/ibc/mock/header.rs b/libraries/rust/common/src/ibc/mock/header.rs index 6c434fb88..1c079839c 100644 --- a/libraries/rust/common/src/ibc/mock/header.rs +++ b/libraries/rust/common/src/ibc/mock/header.rs @@ -112,8 +112,7 @@ impl From for Any { fn from(header: MockHeader) -> Self { Any { type_url: MOCK_HEADER_TYPE_URL.to_string(), - value: Protobuf::::encode_vec(&header) - .expect("encoding to `Any` from `TmHeader`"), + value: Protobuf::::encode_vec(&header).unwrap(), } } } diff --git a/libraries/rust/common/src/ibc/mock/misbehaviour.rs b/libraries/rust/common/src/ibc/mock/misbehaviour.rs index d1509ef3f..f507b2790 100644 --- a/libraries/rust/common/src/ibc/mock/misbehaviour.rs +++ b/libraries/rust/common/src/ibc/mock/misbehaviour.rs @@ -91,8 +91,7 @@ impl From for Any { fn from(misbehaviour: Misbehaviour) -> Self { Any { type_url: MOCK_MISBEHAVIOUR_TYPE_URL.to_string(), - value: Protobuf::::encode_vec(&misbehaviour) - .expect("encoding to `Any` from `TmMisbehaviour`"), + value: Protobuf::::encode_vec(&misbehaviour).unwrap(), } } } diff --git a/libraries/rust/common/src/icon/mod.rs b/libraries/rust/common/src/icon/mod.rs index f3628fa00..0bdf8e031 100644 --- a/libraries/rust/common/src/icon/mod.rs +++ b/libraries/rust/common/src/icon/mod.rs @@ -4,7 +4,6 @@ pub mod icon { // @@protoc_insertion_point(attribute:icon.lightclient.v1) pub mod v1 { include!("icon.lightclient.v1.rs"); - // @@protoc_insertion_point(icon.lightclient.v1) } } pub mod proto { diff --git a/libraries/rust/test-utils/Cargo.toml b/libraries/rust/test-utils/Cargo.toml index c1b9ccce5..92bf68e81 100644 --- a/libraries/rust/test-utils/Cargo.toml +++ b/libraries/rust/test-utils/Cargo.toml @@ -7,16 +7,15 @@ edition = "2021" [dependencies] serde = { workspace=true} -serde_json = "1.0" -cosmwasm-std = {workspace=true, features = ["iterator", "ibc3"]} +serde_json = {workspace=true} +cosmwasm-std = {workspace=true} prost = { workspace=true} ibc-proto = { workspace=true} -#ibc = { version = "0.32.0", default-features = false, features = ["parity-scale-codec", "mocks-no-std", "serde", "borsh"]} -hex="*" -hex-literal="*" -common={path="../common"} -cw-multi-test = "0.16.4" +hex={workspace=true} +hex-literal={workspace=true} +common={workspace=true} -[dev-dependencies] +[dev-dependencies] +#cw-multi-test = "0.15.1" getrandom = {version = "0.2", default-features = false, features = ["custom"]} diff --git a/libraries/rust/test-utils/src/lib.rs b/libraries/rust/test-utils/src/lib.rs index bb2e9e89c..81e03e89d 100644 --- a/libraries/rust/test-utils/src/lib.rs +++ b/libraries/rust/test-utils/src/lib.rs @@ -6,15 +6,13 @@ use std::{ path::PathBuf, }; -use common::ibc::events::IbcEventType; -use cw_multi_test::AppResponse; use ibc_proto::ibc::core::channel::v1::Packet; use serde::Deserialize; use common::icon::icon::types::v1::BtpHeader; use common::icon::icon::types::v1::MerkleNode; use common::icon::icon::types::v1::SignedHeader; -use cosmwasm_std::{Attribute, Event}; +use cosmwasm_std::Attribute; #[derive(Debug, Deserialize, Default, Clone)] pub struct IntegrationData { @@ -256,20 +254,3 @@ pub fn to_attribute_map(attrs: &Vec) -> HashMap { } map } - -pub fn get_event(res: &AppResponse, event: &str) -> Option> { - let event = res - .events - .iter() - .filter(|e| e.ty == event) - .collect::>(); - if !event.is_empty() { - let map = to_attribute_map(&event[0].attributes); - return Some(map); - } - None -} - -pub fn get_event_name(event_type: IbcEventType) -> String { - format!("wasm-{}", event_type.as_str()) -} diff --git a/scripts/optimize-cosmwasm.sh b/scripts/optimize-cosmwasm.sh index 893bb23b7..d517a9c8b 100755 --- a/scripts/optimize-cosmwasm.sh +++ b/scripts/optimize-cosmwasm.sh @@ -9,7 +9,7 @@ RUSTC_VERS="1.69.0" MAX_WASM_SIZE=800 # 800 KB -PROJECTS=("cw-common" "cw-ibc-core" "cw-icon-light-client" "cw-integration" "cw-mock-ibc-core" "cw-xcall-ibc-connection") +PROJECTS=("cw-common" "cw-ibc-core" "cw-icon-light-client" "cw-integration" "cw-mock-ibc-core" "cw-xcall-ibc-connection" "cw-wasm-light-client") # Install wasm-opt binary @@ -36,7 +36,7 @@ cargo clean rustup target add wasm32-unknown-unknown cargo install cosmwasm-check@1.4.1 --locked -RUSTFLAGS='-C link-arg=-s' cargo build --workspace --exclude test-utils --release --lib --target wasm32-unknown-unknown +RUSTFLAGS='-C link-arg=-s' cargo build --workspace --exclude cw-integration --release --lib --target wasm32-unknown-unknown for WASM in ./target/wasm32-unknown-unknown/release/*.wasm; do NAME=$(basename "$WASM" .wasm)${SUFFIX}.wasm echo "Creating intermediate hash for $NAME ..." @@ -49,6 +49,7 @@ done cosmwasm-check artifacts/archway/cw_ibc_core.wasm cosmwasm-check artifacts/archway/cw_icon_light_client.wasm cosmwasm-check artifacts/archway/cw_xcall_ibc_connection.wasm +cosmwasm-check artifacts/archway/cw_wasm_light_client.wasm # Update version From 4af1765321a872fa03312025d732299dedb10dc2 Mon Sep 17 00:00:00 2001 From: ibrizsabin <101165234+ibrizsabin@users.noreply.github.com> Date: Wed, 15 May 2024 11:08:16 +0545 Subject: [PATCH 10/12] docs: add ics-20 deviation (#841) * docs: add ics-20 deviation * fix: remove transfer from * updates on ICS20 specs * chore: typo * docs: separate function for sendICX and save tokenAddress --------- Co-authored-by: izyak --- docs/adr/ICS-20_Deviation.md | 239 +++++++++++++++++++++++++++++++++++ 1 file changed, 239 insertions(+) create mode 100644 docs/adr/ICS-20_Deviation.md diff --git a/docs/adr/ICS-20_Deviation.md b/docs/adr/ICS-20_Deviation.md new file mode 100644 index 000000000..d9ab639cd --- /dev/null +++ b/docs/adr/ICS-20_Deviation.md @@ -0,0 +1,239 @@ +## Introduction +This document outlines the ICS-20 workflow that supports IRC2 Tokens instead of a consolidated Bank Module. This will help us to represent transferred tokens in proper IRC2 wrapped assets. +This is an extension of [ICS20](https://github.com/cosmos/ibc/blob/main/spec/app/ics-020-fungible-token-transfer/README.md) specs to support IBC on ICON. + +### Logical Components + +#### Token Contract: +This will be mintabe burnable IRC2 token contract that will be deployed for each local asset or foreign wrapped asset. We will be using the audited [IRC2 Tradeable Contract](https://github.com/icon-project/icon-bridge/tree/main/javascore/irc2Tradeable) from the ICON Bridge repo + +#### ICS20 Contract: +This contract will be entrypoint for sending and receiving tokens from foreign chains. It will also maintain a registry of tokens that are allowed to be transferred to and fro. Official ICS-20 specs can be found [here](https://github.com/cosmos/ibc/blob/main/spec/app/ics-020-fungible-token-transfer/README.md). + +Any arbitrary tokens from the COSMOS chains will not be allowed to transfer to ICON. Only registered tokens will be allowed to do so. The ICS20 Contract will have an admin, which can register tokens of COSMOS chains on ICON. Once registered, those tokens can be minted on ICON by the ICS20 contract. The name of the token MUST be the corresponding denom from centauri chain. + +**Cross chain tokens to be supported** + +If `ARCH` token is to be bridged from Archway to ICON, it has to go through Archway -> Centauri -> Icon. + +Denom of ARCH on centauri: `transfer/channel-X/ARCH` + +Denom of ARCH on icon: `transfer/channel-ICON/transfer/channel-X/ARCH`. + +The name of the token to register MUST be `transfer/channel-ICON/transfer/channel-X/ARCH`. + +If ARCH token was transfered to another cosmos chain, neutron, and if that needs to be sent to ICON, it MUST go back to Archway chain, then be sent to ICON via centauri. Only the denoms from their native chain will be supported. + +#### Token register +```js +function registerCosmosToken(name: String, symbol: String, decimals: int) { + onlyAdmin() + tokenAddress = deployIRC2Tradeable(name, symbol, decimals) + tokenContracts[name] = tokenAddress +} +``` + +The following function will be used to register tokens on ICON to the ICS 20 App. + +```js +function registerIconToken(tokenAddress: Address) { + onlyAdmin() + tokenContracts[tokenAddress.toString()] = tokenAddress +} +``` + +#### Helper methods +```js +function isNativeAsset(denom:String){ + return denom=="icx" +} + +function getTokenContractAddress(denom:String):String { + assert(tokenContracts[denom]!=null) + return tokenContracts[denom] +} +``` + +#### Sending Tokens +- To send ICX, send using the `sendICX` function. + +- To send tokens other then ICX, it should go through `tokenFallback` function. The `data` bytes, should be parsed into the following structure. + ```json + { + "method": "sendFungibleTokens", + "params": { + "denomination": "string", + "amount": "uint64", + "sender": "string", + "receiver": "string", + "sourcePort": "string", + "sourceChannel": "string", + "timeoutHeight": { + "latestHeight": "uint64", + "revisionNumber": "uint64", + }, + "timeoutTimestamp": "uint64", + "memo":"string" + } + } + ``` +- Implementation of `tokenFallback` and `sendICX` function +```js +// to send tokens other than icx +function tokenFallback(from: Address, value: uint64, data: bytes) { + data = parseStructure(data) + if data.method == "sendFungibleTokens" { + sendFungibleToken = parseFungibleToken(data.params) + assert(sendFungibleToken.amount == value) + assert(sendFungibleToken.sender == from) + sendFungibleTokens(...) + } else { + revert("wrong data") + } +} + +@payable +function sendICX( + receiver: string, + sourcePort: string, + sourceChannel: string, + timeoutHeight: Height, + timeoutTimestamp: string, + @Optional memo: string +) { + sendFungibleTokens("icx", Context.getValue(), Context.getCaller().toString(), ...) +} + + +internal function sendFungibleTokens( + denomination: string, + amount: uint256, + sender: string, + receiver: string, + sourcePort: string, + sourceChannel: string, + timeoutHeight: Height, + timeoutTimestamp: uint64, // in unix nanoseconds + @Optional memo: string +): uint64 { + prefix = "{sourcePort}/{sourceChannel}/" + // we are the source if the denomination is not prefixed + source = denomination.slice(0, len(prefix)) !== prefix + tokenContract=getTokenContracts(denomination) + if source { + if isNativeAsset(denomination) { + assert amount == Context.getValue() + } + } + if !source { + tokenContract.burn(amount); + } + + // create FungibleTokenPacket data + data = FungibleTokenPacketData{denomination, amount, sender, receiver, memo} + + // send packet using the interface defined in ICS4 + sequence = handler.sendPacket( + getCapability("port"), + sourcePort, + sourceChannel, + timeoutHeight, + timeoutTimestamp, + json.marshal(data) // json-marshalled bytes of packet data + ) + + return sequence +} + +``` + +#### Receiving tokens + +```js + +function onRecvPacket(packet: Packet) { + FungibleTokenPacketData data = packet.data + assert(data.denom !== "") + assert(data.amount > 0) + assert(data.sender !== "") + assert(data.receiver !== "") + + // construct default acknowledgement of success + FungibleTokenPacketAcknowledgement ack = FungibleTokenPacketAcknowledgement{true, null} + prefix = "{packet.sourcePort}/{packet.sourceChannel}/" + // we are the source if the packets were prefixed by the sending chain + source = data.denom.slice(0, len(prefix)) === prefix + assert data.receiver is Address + if source { + // receiver is source chain: unescrow tokens + // determine escrow account + denomOnly=data.denom.slice(len(prefix),len(data.denom.prefix)); + if isNativeAsset(denomOnly){ + Context.transfer(data.receiver, data.amount) + } + tokenContract=getTokenContract(denomOnly) + // unescrow tokens to receiver (assumed to fail if balance insufficient) + try { + tokenContract.transfer(data.receiver,data.amount) + } catch (Exception e) { + ack = FungibleTokenPacketAcknowledgement{false, "transfer coins failed"} + } + } else { + prefix = "{packet.destPort}/{packet.destChannel}/" + prefixedDenomination = prefix + data.denom + tokenContract=getTokenContract(prefixedDenomination) + try { + // sender was source, mint vouchers to receiver (assumed to fail if balance insufficient) + tokenContract.mint(data.receiver, data.amount) + } catch (Exception e) { + ack = FungibleTokenPacketAcknowledgement{false, "mint coins failed"} + } + } + return ack +} +``` + +#### Acknowledge Packet +```js +function onAcknowledgePacket( + packet: Packet, + acknowledgement: bytes) { + // if the transfer failed on dst chain, refund the tokens + if (!acknowledgement.success) + refundTokens(packet) +} +``` +#### Timeout Packet +```js +function onTimeoutPacket(packet: Packet) { + // the packet timed-out, so refund the tokens + refundTokens(packet) +} +``` +#### Refund logic +```js + +function refundTokens(packet: Packet) { + FungibleTokenPacketData data = packet.data + prefix = "{packet.sourcePort}/{packet.sourceChannel}/" + // we are the source if the denomination is not prefixed + tokenContract=getTokenContracts(data.denom) + source = data.denom.slice(0, len(prefix)) !== prefix + if source { + // sender was source chain, unescrow tokens back to sender + if isNativeAsset { + Context.transfer(data.sender, data.amount) + return + } + tokenContract.transfer(data.sender, data.amount) + } else { + // receiver was source chain, mint vouchers back to sender + tokenContract.mint(data.sender,data.amount) + } +} + +``` + +### Hopchain +Hop is done based on the memo field during sendFungibleTokens. The structure of memo should follow the following [spec](https://github.com/cosmos/ibc-apps/tree/main/middleware/packet-forward-middleware) + From 19e3f02620e850f28164c2c5c672dccf2e831c8b Mon Sep 17 00:00:00 2001 From: ibrizsabin Date: Wed, 15 May 2024 11:38:53 +0545 Subject: [PATCH 11/12] fix: cleanup --- Cargo.toml | 3 --- 1 file changed, 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index fb7159241..57f193c11 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -38,10 +38,7 @@ prost = { version = "0.11.8", default-features = false,features=["prost-derive"] serde-json-wasm = {version="0.5.0", default-features = false} serde_json = "1.0.96" -#serde = { version = "1.0.154", default-features = false, features = ["derive"] } - bytes = { version = "1.4.0", default-features = false } -#thiserror = { version = "1.0.39" } hex ={ version = "0.4.3", default-features = false } hex-literal={version ="*"} debug_print = "1.0.0" From e76b4b4bbb6d31d8432de0a9ebc6a0d07ed0394b Mon Sep 17 00:00:00 2001 From: bcsainju <157450414+bcsainju@users.noreply.github.com> Date: Mon, 15 Jul 2024 17:50:30 +0545 Subject: [PATCH 12/12] =?UTF-8?q?feat:=20added=20framework=20for=20remote?= =?UTF-8?q?=20chan=20tests=20and=20TC=20for=20token=20transfer=20=E2=80=A6?= =?UTF-8?q?=20(#832)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * add: added framework for remote chan tests and TC for token transfer to-and-from ibc-centauri * fix: added test wallets and configs for e2e * fix: added test cases to cover stake transfer from centauri to icon * fix: increased timeouts and add sha256sum of latest light client wasm * added test keys for relayer for deevnet * feat: added testcase for icon-archway and back via centauri hopchain * chore: refactorings and adjust timeouts * chore: added sample config * chore: added sample config file to run in devnet with configured connection * chore: removed extra logging * chore: added codes in makefile to run hopchain tests * chore: made receivers configurable and updated docs * chore: updated docs for old xcall tests and new ones * fix: fixed case of wallet of chain * fix: fixed case of gh actions issue * fix: remove old test * fix: fixed PR comments --------- Co-authored-by: ibrizsabin Co-authored-by: ibrizsabin <101165234+ibrizsabin@users.noreply.github.com> --- Makefile | 4 + .../cw-icon-light-client/src/context.rs | 1 - .../src/light_client.rs | 2 +- docs/e2e-integration-test-setup.md | 20 +- scripts/execute-test.sh | 8 + test/chains/archway/data/config/app.toml | 263 ++++++ test/chains/archway/data/config/client.toml | 17 + test/chains/archway/data/config/config.toml | 492 +++++++++++ ...6e61d7d7d2e0305d7e2c5604246d892bf2.address | 1 + ...0bb88ebbd0b77f30cba39e1e06447c2d2b.address | 1 + ...3a2b95427aa946e3f43d107d69ae084e01.address | 1 + .../archway/data/keyring-test/default.info | 1 + test/chains/archway/data/keyring-test/fd.info | 1 + .../archway/data/keyring-test/mykey.info | 1 + .../archway/data/keyring-test/relayer.info | 1 + test/chains/chain.go | 9 +- test/chains/cosmos/cosmos_remote_chain.go | 262 ++++++ test/chains/cosmos/data/config/app.toml | 270 ++++++ test/chains/cosmos/data/config/client.toml | 17 + test/chains/cosmos/data/config/config.toml | 471 ++++++++++ ...6e61d7d7d2e0305d7e2c5604246d892bf2.address | 1 + ...0bb88ebbd0b77f30cba39e1e06447c2d2b.address | 1 + ...93e3abd46c72a4031762d680d6d62ead2f.address | 1 + .../cosmos/data/keyring-test/default.info | 1 + test/chains/cosmos/data/keyring-test/fd.info | 1 + .../cosmos/data/keyring-test/relayer.info | 1 + test/chains/cosmos/localnet.go | 24 +- test/chains/cosmos/remotenet.go | 260 ++++++ test/chains/cosmos/types.go | 22 + test/chains/icon/data/config/config.lock | 0 test/chains/icon/data/config/config.yaml | 55 ++ ...6e61d7d7d2e0305d7e2c5604246d892bf2.address | 1 + .../keyring-test/centauri-testnet-1.info | 1 + test/chains/icon/data/minter.json | 1 + test/chains/icon/localnet.go | 27 +- test/chains/icon/remotenet.go | 809 ++++++++++++++++++ test/e2e-demo/e2e_demo_test.go | 6 +- test/e2e-hopchain/e2e_hopchain_test.go | 33 + test/e2e-hopchain/hopchain.go | 355 ++++++++ test/e2e/tests/xcall.go | 13 +- test/integration/tests/relayer.go | 9 +- test/interchain.go | 92 +- test/relayer/data/config/config.yaml | 94 ++ ...6e61d7d7d2e0305d7e2c5604246d892bf2.address | 1 + .../keyring-test/default.info | 1 + .../relayer/data/keys/ibc-icon/godwallet.json | 23 + test/relayer/data/keys/ibc-icon/minter.json | 23 + ...6e61d7d7d2e0305d7e2c5604246d892bf2.address | 1 + ...0bb88ebbd0b77f30cba39e1e06447c2d2b.address | 1 + ...3a2b95427aa946e3f43d107d69ae084e01.address | 1 + .../keys/localnet-1/keyring-test/default.info | 1 + .../data/keys/localnet-1/keyring-test/fd.info | 1 + .../keys/localnet-1/keyring-test/mykey.info | 1 + .../keys/localnet-1/keyring-test/relayer.info | 1 + ...6e61d7d7d2e0305d7e2c5604246d892bf2.address | 1 + ...3a2b95427aa946e3f43d107d69ae084e01.address | 1 + .../keys/test-1/keyring-test/default.info | 1 + .../data/keys/test-1/keyring-test/mykey.info | 1 + test/relayer/docker.go | 62 +- test/relayer/icon/icon_relayer.go | 39 +- test/relayer/icon/icon_relayer_remote.go | 427 +++++++++ test/relayerfactory.go | 9 +- test/test_setup.go | 4 +- test/testsuite/e2e_suite.go | 82 +- test/testsuite/integration_suite.go | 3 +- test/testsuite/relayer/relayer.go | 7 +- test/testsuite/sample-config-archway.yaml | 2 +- test/testsuite/sample-config-ics20.yaml | 117 +++ test/testsuite/testconfig/testconfig.go | 11 +- test/testsuite/testsuite.go | 183 +++- 70 files changed, 4529 insertions(+), 127 deletions(-) create mode 100644 test/chains/archway/data/config/app.toml create mode 100644 test/chains/archway/data/config/client.toml create mode 100644 test/chains/archway/data/config/config.toml create mode 100644 test/chains/archway/data/keyring-test/4506a66e61d7d7d2e0305d7e2c5604246d892bf2.address create mode 100644 test/chains/archway/data/keyring-test/5a97f90bb88ebbd0b77f30cba39e1e06447c2d2b.address create mode 100644 test/chains/archway/data/keyring-test/c5fa013a2b95427aa946e3f43d107d69ae084e01.address create mode 100644 test/chains/archway/data/keyring-test/default.info create mode 100644 test/chains/archway/data/keyring-test/fd.info create mode 100644 test/chains/archway/data/keyring-test/mykey.info create mode 100644 test/chains/archway/data/keyring-test/relayer.info create mode 100644 test/chains/cosmos/cosmos_remote_chain.go create mode 100644 test/chains/cosmos/data/config/app.toml create mode 100644 test/chains/cosmos/data/config/client.toml create mode 100644 test/chains/cosmos/data/config/config.toml create mode 100644 test/chains/cosmos/data/keyring-test/4506a66e61d7d7d2e0305d7e2c5604246d892bf2.address create mode 100644 test/chains/cosmos/data/keyring-test/5a97f90bb88ebbd0b77f30cba39e1e06447c2d2b.address create mode 100644 test/chains/cosmos/data/keyring-test/d2d94193e3abd46c72a4031762d680d6d62ead2f.address create mode 100644 test/chains/cosmos/data/keyring-test/default.info create mode 100644 test/chains/cosmos/data/keyring-test/fd.info create mode 100644 test/chains/cosmos/data/keyring-test/relayer.info create mode 100644 test/chains/cosmos/remotenet.go create mode 100644 test/chains/icon/data/config/config.lock create mode 100644 test/chains/icon/data/config/config.yaml create mode 100644 test/chains/icon/data/keys/centauri-testnet-1/keyring-test/4506a66e61d7d7d2e0305d7e2c5604246d892bf2.address create mode 100644 test/chains/icon/data/keys/centauri-testnet-1/keyring-test/centauri-testnet-1.info create mode 100644 test/chains/icon/data/minter.json create mode 100644 test/chains/icon/remotenet.go create mode 100644 test/e2e-hopchain/e2e_hopchain_test.go create mode 100644 test/e2e-hopchain/hopchain.go create mode 100644 test/relayer/data/config/config.yaml create mode 100644 test/relayer/data/keys/centauri-testnet-1/keyring-test/4506a66e61d7d7d2e0305d7e2c5604246d892bf2.address create mode 100644 test/relayer/data/keys/centauri-testnet-1/keyring-test/default.info create mode 100644 test/relayer/data/keys/ibc-icon/godwallet.json create mode 100644 test/relayer/data/keys/ibc-icon/minter.json create mode 100644 test/relayer/data/keys/localnet-1/keyring-test/4506a66e61d7d7d2e0305d7e2c5604246d892bf2.address create mode 100644 test/relayer/data/keys/localnet-1/keyring-test/5a97f90bb88ebbd0b77f30cba39e1e06447c2d2b.address create mode 100644 test/relayer/data/keys/localnet-1/keyring-test/c5fa013a2b95427aa946e3f43d107d69ae084e01.address create mode 100644 test/relayer/data/keys/localnet-1/keyring-test/default.info create mode 100644 test/relayer/data/keys/localnet-1/keyring-test/fd.info create mode 100644 test/relayer/data/keys/localnet-1/keyring-test/mykey.info create mode 100644 test/relayer/data/keys/localnet-1/keyring-test/relayer.info create mode 100644 test/relayer/data/keys/test-1/keyring-test/4506a66e61d7d7d2e0305d7e2c5604246d892bf2.address create mode 100644 test/relayer/data/keys/test-1/keyring-test/c5fa013a2b95427aa946e3f43d107d69ae084e01.address create mode 100644 test/relayer/data/keys/test-1/keyring-test/default.info create mode 100644 test/relayer/data/keys/test-1/keyring-test/mykey.info create mode 100644 test/relayer/icon/icon_relayer_remote.go create mode 100644 test/testsuite/sample-config-ics20.yaml diff --git a/Makefile b/Makefile index a7a54c72b..c444faa1a 100644 --- a/Makefile +++ b/Makefile @@ -84,6 +84,10 @@ e2e: @echo "Running e2e tests..." go test -v ./test/e2e -testify.m TestE2E_all +e2e-hopchain: + @echo "Running hopchain e2e tests..." + go test -v ./test/e2e-hopchain -testify.m TestE2E_hopchain + e2e-demo-setup: @echo "Configuring e2e demo..." export PRESERVE_DOCKER=true && \ diff --git a/contracts/cosmwasm-vm/cw-icon-light-client/src/context.rs b/contracts/cosmwasm-vm/cw-icon-light-client/src/context.rs index a6100b4e9..09fe90b95 100644 --- a/contracts/cosmwasm-vm/cw-icon-light-client/src/context.rs +++ b/contracts/cosmwasm-vm/cw-icon-light-client/src/context.rs @@ -539,7 +539,6 @@ mod tests { let mut contract = CwContext::new(deps.as_mut(), mock_env()); contract.insert_config(&config).unwrap(); - contract .ensure_ibc_host(&Addr::unchecked("regular_host")) .unwrap() diff --git a/contracts/cosmwasm-vm/cw-light-client-common/src/light_client.rs b/contracts/cosmwasm-vm/cw-light-client-common/src/light_client.rs index 12b6ae694..64973ea67 100644 --- a/contracts/cosmwasm-vm/cw-light-client-common/src/light_client.rs +++ b/contracts/cosmwasm-vm/cw-light-client-common/src/light_client.rs @@ -235,4 +235,4 @@ impl ILightClient for IconClient { Ok(()) } -} +} \ No newline at end of file diff --git a/docs/e2e-integration-test-setup.md b/docs/e2e-integration-test-setup.md index a74b8b6fe..821fe22d5 100644 --- a/docs/e2e-integration-test-setup.md +++ b/docs/e2e-integration-test-setup.md @@ -65,7 +65,8 @@ To run the demo, the following software needs to be installed. ```bash git clone https://github.com/archway-network/archway/ cd archway - docker build -f Dockerfile.deprecated -t archway . --build-arg arch=aarch64 + git checkout v0.5.1 + docker build -f Dockerfile.deprecated -t archwaynetwork/archwayd:v0.5.1 . --build-arg arch=aarch64 cd .. ``` @@ -132,7 +133,18 @@ go test -v ./test/e2e -timeout 0 go test -v ./test/integration -timeout 0 ``` -#### 3. Set Up the Demo Test Environment (Optional) +#### 5. Set Up the Hpchain Test Environment (Optional) +- To execute the end-to-end hopchain tests: +```bash +export TEST_CONFIG_PATH=/home/User/IBC-integration/test/testsuite/sample-config-ics20.yaml; +make e2e-hopchain +``` +ℹ️ The hopchain tests expects remote chain deployments with respective keys for each chain in the expected folders and synced with remote chains. To use existing relay config, the config should be placed at /home/User/IBC-integration/test/relayer/data/config/config.yaml and the parameters **ics20_app** should be populated with ics20_app deployed address and the flag **use_existing_config** should be true. To create new connection and channels, the param should be set to false and ics20_app value should be empty. The test case assumes following receiver address to be specified in config which might reqiure some funds to be available. + +Necessary configured keys should exist at appropriate location for chain/relayer at /home/User/IBC-integration/test/chains/{chain_name}/data and test/relayer/data/keys/{chain_id} + + +#### 5. Set Up the Demo Test Environment (Optional) If necessary, establish the e2e demo test environment by executing the following command: @@ -142,10 +154,10 @@ make e2e-demo-setup During the setup process, distinct configuration files are generated in the `test/e2e-demo/ibc-config` directory. These files include contract addresses, along with wallets containing mnemonic/private keys. These keys are essential for conducting subsequent tests. -#### 4. Clean Up the Demo Test Environment (Optional) +#### 6. Clean Up the Demo Test Environment (Optional) Upon completion of the testing process, if you've set up the e2e demo environment, you can execute the following command to perform a cleanup: ```bash make e2e-demo-clean -``` +``` \ No newline at end of file diff --git a/scripts/execute-test.sh b/scripts/execute-test.sh index 866281531..e4311ac9e 100755 --- a/scripts/execute-test.sh +++ b/scripts/execute-test.sh @@ -39,6 +39,11 @@ e2e_test() { go test -v ./test/e2e -timeout 0 -count=1 } +e2e_hopchain() { + echo "Running e2e hopchain test..." + go test -v ./test/e2e-hopchain -timeout 0 -count=1 +} + e2e_demo() { echo "Configuring e2e demo..." export PRESERVE_DOCKER=true && go test -v ./test/e2e-demo -testify.m TestSetup @@ -117,6 +122,9 @@ case "$test" in "e2e") e2e_test ;; +"e2e-hopchain") + e2e_hopchain + ;; "e2e-demo") e2e_demo ;; diff --git a/test/chains/archway/data/config/app.toml b/test/chains/archway/data/config/app.toml new file mode 100644 index 000000000..daacb8a4b --- /dev/null +++ b/test/chains/archway/data/config/app.toml @@ -0,0 +1,263 @@ +# This is a TOML config file. +# For more information, see https://github.com/toml-lang/toml + +############################################################################### +### Base Configuration ### +############################################################################### + +# The minimum gas prices a validator is willing to accept for processing a +# transaction. A transaction's fees must meet the minimum of any denomination +# specified in this config (e.g. 0.25token1,0.0001token2). +minimum-gas-prices = "" + +# default: the last 362880 states are kept, pruning at 10 block intervals +# nothing: all historic states will be saved, nothing will be deleted (i.e. archiving node) +# everything: 2 latest states will be kept; pruning at 10 block intervals. +# custom: allow pruning options to be manually specified through 'pruning-keep-recent', and 'pruning-interval' +pruning = "default" + +# These are applied if and only if the pruning strategy is custom. +pruning-keep-recent = "0" +pruning-interval = "0" + +# HaltHeight contains a non-zero block height at which a node will gracefully +# halt and shutdown that can be used to assist upgrades and testing. +# +# Note: Commitment of state will be attempted on the corresponding block. +halt-height = 0 + +# HaltTime contains a non-zero minimum block time (in Unix seconds) at which +# a node will gracefully halt and shutdown that can be used to assist upgrades +# and testing. +# +# Note: Commitment of state will be attempted on the corresponding block. +halt-time = 0 + +# MinRetainBlocks defines the minimum block height offset from the current +# block being committed, such that all blocks past this offset are pruned +# from Tendermint. It is used as part of the process of determining the +# ResponseCommit.RetainHeight value during ABCI Commit. A value of 0 indicates +# that no blocks should be pruned. +# +# This configuration value is only responsible for pruning Tendermint blocks. +# It has no bearing on application state pruning which is determined by the +# "pruning-*" configurations. +# +# Note: Tendermint block pruning is dependant on this parameter in conunction +# with the unbonding (safety threshold) period, state pruning and state sync +# snapshot parameters to determine the correct minimum value of +# ResponseCommit.RetainHeight. +min-retain-blocks = 0 + +# InterBlockCache enables inter-block caching. +inter-block-cache = true + +# IndexEvents defines the set of events in the form {eventType}.{attributeKey}, +# which informs Tendermint what to index. If empty, all events will be indexed. +# +# Example: +# ["message.sender", "message.recipient"] +index-events = [] + +# IavlCacheSize set the size of the iavl tree cache (in number of nodes). +iavl-cache-size = 781250 + +# IAVLDisableFastNode enables or disables the fast node feature of IAVL. +# Default is false. +iavl-disable-fastnode = false + +# IAVLLazyLoading enable/disable the lazy loading of iavl store. +# Default is false. +iavl-lazy-loading = false + +# AppDBBackend defines the database backend type to use for the application and snapshots DBs. +# An empty string indicates that a fallback will be used. +# The fallback is the db_backend value set in Tendermint's config.toml. +app-db-backend = "" + +############################################################################### +### Telemetry Configuration ### +############################################################################### + +[telemetry] + +# Prefixed with keys to separate services. +service-name = "" + +# Enabled enables the application telemetry functionality. When enabled, +# an in-memory sink is also enabled by default. Operators may also enabled +# other sinks such as Prometheus. +enabled = false + +# Enable prefixing gauge values with hostname. +enable-hostname = false + +# Enable adding hostname to labels. +enable-hostname-label = false + +# Enable adding service to labels. +enable-service-label = false + +# PrometheusRetentionTime, when positive, enables a Prometheus metrics sink. +prometheus-retention-time = 0 + +# GlobalLabels defines a global set of name/value label tuples applied to all +# metrics emitted using the wrapper functions defined in telemetry package. +# +# Example: +# [["chain_id", "cosmoshub-1"]] +global-labels = [ +] + +############################################################################### +### API Configuration ### +############################################################################### + +[api] + +# Enable defines if the API server should be enabled. +enable = false + +# Swagger defines if swagger documentation should automatically be registered. +swagger = false + +# Address defines the API server to listen on. +address = "tcp://localhost:1317" + +# MaxOpenConnections defines the number of maximum open connections. +max-open-connections = 1000 + +# RPCReadTimeout defines the Tendermint RPC read timeout (in seconds). +rpc-read-timeout = 10 + +# RPCWriteTimeout defines the Tendermint RPC write timeout (in seconds). +rpc-write-timeout = 0 + +# RPCMaxBodyBytes defines the Tendermint maximum request body (in bytes). +rpc-max-body-bytes = 1000000 + +# EnableUnsafeCORS defines if CORS should be enabled (unsafe - use it at your own risk). +enabled-unsafe-cors = false + +############################################################################### +### Rosetta Configuration ### +############################################################################### + +[rosetta] + +# Enable defines if the Rosetta API server should be enabled. +enable = false + +# Address defines the Rosetta API server to listen on. +address = ":8080" + +# Network defines the name of the blockchain that will be returned by Rosetta. +blockchain = "app" + +# Network defines the name of the network that will be returned by Rosetta. +network = "network" + +# Retries defines the number of retries when connecting to the node before failing. +retries = 3 + +# Offline defines if Rosetta server should run in offline mode. +offline = false + +# EnableDefaultSuggestedFee defines if the server should suggest fee by default. +# If 'construction/medata' is called without gas limit and gas price, +# suggested fee based on gas-to-suggest and denom-to-suggest will be given. +enable-fee-suggestion = false + +# GasToSuggest defines gas limit when calculating the fee +gas-to-suggest = 200000 + +# DenomToSuggest defines the defult denom for fee suggestion. +# Price must be in minimum-gas-prices. +denom-to-suggest = "uatom" + +############################################################################### +### gRPC Configuration ### +############################################################################### + +[grpc] + +# Enable defines if the gRPC server should be enabled. +enable = true + +# Address defines the gRPC server address to bind to. +address = "localhost:9090" + +# MaxRecvMsgSize defines the max message size in bytes the server can receive. +# The default value is 10MB. +max-recv-msg-size = "10485760" + +# MaxSendMsgSize defines the max message size in bytes the server can send. +# The default value is math.MaxInt32. +max-send-msg-size = "2147483647" + +############################################################################### +### gRPC Web Configuration ### +############################################################################### + +[grpc-web] + +# GRPCWebEnable defines if the gRPC-web should be enabled. +# NOTE: gRPC must also be enabled, otherwise, this configuration is a no-op. +enable = true + +# Address defines the gRPC-web server address to bind to. +address = "localhost:9091" + +# EnableUnsafeCORS defines if CORS should be enabled (unsafe - use it at your own risk). +enable-unsafe-cors = false + +############################################################################### +### State Sync Configuration ### +############################################################################### + +# State sync snapshots allow other nodes to rapidly join the network without replaying historical +# blocks, instead downloading and applying a snapshot of the application state at a given height. +[state-sync] + +# snapshot-interval specifies the block interval at which local state sync snapshots are +# taken (0 to disable). +snapshot-interval = 0 + +# snapshot-keep-recent specifies the number of recent snapshots to keep and serve (0 to keep all). +snapshot-keep-recent = 2 + +############################################################################### +### Store / State Streaming ### +############################################################################### + +[store] +streamers = [] + +[streamers] +[streamers.file] +keys = ["*", ] +write_dir = "" +prefix = "" + +# output-metadata specifies if output the metadata file which includes the abci request/responses +# during processing the block. +output-metadata = "true" + +# stop-node-on-error specifies if propagate the file streamer errors to consensus state machine. +stop-node-on-error = "true" + +# fsync specifies if call fsync after writing the files. +fsync = "false" + +############################################################################### +### Mempool ### +############################################################################### + +[mempool] +# Setting max-txs to 0 will allow for a unbounded amount of transactions in the mempool. +# Setting max_txs to negative 1 (-1) will disable transactions from being inserted into the mempool. +# Setting max_txs to a positive number (> 0) will limit the number of transactions in the mempool, by the specified amount. +# +# Note, this configuration only applies to SDK built-in app-side mempool +# implementations. +max-txs = 5000 diff --git a/test/chains/archway/data/config/client.toml b/test/chains/archway/data/config/client.toml new file mode 100644 index 000000000..d3f675cec --- /dev/null +++ b/test/chains/archway/data/config/client.toml @@ -0,0 +1,17 @@ +# This is a TOML config file. +# For more information, see https://github.com/toml-lang/toml + +############################################################################### +### Client Configuration ### +############################################################################### + +# The network chain ID +chain-id = "localnet-1" +# The keyring's backend, where the keys are stored (os|file|kwallet|pass|test|memory) +keyring-backend = "os" +# CLI output format (text|json) +output = "text" +# : to Tendermint RPC interface for this chain +node = "tcp://localhost:26657" +# Transaction broadcasting mode (sync|async) +broadcast-mode = "sync" diff --git a/test/chains/archway/data/config/config.toml b/test/chains/archway/data/config/config.toml new file mode 100644 index 000000000..9f9ac1a62 --- /dev/null +++ b/test/chains/archway/data/config/config.toml @@ -0,0 +1,492 @@ +# This is a TOML config file. +# For more information, see https://github.com/toml-lang/toml + +# NOTE: Any path below can be absolute (e.g. "/var/myawesomeapp/data") or +# relative to the home directory (e.g. "data"). The home directory is +# "$HOME/.cometbft" by default, but could be changed via $CMTHOME env variable +# or --home cmd flag. + +####################################################################### +### Main Base Config Options ### +####################################################################### + +# TCP or UNIX socket address of the ABCI application, +# or the name of an ABCI application compiled in with the CometBFT binary +proxy_app = "tcp://127.0.0.1:26658" + +# A custom human readable name for this node +moniker = "TestE2EHopchainTestSuite_TestE2E_hopchain-akbnew" + +# If this node is many blocks behind the tip of the chain, BlockSync +# allows them to catchup quickly by downloading blocks in parallel +# and verifying their commits +# +# Deprecated: this key will be removed and BlockSync will be enabled +# unconditionally in the next major release. +block_sync = true + +# Database backend: goleveldb | cleveldb | boltdb | rocksdb | badgerdb +# * goleveldb (github.com/syndtr/goleveldb - most popular implementation) +# - pure go +# - stable +# * cleveldb (uses levigo wrapper) +# - fast +# - requires gcc +# - use cleveldb build tag (go build -tags cleveldb) +# * boltdb (uses etcd's fork of bolt - github.com/etcd-io/bbolt) +# - EXPERIMENTAL +# - may be faster is some use-cases (random reads - indexer) +# - use boltdb build tag (go build -tags boltdb) +# * rocksdb (uses github.com/tecbot/gorocksdb) +# - EXPERIMENTAL +# - requires gcc +# - use rocksdb build tag (go build -tags rocksdb) +# * badgerdb (uses github.com/dgraph-io/badger) +# - EXPERIMENTAL +# - use badgerdb build tag (go build -tags badgerdb) +db_backend = "goleveldb" + +# Database directory +db_dir = "data" + +# Output level for logging, including package level options +log_level = "info" + +# Output format: 'plain' (colored text) or 'json' +log_format = "plain" + +##### additional base config options ##### + +# Path to the JSON file containing the initial validator set and other meta data +genesis_file = "config/genesis.json" + +# Path to the JSON file containing the private key to use as a validator in the consensus protocol +priv_validator_key_file = "config/priv_validator_key.json" + +# Path to the JSON file containing the last sign state of a validator +priv_validator_state_file = "data/priv_validator_state.json" + +# TCP or UNIX socket address for CometBFT to listen on for +# connections from an external PrivValidator process +priv_validator_laddr = "" + +# Path to the JSON file containing the private key to use for node authentication in the p2p protocol +node_key_file = "config/node_key.json" + +# Mechanism to connect to the ABCI application: socket | grpc +abci = "socket" + +# If true, query the ABCI app on connecting to a new peer +# so the app can decide if we should keep the connection or not +filter_peers = false + + +####################################################################### +### Advanced Configuration Options ### +####################################################################### + +####################################################### +### RPC Server Configuration Options ### +####################################################### +[rpc] + +# TCP or UNIX socket address for the RPC server to listen on +laddr = "tcp://127.0.0.1:26657" + +# A list of origins a cross-domain request can be executed from +# Default value '[]' disables cors support +# Use '["*"]' to allow any origin +cors_allowed_origins = [] + +# A list of methods the client is allowed to use with cross-domain requests +cors_allowed_methods = ["HEAD", "GET", "POST", ] + +# A list of non simple headers the client is allowed to use with cross-domain requests +cors_allowed_headers = ["Origin", "Accept", "Content-Type", "X-Requested-With", "X-Server-Time", ] + +# TCP or UNIX socket address for the gRPC server to listen on +# NOTE: This server only supports /broadcast_tx_commit +grpc_laddr = "" + +# Maximum number of simultaneous connections. +# Does not include RPC (HTTP&WebSocket) connections. See max_open_connections +# If you want to accept a larger number than the default, make sure +# you increase your OS limits. +# 0 - unlimited. +# Should be < {ulimit -Sn} - {MaxNumInboundPeers} - {MaxNumOutboundPeers} - {N of wal, db and other open files} +# 1024 - 40 - 10 - 50 = 924 = ~900 +grpc_max_open_connections = 900 + +# Activate unsafe RPC commands like /dial_seeds and /unsafe_flush_mempool +unsafe = false + +# Maximum number of simultaneous connections (including WebSocket). +# Does not include gRPC connections. See grpc_max_open_connections +# If you want to accept a larger number than the default, make sure +# you increase your OS limits. +# 0 - unlimited. +# Should be < {ulimit -Sn} - {MaxNumInboundPeers} - {MaxNumOutboundPeers} - {N of wal, db and other open files} +# 1024 - 40 - 10 - 50 = 924 = ~900 +max_open_connections = 900 + +# Maximum number of unique clientIDs that can /subscribe +# If you're using /broadcast_tx_commit, set to the estimated maximum number +# of broadcast_tx_commit calls per block. +max_subscription_clients = 100 + +# Maximum number of unique queries a given client can /subscribe to +# If you're using GRPC (or Local RPC client) and /broadcast_tx_commit, set to +# the estimated # maximum number of broadcast_tx_commit calls per block. +max_subscriptions_per_client = 5 + +# Experimental parameter to specify the maximum number of events a node will +# buffer, per subscription, before returning an error and closing the +# subscription. Must be set to at least 100, but higher values will accommodate +# higher event throughput rates (and will use more memory). +experimental_subscription_buffer_size = 200 + +# Experimental parameter to specify the maximum number of RPC responses that +# can be buffered per WebSocket client. If clients cannot read from the +# WebSocket endpoint fast enough, they will be disconnected, so increasing this +# parameter may reduce the chances of them being disconnected (but will cause +# the node to use more memory). +# +# Must be at least the same as "experimental_subscription_buffer_size", +# otherwise connections could be dropped unnecessarily. This value should +# ideally be somewhat higher than "experimental_subscription_buffer_size" to +# accommodate non-subscription-related RPC responses. +experimental_websocket_write_buffer_size = 200 + +# If a WebSocket client cannot read fast enough, at present we may +# silently drop events instead of generating an error or disconnecting the +# client. +# +# Enabling this experimental parameter will cause the WebSocket connection to +# be closed instead if it cannot read fast enough, allowing for greater +# predictability in subscription behavior. +experimental_close_on_slow_client = false + +# How long to wait for a tx to be committed during /broadcast_tx_commit. +# WARNING: Using a value larger than 10s will result in increasing the +# global HTTP write timeout, which applies to all connections and endpoints. +# See https://github.com/tendermint/tendermint/issues/3435 +timeout_broadcast_tx_commit = "10s" + +# Maximum size of request body, in bytes +max_body_bytes = 1000000 + +# Maximum size of request header, in bytes +max_header_bytes = 1048576 + +# The path to a file containing certificate that is used to create the HTTPS server. +# Might be either absolute path or path related to CometBFT's config directory. +# If the certificate is signed by a certificate authority, +# the certFile should be the concatenation of the server's certificate, any intermediates, +# and the CA's certificate. +# NOTE: both tls_cert_file and tls_key_file must be present for CometBFT to create HTTPS server. +# Otherwise, HTTP server is run. +tls_cert_file = "" + +# The path to a file containing matching private key that is used to create the HTTPS server. +# Might be either absolute path or path related to CometBFT's config directory. +# NOTE: both tls-cert-file and tls-key-file must be present for CometBFT to create HTTPS server. +# Otherwise, HTTP server is run. +tls_key_file = "" + +# pprof listen address (https://golang.org/pkg/net/http/pprof) +pprof_laddr = "localhost:6060" + +####################################################### +### P2P Configuration Options ### +####################################################### +[p2p] + +# Address to listen for incoming connections +laddr = "tcp://0.0.0.0:26656" + +# Address to advertise to peers for them to dial. If empty, will use the same +# port as the laddr, and will introspect on the listener to figure out the +# address. IP and port are required. Example: 159.89.10.97:26656 +external_address = "" + +# Comma separated list of seed nodes to connect to +seeds = "" + +# Comma separated list of nodes to keep persistent connections to +persistent_peers = "" + +# Path to address book +addr_book_file = "config/addrbook.json" + +# Set true for strict address routability rules +# Set false for private or local networks +addr_book_strict = true + +# Maximum number of inbound peers +max_num_inbound_peers = 40 + +# Maximum number of outbound peers to connect to, excluding persistent peers +max_num_outbound_peers = 10 + +# List of node IDs, to which a connection will be (re)established ignoring any existing limits +unconditional_peer_ids = "" + +# Maximum pause when redialing a persistent peer (if zero, exponential backoff is used) +persistent_peers_max_dial_period = "0s" + +# Time to wait before flushing messages out on the connection +flush_throttle_timeout = "100ms" + +# Maximum size of a message packet payload, in bytes +max_packet_msg_payload_size = 1024 + +# Rate at which packets can be sent, in bytes/second +send_rate = 5120000 + +# Rate at which packets can be received, in bytes/second +recv_rate = 5120000 + +# Set true to enable the peer-exchange reactor +pex = true + +# Seed mode, in which node constantly crawls the network and looks for +# peers. If another node asks it for addresses, it responds and disconnects. +# +# Does not work if the peer-exchange reactor is disabled. +seed_mode = false + +# Comma separated list of peer IDs to keep private (will not be gossiped to other peers) +private_peer_ids = "" + +# Toggle to disable guard against peers connecting from the same ip. +allow_duplicate_ip = false + +# Peer connection configuration. +handshake_timeout = "20s" +dial_timeout = "3s" + +####################################################### +### Mempool Configuration Option ### +####################################################### +[mempool] + +# Mempool version to use: +# 1) "v0" - (default) FIFO mempool. +# 2) "v1" - prioritized mempool (deprecated; will be removed in the next release). +version = "v0" + +# The type of mempool for this node to use. +# +# Possible types: +# - "flood" : concurrent linked list mempool with flooding gossip protocol +# (default) +# - "nop" : nop-mempool (short for no operation; the ABCI app is responsible +# for storing, disseminating and proposing txs). "create_empty_blocks=false" is +# not supported. +type = "flood" + +recheck = true +broadcast = true +wal_dir = "" + +# Maximum number of transactions in the mempool +size = 5000 + +# Limit the total size of all txs in the mempool. +# This only accounts for raw transactions (e.g. given 1MB transactions and +# max_txs_bytes=5MB, mempool will only accept 5 transactions). +max_txs_bytes = 1073741824 + +# Size of the cache (used to filter transactions we saw earlier) in transactions +cache_size = 10000 + +# Do not remove invalid transactions from the cache (default: false) +# Set to true if it's not possible for any invalid transaction to become valid +# again in the future. +keep-invalid-txs-in-cache = false + +# Maximum size of a single transaction. +# NOTE: the max size of a tx transmitted over the network is {max_tx_bytes}. +max_tx_bytes = 1048576 + +# Maximum size of a batch of transactions to send to a peer +# Including space needed by encoding (one varint per transaction). +# XXX: Unused due to https://github.com/tendermint/tendermint/issues/5796 +max_batch_bytes = 0 + +# ttl-duration, if non-zero, defines the maximum amount of time a transaction +# can exist for in the mempool. +# +# Note, if ttl-num-blocks is also defined, a transaction will be removed if it +# has existed in the mempool at least ttl-num-blocks number of blocks or if it's +# insertion time into the mempool is beyond ttl-duration. +ttl-duration = "0s" + +# ttl-num-blocks, if non-zero, defines the maximum number of blocks a transaction +# can exist for in the mempool. +# +# Note, if ttl-duration is also defined, a transaction will be removed if it +# has existed in the mempool at least ttl-num-blocks number of blocks or if +# it's insertion time into the mempool is beyond ttl-duration. +ttl-num-blocks = 0 + +# Experimental parameters to limit gossiping txs to up to the specified number of peers. +# This feature is only available for the default mempool (version config set to "v0"). +# We use two independent upper values for persistent and non-persistent peers. +# Unconditional peers are not affected by this feature. +# If we are connected to more than the specified number of persistent peers, only send txs to +# ExperimentalMaxGossipConnectionsToPersistentPeers of them. If one of those +# persistent peers disconnects, activate another persistent peer. +# Similarly for non-persistent peers, with an upper limit of +# ExperimentalMaxGossipConnectionsToNonPersistentPeers. +# If set to 0, the feature is disabled for the corresponding group of peers, that is, the +# number of active connections to that group of peers is not bounded. +# For non-persistent peers, if enabled, a value of 10 is recommended based on experimental +# performance results using the default P2P configuration. +experimental_max_gossip_connections_to_persistent_peers = 0 +experimental_max_gossip_connections_to_non_persistent_peers = 0 + +####################################################### +### State Sync Configuration Options ### +####################################################### +[statesync] +# State sync rapidly bootstraps a new node by discovering, fetching, and restoring a state machine +# snapshot from peers instead of fetching and replaying historical blocks. Requires some peers in +# the network to take and serve state machine snapshots. State sync is not attempted if the node +# has any local state (LastBlockHeight > 0). The node will have a truncated block history, +# starting from the height of the snapshot. +enable = false + +# RPC servers (comma-separated) for light client verification of the synced state machine and +# retrieval of state data for node bootstrapping. Also needs a trusted height and corresponding +# header hash obtained from a trusted source, and a period during which validators can be trusted. +# +# For Cosmos SDK-based chains, trust_period should usually be about 2/3 of the unbonding time (~2 +# weeks) during which they can be financially punished (slashed) for misbehavior. +rpc_servers = "" +trust_height = 0 +trust_hash = "" +trust_period = "168h0m0s" + +# Time to spend discovering snapshots before initiating a restore. +discovery_time = "15s" + +# Temporary directory for state sync snapshot chunks, defaults to the OS tempdir (typically /tmp). +# Will create a new, randomly named directory within, and remove it when done. +temp_dir = "" + +# The timeout duration before re-requesting a chunk, possibly from a different +# peer (default: 1 minute). +chunk_request_timeout = "10s" + +# The number of concurrent chunk fetchers to run (default: 1). +chunk_fetchers = "4" + +####################################################### +### Block Sync Configuration Options ### +####################################################### +[blocksync] + +# Block Sync version to use: +# +# In v0.37, v1 and v2 of the block sync protocols were deprecated. +# Please use v0 instead. +# +# 1) "v0" - the default block sync implementation +version = "v0" + +####################################################### +### Consensus Configuration Options ### +####################################################### +[consensus] + +wal_file = "data/cs.wal/wal" + +# How long we wait for a proposal block before prevoting nil +timeout_propose = "3s" +# How much timeout_propose increases with each round +timeout_propose_delta = "500ms" +# How long we wait after receiving +2/3 prevotes for “anything” (ie. not a single block or nil) +timeout_prevote = "1s" +# How much the timeout_prevote increases with each round +timeout_prevote_delta = "500ms" +# How long we wait after receiving +2/3 precommits for “anything” (ie. not a single block or nil) +timeout_precommit = "1s" +# How much the timeout_precommit increases with each round +timeout_precommit_delta = "500ms" +# How long we wait after committing a block, before starting on the new +# height (this gives us a chance to receive some more precommits, even +# though we already have +2/3). +timeout_commit = "5s" + +# How many blocks to look back to check existence of the node's consensus votes before joining consensus +# When non-zero, the node will panic upon restart +# if the same consensus key was used to sign {double_sign_check_height} last blocks. +# So, validators should stop the state machine, wait for some blocks, and then restart the state machine to avoid panic. +double_sign_check_height = 0 + +# Make progress as soon as we have all the precommits (as if TimeoutCommit = 0) +skip_timeout_commit = false + +# EmptyBlocks mode and possible interval between empty blocks +create_empty_blocks = true +create_empty_blocks_interval = "0s" + +# Reactor sleep duration parameters +peer_gossip_sleep_duration = "100ms" +peer_query_maj23_sleep_duration = "2s" + +####################################################### +### Storage Configuration Options ### +####################################################### +[storage] + +# Set to true to discard ABCI responses from the state store, which can save a +# considerable amount of disk space. Set to false to ensure ABCI responses are +# persisted. ABCI responses are required for /block_results RPC queries, and to +# reindex events in the command-line tool. +discard_abci_responses = false + +####################################################### +### Transaction Indexer Configuration Options ### +####################################################### +[tx_index] + +# What indexer to use for transactions +# +# The application will set which txs to index. In some cases a node operator will be able +# to decide which txs to index based on configuration set in the application. +# +# Options: +# 1) "null" +# 2) "kv" (default) - the simplest possible indexer, backed by key-value storage (defaults to levelDB; see DBBackend). +# - When "kv" is chosen "tx.height" and "tx.hash" will always be indexed. +# 3) "psql" - the indexer services backed by PostgreSQL. +# When "kv" or "psql" is chosen "tx.height" and "tx.hash" will always be indexed. +indexer = "kv" + +# The PostgreSQL connection configuration, the connection format: +# postgresql://:@:/? +psql-conn = "" + +####################################################### +### Instrumentation Configuration Options ### +####################################################### +[instrumentation] + +# When true, Prometheus metrics are served under /metrics on +# PrometheusListenAddr. +# Check out the documentation for the list of available metrics. +prometheus = false + +# Address to listen for Prometheus collector(s) connections +prometheus_listen_addr = ":26660" + +# Maximum number of simultaneous connections. +# If you want to accept a larger number than the default, make sure +# you increase your OS limits. +# 0 - unlimited. +max_open_connections = 3 + +# Instrumentation namespace +namespace = "cometbft" diff --git a/test/chains/archway/data/keyring-test/4506a66e61d7d7d2e0305d7e2c5604246d892bf2.address b/test/chains/archway/data/keyring-test/4506a66e61d7d7d2e0305d7e2c5604246d892bf2.address new file mode 100644 index 000000000..d9b087577 --- /dev/null +++ b/test/chains/archway/data/keyring-test/4506a66e61d7d7d2e0305d7e2c5604246d892bf2.address @@ -0,0 +1 @@ +eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJjcmVhdGVkIjoiMjAyNC0wMi0wNyAxNDo1Mjo0Ny40NTYyNTMgKzA1NDUgKzA1NDUgbT0rMC4xNjU5NjA2NjciLCJlbmMiOiJBMjU2R0NNIiwicDJjIjo4MTkyLCJwMnMiOiJUWW05d01vNnVZeW0zWVlfIn0.ac8Vv5F3BUQzGvincsu5qHc99n3LIPNJX1YbYmT85qS4fLCa0XqBng.44KA53phoq24xQml.zAIXlqghpWqcGGr9wD2XgqTPich7numUm_ZzToR2XVKpKmwuYPyOVApQ7swEN3CA56parvP2d5CTfPI2exy6QvX6vbl4vRjqzjaf0PtYgWe8FYAC2Uz1GC4mc3yK_fDUpzwexl-wdce0eLQ7JoRaHQHO09bxi2ZEA_uwb1NsIFlxyaZtv7bxyPyjQrXj9S4FG1f__dJ54-bcKHl319D8FuwcFFrLjGpXMbJiIqdjAbZUEb1FceE.jt7iRbKKmesJ1MiELxxUlA \ No newline at end of file diff --git a/test/chains/archway/data/keyring-test/5a97f90bb88ebbd0b77f30cba39e1e06447c2d2b.address b/test/chains/archway/data/keyring-test/5a97f90bb88ebbd0b77f30cba39e1e06447c2d2b.address new file mode 100644 index 000000000..16bc68e4d --- /dev/null +++ b/test/chains/archway/data/keyring-test/5a97f90bb88ebbd0b77f30cba39e1e06447c2d2b.address @@ -0,0 +1 @@ +eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJjcmVhdGVkIjoiMjAyNC0wMy0xOCAxODo0MjoxNS41MjU4MzUgKzA1NDUgKzA1NDUgbT0rMC4wMzQ0ODMxMjYiLCJlbmMiOiJBMjU2R0NNIiwicDJjIjo4MTkyLCJwMnMiOiJ6UFBKUl9UWjJMNnFZSVZjIn0.-BfnwZ_8Gq7DUpnbsWj7wsqYBn91fRqMMx7kHClV08fGncxjEH_ZDQ.Kabj8qQ7ZRSVAWVi.vSgM9IG9sCh-0T2gpnRD4H_XxHImsreuc4vcBDYujYF8-oCKfsGgU2-DfXjakJfVNJzAowfaCuoE8HdyVKUEXv4JEfQFOrHxBre5oah6enTTv1ig2mt2N8xqC_txCxJaGPscNSjOoe8HZn4BcrotbIjgibZ7-FDdzNSE0GqRcVYCobnJZyhk1ZqYRqmNwXqAT26xMA0tDDR-VAgEWSnpk24NBlbE6Kx_Rc4nqR-qCBrn1yT0WvQ.1Ks8qGTLm71qkvsw1v7YTg \ No newline at end of file diff --git a/test/chains/archway/data/keyring-test/c5fa013a2b95427aa946e3f43d107d69ae084e01.address b/test/chains/archway/data/keyring-test/c5fa013a2b95427aa946e3f43d107d69ae084e01.address new file mode 100644 index 000000000..dbcaa0c0f --- /dev/null +++ b/test/chains/archway/data/keyring-test/c5fa013a2b95427aa946e3f43d107d69ae084e01.address @@ -0,0 +1 @@ +eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJjcmVhdGVkIjoiMjAyNC0wMS0yNiAwNDo0MDo1OC4yMTQzMjI3OTkgKzAwMDAgVVRDIG09KzAuMDk0MDgxMDkzIiwiZW5jIjoiQTI1NkdDTSIsInAyYyI6ODE5MiwicDJzIjoicVJjSnpNVmJVMHVxQWFQNyJ9.2gHol9WHYQY4sXnS8sQsGdO1hA4Y7aPAlP8ABxy34vN1HjOJdWBJcg.E1kyHRwKqHS5oLsi.K2H0qGGUcGVCHdqHOr_es-vntkd3wJsxjBmQrLIADUF9czxtTKVTht-wSMUBLoGSiA7-dCsXV6wjeJSygt80SOuoTOm2tOty2Sx9LEtNXmJwWoAv7bXxekxPHQ6AC1NVRAK2CA13AdB450R92CTMLhxismxQZnr5TvgorV6TGJcOd3jLbBvk5xTlq7kcrf8irhN-5rMLFazUGctZE6gBwrXB1sQuSxlKP92z4GCI9rjHraGcE1A.n1X4pY3ZGO6S12EF6fAfkA \ No newline at end of file diff --git a/test/chains/archway/data/keyring-test/default.info b/test/chains/archway/data/keyring-test/default.info new file mode 100644 index 000000000..86e63ef9d --- /dev/null +++ b/test/chains/archway/data/keyring-test/default.info @@ -0,0 +1 @@ +eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJjcmVhdGVkIjoiMjAyNC0wMi0wNyAxNDo1Mjo0Ny40NTI4NTYgKzA1NDUgKzA1NDUgbT0rMC4xNjI1NjMyNTEiLCJlbmMiOiJBMjU2R0NNIiwicDJjIjo4MTkyLCJwMnMiOiJKSzlSZElqUjBJRGdwb0JJIn0.3fYNYfB58hyLugntSUGN1YSZSVk_JEidpRNLezaYxR76oZltQve_0w.RiaxpqNZ1YzZq3JW.BtY4S7hjK_SGP3uZm1kwPvfSfU5ppLT-uFsFOAnEIMK3Q0oLXa4p8EdQm8KDBEsdpShrbBsiwmd-2-dO8XiTcswIBWmZxD437r_MAfbkLRDWvT5sbjqPP_HY2CKnP8Q3gDrwKVBSGZl0FVmU0tWTiLjjf_pYfNhUSVNkr_Lq3PXu9aFxXgI3tehv4ih9TmCpYu-S0d3mEYa63hXrF7iSjW5XaPtauSElHob84DHExuazpeIx-i3vcpAmhzv4FEAH9dg9PZQ91sdIh4SF-GakkpOWxdnH6mdnhMzCuejMCsnUei_BamKtgzXkpa_EpFEq4UWGt7pwn2KuBvObbBQ1QSVUPhq_gitsXZRouuG3rcbK1OQ6dj4EMj88bW1urQ011AOLQVc4CNEUlTTuArv9os-l3OXonQXbNFK0xm1npkI2V9a5dvJt-NNL2RH9dyeDzYA.5vGJXsXLdwRUTUNmjFlIxQ \ No newline at end of file diff --git a/test/chains/archway/data/keyring-test/fd.info b/test/chains/archway/data/keyring-test/fd.info new file mode 100644 index 000000000..581993ac5 --- /dev/null +++ b/test/chains/archway/data/keyring-test/fd.info @@ -0,0 +1 @@ +eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJjcmVhdGVkIjoiMjAyNC0wMy0wNyAxNDoxMjozMy4zNDc3NTQgKzA1NDUgKzA1NDUgbT0rMC4wMjcyMjExNjgiLCJlbmMiOiJBMjU2R0NNIiwicDJjIjo4MTkyLCJwMnMiOiJOZVh2UElidER5em5tZTRyIn0.X-0OBdBTamZ1Wqg-UsxR4OFdwqZtcTju7HQWFanLo644hfsA_eNsuA.afh7OPW4tKoORr5b.yZYjFogogHiSLQmgcreO8f6k4JR_66ezAwqxCIxgshiH65CGVm3zch-C6dUvWhxFNqXgPjcq67DSzzhOk_uCeF7oS1T_X0Q_hwGMngRy-CH0YtPtaQftJdnaVGNxCkC6CTWuhLyn6lu7_ecLOt-co881RgilCYxyz_2znvkj4oFbw94BLCQCsyRll4d1jDLzDPFR1uFu9CcYqU-9lSAjzav0FntsTZEAIvt2j2MR8zxXGiiZJg50XbesMsHEP4ZBlHCPaQzKGEo2Q-R3dImn-d4rSCDOWpDUekxObnUun5-S_3Bn1XuEiTUaTipiYtZHmQnRgMQDsH6hwWVaY5MHQN20BeV8uuw1qEJBuqgdddGX5SuD2yPfXQzVuxGz3MAVu306xczild9FPYMxLwH8fXlh-Yk93gSMmpMIWJRvGll6KwE-6pfX7_jB.910JYZPj8VS8HTyvw7mJ7A \ No newline at end of file diff --git a/test/chains/archway/data/keyring-test/mykey.info b/test/chains/archway/data/keyring-test/mykey.info new file mode 100644 index 000000000..20b6c49e6 --- /dev/null +++ b/test/chains/archway/data/keyring-test/mykey.info @@ -0,0 +1 @@ +eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJjcmVhdGVkIjoiMjAyNC0wMS0yNiAwNDo0MDo1OC4yMDk2NjgxMzUgKzAwMDAgVVRDIG09KzAuMDg5NDI2NDQwIiwiZW5jIjoiQTI1NkdDTSIsInAyYyI6ODE5MiwicDJzIjoiS3FmTmNFMW1iWENBQTZpVyJ9.r-aJTCi-PHclMsmfu567bw2wrrPo0JKEQOmAOtJISg0_eftyJI8q0w.UDbKlG2Qq84f4g0B.CSi7X1zgaMlQFHsP3FjGIswPp60KHUOm6NM4fM9P0c8PGNdBubD7jTTxtCxYULxw3ju5zeqSbEFFW9zvlAHnzj61yXIKoL9Zc9n16CbpgMJh2WQyQ3hLEXBPWwTNNL38JrNaGY9wn0S_L1VXX3_8yf1P31hUeMzAlkjyVV3erHPIb2IbuyWkRHZxgeMmEzM6nMDTkTJj8Znem_k268WBPvC2SIEUk-_xukmgPA87hs30dFVhUnD_MkYEiW3_DiVqqmYNwzL210W59O52uBiOP08EjAlDBG-xgTfY3sjxPWh85AfJUNP3aE-kaV_1Uv37IdbPlOgB70rDbrhn8__4z6INT8GVoiTDuF9P8huk3BEjFJClFOig2dEJgYrwn2OBYRTJR3tTmhlNH7270Ol5GxbD-ZXjn_KHtN_PRay2UIBloTih7AXxXgChEdo.SXkKJLsWwudXLnOb5LmMCA \ No newline at end of file diff --git a/test/chains/archway/data/keyring-test/relayer.info b/test/chains/archway/data/keyring-test/relayer.info new file mode 100644 index 000000000..f1806ceb2 --- /dev/null +++ b/test/chains/archway/data/keyring-test/relayer.info @@ -0,0 +1 @@ +eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJjcmVhdGVkIjoiMjAyNC0wMy0xOCAxODo0MjoxNS41MjQ1OSArMDU0NSArMDU0NSBtPSswLjAzMzIzODAwMSIsImVuYyI6IkEyNTZHQ00iLCJwMmMiOjgxOTIsInAycyI6IlNKYkNlWHljX0hYNGxRdWMifQ.CJj-kKnZrTwpIpCrIisK43SCtB59wkHnJyydrfae_gt6j1I5DX95qA.ACFcCdJGRWAjwzuC.p6Kh-LsJhORVRuzROdIc1LCT-VdhBYrxO_6UdH0aprJ7lTasYi4xgbox98WfXsbLWHUyzQPu8N3g_27OLvqdysQgiGdgryhkYCzM-fDPxgK84_vCecRxjjhmxzTaFW8_ViA-5Tc3omaJjuvMu34L4quv639TuehZlxdN9DYEkLxsCT9xlo39j7p08A2-G-ymJcJU-IKINbDrNQ0KFmhlME3l_Y8wZACjTmvTgJsVeLUwZfqHd2CvGnQwwQaydQheGTl2Q1OyQ5XGz99wzK7T0w8638u_MjOdu4DQAUfPruoNdHHgZ1_cQAu9VGmUtcoo5PnR5EpAtUwont0j4PYBjUCsH67tI-n99xOV6jq9UMCYBOb-rsNPSbfQTpUPPY7rVnIqBjiDzLPJWEBc5DcXr5vt59p4dU2yXcTddeZGW2Vg8ByBfBUOPF0kF_NQfDydq4Y._uDrDR7W6J3FAqDAGyffQg \ No newline at end of file diff --git a/test/chains/chain.go b/test/chains/chain.go index 73cdad04e..398fc7d2f 100644 --- a/test/chains/chain.go +++ b/test/chains/chain.go @@ -5,10 +5,12 @@ import ( "context" "encoding/hex" "fmt" - "github.com/strangelove-ventures/interchaintest/v7/ibc" + "math/big" "os" "strings" + "github.com/strangelove-ventures/interchaintest/v7/ibc" + wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" "github.com/cosmos/gogoproto/proto" conntypes "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types" @@ -61,8 +63,13 @@ type Chain interface { BackupConfig() ([]byte, error) RestoreConfig([]byte) error + GetSenderReceiverAddress() (string, string) //integration test specific SendPacketMockDApp(ctx context.Context, targetChain Chain, keyName string, params map[string]interface{}) (PacketTransferResponse, error) + SetupIBCICS20(ctx context.Context, keyName string) (context.Context, error) + SendIBCTokenTransfer(ctx context.Context, sourceChannel, destinationChannel, port, sender, receiver, chainID, ibcamount string, hopRequired bool) (string, error) + GetWalletBalance(ctx context.Context, address string, denom string) (*big.Int, error) + RegisterToken(ctx context.Context, name, denom, decimal string) error } func GetEnvOrDefault(key, defaultValue string) string { diff --git a/test/chains/cosmos/cosmos_remote_chain.go b/test/chains/cosmos/cosmos_remote_chain.go new file mode 100644 index 000000000..b59d83f05 --- /dev/null +++ b/test/chains/cosmos/cosmos_remote_chain.go @@ -0,0 +1,262 @@ +package cosmos + +import ( + "context" + "encoding/json" + "fmt" + "math/big" + "strings" + + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" + "github.com/docker/docker/client" + "github.com/icon-project/ibc-integration/test/internal/dockerutil" + "github.com/icon-project/ibc-integration/test/testsuite/testconfig" + "github.com/strangelove-ventures/interchaintest/v7/ibc" + "go.uber.org/zap" +) + +// CosmosRemoteChain is a local docker testnet for a Cosmos SDK chain. +// Implements the ibc.Chain interface. +type CosmosRemoteChain struct { + testName string + cfg ibc.ChainConfig + log *zap.Logger + Client *client.Client + Network string + testConfig testconfig.Chain +} + +func NewCosmosHeighlinerChainConfig(name string, + binary string, + bech32Prefix string, + denom string, + gasPrices string, + gasAdjustment float64, + trustingPeriod string, + noHostMount bool) ibc.ChainConfig { + return ibc.ChainConfig{ + Type: "cosmos", + Name: name, + Bech32Prefix: bech32Prefix, + Denom: denom, + GasPrices: gasPrices, + GasAdjustment: gasAdjustment, + TrustingPeriod: trustingPeriod, + NoHostMount: noHostMount, + Images: []ibc.DockerImage{ + { + Repository: fmt.Sprintf("ghcr.io/strangelove-ventures/heighliner/%s", name), + UidGid: dockerutil.GetHeighlinerUserString(), + }, + }, + Bin: binary, + } +} + +func NewCosmosRemoteChain(testName string, chainConfig ibc.ChainConfig, client *client.Client, network string, log *zap.Logger, testConfig testconfig.Chain) *CosmosRemoteChain { + if chainConfig.EncodingConfig == nil { + cfg := DefaultEncoding() + chainConfig.EncodingConfig = &cfg + } + + registry := codectypes.NewInterfaceRegistry() + cryptocodec.RegisterInterfaces(registry) + return &CosmosRemoteChain{ + testName: testName, + cfg: chainConfig, + log: log, + Client: client, + Network: network, + testConfig: testConfig, + } +} + +// // Implements Chain interface +func (c *CosmosRemoteChain) Config() ibc.ChainConfig { + return c.cfg +} + +// // Implements Chain interface +func (c *CosmosRemoteChain) Initialize(ctx context.Context, testName string, cli *client.Client, networkID string) error { + return nil +} + +// // Implements Chain interface +func (c *CosmosRemoteChain) GetRPCAddress() string { + return c.testConfig.RPCUri +} + +// // Implements Chain interface +func (c *CosmosRemoteChain) GetGRPCAddress() string { + return c.testConfig.RPCUri +} + +// // GetHostRPCAddress returns the address of the RPC server accessible by the host. +// // This will not return a valid address until the chain has been started. +func (c *CosmosRemoteChain) GetHostRPCAddress() string { + return c.testConfig.RPCUri +} + +// // GetHostGRPCAddress returns the address of the gRPC server accessible by the host. +// // This will not return a valid address until the chain has been started. +func (c *CosmosRemoteChain) GetHostGRPCAddress() string { + return c.testConfig.RPCUri +} + +// // HomeDir implements ibc.Chain. +func (c *CosmosRemoteChain) HomeDir() string { + panic("not implemented") +} + +// // Implements Chain interface +func (c *CosmosRemoteChain) CreateKey(ctx context.Context, keyName string) error { + panic("not implemented") +} + +// Implements Chain interface +func (c *CosmosRemoteChain) RecoverKey(ctx context.Context, keyName, mnemonic string) error { + panic("not implemented") +} + +// // Implements Chain interface +func (c *CosmosRemoteChain) GetAddress(ctx context.Context, keyName string) ([]byte, error) { + panic("not implemented") +} + +// // BuildWallet will return a Cosmos wallet +// // If mnemonic != "", it will restore using that mnemonic +// // If mnemonic == "", it will create a new key +func (c *CosmosRemoteChain) BuildWallet(ctx context.Context, keyName string, mnemonic string) (ibc.Wallet, error) { + panic("not implemented") +} + +// // BuildRelayerWallet will return a Cosmos wallet populated with the mnemonic so that the wallet can +// // be restored in the relayer node using the mnemonic. After it is built, that address is included in +// // genesis with some funds. +func (c *CosmosRemoteChain) BuildRelayerWallet(ctx context.Context, keyName string) (ibc.Wallet, error) { + panic("not implemented") +} + +// // Implements Chain interface +func (c *CosmosRemoteChain) SendFunds(ctx context.Context, keyName string, amount ibc.WalletAmount) error { + panic("not implemented") +} + +// // Implements Chain interface +func (c *CosmosRemoteChain) SendIBCTransfer( + ctx context.Context, + channelID string, + keyName string, + amount ibc.WalletAmount, + options ibc.TransferOptions, +) (tx ibc.Tx, _ error) { + panic("not implemented") +} + +// // StoreContract takes a file path to smart contract and stores it on-chain. Returns the contracts code id. +func (c *CosmosRemoteChain) StoreContract(ctx context.Context, keyName string, fileName string) (string, error) { + panic("not implemented") +} + +// // InstantiateContract takes a code id for a smart contract and initialization message and returns the instantiated contract address. +func (c *CosmosRemoteChain) InstantiateContract(ctx context.Context, keyName string, codeID string, initMessage string, needsNoAdminFlag bool, extraExecTxArgs ...string) (string, error) { + panic("not implemented") +} + +// // QueryContract performs a smart query, taking in a query struct and returning a error with the response struct populated. +func (c *CosmosRemoteChain) QueryContract(ctx context.Context, contractAddress string, query any, response any) error { + panic("not implemented") +} + +// // ExportState exports the chain state at specific height. +// // Implements Chain interface +func (c *CosmosRemoteChain) ExportState(ctx context.Context, height int64) (string, error) { + panic("not implemented") +} + +func (c *CosmosRemoteChain) GetGasFeesInNativeDenom(gasPaid int64) int64 { + panic("not implemented") +} + +func (c *CosmosRemoteChain) UpgradeVersion(ctx context.Context, cli *client.Client, containerRepo, version string) { + panic("not implemented") +} + +// // Bootstraps the chain and starts it from genesis +func (c *CosmosRemoteChain) Start(testName string, ctx context.Context, additionalGenesisWallets ...ibc.WalletAmount) error { + panic("not implemented") +} + +// Height implements ibc.Chain +func (c *CosmosRemoteChain) Height(ctx context.Context) (uint64, error) { + panic("not implemented") +} + +// // Acknowledgements implements ibc.Chain, returning all acknowledgments in block at height +func (c *CosmosRemoteChain) Acknowledgements(ctx context.Context, height uint64) ([]ibc.PacketAcknowledgement, error) { + panic("not implemented") +} + +// // Timeouts implements ibc.Chain, returning all timeouts in block at height +func (c *CosmosRemoteChain) Timeouts(ctx context.Context, height uint64) ([]ibc.PacketTimeout, error) { + panic("not implemented") +} + +// // Exec implements ibc.Chain. +func (c *CosmosRemoteChain) Exec(ctx context.Context, cmd []string, env []string) (stdout, stderr []byte, err error) { + cmd = append([]string{c.cfg.Bin}, cmd...) + job := dockerutil.NewImage(c.log, c.Client, c.Network, c.testName, c.cfg.Images[0].Repository, c.cfg.Images[0].Version) + mountPath := ":/root/.archway" + if c.cfg.Name == "centauri" { + mountPath = ":/" + c.cfg.Name + "/.banksy" + } + opts := dockerutil.ContainerOptions{ + Binds: []string{ + c.testConfig.ContractsPath + ":/contracts", + c.testConfig.ConfigPath + mountPath, + }, + Env: env, + } + + res := job.Run(ctx, cmd, opts) + return res.Stdout, res.Stderr, res.Err +} + +func (c *CosmosRemoteChain) extractAmount(text string) (*big.Int, error) { + entries := strings.Split(text, "\n") + for _, entry := range entries { + values := strings.Split(entry, ":") + key := values[0] + value := values[1] + if key == "amount" { + var balance string + json.Unmarshal([]byte(value), &balance) + n := new(big.Int) + n, ok := n.SetString(balance, 10) + if !ok { + return nil, fmt.Errorf("error converting") + + } + return n, nil + + } + } + return nil, fmt.Errorf("balance not found") +} + +// // GetBalance fetches the current balance for a specific account address and denom. +// // Implements Chain interface +func (c *CosmosRemoteChain) GetWalletBalance(ctx context.Context, address string, denom string) (*big.Int, error) { + commands := []string{"query", "bank", "balances", address} + commands = append(commands, + "--node", c.GetHostRPCAddress(), + "--denom", denom, + ) + stdout, _, err := c.Exec(ctx, commands, nil) + if err != nil { + return nil, err + } + amount, err := c.extractAmount(string(stdout[:])) + return amount, err +} diff --git a/test/chains/cosmos/data/config/app.toml b/test/chains/cosmos/data/config/app.toml new file mode 100644 index 000000000..44befdf9b --- /dev/null +++ b/test/chains/cosmos/data/config/app.toml @@ -0,0 +1,270 @@ +# This is a TOML config file. +# For more information, see https://github.com/toml-lang/toml + +############################################################################### +### Base Configuration ### +############################################################################### + +# The minimum gas prices a validator is willing to accept for processing a +# transaction. A transaction's fees must meet the minimum of any denomination +# specified in this config (e.g. 0.25token1;0.0001token2). +minimum-gas-prices = "0stake" + +# default: the last 362880 states are kept, pruning at 10 block intervals +# nothing: all historic states will be saved, nothing will be deleted (i.e. archiving node) +# everything: 2 latest states will be kept; pruning at 10 block intervals. +# custom: allow pruning options to be manually specified through 'pruning-keep-recent', and 'pruning-interval' +pruning = "default" + +# These are applied if and only if the pruning strategy is custom. +pruning-keep-recent = "0" +pruning-interval = "0" + +# HaltHeight contains a non-zero block height at which a node will gracefully +# halt and shutdown that can be used to assist upgrades and testing. +# +# Note: Commitment of state will be attempted on the corresponding block. +halt-height = 0 + +# HaltTime contains a non-zero minimum block time (in Unix seconds) at which +# a node will gracefully halt and shutdown that can be used to assist upgrades +# and testing. +# +# Note: Commitment of state will be attempted on the corresponding block. +halt-time = 0 + +# MinRetainBlocks defines the minimum block height offset from the current +# block being committed, such that all blocks past this offset are pruned +# from Tendermint. It is used as part of the process of determining the +# ResponseCommit.RetainHeight value during ABCI Commit. A value of 0 indicates +# that no blocks should be pruned. +# +# This configuration value is only responsible for pruning Tendermint blocks. +# It has no bearing on application state pruning which is determined by the +# "pruning-*" configurations. +# +# Note: Tendermint block pruning is dependant on this parameter in conunction +# with the unbonding (safety threshold) period, state pruning and state sync +# snapshot parameters to determine the correct minimum value of +# ResponseCommit.RetainHeight. +min-retain-blocks = 0 + +# InterBlockCache enables inter-block caching. +inter-block-cache = true + +# IndexEvents defines the set of events in the form {eventType}.{attributeKey}, +# which informs Tendermint what to index. If empty, all events will be indexed. +# +# Example: +# ["message.sender", "message.recipient"] +index-events = [] + +# IavlCacheSize set the size of the iavl tree cache (in number of nodes). +iavl-cache-size = 781250 + +# IAVLDisableFastNode enables or disables the fast node feature of IAVL. +# Default is false. +iavl-disable-fastnode = false + +# IAVLLazyLoading enable/disable the lazy loading of iavl store. +# Default is false. +iavl-lazy-loading = false + +# AppDBBackend defines the database backend type to use for the application and snapshots DBs. +# An empty string indicates that a fallback will be used. +# The fallback is the db_backend value set in Tendermint's config.toml. +app-db-backend = "" + +############################################################################### +### Telemetry Configuration ### +############################################################################### + +[telemetry] + +# Prefixed with keys to separate services. +service-name = "" + +# Enabled enables the application telemetry functionality. When enabled, +# an in-memory sink is also enabled by default. Operators may also enabled +# other sinks such as Prometheus. +enabled = false + +# Enable prefixing gauge values with hostname. +enable-hostname = false + +# Enable adding hostname to labels. +enable-hostname-label = false + +# Enable adding service to labels. +enable-service-label = false + +# PrometheusRetentionTime, when positive, enables a Prometheus metrics sink. +prometheus-retention-time = 0 + +# GlobalLabels defines a global set of name/value label tuples applied to all +# metrics emitted using the wrapper functions defined in telemetry package. +# +# Example: +# [["chain_id", "cosmoshub-1"]] +global-labels = [ +] + +############################################################################### +### API Configuration ### +############################################################################### + +[api] + +# Enable defines if the API server should be enabled. +enable = true + +# Swagger defines if swagger documentation should automatically be registered. +swagger = false + +# Address defines the API server to listen on. +address = "tcp://localhost:1317" + +# MaxOpenConnections defines the number of maximum open connections. +max-open-connections = 1000 + +# RPCReadTimeout defines the Tendermint RPC read timeout (in seconds). +rpc-read-timeout = 10 + +# RPCWriteTimeout defines the Tendermint RPC write timeout (in seconds). +rpc-write-timeout = 0 + +# RPCMaxBodyBytes defines the Tendermint maximum request body (in bytes). +rpc-max-body-bytes = 1000000 + +# EnableUnsafeCORS defines if CORS should be enabled (unsafe - use it at your own risk). +enabled-unsafe-cors = true + +############################################################################### +### Rosetta Configuration ### +############################################################################### + +[rosetta] + +# Enable defines if the Rosetta API server should be enabled. +enable = false + +# Address defines the Rosetta API server to listen on. +address = ":8080" + +# Network defines the name of the blockchain that will be returned by Rosetta. +blockchain = "app" + +# Network defines the name of the network that will be returned by Rosetta. +network = "network" + +# Retries defines the number of retries when connecting to the node before failing. +retries = 3 + +# Offline defines if Rosetta server should run in offline mode. +offline = false + +# EnableDefaultSuggestedFee defines if the server should suggest fee by default. +# If 'construction/medata' is called without gas limit and gas price, +# suggested fee based on gas-to-suggest and denom-to-suggest will be given. +enable-fee-suggestion = false + +# GasToSuggest defines gas limit when calculating the fee +gas-to-suggest = 200000 + +# DenomToSuggest defines the defult denom for fee suggestion. +# Price must be in minimum-gas-prices. +denom-to-suggest = "uatom" + +############################################################################### +### gRPC Configuration ### +############################################################################### + +[grpc] + +# Enable defines if the gRPC server should be enabled. +enable = true + +# Address defines the gRPC server address to bind to. +address = "localhost:9090" + +# MaxRecvMsgSize defines the max message size in bytes the server can receive. +# The default value is 10MB. +max-recv-msg-size = "10485760" + +# MaxSendMsgSize defines the max message size in bytes the server can send. +# The default value is math.MaxInt32. +max-send-msg-size = "2147483647" + +############################################################################### +### gRPC Web Configuration ### +############################################################################### + +[grpc-web] + +# GRPCWebEnable defines if the gRPC-web should be enabled. +# NOTE: gRPC must also be enabled, otherwise, this configuration is a no-op. +enable = true + +# Address defines the gRPC-web server address to bind to. +address = "localhost:9091" + +# EnableUnsafeCORS defines if CORS should be enabled (unsafe - use it at your own risk). +enable-unsafe-cors = true + +############################################################################### +### State Sync Configuration ### +############################################################################### + +# State sync snapshots allow other nodes to rapidly join the network without replaying historical +# blocks, instead downloading and applying a snapshot of the application state at a given height. +[state-sync] + +# snapshot-interval specifies the block interval at which local state sync snapshots are +# taken (0 to disable). +snapshot-interval = 0 + +# snapshot-keep-recent specifies the number of recent snapshots to keep and serve (0 to keep all). +snapshot-keep-recent = 2 + +############################################################################### +### Store / State Streaming ### +############################################################################### + +[store] +streamers = [] + +[streamers] +[streamers.file] +keys = ["*", ] +write_dir = "" +prefix = "" + +# output-metadata specifies if output the metadata file which includes the abci request/responses +# during processing the block. +output-metadata = "true" + +# stop-node-on-error specifies if propagate the file streamer errors to consensus state machine. +stop-node-on-error = "true" + +# fsync specifies if call fsync after writing the files. +fsync = "false" + +############################################################################### +### Mempool ### +############################################################################### + +[mempool] +# Setting max-txs to 0 will allow for a unbounded amount of transactions in the mempool. +# Setting max_txs to negative 1 (-1) will disable transactions from being inserted into the mempool. +# Setting max_txs to a positive number (> 0) will limit the number of transactions in the mempool, by the specified amount. +# +# Note, this configuration only applies to SDK built-in app-side mempool +# implementations. +max-txs = 5000 + +[wasm] +# This is the maximum sdk gas (wasm and storage) that we allow for any x/wasm "smart" queries +query_gas_limit = 300000 +# This is the number of wasm vm instances we keep cached in memory for speed-up +# Warning: this is currently unstable and may lead to crashes, best to keep for 0 unless testing locally +lru_size = 0 \ No newline at end of file diff --git a/test/chains/cosmos/data/config/client.toml b/test/chains/cosmos/data/config/client.toml new file mode 100644 index 000000000..0fbab97c3 --- /dev/null +++ b/test/chains/cosmos/data/config/client.toml @@ -0,0 +1,17 @@ +# This is a TOML config file. +# For more information, see https://github.com/toml-lang/toml + +############################################################################### +### Client Configuration ### +############################################################################### + +# The network chain ID +chain-id = "" +# The keyring's backend, where the keys are stored (os|file|kwallet|pass|test|memory) +keyring-backend = "os" +# CLI output format (text|json) +output = "text" +# : to Tendermint RPC interface for this chain +node = "tcp://localhost:26657" +# Transaction broadcasting mode (sync|async) +broadcast-mode = "sync" diff --git a/test/chains/cosmos/data/config/config.toml b/test/chains/cosmos/data/config/config.toml new file mode 100644 index 000000000..126e40c87 --- /dev/null +++ b/test/chains/cosmos/data/config/config.toml @@ -0,0 +1,471 @@ +# This is a TOML config file. +# For more information, see https://github.com/toml-lang/toml + +# NOTE: Any path below can be absolute (e.g. "/var/myawesomeapp/data") or +# relative to the home directory (e.g. "data"). The home directory is +# "$HOME/.cometbft" by default, but could be changed via $CMTHOME env variable +# or --home cmd flag. + +####################################################################### +### Main Base Config Options ### +####################################################################### + +# TCP or UNIX socket address of the ABCI application, +# or the name of an ABCI application compiled in with the CometBFT binary +proxy_app = "tcp://127.0.0.1:26658" + +# A custom human readable name for this node +moniker = "TestE2ETestSuite_TestE2E_all-rzbxpw" + +# If this node is many blocks behind the tip of the chain, BlockSync +# allows them to catchup quickly by downloading blocks in parallel +# and verifying their commits +# +# Deprecated: this key will be removed and BlockSync will be enabled +# unconditionally in the next major release. +block_sync = true + +# Database backend: goleveldb | cleveldb | boltdb | rocksdb | badgerdb +# * goleveldb (github.com/syndtr/goleveldb - most popular implementation) +# - pure go +# - stable +# * cleveldb (uses levigo wrapper) +# - fast +# - requires gcc +# - use cleveldb build tag (go build -tags cleveldb) +# * boltdb (uses etcd's fork of bolt - github.com/etcd-io/bbolt) +# - EXPERIMENTAL +# - may be faster is some use-cases (random reads - indexer) +# - use boltdb build tag (go build -tags boltdb) +# * rocksdb (uses github.com/tecbot/gorocksdb) +# - EXPERIMENTAL +# - requires gcc +# - use rocksdb build tag (go build -tags rocksdb) +# * badgerdb (uses github.com/dgraph-io/badger) +# - EXPERIMENTAL +# - use badgerdb build tag (go build -tags badgerdb) +db_backend = "goleveldb" + +# Database directory +db_dir = "data" + +# Output level for logging, including package level options +log_level = "info" + +# Output format: 'plain' (colored text) or 'json' +log_format = "plain" + +##### additional base config options ##### + +# Path to the JSON file containing the initial validator set and other meta data +genesis_file = "config/genesis.json" + +# Path to the JSON file containing the private key to use as a validator in the consensus protocol +priv_validator_key_file = "config/priv_validator_key.json" + +# Path to the JSON file containing the last sign state of a validator +priv_validator_state_file = "data/priv_validator_state.json" + +# TCP or UNIX socket address for CometBFT to listen on for +# connections from an external PrivValidator process +priv_validator_laddr = "" + +# Path to the JSON file containing the private key to use for node authentication in the p2p protocol +node_key_file = "config/node_key.json" + +# Mechanism to connect to the ABCI application: socket | grpc +abci = "socket" + +# If true, query the ABCI app on connecting to a new peer +# so the app can decide if we should keep the connection or not +filter_peers = false + + +####################################################################### +### Advanced Configuration Options ### +####################################################################### + +####################################################### +### RPC Server Configuration Options ### +####################################################### +[rpc] + +# TCP or UNIX socket address for the RPC server to listen on +laddr = "tcp://127.0.0.1:26657" + +# A list of origins a cross-domain request can be executed from +# Default value '[]' disables cors support +# Use '["*"]' to allow any origin +cors_allowed_origins = [] + +# A list of methods the client is allowed to use with cross-domain requests +cors_allowed_methods = ["HEAD", "GET", "POST", ] + +# A list of non simple headers the client is allowed to use with cross-domain requests +cors_allowed_headers = ["Origin", "Accept", "Content-Type", "X-Requested-With", "X-Server-Time", ] + +# TCP or UNIX socket address for the gRPC server to listen on +# NOTE: This server only supports /broadcast_tx_commit +grpc_laddr = "" + +# Maximum number of simultaneous connections. +# Does not include RPC (HTTP&WebSocket) connections. See max_open_connections +# If you want to accept a larger number than the default, make sure +# you increase your OS limits. +# 0 - unlimited. +# Should be < {ulimit -Sn} - {MaxNumInboundPeers} - {MaxNumOutboundPeers} - {N of wal, db and other open files} +# 1024 - 40 - 10 - 50 = 924 = ~900 +grpc_max_open_connections = 900 + +# Activate unsafe RPC commands like /dial_seeds and /unsafe_flush_mempool +unsafe = false + +# Maximum number of simultaneous connections (including WebSocket). +# Does not include gRPC connections. See grpc_max_open_connections +# If you want to accept a larger number than the default, make sure +# you increase your OS limits. +# 0 - unlimited. +# Should be < {ulimit -Sn} - {MaxNumInboundPeers} - {MaxNumOutboundPeers} - {N of wal, db and other open files} +# 1024 - 40 - 10 - 50 = 924 = ~900 +max_open_connections = 900 + +# Maximum number of unique clientIDs that can /subscribe +# If you're using /broadcast_tx_commit, set to the estimated maximum number +# of broadcast_tx_commit calls per block. +max_subscription_clients = 100 + +# Maximum number of unique queries a given client can /subscribe to +# If you're using GRPC (or Local RPC client) and /broadcast_tx_commit, set to +# the estimated # maximum number of broadcast_tx_commit calls per block. +max_subscriptions_per_client = 5 + +# Experimental parameter to specify the maximum number of events a node will +# buffer, per subscription, before returning an error and closing the +# subscription. Must be set to at least 100, but higher values will accommodate +# higher event throughput rates (and will use more memory). +experimental_subscription_buffer_size = 200 + +# Experimental parameter to specify the maximum number of RPC responses that +# can be buffered per WebSocket client. If clients cannot read from the +# WebSocket endpoint fast enough, they will be disconnected, so increasing this +# parameter may reduce the chances of them being disconnected (but will cause +# the node to use more memory). +# +# Must be at least the same as "experimental_subscription_buffer_size", +# otherwise connections could be dropped unnecessarily. This value should +# ideally be somewhat higher than "experimental_subscription_buffer_size" to +# accommodate non-subscription-related RPC responses. +experimental_websocket_write_buffer_size = 200 + +# If a WebSocket client cannot read fast enough, at present we may +# silently drop events instead of generating an error or disconnecting the +# client. +# +# Enabling this experimental parameter will cause the WebSocket connection to +# be closed instead if it cannot read fast enough, allowing for greater +# predictability in subscription behavior. +experimental_close_on_slow_client = false + +# How long to wait for a tx to be committed during /broadcast_tx_commit. +# WARNING: Using a value larger than 10s will result in increasing the +# global HTTP write timeout, which applies to all connections and endpoints. +# See https://github.com/tendermint/tendermint/issues/3435 +timeout_broadcast_tx_commit = "10s" + +# Maximum size of request body, in bytes +max_body_bytes = 1000000 + +# Maximum size of request header, in bytes +max_header_bytes = 1048576 + +# The path to a file containing certificate that is used to create the HTTPS server. +# Might be either absolute path or path related to CometBFT's config directory. +# If the certificate is signed by a certificate authority, +# the certFile should be the concatenation of the server's certificate, any intermediates, +# and the CA's certificate. +# NOTE: both tls_cert_file and tls_key_file must be present for CometBFT to create HTTPS server. +# Otherwise, HTTP server is run. +tls_cert_file = "" + +# The path to a file containing matching private key that is used to create the HTTPS server. +# Might be either absolute path or path related to CometBFT's config directory. +# NOTE: both tls-cert-file and tls-key-file must be present for CometBFT to create HTTPS server. +# Otherwise, HTTP server is run. +tls_key_file = "" + +# pprof listen address (https://golang.org/pkg/net/http/pprof) +pprof_laddr = "localhost:6060" + +####################################################### +### P2P Configuration Options ### +####################################################### +[p2p] + +# Address to listen for incoming connections +laddr = "tcp://0.0.0.0:26656" + +# Address to advertise to peers for them to dial +# If empty, will use the same port as the laddr, +# and will introspect on the listener or use UPnP +# to figure out the address. ip and port are required +# example: 159.89.10.97:26656 +external_address = "" + +# Comma separated list of seed nodes to connect to +seeds = "" + +# Comma separated list of nodes to keep persistent connections to +persistent_peers = "" + +# UPNP port forwarding +upnp = false + +# Path to address book +addr_book_file = "config/addrbook.json" + +# Set true for strict address routability rules +# Set false for private or local networks +addr_book_strict = true + +# Maximum number of inbound peers +max_num_inbound_peers = 400 + +# Maximum number of outbound peers to connect to, excluding persistent peers +max_num_outbound_peers = 50 + +# List of node IDs, to which a connection will be (re)established ignoring any existing limits +unconditional_peer_ids = "" + +# Maximum pause when redialing a persistent peer (if zero, exponential backoff is used) +persistent_peers_max_dial_period = "0s" + +# Time to wait before flushing messages out on the connection +flush_throttle_timeout = "100ms" + +# Maximum size of a message packet payload, in bytes +max_packet_msg_payload_size = 1024 + +# Rate at which packets can be sent, in bytes/second +send_rate = 5120000 + +# Rate at which packets can be received, in bytes/second +recv_rate = 5120000 + +# Set true to enable the peer-exchange reactor +pex = true + +# Seed mode, in which node constantly crawls the network and looks for +# peers. If another node asks it for addresses, it responds and disconnects. +# +# Does not work if the peer-exchange reactor is disabled. +seed_mode = false + +# Comma separated list of peer IDs to keep private (will not be gossiped to other peers) +private_peer_ids = "" + +# Toggle to disable guard against peers connecting from the same ip. +allow_duplicate_ip = false + +# Peer connection configuration. +handshake_timeout = "20s" +dial_timeout = "3s" + +####################################################### +### Mempool Configuration Option ### +####################################################### +[mempool] + +# Mempool version to use: +# 1) "v0" - (default) FIFO mempool. +# 2) "v1" - prioritized mempool (deprecated; will be removed in the next release). +version = "v0" + +recheck = true +broadcast = true +wal_dir = "" + +# Maximum number of transactions in the mempool +size = 5000 + +# Limit the total size of all txs in the mempool. +# This only accounts for raw transactions (e.g. given 1MB transactions and +# max_txs_bytes=5MB, mempool will only accept 5 transactions). +max_txs_bytes = 1073741824 + +# Size of the cache (used to filter transactions we saw earlier) in transactions +cache_size = 10000 + +# Do not remove invalid transactions from the cache (default: false) +# Set to true if it's not possible for any invalid transaction to become valid +# again in the future. +keep-invalid-txs-in-cache = false + +# Maximum size of a single transaction. +# NOTE: the max size of a tx transmitted over the network is {max_tx_bytes}. +max_tx_bytes = 1048576 + +# Maximum size of a batch of transactions to send to a peer +# Including space needed by encoding (one varint per transaction). +# XXX: Unused due to https://github.com/tendermint/tendermint/issues/5796 +max_batch_bytes = 0 + +# ttl-duration, if non-zero, defines the maximum amount of time a transaction +# can exist for in the mempool. +# +# Note, if ttl-num-blocks is also defined, a transaction will be removed if it +# has existed in the mempool at least ttl-num-blocks number of blocks or if it's +# insertion time into the mempool is beyond ttl-duration. +ttl-duration = "0s" + +# ttl-num-blocks, if non-zero, defines the maximum number of blocks a transaction +# can exist for in the mempool. +# +# Note, if ttl-duration is also defined, a transaction will be removed if it +# has existed in the mempool at least ttl-num-blocks number of blocks or if +# it's insertion time into the mempool is beyond ttl-duration. +ttl-num-blocks = 0 + +####################################################### +### State Sync Configuration Options ### +####################################################### +[statesync] +# State sync rapidly bootstraps a new node by discovering, fetching, and restoring a state machine +# snapshot from peers instead of fetching and replaying historical blocks. Requires some peers in +# the network to take and serve state machine snapshots. State sync is not attempted if the node +# has any local state (LastBlockHeight > 0). The node will have a truncated block history, +# starting from the height of the snapshot. +enable = false + +# RPC servers (comma-separated) for light client verification of the synced state machine and +# retrieval of state data for node bootstrapping. Also needs a trusted height and corresponding +# header hash obtained from a trusted source, and a period during which validators can be trusted. +# +# For Cosmos SDK-based chains, trust_period should usually be about 2/3 of the unbonding time (~2 +# weeks) during which they can be financially punished (slashed) for misbehavior. +rpc_servers = "" +trust_height = 0 +trust_hash = "" +trust_period = "168h0m0s" + +# Time to spend discovering snapshots before initiating a restore. +discovery_time = "15s" + +# Temporary directory for state sync snapshot chunks, defaults to the OS tempdir (typically /tmp). +# Will create a new, randomly named directory within, and remove it when done. +temp_dir = "" + +# The timeout duration before re-requesting a chunk, possibly from a different +# peer (default: 1 minute). +chunk_request_timeout = "10s" + +# The number of concurrent chunk fetchers to run (default: 1). +chunk_fetchers = "4" + +####################################################### +### Block Sync Configuration Options ### +####################################################### +[blocksync] + +# Block Sync version to use: +# +# In v0.37, v1 and v2 of the block sync protocols were deprecated. +# Please use v0 instead. +# +# 1) "v0" - the default block sync implementation +version = "v0" + +####################################################### +### Consensus Configuration Options ### +####################################################### +[consensus] + +wal_file = "data/cs.wal/wal" + +# How long we wait for a proposal block before prevoting nil +timeout_propose = "3s" +# How much timeout_propose increases with each round +timeout_propose_delta = "500ms" +# How long we wait after receiving +2/3 prevotes for “anything” (ie. not a single block or nil) +timeout_prevote = "1s" +# How much the timeout_prevote increases with each round +timeout_prevote_delta = "500ms" +# How long we wait after receiving +2/3 precommits for “anything” (ie. not a single block or nil) +timeout_precommit = "1s" +# How much the timeout_precommit increases with each round +timeout_precommit_delta = "500ms" +# How long we wait after committing a block, before starting on the new +# height (this gives us a chance to receive some more precommits, even +# though we already have +2/3). +timeout_commit = "5s" + +# How many blocks to look back to check existence of the node's consensus votes before joining consensus +# When non-zero, the node will panic upon restart +# if the same consensus key was used to sign {double_sign_check_height} last blocks. +# So, validators should stop the state machine, wait for some blocks, and then restart the state machine to avoid panic. +double_sign_check_height = 0 + +# Make progress as soon as we have all the precommits (as if TimeoutCommit = 0) +skip_timeout_commit = false + +# EmptyBlocks mode and possible interval between empty blocks +create_empty_blocks = true +create_empty_blocks_interval = "0s" + +# Reactor sleep duration parameters +peer_gossip_sleep_duration = "100ms" +peer_query_maj23_sleep_duration = "2s" + +####################################################### +### Storage Configuration Options ### +####################################################### +[storage] + +# Set to true to discard ABCI responses from the state store, which can save a +# considerable amount of disk space. Set to false to ensure ABCI responses are +# persisted. ABCI responses are required for /block_results RPC queries, and to +# reindex events in the command-line tool. +discard_abci_responses = false + +####################################################### +### Transaction Indexer Configuration Options ### +####################################################### +[tx_index] + +# What indexer to use for transactions +# +# The application will set which txs to index. In some cases a node operator will be able +# to decide which txs to index based on configuration set in the application. +# +# Options: +# 1) "null" +# 2) "kv" (default) - the simplest possible indexer, backed by key-value storage (defaults to levelDB; see DBBackend). +# - When "kv" is chosen "tx.height" and "tx.hash" will always be indexed. +# 3) "psql" - the indexer services backed by PostgreSQL. +# When "kv" or "psql" is chosen "tx.height" and "tx.hash" will always be indexed. +indexer = "kv" + +# The PostgreSQL connection configuration, the connection format: +# postgresql://:@:/? +psql-conn = "" + +####################################################### +### Instrumentation Configuration Options ### +####################################################### +[instrumentation] + +# When true, Prometheus metrics are served under /metrics on +# PrometheusListenAddr. +# Check out the documentation for the list of available metrics. +prometheus = false + +# Address to listen for Prometheus collector(s) connections +prometheus_listen_addr = ":26660" + +# Maximum number of simultaneous connections. +# If you want to accept a larger number than the default, make sure +# you increase your OS limits. +# 0 - unlimited. +max_open_connections = 3 + +# Instrumentation namespace +namespace = "cometbft" diff --git a/test/chains/cosmos/data/keyring-test/4506a66e61d7d7d2e0305d7e2c5604246d892bf2.address b/test/chains/cosmos/data/keyring-test/4506a66e61d7d7d2e0305d7e2c5604246d892bf2.address new file mode 100644 index 000000000..903c7788f --- /dev/null +++ b/test/chains/cosmos/data/keyring-test/4506a66e61d7d7d2e0305d7e2c5604246d892bf2.address @@ -0,0 +1 @@ +eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJjcmVhdGVkIjoiMjAyNC0wMi0wNyAwNTo1Nzo0Ni43MzM2NTU1MTIgKzAwMDAgVVRDIG09KzAuMTUxNjY1MjkyIiwiZW5jIjoiQTI1NkdDTSIsInAyYyI6ODE5MiwicDJzIjoiSEkxOXpPQ2VVeXExQzFBMCJ9.0ZVjARNUgJcfEeOYvxSnmNv0ZEkPjNL70ReqzTK_suqomfH6Rhiwyg.kyIgVaYKOHAA3dJz.inNKmRq58Jc8N1mlx4eNoOl_2ftTNk-4KLWj3PGtPgNRkIZbkp9nH074iINBXzoWV1sER8gMiMfpqf5Fdd9zx8_lXrwSjbCZnKxkaR_Z6F0x3Y7jd9PsWjwNqes480ja9sTOLFvZApzAowKvMOFR_o1Zdw_cJ7ZGsWjS3MD3Qbh84DPFy9jhU-H03Lx-LUQpSH6Yt-ujT0SvLJRmTGs6q--cIaKAKye-2ff49g7Znxruz9RSJtM.pc3y2tS5hHT6kZLAOgBRYg \ No newline at end of file diff --git a/test/chains/cosmos/data/keyring-test/5a97f90bb88ebbd0b77f30cba39e1e06447c2d2b.address b/test/chains/cosmos/data/keyring-test/5a97f90bb88ebbd0b77f30cba39e1e06447c2d2b.address new file mode 100644 index 000000000..16bc68e4d --- /dev/null +++ b/test/chains/cosmos/data/keyring-test/5a97f90bb88ebbd0b77f30cba39e1e06447c2d2b.address @@ -0,0 +1 @@ +eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJjcmVhdGVkIjoiMjAyNC0wMy0xOCAxODo0MjoxNS41MjU4MzUgKzA1NDUgKzA1NDUgbT0rMC4wMzQ0ODMxMjYiLCJlbmMiOiJBMjU2R0NNIiwicDJjIjo4MTkyLCJwMnMiOiJ6UFBKUl9UWjJMNnFZSVZjIn0.-BfnwZ_8Gq7DUpnbsWj7wsqYBn91fRqMMx7kHClV08fGncxjEH_ZDQ.Kabj8qQ7ZRSVAWVi.vSgM9IG9sCh-0T2gpnRD4H_XxHImsreuc4vcBDYujYF8-oCKfsGgU2-DfXjakJfVNJzAowfaCuoE8HdyVKUEXv4JEfQFOrHxBre5oah6enTTv1ig2mt2N8xqC_txCxJaGPscNSjOoe8HZn4BcrotbIjgibZ7-FDdzNSE0GqRcVYCobnJZyhk1ZqYRqmNwXqAT26xMA0tDDR-VAgEWSnpk24NBlbE6Kx_Rc4nqR-qCBrn1yT0WvQ.1Ks8qGTLm71qkvsw1v7YTg \ No newline at end of file diff --git a/test/chains/cosmos/data/keyring-test/d2d94193e3abd46c72a4031762d680d6d62ead2f.address b/test/chains/cosmos/data/keyring-test/d2d94193e3abd46c72a4031762d680d6d62ead2f.address new file mode 100644 index 000000000..32f45dda1 --- /dev/null +++ b/test/chains/cosmos/data/keyring-test/d2d94193e3abd46c72a4031762d680d6d62ead2f.address @@ -0,0 +1 @@ +eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJjcmVhdGVkIjoiMjAyNC0wNC0wNSAxMDoyOTo0OS4yODgwMyArMDU0NSArMDU0NSBtPSswLjA0NTU3NDA0MyIsImVuYyI6IkEyNTZHQ00iLCJwMmMiOjgxOTIsInAycyI6IkNqVmgzcm03bXZkNFJNbHEifQ.BYEoDc3lp3frYICBqDqB_EDI_OA8LYICohwq7P6CZks0qjQOJib04Q.E97Omtm7LZJ-w7jw.4RY4vBLoyf1dJKerDt15IHmm8CjCTvitlN6issch-amyoK_Pc9hTWdOvPQ-moHZnWXbj1NnFHJzNeO7vS1Td0OPN1VisCDOxChhtWC6g-awpnc7_dnglrTQsS8aDofE_RCF8oJE1gJb9_6b13mHkhj6PK4NocfL6vIxIFJKsVcB0_s9rVPnMpjazybmyUTyspsNB99b6Y3SpyqIxbP8t8izOHw7xBxW-t1bIPWrpa1MOoX5Bzyk.G9s2tCKGQAKdv7KAL7YDSg \ No newline at end of file diff --git a/test/chains/cosmos/data/keyring-test/default.info b/test/chains/cosmos/data/keyring-test/default.info new file mode 100644 index 000000000..ea6460f16 --- /dev/null +++ b/test/chains/cosmos/data/keyring-test/default.info @@ -0,0 +1 @@ +eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJjcmVhdGVkIjoiMjAyNC0wMi0wNyAwNTo1Nzo0Ni43MjkzNjA3NjIgKzAwMDAgVVRDIG09KzAuMTQ3MzcwMzM0IiwiZW5jIjoiQTI1NkdDTSIsInAyYyI6ODE5MiwicDJzIjoiZURELTRpWGFxSUhNUFVuOCJ9._d60H7qMp9VO99s0soEs_amOfjlX7LKoLj1PWvue8l9v6a-cwyxb8Q.mL9mBOr_ALloisPA.voZpjld-ejT-vnnxqCHPTtzh5YPi66hc9NQG0GMaiFw_4rAyas8h_13-t0h2UtAJAqbe4q0CKT_y-UT5kEc7O4z3VSXzv10N1hoaVcLx8v33F5pkmFcFv1rZoQLOxP-LDpcf-CAAcjta4YvixH-Fjxs5QypL92hfKRBKX3eZmmgA7VrS_WA4zCHtk8vNrR9QiOz5CG-H9Y-En6tVqrszyopeWYAwOART7nYMqlowjGkcjlsb2s7Bai2r895Rtc_Jqk2wzdjZwya2WZYcC38IS4mSx0-x-gwf8lADp3OsfpvMBSoV2fpYs2oulHRlyl0b-VnicrukfpIy2Mf0x9Pjb-pjv76O6YA7mtu6-po4nsmZucIaPE8cmsZfpQC1SJNFttQ5Qf495eTfs1Fg9mm7vDh8U-164jWNRYwB5wGOnDUMU33lYJxfKAmy1GNUGgpWBAY.TCYsV7SshuNid0LLIMdkcw \ No newline at end of file diff --git a/test/chains/cosmos/data/keyring-test/fd.info b/test/chains/cosmos/data/keyring-test/fd.info new file mode 100644 index 000000000..581993ac5 --- /dev/null +++ b/test/chains/cosmos/data/keyring-test/fd.info @@ -0,0 +1 @@ +eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJjcmVhdGVkIjoiMjAyNC0wMy0wNyAxNDoxMjozMy4zNDc3NTQgKzA1NDUgKzA1NDUgbT0rMC4wMjcyMjExNjgiLCJlbmMiOiJBMjU2R0NNIiwicDJjIjo4MTkyLCJwMnMiOiJOZVh2UElidER5em5tZTRyIn0.X-0OBdBTamZ1Wqg-UsxR4OFdwqZtcTju7HQWFanLo644hfsA_eNsuA.afh7OPW4tKoORr5b.yZYjFogogHiSLQmgcreO8f6k4JR_66ezAwqxCIxgshiH65CGVm3zch-C6dUvWhxFNqXgPjcq67DSzzhOk_uCeF7oS1T_X0Q_hwGMngRy-CH0YtPtaQftJdnaVGNxCkC6CTWuhLyn6lu7_ecLOt-co881RgilCYxyz_2znvkj4oFbw94BLCQCsyRll4d1jDLzDPFR1uFu9CcYqU-9lSAjzav0FntsTZEAIvt2j2MR8zxXGiiZJg50XbesMsHEP4ZBlHCPaQzKGEo2Q-R3dImn-d4rSCDOWpDUekxObnUun5-S_3Bn1XuEiTUaTipiYtZHmQnRgMQDsH6hwWVaY5MHQN20BeV8uuw1qEJBuqgdddGX5SuD2yPfXQzVuxGz3MAVu306xczild9FPYMxLwH8fXlh-Yk93gSMmpMIWJRvGll6KwE-6pfX7_jB.910JYZPj8VS8HTyvw7mJ7A \ No newline at end of file diff --git a/test/chains/cosmos/data/keyring-test/relayer.info b/test/chains/cosmos/data/keyring-test/relayer.info new file mode 100644 index 000000000..aa58e47f5 --- /dev/null +++ b/test/chains/cosmos/data/keyring-test/relayer.info @@ -0,0 +1 @@ +eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJjcmVhdGVkIjoiMjAyNC0wNC0wNSAxMDoyOTo0OS4yODY2NjQgKzA1NDUgKzA1NDUgbT0rMC4wNDQyMDc3MDkiLCJlbmMiOiJBMjU2R0NNIiwicDJjIjo4MTkyLCJwMnMiOiJVZ3QzNlV5LXY4RzBHSXpNIn0.ed_FY9l1tW8z6_roQsm0Go27AQZlRpGtkalaEz1QQLH0uWpUq88jBQ._e3LA-RVwNFmyeSC.hENVL8J7-yznT2hwg2zyUGBWEN7ZEQfTjbhL6LKrqxH33RXRy_K7Zz5fcv6gjRH02EfR7w68XfDKv6Hl8URH6AtgW7Nlq17SDPVmJBm4g8E-cPwSIeP-OxJRo38rUYTzv-svdF1Ay80ENJsvFObc5PmRIIYhPiYWo6y-2rIUzzciHq3BT-4pjHgKuJqluMFEm-iMMS70ii8pttIOFGwHLyyIj9pve53Tt9j4bAvhNL-ESEp8yo3MiddaPlahAJAX6EUkIX4dJRXnFexSHx-ZCs9NL7W5DQjRMjT0syM4gdBQ00hXqzeCr-v4L_WYpZRsKgV6jhl8jpR6PVZhI-s-T5fVa-DwEdFcLZoUgfiXX9PD7GyDnqHtM-cGOw4l53clsZ-eg74bB1621LoaYlOS1NoNfP08wAMY4XXx7Co-Kl8q0fgv4D4AVdJL3Q9nFXBP8co.fLxJ3_73LOuKZBqSLW-u4Q \ No newline at end of file diff --git a/test/chains/cosmos/localnet.go b/test/chains/cosmos/localnet.go index ec49de6e0..1c41ceb0e 100644 --- a/test/chains/cosmos/localnet.go +++ b/test/chains/cosmos/localnet.go @@ -6,11 +6,13 @@ import ( "encoding/hex" "encoding/json" "fmt" - interchaintest "github.com/icon-project/ibc-integration/test" + "math/big" "strconv" "strings" "time" + interchaintest "github.com/icon-project/ibc-integration/test" + "github.com/avast/retry-go/v4" "github.com/cosmos/gogoproto/proto" clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" @@ -776,3 +778,23 @@ func (c *CosmosLocalnet) RestoreConfig(backup []byte) error { c.Wallets = wallets return nil } + +func (c *CosmosLocalnet) SetupIBCICS20(ctx context.Context, keyName string) (context.Context, error) { + panic("not implemented") +} + +func (c *CosmosLocalnet) SendIBCTokenTransfer(ctx context.Context, sourceChannel, destinationChannel, port, sender, receiver, chainID, ibcamount string, hopRequired bool) (string, error) { + panic("not implemented") +} + +func (c *CosmosLocalnet) GetWalletBalance(ctx context.Context, address string, denom string) (*big.Int, error) { + panic("not implemented") +} + +func (c *CosmosLocalnet) RegisterToken(ctx context.Context, name, denom, decimal string) error { + return nil +} + +func (c *CosmosLocalnet) GetSenderReceiverAddress() (string, string) { + return "", "" +} diff --git a/test/chains/cosmos/remotenet.go b/test/chains/cosmos/remotenet.go new file mode 100644 index 000000000..448be1957 --- /dev/null +++ b/test/chains/cosmos/remotenet.go @@ -0,0 +1,260 @@ +package cosmos + +import ( + "context" + "encoding/json" + "fmt" + + "github.com/docker/docker/client" + + conntypes "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types" + chantypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" + + "github.com/icon-project/ibc-integration/test/chains" + "github.com/icon-project/ibc-integration/test/internal/blockdb" + "github.com/icon-project/ibc-integration/test/testsuite/testconfig" + "github.com/strangelove-ventures/interchaintest/v7/ibc" + + ctypes "github.com/cometbft/cometbft/rpc/core/types" + + "go.uber.org/zap" +) + +func NewCosmosRemotenet(testName string, log *zap.Logger, chainConfig ibc.ChainConfig, cli *client.Client, network string, keyPassword string, testconfig testconfig.Chain) (chains.Chain, error) { + + chain := NewCosmosRemoteChain(testName, chainConfig, cli, network, log, testconfig) + return &CosmosRemotenet{ + CosmosRemoteChain: chain, + cfg: chain.Config(), + keyName: keyPassword, + filepath: testconfig.Contracts, + Wallets: map[string]ibc.Wallet{}, + testCfg: testconfig, + }, nil +} + +func (c *CosmosRemotenet) PreGenesis() error { + return nil +} + +func (c *CosmosRemotenet) SetupIBC(ctx context.Context, keyName string) (context.Context, error) { + panic("not implemented") +} + +func (c *CosmosRemotenet) SetupXCall(ctx context.Context, portId string, keyName string) error { + panic("not implemented") +} + +func (c *CosmosRemotenet) ConfigureBaseConnection(ctx context.Context, connection chains.XCallConnection) (context.Context, error) { + panic("not implemented") +} + +func (c *CosmosRemotenet) GetIBCAddress(key string) string { + panic("not implemented") +} + +func (c *CosmosRemotenet) DeployXCallMockApp(ctx context.Context, connection chains.XCallConnection) error { + panic("not implemented") +} + +func (c *CosmosRemotenet) InitEventListener(ctx context.Context, contract string) chains.EventListener { + panic("not implemented") +} + +func (c *CosmosRemotenet) CheckForTimeout(ctx context.Context, target chains.Chain, params map[string]interface{}, listener chains.EventListener) (context.Context, error) { + panic("not implemented") +} + +func (c *CosmosRemotenet) SendPacketXCall(ctx context.Context, keyName, _to string, data, rollback []byte) (context.Context, error) { + panic("not implemented") +} + +// FindTargetXCallMessage returns the request id and the data of the message sent to the target chain +func (c *CosmosRemotenet) FindTargetXCallMessage(ctx context.Context, target chains.Chain, height uint64, to string) (*chains.XCallResponse, error) { + panic("not implemented") +} + +func (c *CosmosRemotenet) SendPacketMockDApp(ctx context.Context, targetChain chains.Chain, keyName string, params map[string]interface{}) (chains.PacketTransferResponse, error) { + panic("not implemented") +} + +func (c *CosmosRemotenet) findPacket(tx *TxResul, eventType string) chantypes.Packet { + panic("not implemented") +} + +func (c *CosmosRemotenet) XCall(ctx context.Context, targetChain chains.Chain, keyName, to string, data, rollback []byte) (*chains.XCallResponse, error) { + panic("not implemented") +} + +func (c *CosmosRemotenet) EOAXCall(ctx context.Context, targetChain chains.Chain, keyName, _to string, data []byte, sources, destinations []string) (string, string, string, error) { + panic("not implemented") +} + +func (c *CosmosRemotenet) findSn(tx *TxResul, eType string) string { + panic("not implemented") +} + +// IsPacketReceived returns the receipt of the packet sent to the target chain +func (c *CosmosRemotenet) IsPacketReceived(ctx context.Context, params map[string]interface{}, order ibc.Order) bool { + panic("not implemented") +} + +func (c *CosmosRemotenet) ExecuteCall(ctx context.Context, reqId, data string) (context.Context, error) { + panic("not implemented") +} + +func (c *CosmosRemotenet) ExecuteRollback(ctx context.Context, sn string) (context.Context, error) { + panic("not implemented") +} + +func (c *CosmosRemotenet) FindCallMessage(ctx context.Context, startHeight uint64, from, to, sn string) (string, string, error) { + panic("not implemented") + +} + +func (c *CosmosRemotenet) FindCallResponse(ctx context.Context, startHeight uint64, sn string) (string, error) { + panic("not implemented") +} + +func (c *CosmosRemotenet) FindEvent(ctx context.Context, startHeight uint64, contract, index string) (*ctypes.ResultEvent, error) { + panic("not implemented") +} + +func (c *CosmosRemotenet) DeployContract(ctx context.Context, keyName string) (context.Context, error) { + panic("not implemented") +} + +func (c *CosmosRemotenet) QueryContract(ctx context.Context, contractAddress, methodName string, params map[string]interface{}) (context.Context, error) { + panic("not implemented") +} + +func (c *CosmosRemotenet) ExecuteContract(ctx context.Context, contractAddress, keyName, methodName string, params map[string]interface{}) (context.Context, error) { + panic("not implemented") +} + +func (c *CosmosRemotenet) GetLastBlock(ctx context.Context) (context.Context, error) { + panic("not implemented") +} + +func (c *CosmosRemotenet) GetBlockByHeight(ctx context.Context) (context.Context, error) { + panic("not implemented") // TODO: Implement +} + +func (c *CosmosRemotenet) FindTxs(ctx context.Context, height uint64) ([]blockdb.Tx, error) { + panic("not implemented") +} + +func (c *CosmosRemotenet) BuildWallets(ctx context.Context, keyName string) (ibc.Wallet, error) { + panic("not implemented") +} + +func (c *CosmosRemotenet) BuildWallet(ctx context.Context, keyName string, mnemonic string) (ibc.Wallet, error) { + panic("not implemented") +} + +func (c *CosmosRemotenet) GetCommonArgs() []string { + return []string{"--gas", "auto"} +} + +func (c *CosmosRemotenet) GetClientName(suffix int) string { + return fmt.Sprintf("remote-cosmos-%d", suffix) +} + +func (c *CosmosRemotenet) GetClientState(ctx context.Context, clientSuffix int) (any, error) { + + panic("not implemented") +} + +// GetClientsCount returns the next sequence number for the client +func (c *CosmosRemotenet) GetClientsCount(ctx context.Context) (int, error) { + panic("not implemented") +} + +// GetConnectionState returns the next sequence number for the client +func (c *CosmosRemotenet) GetConnectionState(ctx context.Context, connectionPrefix int) (*conntypes.ConnectionEnd, error) { + panic("not implemented") +} + +// GetNextConnectionSequence returns the next sequence number for the client +func (c *CosmosRemotenet) GetNextConnectionSequence(ctx context.Context) (int, error) { + panic("not implemented") +} + +// GetChannel returns the next sequence number for the client +func (c *CosmosRemotenet) GetChannel(ctx context.Context, connectionPrefix int, portID string) (*chantypes.Channel, error) { + panic("not implemented") +} + +// GetNextChannelSequence returns the next sequence number for the client +func (c *CosmosRemotenet) GetNextChannelSequence(ctx context.Context) (int, error) { + panic("not implemented") +} + +// PauseNode halts a node +func (c *CosmosRemotenet) PauseNode(ctx context.Context) error { + panic("not implemented") +} + +// UnpauseNode restarts a node +func (c *CosmosRemotenet) UnpauseNode(ctx context.Context) error { + panic("not implemented") +} + +func (c *CosmosRemotenet) BackupConfig() ([]byte, error) { + panic("not implemented") +} + +func (c *CosmosRemotenet) RestoreConfig(backup []byte) error { + panic("not implemented") +} + +func (c *CosmosRemotenet) SetupIBCICS20(ctx context.Context, keyName string) (context.Context, error) { + fmt.Println("Nothing to do in cosmos for ibc ics20 remote setup") + return ctx, nil +} + +func (c *CosmosRemotenet) SendIBCTokenTransfer(ctx context.Context, sourceChannel, destinationChannel, port, sender, receiver, chainID, ibcamount string, hopRequired bool) (string, error) { + memo := `{"forward":{"receiver":"` + receiver + `","port":"transfer","channel":"` + destinationChannel + `","timeout":"10m","retries":2}}` + commands := []string{"tx", "ibc-transfer", port, port, sourceChannel, receiver, ibcamount} + commands = append(commands, + "--node", c.GetHostRPCAddress(), + "--packet-timeout-height", "1-500000", + "--packet-timeout-timestamp", "0", + "--gas-prices", "0.1stake", + "--gas-adjustment", "1.5", + "--gas", "auto", + "--from", c.testConfig.KeystoreFile, + "--keyring-backend", c.testConfig.KeystorePassword, + "--output", "json", + "--chain-id", chainID, + "-y", + ) + if hopRequired { + commands = append(commands, + "--memo", memo, + ) + } + stdout, _, err := c.Exec(ctx, commands, nil) + if err != nil { + return "", err + } + var output TxResul + err = json.Unmarshal(stdout, &output) + if err != nil { + return "", err + } + return output.Txhash, nil +} + +// GetBalance fetches the current balance for a specific account address and denom. +func (c *CosmosRemotenet) GetBalance(ctx context.Context, address string, denom string) (int64, error) { + panic("not implemented") +} + +func (c *CosmosRemotenet) RegisterToken(ctx context.Context, name, denom, decimal string) error { + return nil +} + +func (c *CosmosRemotenet) GetSenderReceiverAddress() (string, string) { + return c.testCfg.Sender, c.testCfg.Receiver +} diff --git a/test/chains/cosmos/types.go b/test/chains/cosmos/types.go index 1bcca9154..1517bad04 100644 --- a/test/chains/cosmos/types.go +++ b/test/chains/cosmos/types.go @@ -5,6 +5,7 @@ import ( "time" "github.com/icon-project/ibc-integration/test/chains" + "github.com/icon-project/ibc-integration/test/testsuite/testconfig" "github.com/strangelove-ventures/interchaintest/v7/chain/cosmos" "github.com/strangelove-ventures/interchaintest/v7/ibc" @@ -21,6 +22,27 @@ type CosmosLocalnet struct { Wallets map[string]ibc.Wallet `json:"wallets"` } +type CosmosRemotenet struct { + *CosmosRemoteChain + cfg ibc.ChainConfig + testCfg testconfig.Chain + keyName string + filepath map[string]string + IBCAddresses map[string]string `json:"addresses"` + Wallets map[string]ibc.Wallet `json:"wallets"` +} + +func (c *CosmosRemotenet) Config() ibc.ChainConfig { + return c.cfg +} + +func (c *CosmosRemotenet) OverrideConfig(key string, value any) { + if value == nil { + return + } + c.cfg.ConfigFileOverrides[key] = value +} + func (c *CosmosLocalnet) Config() ibc.ChainConfig { return c.cfg } diff --git a/test/chains/icon/data/config/config.lock b/test/chains/icon/data/config/config.lock new file mode 100644 index 000000000..e69de29bb diff --git a/test/chains/icon/data/config/config.yaml b/test/chains/icon/data/config/config.yaml new file mode 100644 index 000000000..0caeb7371 --- /dev/null +++ b/test/chains/icon/data/config/config.yaml @@ -0,0 +1,55 @@ +global: + api-listen-addr: :5183 + timeout: 10s + memo: "" + light-cache-size: 20 +chains: + centauri-testnet-1: + type: cosmos + value: + key-directory: /home/relayer/.relayer/keys/centauri-testnet-1 + key: centauri-testnet-1 + chain-id: centauri-testnet-1 + rpc-addr: http://docker.for.mac.host.internal:50001 + account-prefix: centauri + keyring-backend: test + gas-adjustment: 1.3 + gas-prices: 0.00stake + min-gas-amount: 1000000 + max-gas-amount: 0 + debug: true + timeout: 10s + block-timeout: "" + output-format: json + sign-mode: direct + extra-codecs: [] + coin-type: 118 + signing-algorithm: "" + broadcast-mode: batch + min-loop-duration: 0s + ibc-icon: + type: icon + value: + key-directory: /home/relayer/.relayer/keys + chain-id: ibc-icon + rpc-addr: http://http://docker.for.mac.host.internal:9082/api/v3/api/v3/ + timeout: 10s + keystore: godWallet + password: gochain + icon-network-id: 3 + btp-network-id: 1 + btp-network-type-id: 1 + start-height: 0 + ibc-handler-address: cx9696996d8477c0b0853ad9c8ee540baa8e715926 + first-retry-block-after: 0 + block-interval: 2000 + revision-number: 0 +paths: + TestE2ETestSuite-TestE2E_all-path-0: + src: + chain-id: ibc-icon + dst: + chain-id: centauri-testnet-1 + src-channel-filter: + rule: "" + channel-list: [] diff --git a/test/chains/icon/data/keys/centauri-testnet-1/keyring-test/4506a66e61d7d7d2e0305d7e2c5604246d892bf2.address b/test/chains/icon/data/keys/centauri-testnet-1/keyring-test/4506a66e61d7d7d2e0305d7e2c5604246d892bf2.address new file mode 100644 index 000000000..912bf6666 --- /dev/null +++ b/test/chains/icon/data/keys/centauri-testnet-1/keyring-test/4506a66e61d7d7d2e0305d7e2c5604246d892bf2.address @@ -0,0 +1 @@ +eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJjcmVhdGVkIjoiMjAyNC0wMi0wNyAwOTo0NDoxNy4yNDQzOTg0MjggKzAwMDAgVVRDIG09KzAuMDkyODQ2MDAxIiwiZW5jIjoiQTI1NkdDTSIsInAyYyI6ODE5MiwicDJzIjoieVpvMVVaLWEtSnNLMGdseiJ9.ZC2IOg9ODnHNxm11tOhvkstExQztYfnv7IjqZF0Kdt45b7kQeSNm8w.cTvIti0QxKaRyMTt.0M-J1NLaE50_N_cfxD8sFYMqNrDHvMS8UmgFaeXtL7juHyo49s9hYOZFZM6c_j-X4qG3iV84pW8FWX79tWIt1L_nS4RH-8tAzES93EVy49Eeo_yYghXEC3wpNYzo1mrNGJn4gMMacN44g0Klc7FU1QEkQG7AKqgaY8qOGX_8Hx8r8qyKaEASYUV_Ca0fB0BAJGPW3Rvt05cW-RkliXjfe6L-9BkmmovxwPozIc2OSaumEojxPBNIovvX0yRXR9aqnI7E8kuc.swyQqrMny8XwZolRIpt3CA \ No newline at end of file diff --git a/test/chains/icon/data/keys/centauri-testnet-1/keyring-test/centauri-testnet-1.info b/test/chains/icon/data/keys/centauri-testnet-1/keyring-test/centauri-testnet-1.info new file mode 100644 index 000000000..5502add65 --- /dev/null +++ b/test/chains/icon/data/keys/centauri-testnet-1/keyring-test/centauri-testnet-1.info @@ -0,0 +1 @@ +eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJjcmVhdGVkIjoiMjAyNC0wMi0wNyAwOTo0NDoxNy4yMzk4NTQzMDMgKzAwMDAgVVRDIG09KzAuMDg4MzAxNTg0IiwiZW5jIjoiQTI1NkdDTSIsInAyYyI6ODE5MiwicDJzIjoiZ0ZadWpPZEJmWWlnQlZUViJ9.95XFqhSbUG7nDEtckijdeXefXmba2iQEED6lxV5zWXVUyXMbdBQGHw.DsmI5Muif_cvj1Ty.WVum8xDP0uBMZC6Ybth6vRjdfDYrlXeNjGyocix66xgt8QS2niIRP4kvLwxYw6s-xU_yFwvU1bOmM3pFQH08MW-Xt3uNzYd67e3OmZKz3Sy3o0RKxzqR40YbK22oy_yn65KNcWBLQnzHp5K8KdNl7SRaLUWCVnIgMG6Nqs6RxLHA0DESa15fF8yEOtXdjnePPOfJacdDGeE721ff4euwuYlu703Qi1Zzd_1-t1e8GoT5ZoUMB7-sCSqfuM7j0GqaSWw9hgYq3p0yk7-jqMBWmnriCTTTxaZfzcXnWq27T_kMwTEACLy09mlAfS3ElYA6yBCD8lsjRD1yaTzwOyCYhQ32mBfvH0q67_K-nn2jj8RrJJH_9H1OSqogWb2HBradQO3nm1EpwiFGdaW7WYs6EWNStcSV70TsVS1h99CBpWMaMYwDCEQbg3eQcRFfZ8VAtBYLr7ictu-jxs2-p4B3oUJPUJJrB-95EA1U_vI.q2RDwWO92ApsXGOozPPMYw \ No newline at end of file diff --git a/test/chains/icon/data/minter.json b/test/chains/icon/data/minter.json new file mode 100644 index 000000000..0bdfd9147 --- /dev/null +++ b/test/chains/icon/data/minter.json @@ -0,0 +1 @@ +{"address":"hxac1f0b75d2c05692fdea027fdd0d8475650c72d6","id":"19a43289-f8d0-4d5f-8651-4bc694513f26","version":3,"coinType":"icx","crypto":{"cipher":"aes-128-ctr","cipherparams":{"iv":"a8d94d90da04392cc01825925de775cb"},"ciphertext":"29defc1a11f26ed9167572d410a4a1d666c02862b25865df267713aa4255f61d","kdf":"scrypt","kdfparams":{"dklen":32,"n":65536,"r":8,"p":1,"salt":"2b16fb5510ee8ebd"},"mac":"ad56a806a93c015676fb491a4a46e49658e3771add5f424365f33ad346abc3a4"}} \ No newline at end of file diff --git a/test/chains/icon/localnet.go b/test/chains/icon/localnet.go index 0a4e823f3..4f1e876c7 100644 --- a/test/chains/icon/localnet.go +++ b/test/chains/icon/localnet.go @@ -5,9 +5,6 @@ import ( "encoding/hex" "encoding/json" "fmt" - "github.com/icon-project/ibc-integration/libraries/go/common/tendermint" - interchaintest "github.com/icon-project/ibc-integration/test" - "github.com/icon-project/icon-bridge/common/wallet" "io" "log" "math/big" @@ -17,6 +14,10 @@ import ( "sync" "time" + "github.com/icon-project/ibc-integration/libraries/go/common/tendermint" + interchaintest "github.com/icon-project/ibc-integration/test" + "github.com/icon-project/icon-bridge/common/wallet" + dockertypes "github.com/docker/docker/api/types" volumetypes "github.com/docker/docker/api/types/volume" "github.com/docker/docker/client" @@ -353,6 +354,10 @@ func (c *IconLocalnet) GetBalance(ctx context.Context, address string, denom str return c.getFullNode().GetBalance(ctx, address) } +func (c *IconLocalnet) GetWalletBalance(ctx context.Context, address string, denom string) (*big.Int, error) { + panic("not implemented") +} + func (c *IconLocalnet) SetupIBC(ctx context.Context, keyName string) (context.Context, error) { var contracts chains.ContractKey time.Sleep(4 * time.Second) @@ -1034,3 +1039,19 @@ func (c *IconLocalnet) SendPacketMockDApp(ctx context.Context, targetChain chain return response, err } + +func (c *IconLocalnet) SetupIBCICS20(ctx context.Context, keyName string) (context.Context, error) { + panic("not implemented") +} + +func (c *IconLocalnet) SendIBCTokenTransfer(ctx context.Context, sourceChannel, destinationChannel, port, sender, receiver, chainID, ibcamount string, hopRequired bool) (string, error) { + panic("not implemented") +} + +func (c *IconLocalnet) RegisterToken(ctx context.Context, name, denom, decimal string) error { + return nil +} + +func (c *IconLocalnet) GetSenderReceiverAddress() (string, string) { + return "", "" +} diff --git a/test/chains/icon/remotenet.go b/test/chains/icon/remotenet.go new file mode 100644 index 000000000..ad7ef35b8 --- /dev/null +++ b/test/chains/icon/remotenet.go @@ -0,0 +1,809 @@ +package icon + +import ( + "context" + "encoding/hex" + "encoding/json" + "fmt" + "math/big" + "path/filepath" + "strings" + "time" + + "github.com/docker/docker/client" + "github.com/icon-project/ibc-integration/test/chains" + "github.com/icon-project/ibc-integration/test/internal/blockdb" + "github.com/icon-project/ibc-integration/test/internal/dockerutil" + "github.com/icon-project/ibc-integration/test/testsuite/testconfig" + + conntypes "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types" + chantypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" + + icontypes "github.com/icon-project/icon-bridge/cmd/iconbridge/chain/icon/types" + + "github.com/strangelove-ventures/interchaintest/v7/ibc" + + // "github.com/strangelove-ventures/interchaintest/v7/testutil" + "go.uber.org/zap" +) + +type IconRemotenet struct { + log *zap.Logger + testName string + cfg ibc.ChainConfig + Client *client.Client + Network string + scorePaths map[string]string + IBCAddresses map[string]string `json:"addresses"` + Wallets map[string]ibc.Wallet `json:"wallets"` + testconfig testconfig.Chain +} + +const ( + WalletKeyStore = "/goloop/data/" + MinterWalletKeyStore = "/goloop/data/minter.json" +) + +func (c *IconRemotenet) CreateKey(ctx context.Context, keyName string) error { + panic("implement me") + +} + +func NewIconRemotenet(testName string, log *zap.Logger, chainConfig ibc.ChainConfig, client *client.Client, network string, testconfig testconfig.Chain) chains.Chain { + return &IconRemotenet{ + testName: testName, + cfg: chainConfig, + log: log, + scorePaths: testconfig.Contracts, + Wallets: map[string]ibc.Wallet{}, + Client: client, + Network: network, + testconfig: testconfig, + } +} + +// Config fetches the chain configuration. +func (c *IconRemotenet) Config() ibc.ChainConfig { + return c.cfg +} + +func (c *IconRemotenet) OverrideConfig(key string, value any) { + if value == nil { + return + } + c.cfg.ConfigFileOverrides[key] = value +} + +// Initialize initializes node structs so that things like initializing keys can be done before starting the chain +func (c *IconRemotenet) Initialize(ctx context.Context, testName string, cli *client.Client, networkID string) error { + panic("not implemented") +} + +func (c *IconRemotenet) NewChainNode( + ctx context.Context, + testName string, + cli *client.Client, + networkID string, + image ibc.DockerImage, + validator bool, +) (*IconNode, error) { + panic("not implemented") +} + +// Start sets up everything needed (validators, gentx, fullnodes, peering, additional accounts) for chain to start from genesis. +func (c *IconRemotenet) Start(testName string, ctx context.Context, additionalGenesisWallets ...ibc.WalletAmount) error { + panic("not implemented") +} + +// Exec runs an arbitrary command using Chain's docker environment. +// Whether the invoked command is run in a one-off container or execing into an already running container +// is up to the chain implementation. +// +// "env" are environment variables in the format "MY_ENV_VAR=value" +func (c *IconRemotenet) Exec(ctx context.Context, cmd []string, env []string) (stdout []byte, stderr []byte, err error) { + cmd = append([]string{c.cfg.Bin}, cmd...) + job := dockerutil.NewImage(c.log, c.Client, c.Network, c.testName, c.cfg.Images[0].Repository, c.cfg.Images[0].Version) + var ContainerEnvs = [9]string{ + "GOCHAIN_CONFIG=/goloop/data/config.json", + "GOCHAIN_GENESIS=/goloop/data/genesis.json", + "GOCHAIN_DATA=/goloop/chain/iconee", + "GOCHAIN_LOGFILE=/goloop/chain/iconee.log", + "GOCHAIN_DB_TYPE=rocksdb", + "GOCHAIN_CLEAN_DATA=true", + "JAVAEE_BIN=/goloop/execman/bin/execman", + "PYEE_VERIFY_PACKAGE=true", + "ICON_CONFIG=/goloop/data/icon_config.json", + } + opts := dockerutil.ContainerOptions{ + Binds: []string{ + c.testconfig.ContractsPath + ":/contracts", + c.testconfig.ConfigPath + ":/goloop/data", + }, + Env: ContainerEnvs[:], + } + res := job.Run(ctx, cmd, opts) + return res.Stdout, res.Stderr, res.Err +} + +// ExportState exports the chain state at specific height. +func (c *IconRemotenet) ExportState(ctx context.Context, height int64) (string, error) { + panic("not implemented") +} + +// GetRPCAddress retrieves the rpc address that can be reached by other containers in the docker network. +func (c *IconRemotenet) GetRPCAddress() string { + return c.testconfig.RPCUri +} + +// GetGRPCAddress retrieves the grpc address that can be reached by other containers in the docker network. +// Not Applicable for Icon +func (c *IconRemotenet) GetGRPCAddress() string { + return c.testconfig.RPCUri +} + +// GetHostRPCAddress returns the rpc address that can be reached by processes on the host machine. +// Note that this will not return a valid value until after Start returns. +func (c *IconRemotenet) GetHostRPCAddress() string { + return c.testconfig.RPCUri +} + +// GetHostGRPCAddress returns the grpc address that can be reached by processes on the host machine. +// Note that this will not return a valid value until after Start returns. +// Not applicable for Icon +func (c *IconRemotenet) GetHostGRPCAddress() string { + return c.testconfig.RPCUri +} + +// HomeDir is the home directory of a node running in a docker container. Therefore, this maps to +// the container's filesystem (not the host). +func (c *IconRemotenet) HomeDir() string { + return c.getFullNode().HomeDir() +} + +// RecoverKey recovers an existing user from a given mnemonic. +func (c *IconRemotenet) RecoverKey(ctx context.Context, name string, mnemonic string) error { + panic("not implemented") // TODO: Implement +} + +// GetAddress fetches the bech32 address for a test key on the "user" node (either the first fullnode or the first validator if no fullnodes). +func (c *IconRemotenet) GetAddress(ctx context.Context, keyName string) ([]byte, error) { + panic("not implemented") +} + +// SendFunds sends funds to a wallet from a user account. +func (c *IconRemotenet) SendFunds(ctx context.Context, keyName string, amount ibc.WalletAmount) error { + panic("not implemented") +} + +func (c *IconRemotenet) SendFundsFromGodwallet(ctx context.Context, amount ibc.WalletAmount) error { + commands := []string{"rpc", "sendtx", "transfer"} + commands = append(commands, + "--uri", c.GetHostRPCAddress(), + "--key_store", WalletKeyStore+c.testconfig.KeystoreFile, + "--key_password", c.testconfig.KeystorePassword, + "--to", amount.Address, + "--value", fmt.Sprint(amount.Amount)+"000000000000000000", + "--step_limit", "25000000000", + "--nid", "0x3", + ) + _, _, err := c.Exec(ctx, commands, nil) + return err + +} + +// SendIBCTransfer sends an IBC transfer returning a transaction or an error if the transfer failed. +func (c *IconRemotenet) SendIBCTransfer(ctx context.Context, channelID string, keyName string, amount ibc.WalletAmount, options ibc.TransferOptions) (ibc.Tx, error) { + panic("not implemented") +} +func (c *IconRemotenet) SendIBCTokenTransfer(ctx context.Context, sourceChannel, destinationChannel, port, sender, receiver, chainID, ibcamount string, hopRequired bool) (string, error) { + + ics20App := c.IBCAddresses["ics20App"] + commands := []string{"rpc", "sendtx", "call"} + amount, denom, _ := strings.Cut(ibcamount, "/") + if denom == "icx" { + commands = append(commands, + "--to", ics20App, + "--method", "sendICX", + "--uri", c.GetHostRPCAddress(), + "--key_store", WalletKeyStore+c.testconfig.KeystoreFile, + "--key_password", c.testconfig.KeystorePassword, + "--value", amount, + "--step_limit", "25000000000", + "--nid", "0x3", + ) + + params := `{"params":{"receiver":"pfm","sourcePort":"` + port + `","sourceChannel":"` + + sourceChannel + + `","timeoutHeight":{ "revisionHeight": "80","revisionNumber": "80"},"timeoutTimestamp":"0",` + + `"memo":"{\\\"forward\\\":{\\\"receiver\\\":\\\"` + + receiver + `\\\",\\\"port\\\":\\\"` + port + `\\\",\\\"channel\\\":\\\"` + + destinationChannel + `\\\",\\\"timeout\\\":\\\"10m\\\",\\\"retries\\\":2}}"}}` + if !hopRequired { + // remove memo for no hop + params = `{"params":{"receiver":"` + receiver + `","sourcePort":"` + port + `","sourceChannel":"` + + sourceChannel + + `","timeoutHeight":{ "revisionHeight": "80","revisionNumber": "80"},"timeoutTimestamp":"0"` + + `}}` + } + commands = append(commands, "--raw", params) + var output string + stdout, _, err := c.Exec(ctx, commands, nil) + if err != nil { + return "", err + } + err = json.Unmarshal(stdout, &output) + if err != nil { + return "", err + } + return c.waitForTxn(ctx, output) + } + // Find the index where "transfer" starts + transferIndex := strings.Index(ibcamount, "transfer") + + // Extract the amount + sendAmount := ibcamount[:transferIndex] + + // Extract the denom + sendDenom := ibcamount[transferIndex:] + tokenContractAddress, err := c.GetTokenContractAddress(ctx, sendDenom) + if err != nil { + fmt.Println("Failed to get token contract address") + return "", err + } + commands = append(commands, + "--to", tokenContractAddress, + "--method", "transfer", + "--uri", c.GetHostRPCAddress(), + "--key_store", WalletKeyStore+c.testconfig.KeystoreFile, + "--key_password", c.testconfig.KeystorePassword, + "--step_limit", "25000000000", + "--nid", "0x3", + ) + + ftparams := `{"method":"sendFungibleTokens","params":{"denomination":"` + sendDenom + `","amount": ` + sendAmount + `,"sender": "` + sender + `","receiver": "` + receiver + `","sourcePort": "transfer","sourceChannel":"channel-0","timeoutHeight":{"latestHeight":80,"revisionNumber":80},"timeoutTimestamp":0,"memo":"{\\\"forward\\\":{\\\"receiver\\\":\\\"` + + receiver + `\\\",\\\"port\\\":\\\"` + port + `\\\",\\\"channel\\\":\\\"` + + destinationChannel + `\\\",\\\"timeout\\\":\\\"10m\\\",\\\"retries\\\":2}}"}}` + + if !hopRequired { + // remove memo for no hop + ftparams = `{"method":"sendFungibleTokens","params":{"denomination":"` + sendDenom + `","amount": ` + sendAmount + `,"sender": "` + sender + `","receiver": "` + receiver + `","sourcePort": "transfer","sourceChannel":"channel-0","timeoutHeight":{"latestHeight":80,"revisionNumber":80},"timeoutTimestamp":0}}` + } + tokenParams := hex.EncodeToString([]byte(ftparams)) + params := `{"params":{"_to":"` + ics20App + `","_value":"` + sendAmount + `","_data":"` + tokenParams + `"}}` + commands = append(commands, "--raw", params) + var output string + stdout, _, err := c.Exec(ctx, commands, nil) + if err != nil { + return "", err + } + err = json.Unmarshal(stdout, &output) + if err != nil { + return "", err + } + return c.waitForTxn(ctx, output) +} + +// Height returns the current block height or an error if unable to get current height. +func (c *IconRemotenet) Height(ctx context.Context) (uint64, error) { + panic("not implemented") +} + +// GetGasFeesInNativeDenom gets the fees in native denom for an amount of spent gas. +func (c *IconRemotenet) GetGasFeesInNativeDenom(gasPaid int64) int64 { + panic("not implemented") +} + +// Acknowledgements returns all acknowledgements in a block at height. +func (c *IconRemotenet) Acknowledgements(ctx context.Context, height uint64) ([]ibc.PacketAcknowledgement, error) { + panic("not implemented") // TODO: Implement +} + +// Timeouts returns all timeouts in a block at height. +func (c *IconRemotenet) Timeouts(ctx context.Context, height uint64) ([]ibc.PacketTimeout, error) { + panic("not implemented") // TODO: Implement +} + +// BuildRelayerWallet will return a chain-specific wallet populated with the mnemonic so that the wallet can +// be restored in the relayer node using the mnemonic. After it is built, that address is included in +// genesis with some funds. +func (c *IconRemotenet) BuildRelayerWallet(ctx context.Context, keyName string) (ibc.Wallet, error) { + panic("not implemented") +} + +func (c *IconRemotenet) BuildWallet(ctx context.Context, keyName string, mnemonic string) (ibc.Wallet, error) { + panic("not implemented") +} + +func (c *IconRemotenet) getFullNode() *IconNode { + panic("not implemented") +} + +func (c *IconRemotenet) FindTxs(ctx context.Context, height uint64) ([]blockdb.Tx, error) { + panic("not implemented") +} + +func (c *IconRemotenet) GetTokenContractAddress(ctx context.Context, denom string) (string, error) { + ics20App := c.IBCAddresses["ics20App"] + commands := []string{"rpc", "call"} + commands = append(commands, + "--to", ics20App, + "--method", "getTokenContractAddress", + "--uri", c.GetHostRPCAddress(), + ) + // params := `{"denom":"` + denom + `","account":"` + address + `"}` + params := `{"denom":"` + denom + `"}` + commands = append(commands, "--params", params) + var output string + stdout, _, err := c.Exec(ctx, commands, nil) + if err != nil { + return "", err + } + err = json.Unmarshal(stdout, &output) + if err != nil { + return "", err + } + return output, nil +} + +// GetBalance fetches the current balance for a specific account address and denom. +func (c *IconRemotenet) GetWalletBalance(ctx context.Context, address string, denom string) (*big.Int, error) { + if denom == "icx" { + bal, err := c.GetBalance(ctx, address, denom) + return big.NewInt(bal), err + } + + // get token contract address + ics20App := c.IBCAddresses["ics20App"] + commands := []string{"rpc", "call"} + commands = append(commands, + "--to", ics20App, + "--method", "getTokenContractAddress", + "--uri", c.GetHostRPCAddress(), + ) + params := `{"denom":"` + denom + `"}` + commands = append(commands, "--params", params) + var tokenContractAddress string + stdout, _, err := c.Exec(ctx, commands, nil) + if err != nil { + fmt.Println(err) + return big.NewInt(0), err + } + err = json.Unmarshal(stdout, &tokenContractAddress) + if err != nil { + fmt.Println(err) + return big.NewInt(0), err + } + + //get balance + commands = []string{"rpc", "call"} + commands = append(commands, + "--to", tokenContractAddress, + "--method", "balanceOf", + "--uri", c.GetHostRPCAddress(), + ) + // params := `{"denom":"` + denom + `","account":"` + address + `"}` + params = `{"_owner":"` + address + `"}` + commands = append(commands, "--params", params) + var output string + stdout, _, err = c.Exec(ctx, commands, nil) + if err != nil { + fmt.Println(err) + return big.NewInt(0), err + } + err = json.Unmarshal(stdout, &output) + if err != nil { + fmt.Println(err) + return big.NewInt(0), err + } + balanceBigInt := new(big.Int) + output = strings.TrimPrefix(output, "0x") + balanceBigInt.SetString(output, 16) + return balanceBigInt, nil +} + +func (c *IconRemotenet) GetBalance(ctx context.Context, address string, denom string) (int64, error) { + commands := []string{"rpc", "balance", address} + commands = append(commands, + "--uri", c.GetHostRPCAddress(), + ) + var output string + stdout, _, err := c.Exec(ctx, commands, nil) + if err != nil { + return 0, nil + } + balanceBigInt := new(big.Int) + if err := json.Unmarshal(stdout, &output); err != nil { + panic(err) + } + output = strings.TrimPrefix(output, "0x") + balanceBigInt.SetString(output, 16) + return balanceBigInt.Int64(), nil +} + +func (c *IconRemotenet) SetupIBC(ctx context.Context, keyName string) (context.Context, error) { + panic("unimplemented") +} + +func (c *IconRemotenet) SetupXCall(ctx context.Context, portId string, keyName string) error { + panic("unimplemented") +} + +func (c *IconRemotenet) PreGenesis() error { + panic("unimplemented") +} + +func (c *IconRemotenet) DeployXCallMockApp(ctx context.Context, connection chains.XCallConnection) error { + panic("unimplemented") +} + +func (c *IconRemotenet) GetIBCAddress(key string) string { + value, exist := c.IBCAddresses[key] + if !exist { + panic(fmt.Sprintf(`IBC address not exist %s`, key)) + } + return value +} + +func (c *IconRemotenet) BackupConfig() ([]byte, error) { + panic("unimplemented") +} + +func (c *IconRemotenet) RestoreConfig(backup []byte) error { + panic("unimplemented") +} + +func (c *IconRemotenet) ConfigureBaseConnection(ctx context.Context, connection chains.XCallConnection) (context.Context, error) { + panic("unimplemented") +} + +func (c *IconRemotenet) SendPacketXCall(ctx context.Context, keyName, _to string, data, rollback []byte) (context.Context, error) { + panic("unimplemented") +} + +// HasPacketReceipt returns the receipt of the packet sent to the target chain +func (c *IconRemotenet) IsPacketReceived(ctx context.Context, params map[string]interface{}, order ibc.Order) bool { + panic("not implemented") +} + +// FindTargetXCallMessage returns the request id and the data of the message sent to the target chain +func (c *IconRemotenet) FindTargetXCallMessage(ctx context.Context, target chains.Chain, height uint64, to string) (*chains.XCallResponse, error) { + panic("not implemented") +} + +func (c *IconRemotenet) XCall(ctx context.Context, targetChain chains.Chain, keyName, to string, data, rollback []byte) (*chains.XCallResponse, error) { + panic("not implemented") +} + +func (c *IconRemotenet) EOAXCall(ctx context.Context, targetChain chains.Chain, keyName, _to string, data []byte, sources, destinations []string) (string, string, string, error) { + panic("not implemented") +} + +func (c *IconRemotenet) ExecuteCall(ctx context.Context, reqId, data string) (context.Context, error) { + panic("not implemented") +} + +func (c *IconRemotenet) ExecuteRollback(ctx context.Context, sn string) (context.Context, error) { + panic("unimplemented") +} + +func (c *IconRemotenet) FindCallMessage(ctx context.Context, startHeight uint64, from, to, sn string) (string, string, error) { + panic("unimplemented") +} + +func (c *IconRemotenet) FindCallResponse(ctx context.Context, startHeight uint64, sn string) (string, error) { + panic("unimplemented") +} + +func (c *IconRemotenet) FindEvent(ctx context.Context, startHeight uint64, contract, signature string, index []*string) (*icontypes.EventNotification, error) { + panic("unimplemented") +} + +// DeployContract implements chains.Chain +func (c *IconRemotenet) DeployContract(ctx context.Context, scorePath string) (context.Context, error) { + panic("unimplemented") +} + +func (c *IconRemotenet) ExecuteContract(ctx context.Context, contractAddress, keyName, methodName string, params map[string]interface{}) (context.Context, error) { + panic("unimplemented") +} + +// GetBlockByHeight implements chains.Chain +func (c *IconRemotenet) GetBlockByHeight(ctx context.Context) (context.Context, error) { + panic("unimplemented") +} + +// GetLastBlock implements chains.Chain +func (c *IconRemotenet) GetLastBlock(ctx context.Context) (context.Context, error) { + panic("unimplemented") +} + +func (c *IconRemotenet) InitEventListener(ctx context.Context, contract string) chains.EventListener { + panic("unimplemented") +} + +func (c *IconRemotenet) CheckForTimeout(ctx context.Context, target chains.Chain, params map[string]interface{}, listener chains.EventListener) (context.Context, error) { + + panic("unimplemented") +} + +// QueryContract implements chains.Chain +func (c *IconRemotenet) QueryContract(ctx context.Context, contractAddress, methodName string, params map[string]interface{}) (context.Context, error) { + panic("unimplemented") + +} + +func (c *IconRemotenet) BuildWallets(ctx context.Context, keyName string) (ibc.Wallet, error) { + return nil, nil +} + +func (c *IconRemotenet) GetClientName(suffix int) string { + return fmt.Sprintf("08-tendermint-%d", suffix) +} + +func (c *IconRemotenet) GetClientState(ctx context.Context, clientSuffix int) (any, error) { + panic("unimplemented") +} + +// GetClientsCount returns the next sequence number for the client +func (c *IconRemotenet) GetClientsCount(ctx context.Context) (int, error) { + panic("unimplemented") +} + +// GetConnectionState returns the next sequence number for the client +func (c *IconRemotenet) GetConnectionState(ctx context.Context, clientSuffix int) (*conntypes.ConnectionEnd, error) { + panic("unimplemented") +} + +// GetNextConnectionSequence returns the next sequence number for the client +func (c *IconRemotenet) GetNextConnectionSequence(ctx context.Context) (int, error) { + panic("unimplemented") +} + +func (c *IconRemotenet) GetChannel(ctx context.Context, channelSuffix int, portID string) (*chantypes.Channel, error) { + panic("unimplemented") +} + +// GetNextChannelSequence returns the next sequence number for the client +func (c *IconRemotenet) GetNextChannelSequence(ctx context.Context) (int, error) { + panic("unimplemented") +} + +// PauseNode pauses the node +func (c *IconRemotenet) PauseNode(ctx context.Context) error { + panic("unimplemented") +} + +// UnpauseNode starts the paused node +func (c *IconRemotenet) UnpauseNode(ctx context.Context) error { + panic("unimplemented") +} + +func (c *IconRemotenet) SendPacketMockDApp(ctx context.Context, targetChain chains.Chain, keyName string, params map[string]interface{}) (chains.PacketTransferResponse, error) { + panic("unimplemented") + +} + +func (c *IconRemotenet) waitForTxn(ctx context.Context, txnhash string) (string, error) { + loop := 0 + time.Sleep(time.Second * 4) + for loop < 10 { + commands := []string{"rpc", "txresult", txnhash} + commands = append(commands, + "--uri", c.GetHostRPCAddress(), + ) + stdout, _, err := c.Exec(ctx, commands, nil) + if err != nil { + fmt.Println(err) + } + var res *icontypes.TransactionResult + if err := json.Unmarshal(stdout, &res); err != nil { + panic(err) + } + if res.Status == "0x1" { + return string(res.SCOREAddress), nil + } + if res.Failure.CodeValue != "Ox0" { + return "", fmt.Errorf("error encountered in transaction execution") + } + time.Sleep(time.Second * 2) + loop++ + } + return "", fmt.Errorf("timeout waiting for transaction") +} + +func (c *IconRemotenet) waitForTxnRsp(ctx context.Context, txnhash string) (*icontypes.TransactionResult, error) { + loop := 0 + time.Sleep(time.Second * 4) + for loop < 10 { + commands := []string{"rpc", "txresult", txnhash} + commands = append(commands, + "--uri", c.GetHostRPCAddress(), + ) + stdout, _, err := c.Exec(ctx, commands, nil) + if err != nil { + fmt.Println(err) + } + var res *icontypes.TransactionResult + if err := json.Unmarshal(stdout, &res); err != nil { + panic(err) + } + if res.Status == "0x1" { + return res, nil + } + if res.Failure.CodeValue != "Ox0" { + return nil, fmt.Errorf("error encountered in transaction execution") + } + time.Sleep(time.Second * 2) + loop++ + } + return nil, fmt.Errorf("timeout waiting for transaction") +} + +func (c *IconRemotenet) DeployContractRemote(ctx context.Context, contractPath, initMessage string) (string, error) { + _, score := filepath.Split(contractPath) + commands := []string{"rpc", "sendtx", "deploy", "/contracts/" + score} + commands = append(commands, + "--to", "cx0000000000000000000000000000000000000000", + "--key_store", WalletKeyStore+c.testconfig.KeystoreFile, + "--key_password", c.testconfig.KeystorePassword, + "--step_limit", "25000000000", + "--content_type", "application/java", + "--nid", "0x3", + "--uri", c.GetHostRPCAddress(), + ) + if initMessage != "" && initMessage != "{}" { + if strings.HasPrefix(initMessage, "{") { + commands = append(commands, "--params", initMessage) + } else { + commands = append(commands, "--param", initMessage) + } + } + var output string + stdout, _, err := c.Exec(ctx, commands, nil) + if err != nil { + return "", err + } + err = json.Unmarshal(stdout, &output) + if err != nil { + return "", err + } + return c.waitForTxn(ctx, output) +} + +func (c *IconRemotenet) ExecuteContractRemote(ctx context.Context, contractAddress, methodName, params string) (context.Context, error) { + + commands := []string{"rpc", "sendtx", "call"} + keyst := WalletKeyStore + c.testconfig.KeystoreFile + if methodName == "mint" { + keyst = MinterWalletKeyStore + } + commands = append(commands, + "--to", contractAddress, + "--method", methodName, + "--key_store", keyst, + "--key_password", c.testconfig.KeystorePassword, + "--step_limit", "25000000000", + "--nid", "0x3", + "--uri", c.GetHostGRPCAddress(), + ) + if params != "" && params != "{}" { + if strings.HasPrefix(params, "{") { + commands = append(commands, "--params", params) + } else { + commands = append(commands, "--param", params) + } + } + if methodName == "registerPRep" { + commands = append(commands, "--value", "2000000000000000000000") + } + var output string + stdout, _, err := c.Exec(ctx, commands, nil) + if err != nil { + fmt.Println("error occurred whiuc executing command ", err) + return ctx, err + } + err = json.Unmarshal(stdout, &output) + if err != nil { + return ctx, err + } + res, err := c.waitForTxnRsp(ctx, output) + if err != nil { + return ctx, err + } + return context.WithValue(ctx, "txResult", res), nil +} + +func (c *IconRemotenet) SetupIBCICS20(ctx context.Context, keyName string) (context.Context, error) { + var contracts chains.ContractKey + + if c.scorePaths["ics20_app"] == "" { + time.Sleep(1 * time.Second) + ibcAddress, err := c.DeployContractRemote(ctx, c.scorePaths["ibc_ics"], "") + if err != nil { + return nil, err + } + fmt.Println("IBC Handler deployed at ", ibcAddress) + + ics20client, err := c.DeployContractRemote(ctx, c.scorePaths["ibc_ics20_client"], "ibcHandler="+ibcAddress) + if err != nil { + return nil, err + } + fmt.Println("IBC ics20 light Client deployed at ", ics20client) + + c.ExecuteContractRemote(context.Background(), ibcAddress, "registerClient", `{"hashType":"1","clientType":"`+"ics08-tendermint"+`", "client":"`+ics20client+`"}`) + + ics20App, err := c.DeployContractRemote(ctx, c.scorePaths["ics20app"], `{"_ibcHandler":"`+ibcAddress+`","_serializeIrc2":"504b03041400080808000000210000000000000000000000000014000d004d4554412d494e462f4d414e49464553542e4d46555405000100000000feca0000f34dcccb4c4b2d2ed10d4b2d2acecccfb35230d433e0e5f24dccccd375ce492c2eb65270e2e5e2e50200504b0708fbb81f722a00000028000000504b0304140008080800000021000000000000000000000000000d0009004d4554412d494e462f41504953555405000100000000b594cf4ee33010875d077802dea30f00422a072424240e5ded613944d3641a821c3bb29d22dea205ab77a07f5240629703e73e080fc3246d2fd084b2da3d46fee59bf17c93bcb1dd211b4948d063fd017f39b9801e3405c8a8d9b63a96d1de904dcc55d251a23a908718c4090853441aaf8b4802f6bc791847c7d262849a628f565910ed2c4dc5557d72d601aa10e069d76b0cdcc4579712f5f3890994c6662b0c351ab3b73daf21e45683345dd49cdfb87bdfaacf6f13b70722c30a4663eec67e0816eece0ebd797fc8f31f4b24f31c1d75b54ad640ff492d36d98f656c0f98774307859d3573e77337f5176ad69fcefc9597dbe346411d75322d394d74ea43a232692bdba1f00c84509785058f5fbb718502373529caf09b7646492c2d276cc5b436e96f0a69aa550f0b4c75136ef20569b075fb6bc89e56eb724456f97ff6bb28f92796814630d85acdf98b9b3c401862f8b3b6cc124ddebf857e3659872610d8cdf83975725aec43b14b639f9ed64049d1a3c6840c6d129d4568cb5cf90fd9f97df62144be635306bc1a50d91ecf5be5668060f4edffc5e2ba71bdcbfe3b504b07088f8e194ea001000035050000504b03041400080808000000210000000000000000000000000007000900422e636c617373555405000100000000a556f9571b5514fe5e32744232b434b6546a9774cf46e9225d002b10a88d96a204a904b7217984d064864e268075a9fbbed5ddd65d6b5dea39d66329e8d1e3cffe4d1e8ff74d262190d0726a388737efcd7df7fbee77efbb6ffefef7b73f011cc44f0cac4b06a3a153869386888c1a066fb43fb26fc050935c1dc9f0dde3eaa44aefc618ea8fe712bac19bbb0c554b8c7577b5310c2e5a6ab7e79dc9a4c173b9367bda9d4e98555e0ad7cd59d51c6bee4aa7a29ac953dc683b427f844798ab16d9d36a9ac1793c424f2bdad35ada3cc2e0f717dc64542dd51c338db4966aab5c89060615ac42bd1b125633b8d54c469f22ca3ce7c22d0c6baa3191b196a1ae4021a2d3dab429631d8347e353c578195aae8f1fc9a8c43cb05839058d58efc6adb84d810bb5b570602343706c7acf327f2e6c2e91b3f591b185221b35f46c8106c3b62adc028b4455b00ddbddd88a1d0a3c5004935d24748f8c00a9ac4f69dc208d420c6bab39b3546d722388dd0aeab0526cdfc3208de40d8da1d15f3dc581414aa35f6c76e176376d6961a84d71334269e106c36a7f25cb833824f43a4cdc9256d697534b02a20ded02e20e8228659de140858385d34075870c2b1766524627834335197696ebd33732ce1366d14bf9928208ba3de8420f83527e3a64dc45c2c57bfafb181aaaa32b88e2ee5a34e01eda4b7af519dd7c54cd6708fd5015f465f2e9c5090f8e8160a56c5a235f2ca1a0bfa05a8c415627260c7d922f5ff438b9a0ea3b780389974ed9493c20c087284a9374ce8d72e3289535c3e19b7239dc2528d526f4ec846af001fd3a851955f0101e7693c48f50bca211ee69f51539f8d4ac9ed74c1f9f4e709eccf94ae5e402752bd9e0a7f36983746af0c7ab1f950492a286c9c495cb8f90db04a9bd7b292e4bd5400a638220b54236f23f24213ea790113a93b0abd35ac2e06a8e77ce1f11a79a4c2a9828a09d269b24afb0d9614b547c959c17c537c2e9c977861bba0b14e776dbd42e279f68543e738c5b163eb540d7854986ad8b2c4dbd8add3411cc71f2bb6b79954fe19ec1e3a2d09f20f93b2dd76a46c153855a3b4b094ce7fa44bba31b70b1a681b88267f0ac072bf01c1d137fbc90cd1744365f2477c46ac9add4eb36cfd38952874ba99998a99abc87ea68c24ceb9a8c5729ea0aa34e2395cf72cd2cb37b5dc1cb7845f0789361fdfc8e7eaacb74b6dce3db7417508be8250e6a8a32b5c61fa82c4a05efe05d37cee13deaf5069fe48629ca375abd7c3fc08722e08fe80a3478963263c5ace07c81d1854213b716734289c0704517ff149f09d3cfe96362718a647cc9b0b19818bfbd275c1ca933055cf89ac4cee8a99e492e1a55c03f5c99e92a4b82fc457c2bc85f2292b1744a53cdbc38aa52444fd25047f9489cea552706c4270f2917d3f346821f4d6738b6507548207de084575cd6f4fc3d7d4039e0a6395d99f4ec15771f8dabe81d7d65d0ff1f68d642fb241a03c15078e3357883de35de86596cb88a4d41af6f163bafc21ffc1dc1216ff81a9aaf62ef15881fc33eecb75d3412a883c6bae00c0e0467d11a9ac191a2d99de8b0cd76929993c6f5c15fb1293487a30efc8563e15f707c0ef73ae9b9e1677bcf7d68b7f7acb3f7782cd7a1f00c068a8eefc760c948b28d0436d9c4a5cbb6d1301eb48d386a481d20ba009d3694e1b7d634d634cde0d10b90a54b909cde91598c06436464ad8f9367e2d0d428cd40b320187ea4ff7434ff4150464307753be8255e2d563a84b48297c0a5b1881c2ac325ca4639eb5cc9458e5c88ec9cbcceee134de172ce79c1f9c680e345c0b218fc85181ce26eb309c4edf2e810eefc178b205304125eb0f298805d90d8a6393ce984106c064f5f2921b920291dacdec2a12f2b1b6703cd188df5e463afc5fa790766f15231dbd4506ccb0eb214aaae139684f6960397a0f43a29a6f767f1f115ab14dd54ebafd9e31b36b00c47af8c732e9a9e5fd2db2737e18dfa85edad01cc8ac22dbccde10b86624953632e55abc372eab11129ce42de25d1e66da3fd3413d5baabdef907be1a727abf890d49a1d8504d38d62ad5336bad2946f52a35d6cce2bba24a97ad232fff07504b0708c979aeffe40500003e0d0000504b03041400080808000000210000000000000000000000000007000900412e636c61737355540500010000000095578b7fdb5615feae2dc78aa3248e69434d9bcedda3f32b49d775a3cb4249f3e896ad2350979624409065c555234b992427eb06940263830d187bc15ade8395376bbbbac9da3d78ad309efb7ff801e74ab2eb3aca167eb12d9da373cff9ce39dfb95779fb3fafbe0ee083788781ed8f8231c48fcb4bf2a02e1be5c1a9e2715571a208d3c3f128220c5d9387c6768fcab6a60c7033d2d3b7fba0ad98963ab8bf54b254dbbe9bb445864e5f7b44b6c64749b7a3591e3e782d4ac1b134a37cf73ebe4ea16f89e19600db8aec1c1b1cd5ca9386a39655cbb357e93b4fb07cfb714d71dc60775ca7186e01f82e0ecbf49d61681bd60ccdd9c7904eaf45ba56339939c2104e678e48e8c59618042419628eb9a01a73865c51456cbdaeb0deb228faa84c1eb43193503c44b5be814134d465377386ddef1e7e4c97299dcc759596b00337c690c24d1262e8684708b730481e18fb44a568ea226e95d0e93dcb50bc92aa681559b745e418360515278a7e095dde8a41d79b23eb73767571513f21e2360971efd9ede4ad28133645256f7730b4532e5e13186eff7f92f15b291137f7f26cee92d083048f416dea684a388a0f51edcbaa43d0d39983adec250f1fc64807f6613fc3ce000499b52a0922c662146a9c3cdbdcf3e6f45ac7bcdb07700f777d2f435fbd882943554b76ca31534535b568da9aa32d1101ee63885aea8355cd22cef6a667028090bf83788027fb11865ca03f7220eb29d34ae9e6b26aa59c63b291da7d9b888f92f72559afaa53340dc9f47d99608a4b3884420c0338cc2050d44a6bcd1a053882a3316cc727c8af664f54169d132ec16724cc60963ff9242db51d2ba511c0aaee6252b999884f4bd884cdbc539f61d872cdf77edb562d47338d09cb328951c518143e27029f101a398f9bb424bd0e7aeabbcbbb824b3b5a383371688a8ab95eae1a8eb753ae0bc457a2c79435aececb55dd69a141bd9b41cca9c0e0ed3589c73eab797d6f4db7ec27eb563b0e8bd3c8a6a9702cd9b0e7558b21dbba3c78f5ec28df54da09f998aceb7c614f3ad3b252c2321ee284a16adcb5c6ed46a3f07de2118ef3b39cf8edbc739f6f6c4cfef228be402d72e967af330ec48d2fe24b319cc297196e9e9bb7cc4a4af656a714d9304c8733f861d532eb6a115f61b871ce31dfd3ee71aa84625616654b3d6c72860767939994f0353cc119fe24c3d6397724d619c86f1081270dbb3a3faf299a6a5050afc3229ea276d9d522754c21b20cac176bbda63f8d67388067ddc363233de01de8c1f3bc03dfa629a3a425bce03939cd109aa52deebb749c68363f24382809dfe743780a3fa036b91bfb01a24851561644fc88e6422189e1dee0e8cd733ebbc13978113fe12cfb2915e6b0cf6309673dd2fc8c9a3db56cd06ef45e4dfc05b544ae9855aa75704b7e45d82b9ae188f80d4522e68f9e7054a29b90cecc8e4a7819e7f8ce739e14c5aa6588788526bbf9b488a2c6b037809b1b1ef7950e5cc2aa3be21b71e29e0097f99a2b0c37d54b93f60b9eaf5f29a57c91a79211f13a65a69be58925a21c43261dd082a0ae50a437f13bde84df93836145f7df4fba5bcecf28fe443b6249b5e99c293576dc82233b555bc2554e9bb7f0678648da9bfc5ebccd89f4579aaf825636c88c9f4fc29859a24b27ad53161e90170fcb459de458c1ac5a8a7a40d3556107b55e00ed0988621bdf36e83532c15f3848f777ba0f4122b9b345ee6a92bb498eb7c874c437e4f7c5b7f08384eebb49d78bf7d3ef3f48ba8c3045069eca5ec207b2896d89ed2bb8f92276661369ff369b4de41303eeedae6c62b77fbb279bb893df0e5dc470f615ec5c05bd935cc5fdfc3e9bab61621593219094cde6eb52df194485b310c289fb5730d517dffc625dfe18c964bbabefd1157cdcb53d479818fe49bf4944fe8b05085184a2d84e1f068cb0ae1196a0b4e8d5c24fe41e9242741dccbd851e02305dc3a74ed7fdcf91fff3904fa33b77151d97a14c5f42e90d6ef572234e1bc28911d64b928aa3bed3245d291c3a1b29be89ed7c095f341f68966d35cba11c60b6cb371ba89b1d6b986da33cb8599cccf69c87be8ac550b3e583b07ccb849f731bafb8537f5ec592ff7c2b22f4472d5fc1c343423629e4f2fd357cee9c6b28f083ca377c87b26fa3eb4be771925c3dda28dc636ee14ee69b755f255d3fe1aae1eb8d867e93379083e86fd67ecbd5d6f5cfd5f09d6c9ed3814b67484a0a57d11ebe229e4524290c45e8c90f5fc0d67ce2c76daf41980ee70ad3427f613a928c1456f0d2d12ca14f466af87933373a3811dccfa61196a37fbabef76fa4e897d2ebc4f37e7a8f5015c274955bd3fb2501ccb7a4f26b8f8b7b5aaa4fe0ce789cf612ca7b2964b9cb7ce2b7355cb80e9908c1434640ba1a409ef5812c6f18881f2ab0a679bfa681609ff3c1f2ee252eb6c2eb405b57bd6a44a17883527d848f53aa873c0ee75c97af86afb12fc4cf56df740b99f26424d734bf8ad7c238e773f06c835a7ba90051bae6e382dbd4c41bd455ea6c245f986eeb2f0c45e2ccd52785c2505b32926c5bc11f3c2f22fe48313c2f77ba91801b12a11afe522fdb05c897716a3abef98a78097fbb8093d7128c20248df071fb978b3afa3f504b070808fc33285b0700009c0f0000504b03041400080808000000210000000000000000000000000007000900432e636c61737355540500010000000075514d4fc240107d034881fa057e1d389878928b3d7ae0440c26241a12493ce06969274dc9b235dba5e25ff3e00ff0471987a64183ba979979efe5cd9becc7e7db3b806b9c11e8c603110ee72a578156260ec6b33987ce4395d01ebf18b6f7caa898edd55a4268a8282a6042e7f22e0b53cbc1208a2c6759bff74838ff761a69cdb1d213a71c0f57213fbb24351e1a848b5fa2818d970b36ee87ae45e8960b9431a9b8081c0c578ead51ba4ff02d2fd29ccb34cd985dd166eb64bda7ad6c92dcb28a52a35fab72bcdcec25d9bf874c09ad4d1431ec3e2c8d4b163c3279922533cd834d22615b93746943be4d34d70915d4b07eb51aa10e4fe66399ea529bf07152f4845d1110f684a72d6c1f0725e61798fcce146d213a38fa8390722a50053b5f504b07080769ea7c21010000d8010000504b03041400080808000000210000000000000000000000000007000900442e636c6173735554050001000000003bf56fd73e06060673067646064617760646460681acc4b244fd9cc4bc747dffa4acd4e41276066646064ecf2067233d9014230357707e695172aa5b664e2a1b230313030b03043032b0014926065600504b070830f176835000000056000000504b03041400080808000000210000000000000000000000000007000900452e636c6173735554050001000000008555db72db54145d475250a2c86ded2681128738a1802f49c3a550682e34755330380de0129a16684eec83aa54918da4a429cffd09dace30d3175ef24067208961a03cf3097c001fd1c914f69115db3566b0c73ad2d6de6bafb5ce96fcc7939f7f03700636035bd0c1188eadf32d3ee570d79a5a5a5b17e540874a37f33a7a1806976eb9c25be42eb78457d8a839a76436dd5e67385af4cb554f4ccd7b1ebf7de1fc3443eae9c8cce165a5e209df9f9ea39467666cd70ee608395d6c352e059eed5ad3996506359d5936d18f98010d4718624f61e838d60ce5ab6e20b6896e82c170c5ada82bc3e92ed06d91bcc3894ca683bd89010c1a388e2113bde8eb8382e74827f9944877e8c8145ab41ad53a920c9a6f7f23420105132f60b41f2348d1b5250229b79029763a4d4dc7f1a2cc3b49ce88af37b9e37738132566ae9a7819af188823dd8d111937de2a2a388eb0b833ef599b1bc20d16b6cba216d8555747cec4f3183648dc24c300773cc12bb75362dbf6033f55957bdd8b2969bf696002af117b5ea9fc0725daa637705ab27f938cba4993e456830eacb709a156ad51af7457f967312d016628cd97360da50bdd3bcde15d99788e3add60e8234ff39c547a0cf174a6c30d13795c905bb9c0a0db7e38c2dd4c234fdfc3fbd20cdad0d17fd9570a7820dabcfb90e178396c9ab2fd94d41a895c3450945e3187a19798850d4d7cdc20f10943d2b2b7849be28dc6b23a6472587f99cae85e54765e8ebe82cf4c7c84ac3c5b9103199e5d63e8f7c446754b44b9671af12f1b8e84415f2acd5cebd04a9bd319d2b1466525db7279b0e9d1e06af96a859618e92edf5ce4b5cb7ccda16ba36901411ba5eaa65716176d47608c3a6ba0c1a55f423e33b456e8e5a2c0a02f93434447419161a814058e66f7e8974bc4f7f1ec4f38f110f2a3c9898c120b94a6d23aa9ce26b33fe2441d630c0f302acf9375bca4e077c473bbc87c8b9ee4ce1d857dfff79fca0e15307c454703ea011436fe183d044ba6119c085f776a083b9aa5da53b3c97b88fd828995c4ab7b78fd91c4ced5f19682874d2092748001062be4c7e851d0a4d711dc1502d3683d1bc1dd8fe0de3984ab639649a6975a22bec39150c4641df36a5b27138aec7480933a3ddbedfd680e2257b2d48fd13a98ddc7c55d7c7057f62bae242eed61e9510b8a9206a88ea6a6ad4eda3eb88f52c3b406cf4f25cf8e3a86e5a6be615a1bdbb58b2b52e35579f8bcb15d56688f42133f41455ffc4fd1f56e45abe011c3ebc4573a79aee993b6fa2be2c59c4a944bcde0ac3a37927c80e1dc88b62a832387a350baa3d208fc95fba1292606e509c67494197b8c2405e9098f9a4d440c87223beea23fdcc07be8d176d4d6146950e81f85e14638cbfa3f504b0708f1364a35e903000033070000504b0102140014000808080000002100fbb81f722a0000002800000014000d0000000000000000000000000000004d4554412d494e462f4d414e49464553542e4d46555405000100000000feca0000504b01021400140008080800000021008f8e194ea0010000350500000d00090000000000000000000000790000004d4554412d494e462f41504953555405000100000000504b0102140014000808080000002100c979aeffe40500003e0d000007000900000000000000000000005d020000422e636c617373555405000100000000504b010214001400080808000000210008fc33285b0700009c0f000007000900000000000000000000007f080000412e636c617373555405000100000000504b01021400140008080800000021000769ea7c21010000d8010000070009000000000000000000000018100000432e636c617373555405000100000000504b010214001400080808000000210030f176835000000056000000070009000000000000000000000077110000442e636c617373555405000100000000504b0102140014000808080000002100f1364a35e903000033070000070009000000000000000000000005120000452e636c617373555405000100000000504b05060000000007000700c90100002c1600000000"}`) + if err != nil { + return nil, err + } + fmt.Println("ICS20 app deployed at ", ics20App) + contracts.ContractAddress = map[string]string{ + "ibc": ibcAddress, + "ics20App": ics20App, + } + + // assume Preps are already configured + params := `{"networkTypeName":"eth", "name":"eth", "owner":"` + ibcAddress + `"}` + ctx, _ = c.ExecuteContractRemote(ctx, "cx0000000000000000000000000000000000000001", "openBTPNetwork", params) + //height, _ := ctx.Value("txResult").(icontypes.TransactionResult).BlockHeight.Int() + id := ctx.Value("txResult").(*icontypes.TransactionResult).EventLogs[0].Indexed[2] + typeId := ctx.Value("txResult").(*icontypes.TransactionResult).EventLogs[0].Indexed[1] + btpNetworkId, _ := icontypes.HexInt(id).Int() + btpNetworkTypeId, _ := icontypes.HexInt(typeId).Int() + // //bind ics app + portId := "transfer" + params = `{"portId":"` + portId + `","moduleAddress":"` + ics20App + `"}` + ctx, err = c.ExecuteContractRemote(ctx, ibcAddress, "bindPort", params) + if err != nil { + return ctx, err + } + + overrides := map[string]any{ + "ibc-handler-address": ibcAddress, + "start-height": 0, // height + 1, + "btp-network-id": btpNetworkId, + "btp-network-type-id": btpNetworkTypeId, + "block-interval": 2_000, + } + cfg := c.cfg + cfg.ConfigFileOverrides = overrides + c.cfg = cfg + } else { + contracts.ContractAddress = map[string]string{ + "ics20App": c.scorePaths["ics20_app"], + } + } + c.IBCAddresses = contracts.ContractAddress + return context.WithValue(ctx, chains.Mykey("contract Names"), chains.ContractKey{ + ContractAddress: contracts.ContractAddress, + ContractOwner: contracts.ContractOwner, + }), nil +} + +func (c *IconRemotenet) RegisterToken(ctx context.Context, name, symbol, decimal string) error { + ics20App := c.IBCAddresses["ics20App"] + commands := []string{"rpc", "sendtx", "call"} + commands = append(commands, + "--to", ics20App, + "--method", "registerCosmosToken", + "--uri", c.GetHostRPCAddress(), + "--key_store", WalletKeyStore+c.testconfig.KeystoreFile, + "--key_password", c.testconfig.KeystorePassword, + "--step_limit", "25000000000", + "--nid", "0x3", + ) + params := `{"name":"` + name + `","symbol":"` + symbol + `","decimals":"` + decimal + `"}` + commands = append(commands, "--params", params) + var output string + stdout, _, err := c.Exec(ctx, commands, nil) + if err != nil { + return err + } + json.Unmarshal(stdout, &output) + _, err = c.waitForTxn(ctx, output) + return err +} + +func (c *IconRemotenet) GetSenderReceiverAddress() (string, string) { + return c.testconfig.Sender, c.testconfig.Receiver +} diff --git a/test/e2e-demo/e2e_demo_test.go b/test/e2e-demo/e2e_demo_test.go index b03d07954..c20b643a4 100644 --- a/test/e2e-demo/e2e_demo_test.go +++ b/test/e2e-demo/e2e_demo_test.go @@ -3,11 +3,12 @@ package e2e_demo import ( "context" "fmt" + "testing" + interchaintest "github.com/icon-project/ibc-integration/test" "github.com/icon-project/ibc-integration/test/testsuite" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/suite" - "testing" ) func TestE2EDemo(t *testing.T) { @@ -38,7 +39,8 @@ func (e *E2EDemoSuite) TestSetup() { assert.NoErrorf(t, err, "fail to setup xcall -%w", err) err = e.DeployXCallMockApp(ctx, portId) assert.NoErrorf(t, err, "fail to deploy xcall dapp -%w", err) - chainA, chainB := e.GetChains() + createdChains := e.GetChains() + chainA, chainB := createdChains[0], createdChains[1] err = interchaintest.BackupConfig(chainA) assert.NoErrorf(t, err, "fail to backup xcall config for chainA -%w", err) diff --git a/test/e2e-hopchain/e2e_hopchain_test.go b/test/e2e-hopchain/e2e_hopchain_test.go new file mode 100644 index 000000000..c4cc9f0b7 --- /dev/null +++ b/test/e2e-hopchain/e2e_hopchain_test.go @@ -0,0 +1,33 @@ +package e2e_hopchain + +import ( + "context" + "testing" + + "github.com/icon-project/ibc-integration/test/testsuite" + "github.com/stretchr/testify/suite" +) + +func TestE2EHopchainTestSuite(t *testing.T) { + suite.Run(t, new(E2EHopchainTest)) +} + +type E2EHopchainTest struct { + testsuite.E2ETestSuite +} + +func (s *E2EHopchainTest) TestE2E_hopchain() { + + t := s.T() + ctx := context.TODO() + s.Require().NoError(s.SetCfg()) + relayer := s.SetupICS20ChainsAndRelayer(ctx) + hopchain := HopchainTestSuite{ + E2ETestSuite: &s.E2ETestSuite, + T: t, + } + t.Run("test hopchain", func(t *testing.T) { + hopchain.TestICS20(relayer) + }) + +} diff --git a/test/e2e-hopchain/hopchain.go b/test/e2e-hopchain/hopchain.go new file mode 100644 index 000000000..f2f032719 --- /dev/null +++ b/test/e2e-hopchain/hopchain.go @@ -0,0 +1,355 @@ +package e2e_hopchain + +import ( + "context" + "crypto/sha256" + "encoding/hex" + "fmt" + "math/big" + "strings" + "testing" + "time" + + "github.com/icon-project/ibc-integration/test/chains" + "github.com/icon-project/ibc-integration/test/testsuite" + "github.com/strangelove-ventures/interchaintest/v7/ibc" + "github.com/strangelove-ventures/interchaintest/v7/testreporter" + "github.com/stretchr/testify/assert" + "gopkg.in/yaml.v3" +) + +type HopchainTestSuite struct { + *testsuite.E2ETestSuite + T *testing.T +} + +const ( + IconChainName = "icon" + CentauriChainName = "centauri" + ArchwayChainName = "archway" + iconCurrency = "icx" + archwayCurrency = "stake" +) + +func getLatestChannels(ctx context.Context, eRep *testreporter.RelayerExecReporter, chainID string, relayer ibc.Relayer, connectionId string) (string, string, error) { + channels, err := relayer.GetChannels(ctx, eRep, chainID) + if err != nil { + return "", "", err + } + for _, channel := range channels { + for _, hop := range channel.ConnectionHops { + if strings.Contains(hop, connectionId) { + return channel.ChannelID, channel.Counterparty.ChannelID, nil + } + } + } + latestChannel := channels[len(channels)-1] + return latestChannel.Counterparty.ChannelID, latestChannel.ChannelID, nil +} + +func getIconChain(chains []chains.Chain) chains.Chain { + for _, chain := range chains { + if chain.(ibc.Chain).Config().Name == IconChainName { + return chain + } + } + return nil +} + +func getCentauriChain(chains []chains.Chain) chains.Chain { + for _, chain := range chains { + if chain.(ibc.Chain).Config().Name == CentauriChainName { + return chain + } + } + return nil +} + +func getArchwayChain(chains []chains.Chain) chains.Chain { + for _, chain := range chains { + if chain.(ibc.Chain).Config().Name == ArchwayChainName { + return chain + } + } + return nil +} + +func getDenomHash(input string) string { + hasher := sha256.New() + hasher.Write([]byte(input)) + hash := hasher.Sum(nil) + + return strings.ToUpper(hex.EncodeToString(hash[:])) +} + +type SrcDst struct { + ChainID string `yaml:"chain-id"` + ClientID string `yaml:"client-id"` + ConnectionID string `yaml:"connection-id"` +} + +type Path struct { + Src SrcDst `yaml:"src"` + Dst SrcDst `yaml:"dst"` +} + +type Paths struct { + Paths map[string]Path `yaml:"paths"` +} + +func (h *HopchainTestSuite) TestICS20(relayer ibc.Relayer) { + testcase := "ics20" + time.Sleep(15 * time.Second) + ctx := context.WithValue(context.TODO(), "testcase", testcase) + createdChains := h.GetChains() + eRep := h.GetRelayerExecReporter() + result := relayer.Exec(ctx, eRep, []string{"cat", "/home/relayer/.relayer/config/config.yaml"}, []string{}) + var paths Paths + yaml.Unmarshal(result.Stdout, &paths) + portId := "transfer" + + iconChain := getIconChain(createdChains) + centauriChain := getCentauriChain(createdChains) + archwayChain := getArchwayChain(createdChains) + + _, centauriReceiver := centauriChain.GetSenderReceiverAddress() + _, archwayReceiver := archwayChain.GetSenderReceiverAddress() + iconSender, iconReceiver := iconChain.GetSenderReceiverAddress() + + centToIconChannel, iconToCentChannel, err := getLatestChannels(ctx, eRep, centauriChain.(ibc.Chain).Config().ChainID, relayer, paths.Paths[testsuite.CentauriIconRelayPath].Src.ConnectionID) + h.Require().NoError(err, "error should be nil") + centToArchChanel, archwayToCentChannel, err := getLatestChannels(ctx, eRep, centauriChain.(ibc.Chain).Config().ChainID, relayer, paths.Paths[testsuite.CentauriArchwayRelayPath].Src.ConnectionID) + h.Require().NoError(err, "error should be nil") + + h.T.Run("send icon Ftokens for relay ibc-centauri", func(t *testing.T) { + denom := "transfer/" + centToIconChannel + "/" + iconCurrency + ibcDenom := "ibc/" + getDenomHash(denom) + h.Require().NoError(err, "error should be nil") + h.T.Run("send icx tokens from icon to centauri ", func(t *testing.T) { + initialIconBalance, err := iconChain.GetWalletBalance(ctx, iconReceiver, iconCurrency) + h.Require().NoError(err, "error retrieving balance") + fmt.Println("Initial Icon Balance ", initialIconBalance) + initialCentauriBalance, err := centauriChain.GetWalletBalance(ctx, centauriReceiver, ibcDenom) + fmt.Println("Initial Centauri Balance ", initialCentauriBalance) + h.Require().NoError(err, "error retrieving balance") + ibcAmount := fmt.Sprint(1000) + "/" + iconCurrency + _, err = iconChain.SendIBCTokenTransfer(ctx, iconToCentChannel, centToArchChanel, portId, iconSender, centauriReceiver, centauriChain.(ibc.Chain).Config().ChainID, ibcAmount, false) + h.Require().NoError(err, "error should be nil") + // give some time for txn to settle + time.Sleep(40 * time.Second) + newCentauriChanBalance, err := centauriChain.GetWalletBalance(ctx, centauriReceiver, ibcDenom) + fmt.Println("New Centauri Balance ", newCentauriChanBalance) + h.Require().NoError(err, "error retrieving balance") + valueTocheck := new(big.Int) + valueTocheck, _ = valueTocheck.SetString("1000", 10) + balanceIncreased := new(big.Int).Sub(newCentauriChanBalance, initialCentauriBalance) + assert.True(t, balanceIncreased.Cmp(valueTocheck) == 0, "balance increment should be equal to 1000") + newIconBalance, err := iconChain.GetWalletBalance(ctx, iconReceiver, iconCurrency) + h.Require().NoError(err, "error should be nil") + fmt.Println("New Icon Balance", newIconBalance) + // as gas needs to be paid from the same account + assert.True(t, newIconBalance.Cmp(initialIconBalance) == 0, "icon balance should be same as balance transferred from main wallet") + }) + + h.T.Run("send ibc/../icx tokens from centauri to icon", func(t *testing.T) { + // send back to icon + initialIconBalance, err := iconChain.GetWalletBalance(ctx, iconReceiver, iconCurrency) + h.Require().NoError(err, "error should be nil") + initialCentauriBalance, err := centauriChain.GetWalletBalance(ctx, centauriReceiver, ibcDenom) + h.Require().NoError(err, "error should be nil") + fmt.Println("Initial Icon Balance", initialIconBalance) + fmt.Println("Initial Centauri Balance", initialCentauriBalance) + ibcamount := fmt.Sprint(500) + ibcDenom + txnhash, err := centauriChain.SendIBCTokenTransfer(ctx, centToIconChannel, centToIconChannel, "transfer", centauriReceiver, iconReceiver, centauriChain.(ibc.Chain).Config().ChainID, ibcamount, false) + h.Require().NoError(err, "error should be nil") + fmt.Println("Txn hash is ", txnhash) + time.Sleep(40 * time.Second) + valueTocheck := new(big.Int) + valueTocheck, _ = valueTocheck.SetString("500", 10) + newCentauriChanBalance, err := centauriChain.GetWalletBalance(ctx, centauriReceiver, ibcDenom) + h.Require().NoError(err, "error retrieving balance") + fmt.Println("New Centauri Balance", newCentauriChanBalance) + centauriBalanceDecreased := new(big.Int).Sub(initialCentauriBalance, newCentauriChanBalance) + assert.True(t, centauriBalanceDecreased.Cmp(valueTocheck) == 0, "balance should be equal to 500") + newIconBalance, err := iconChain.GetWalletBalance(ctx, iconReceiver, iconCurrency) + h.Require().NoError(err, "error should be nil") + fmt.Println("New Icon Balance", newIconBalance) + increasedIconBalance := new(big.Int).Sub(newIconBalance, initialIconBalance) + assert.True(t, increasedIconBalance.Cmp(valueTocheck) == 0, "icon balance should be increased") + }) + }) + + h.T.Run("send stake Ftokens for relay centauri-ibc", func(t *testing.T) { + denom := "transfer/" + iconToCentChannel + "/stake" + h.Require().NoError(err, "error should be nil") + // register cosmos token + iconChain.RegisterToken(ctx, denom, archwayCurrency, "2") + h.T.Run("send stake tokens from centauri to ibc", func(t *testing.T) { + // send back to icon + initialIconBalance, err := iconChain.GetWalletBalance(ctx, iconSender, denom) + h.Require().NoError(err, "error should be nil") + fmt.Println("Initial Icon Balance", initialIconBalance) + initialCentauriChainBalance, err := centauriChain.GetWalletBalance(ctx, centauriReceiver, archwayCurrency) + h.Require().NoError(err, "error should be nil") + fmt.Println("Initial Centauri Balance", initialCentauriChainBalance) + ibcamount := fmt.Sprint(1000) + archwayCurrency + txnhash, err := centauriChain.SendIBCTokenTransfer(ctx, centToIconChannel, iconToCentChannel, "transfer", archwayReceiver, iconSender, centauriChain.(ibc.Chain).Config().ChainID, ibcamount, false) + h.Require().NoError(err, "error should be nil") + fmt.Println("Txn hash is ", txnhash) + time.Sleep(40 * time.Second) + valueTocheck := new(big.Int) + valueTocheck, _ = valueTocheck.SetString("1000", 10) + newCentauriChainBalance, err := centauriChain.GetWalletBalance(ctx, centauriReceiver, archwayCurrency) + h.Require().NoError(err, "error retrieving balance") + centauriBalanceDecreased := new(big.Int).Sub(initialCentauriChainBalance, newCentauriChainBalance) + assert.True(t, centauriBalanceDecreased.Cmp(valueTocheck) > 0, "decreased balance should be more than 1000 plus fee") + fmt.Println("Decreased centauri balance", centauriBalanceDecreased) + newIconBalance, err := iconChain.GetWalletBalance(ctx, iconSender, denom) + h.Require().NoError(err, "error should be nil") + fmt.Println("New Icon Balance", newIconBalance) + iconBalanceIncreased := new(big.Int).Sub(newIconBalance, initialIconBalance) + fmt.Println("Increased icon balance", iconBalanceIncreased) + assert.True(t, iconBalanceIncreased.Cmp(valueTocheck) == 0, "balance should be equal to 1000") + }) + + h.T.Run("send ibc/../stake tokens from icon to centauri ", func(t *testing.T) { + initialIconBalance, err := iconChain.GetWalletBalance(ctx, iconSender, denom) + h.Require().NoError(err, "error should be nil") + initialCentauriBalance, err := centauriChain.GetWalletBalance(ctx, centauriReceiver, archwayCurrency) + fmt.Println("Centauri Initial Balance ", initialCentauriBalance) + h.Require().NoError(err, "error retrieving balance") + ibcAmount := fmt.Sprint(500) + denom + // need to call token contract tokenFallback method + _, err = iconChain.SendIBCTokenTransfer(ctx, iconToCentChannel, centToArchChanel, portId, iconSender, centauriReceiver, centauriChain.(ibc.Chain).Config().ChainID, ibcAmount, false) + h.Require().NoError(err, "error should be nil") + // give some time for txn to settle + time.Sleep(40 * time.Second) + newCentauriChanBalance, err := centauriChain.GetWalletBalance(ctx, centauriReceiver, archwayCurrency) + fmt.Println("New centauri Balance ", newCentauriChanBalance) + h.Require().NoError(err, "error retrieving balance") + valueTocheck := new(big.Int) + valueTocheck, _ = valueTocheck.SetString("500", 10) + balanceIncreased := new(big.Int).Sub(newCentauriChanBalance, initialCentauriBalance) + assert.True(t, balanceIncreased.Cmp(valueTocheck) == 0, "balance should be equal") + newIconBalance, err := iconChain.GetWalletBalance(ctx, iconSender, denom) + h.Require().NoError(err, "error should be nil") + fmt.Println("New Icon Balance", newIconBalance) + decreasedIconBalance := new(big.Int).Sub(initialIconBalance, newIconBalance) + fmt.Println("Increased icon balance", decreasedIconBalance) + assert.True(t, decreasedIconBalance.Cmp(valueTocheck) == 0, "decreased balance should be equal to 500") + }) + }) + + h.T.Run("send icon Ftokens for relay ibc-archway via centauri", func(t *testing.T) { + denom := "transfer/" + archwayToCentChannel + "/transfer/" + centToIconChannel + "/icx" + ibcDenom := "ibc/" + getDenomHash(denom) + h.Require().NoError(err, "error should be nil") + h.T.Run("send icx tokens from icon to centauri ", func(t *testing.T) { + initialArchwayBalance, err := archwayChain.GetWalletBalance(ctx, archwayReceiver, ibcDenom) + fmt.Println("Initial archway Balance ", initialArchwayBalance) + h.Require().NoError(err, "error retrieving balance") + ibcAmount := fmt.Sprint(1000) + "/icx" + _, err = iconChain.SendIBCTokenTransfer(ctx, iconToCentChannel, centToArchChanel, portId, iconSender, archwayReceiver, centauriChain.(ibc.Chain).Config().ChainID, ibcAmount, true) + h.Require().NoError(err, "error should be nil") + // give some time for txn to settle + time.Sleep(40 * time.Second) + archwayChanBalance, err := archwayChain.GetWalletBalance(ctx, archwayReceiver, ibcDenom) + fmt.Println("New archway Balance ", archwayChanBalance) + h.Require().NoError(err, "error retrieving balance") + valueTocheck := new(big.Int) + valueTocheck, _ = valueTocheck.SetString("1000", 10) + balanceIncreased := new(big.Int).Sub(archwayChanBalance, initialArchwayBalance) + assert.True(t, balanceIncreased.Cmp(valueTocheck) == 0, "balance should be equal to 1000") + }) + + h.T.Run("send ibc/../icx tokens from archway to ibc via centauri", func(t *testing.T) { + // send back to icon + initialIconBalance, err := iconChain.GetWalletBalance(ctx, iconReceiver, "icx") + h.Require().NoError(err, "error should be nil") + initialArchwayChainBalance, err := archwayChain.GetWalletBalance(ctx, archwayReceiver, ibcDenom) + h.Require().NoError(err, "error should be nil") + fmt.Println("Initial Icon Balance", initialIconBalance) + fmt.Println("Initial archway Balance", initialArchwayChainBalance) + ibcamount := fmt.Sprint(500) + ibcDenom + txnhash, err := archwayChain.SendIBCTokenTransfer(ctx, archwayToCentChannel, centToIconChannel, "transfer", archwayReceiver, iconReceiver, archwayChain.(ibc.Chain).Config().ChainID, ibcamount, true) + h.Require().NoError(err, "error should be nil") + fmt.Println("Txn hash is ", txnhash) + time.Sleep(40 * time.Second) + valueTocheck := new(big.Int) + valueTocheck, _ = valueTocheck.SetString("500", 10) + newArchwayChainBalance, err := archwayChain.GetWalletBalance(ctx, archwayReceiver, ibcDenom) + h.Require().NoError(err, "error retrieving balance") + archwayBalanceDecreased := new(big.Int).Sub(initialArchwayChainBalance, newArchwayChainBalance) + assert.True(t, archwayBalanceDecreased.Cmp(valueTocheck) == 0, "balance should be equal to 500") + newIconBalance, err := iconChain.GetWalletBalance(ctx, iconReceiver, "icx") + h.Require().NoError(err, "error should be nil") + fmt.Println("New Icon Balance", newIconBalance) + increasedIconBalance := new(big.Int).Sub(newIconBalance, initialIconBalance) + assert.True(t, increasedIconBalance.Cmp(valueTocheck) == 0, "icon balance should be increased by 500") + }) + }) + + h.T.Run("send stake Ftokens for relay archway-ibc via centauri", func(t *testing.T) { + // denom := "transfer/channel-0/transfer/channel-3/stake" + denom := "transfer/" + iconToCentChannel + "/transfer/" + centToArchChanel + "/stake" + // ibcDenom := "ibc/" + getDenomHash(denom) + h.Require().NoError(err, "error should be nil") + // register cosmos token + iconChain.RegisterToken(ctx, denom, archwayCurrency, "2") + h.T.Run("send stake tokens from archway to ibc via centauri", func(t *testing.T) { + // send back to icon + initialIconBalance, err := iconChain.GetWalletBalance(ctx, iconSender, denom) + h.Require().NoError(err, "error should be nil") + fmt.Println("Initial Icon Balance", initialIconBalance) + initialArchwayChainBalance, err := archwayChain.GetWalletBalance(ctx, archwayReceiver, archwayCurrency) + h.Require().NoError(err, "error should be nil") + fmt.Println("Initial Archway Balance", initialArchwayChainBalance) + ibcamount := fmt.Sprint(1000) + archwayCurrency + txnhash, err := archwayChain.SendIBCTokenTransfer(ctx, archwayToCentChannel, centToIconChannel, "transfer", archwayReceiver, iconSender, archwayChain.(ibc.Chain).Config().ChainID, ibcamount, true) + h.Require().NoError(err, "error should be nil") + fmt.Println("Txn hash is ", txnhash) + time.Sleep(40 * time.Second) + valueTocheck := new(big.Int) + valueTocheck, _ = valueTocheck.SetString("1000", 10) + newArchwayChainBalance, err := archwayChain.GetWalletBalance(ctx, archwayReceiver, archwayCurrency) + h.Require().NoError(err, "error retrieving balance") + archwayBalanceDecreased := new(big.Int).Sub(initialArchwayChainBalance, newArchwayChainBalance) + assert.True(t, archwayBalanceDecreased.Cmp(valueTocheck) > 0, "decreased balance should be more than 1000 plus fee") + fmt.Println("Decreased archway balance", archwayBalanceDecreased) + newIconBalance, err := iconChain.GetWalletBalance(ctx, iconSender, denom) + h.Require().NoError(err, "error should be nil") + fmt.Println("New Icon Balance", newIconBalance) + iconBalanceIncreased := new(big.Int).Sub(newIconBalance, initialIconBalance) + fmt.Println("Increased icon balance", iconBalanceIncreased) + assert.True(t, iconBalanceIncreased.Cmp(valueTocheck) == 0, "balance should be equal to 1000") + }) + + h.T.Run("send ibc/../stake tokens from icon to archway ", func(t *testing.T) { + initialIconBalance, err := iconChain.GetWalletBalance(ctx, iconSender, denom) + h.Require().NoError(err, "error should be nil") + initialArchwayBalance, err := archwayChain.GetWalletBalance(ctx, archwayReceiver, archwayCurrency) + fmt.Println("Archway Initial Balance ", initialArchwayBalance) + h.Require().NoError(err, "error retrieving balance") + ibcAmount := fmt.Sprint(500) + denom + // need to call token contract tokenFallback method + _, err = iconChain.SendIBCTokenTransfer(ctx, iconToCentChannel, centToArchChanel, portId, iconSender, archwayReceiver, centauriChain.(ibc.Chain).Config().ChainID, ibcAmount, true) + h.Require().NoError(err, "error should be nil") + // give some time for txn to settle + time.Sleep(40 * time.Second) + newArchwayChanBalance, err := archwayChain.GetWalletBalance(ctx, archwayReceiver, archwayCurrency) + fmt.Println("New archway Balance ", newArchwayChanBalance) + h.Require().NoError(err, "error retrieving balance") + valueTocheck := new(big.Int) + valueTocheck, _ = valueTocheck.SetString("500", 10) + balanceIncreased := new(big.Int).Sub(newArchwayChanBalance, initialArchwayBalance) + assert.True(t, balanceIncreased.Cmp(valueTocheck) == 0, "balance should be equal") + newIconBalance, err := iconChain.GetWalletBalance(ctx, iconSender, denom) + h.Require().NoError(err, "error should be nil") + fmt.Println("New Icon Balance", newIconBalance) + decreasedIconBalance := new(big.Int).Sub(initialIconBalance, newIconBalance) + fmt.Println("Increased icon balance", decreasedIconBalance) + assert.True(t, decreasedIconBalance.Cmp(valueTocheck) == 0, "decreased balance should be equal to 500") + }) + }) + +} diff --git a/test/e2e/tests/xcall.go b/test/e2e/tests/xcall.go index 0d8e7f6ed..9f7a15d01 100644 --- a/test/e2e/tests/xcall.go +++ b/test/e2e/tests/xcall.go @@ -4,14 +4,15 @@ import ( "context" "errors" "fmt" + "strconv" + "strings" + "testing" + interchaintest "github.com/icon-project/ibc-integration/test" "github.com/icon-project/ibc-integration/test/chains" "github.com/icon-project/ibc-integration/test/testsuite" "github.com/strangelove-ventures/interchaintest/v7/ibc" "github.com/stretchr/testify/assert" - "strconv" - "strings" - "testing" ) type XCallTestSuite struct { @@ -25,7 +26,8 @@ func (x *XCallTestSuite) TextXCall() { ctx := context.WithValue(context.TODO(), "testcase", testcase) x.Require().NoError(x.SetupXCall(ctx, portId, 100), "fail to setup xcall") x.Require().NoError(x.DeployXCallMockApp(ctx, portId), "fail to deploy xcall dapp") - chainA, chainB := x.GetChains() + createdChains := x.GetChains() + chainA, chainB := createdChains[0], createdChains[1] x.T.Run("xcall one way message chainA-chainB", func(t *testing.T) { x.testOneWayMessage(ctx, t, chainA, chainB) @@ -62,7 +64,8 @@ func (x *XCallTestSuite) TestXCallPacketDrop() { ctx := context.WithValue(context.TODO(), "testcase", testcase) x.Require().NoError(x.SetupXCall(ctx, portId, 1), "fail to setup xcall") x.Require().NoError(x.DeployXCallMockApp(ctx, portId), "fail to deploy xcall dapp") - chainA, chainB := x.GetChains() + createdChains := x.GetChains() + chainA, chainB := createdChains[0], createdChains[1] x.T.Run("xcall packet drop chainA-chainB", func(t *testing.T) { x.testPacketDrop(ctx, t, chainA, chainB) }) diff --git a/test/integration/tests/relayer.go b/test/integration/tests/relayer.go index 4d6b1942c..7e1409497 100644 --- a/test/integration/tests/relayer.go +++ b/test/integration/tests/relayer.go @@ -32,7 +32,8 @@ func (r *RelayerTestSuite) TestClientCreation(ctx context.Context, relayer ibc.R }) r.T.Run("should able to client for an existing pat", func(t *testing.T) { - chainA, chainB := r.GetChains() + createdChains := r.GetChains() + chainA, chainB := createdChains[0], createdChains[1] pathName := r.GeneratePathName() var err error @@ -64,7 +65,8 @@ func (r *RelayerTestSuite) TestClientCreation(ctx context.Context, relayer ibc.R } func (r *RelayerTestSuite) TestConnection(ctx context.Context, relayer ibc.Relayer) { - chainA, chainB := r.GetChains() + createdChains := r.GetChains() + chainA, chainB := createdChains[0], createdChains[1] eRep := r.GetRelayerExecReporter() pathName := r.GeneratePathName() T := r.T @@ -107,7 +109,8 @@ func (r *RelayerTestSuite) TestConnection(ctx context.Context, relayer ibc.Relay } func (r *RelayerTestSuite) TestRelayer(ctx context.Context, relayer ibc.Relayer) { - chainA, chainB := r.GetChains() + createdChains := r.GetChains() + chainA, chainB := createdChains[0], createdChains[1] eRep := r.GetRelayerExecReporter() pathName := r.GeneratePathName() diff --git a/test/interchain.go b/test/interchain.go index 1be136a49..36edd8cdf 100644 --- a/test/interchain.go +++ b/test/interchain.go @@ -3,7 +3,9 @@ package interchaintest import ( "context" "fmt" + "github.com/docker/docker/client" + "github.com/icon-project/ibc-integration/test/chains" "github.com/strangelove-ventures/interchaintest/v7/ibc" "github.com/strangelove-ventures/interchaintest/v7/testreporter" "go.uber.org/zap" @@ -39,7 +41,7 @@ type Interchain struct { } type interchainLink struct { - chains [2]ibc.Chain + chains []chains.Chain // If set, these options will be used when creating the client in the path link step. // If a zero value initialization is used, e.g. CreateClientOptions{}, // then the default values will be used via ibc.DefaultClientOpts. @@ -80,10 +82,8 @@ func (ic *Interchain) AddChain(chain ibc.Chain, additionalGenesisWallets ...ibc. if chain == nil { panic(fmt.Errorf("cannot add nil chain")) } - newID := chain.Config().ChainID newName := chain.Config().Name - for c, id := range ic.chains { if c == chain { panic(fmt.Errorf("chain %v was already added", c)) @@ -95,7 +95,6 @@ func (ic *Interchain) AddChain(chain ibc.Chain, additionalGenesisWallets ...ibc. panic(fmt.Errorf("a chain with name %s already exists", newName)) } } - ic.chains[chain] = newID if len(additionalGenesisWallets) == 0 { @@ -134,7 +133,7 @@ func (ic *Interchain) AddRelayer(relayer ibc.Relayer, name string) *Interchain { // and the name of the path to create. type InterchainLink struct { // Chains involved. - Chain1, Chain2 ibc.Chain + Chains []chains.Chain // Relayer to use for link. Relayer ibc.Relayer @@ -156,33 +155,20 @@ type InterchainLink struct { // AddLink adds the given link to the Interchain. // If any validation fails, AddLink panics. func (ic *Interchain) AddLink(link InterchainLink) *Interchain { - if _, exists := ic.chains[link.Chain1]; !exists { - cfg := link.Chain1.Config() - panic(fmt.Errorf("chain with name=%s and id=%s was never added to Interchain", cfg.Name, cfg.ChainID)) - } - if _, exists := ic.chains[link.Chain2]; !exists { - cfg := link.Chain2.Config() - panic(fmt.Errorf("chain with name=%s and id=%s was never added to Interchain", cfg.Name, cfg.ChainID)) - } if _, exists := ic.relayers[link.Relayer]; !exists { panic(fmt.Errorf("relayer %v was never added to Interchain", link.Relayer)) } - if link.Chain1 == link.Chain2 { - panic(fmt.Errorf("chains must be different (both were %v)", link.Chain1)) - } - key := relayerPath{ Relayer: link.Relayer, Path: link.Path, } - if _, exists := ic.links[key]; exists { panic(fmt.Errorf("relayer %q already has a path named %q", key.Relayer, key.Path)) } ic.links[key] = interchainLink{ - chains: [2]ibc.Chain{link.Chain1, link.Chain2}, + chains: link.Chains, createChannelOpts: link.CreateChannelOpts, createClientOpts: link.CreateClientOpts, } @@ -267,10 +253,10 @@ func (ic *Interchain) Build(ctx context.Context, rep *testreporter.RelayerExecRe c0 := link.chains[0] c1 := link.chains[1] - if err := rp.Relayer.GeneratePath(ctx, rep, c0.Config().ChainID, c1.Config().ChainID, rp.Path); err != nil { + if err := rp.Relayer.GeneratePath(ctx, rep, c0.(ibc.Chain).Config().ChainID, c1.(ibc.Chain).Config().ChainID, rp.Path); err != nil { return fmt.Errorf( "failed to generate path %s on relayer %s between chains %s and %s: %w", - rp.Path, rp.Relayer, ic.chains[c0], ic.chains[c1], err, + rp.Path, rp.Relayer, ic.chains[c0.(ibc.Chain)], ic.chains[c1.(ibc.Chain)], err, ) } } @@ -309,7 +295,7 @@ func (ic *Interchain) Build(ctx context.Context, rep *testreporter.RelayerExecRe if err := rp.Relayer.LinkPath(ctx, rep, rp.Path, link.createChannelOpts, link.createClientOpts); err != nil { return fmt.Errorf( "failed to link path %s on relayer %s between chains %s and %s: %w", - rp.Path, rp.Relayer, ic.chains[c0], ic.chains[c1], err, + rp.Path, rp.Relayer, ic.chains[c0.(ibc.Chain)], ic.chains[c1.(ibc.Chain)], err, ) } return nil @@ -324,7 +310,6 @@ func (ic *Interchain) BuildChains(ctx context.Context, rep *testreporter.Relayer panic(fmt.Errorf("Interchain.Build called more than once")) } ic.built = true - chains := make([]ibc.Chain, 0, len(ic.chains)) for chain := range ic.chains { chains = append(chains, chain) @@ -358,18 +343,37 @@ func (ic *Interchain) BuildChains(ctx context.Context, rep *testreporter.Relayer return nil } +func (ic *Interchain) BuildRemoteChains(ctx context.Context, rep *testreporter.RelayerExecReporter, opts InterchainBuildOptions) error { + if ic.built { + panic(fmt.Errorf("Interchain.Build called more than once")) + } + ic.built = true + chains := make([]ibc.Chain, 0, len(ic.chains)) + for chain := range ic.chains { + chains = append(chains, chain) + } + ic.cs = newChainSet(ic.log, chains) + return nil +} + +func (ic *Interchain) BuildRemoteRelayer(ctx context.Context, rep *testreporter.RelayerExecReporter, opts InterchainBuildOptions) error { + if err := ic.configureRemoteRelayerKeys(ctx, rep); err != nil { + // Error already wrapped with appropriate detail. + return err + } + return nil +} + func (ic *Interchain) BuildRelayer(ctx context.Context, rep *testreporter.RelayerExecReporter, opts InterchainBuildOptions) error { if err := ic.configureRelayerKeys(ctx, rep); err != nil { // Error already wrapped with appropriate detail. return err } - // Some tests may want to configure the relayer from a lower level, // but still have wallets configured. if opts.SkipPathCreation { return nil } - // For every relayer link, teach the relayer about the link and create the link. for rp, link := range ic.links { rp := rp @@ -377,14 +381,13 @@ func (ic *Interchain) BuildRelayer(ctx context.Context, rep *testreporter.Relaye c0 := link.chains[0] c1 := link.chains[1] - if err := rp.Relayer.GeneratePath(ctx, rep, c0.Config().ChainID, c1.Config().ChainID, rp.Path); err != nil { + if err := rp.Relayer.GeneratePath(ctx, rep, c0.(ibc.Chain).Config().ChainID, c1.(ibc.Chain).Config().ChainID, rp.Path); err != nil { return fmt.Errorf( "failed to generate path %s on relayer %s between chains %s and %s: %w", - rp.Path, rp.Relayer, ic.chains[c0], ic.chains[c1], err, + rp.Path, rp.Relayer, ic.chains[c0.(ibc.Chain)], ic.chains[c1.(ibc.Chain)], err, ) } } - // Now link the paths in parallel // Creates clients, connections, and channels for each link/path. var eg errgroup.Group @@ -419,7 +422,7 @@ func (ic *Interchain) BuildRelayer(ctx context.Context, rep *testreporter.Relaye if err := rp.Relayer.LinkPath(ctx, rep, rp.Path, link.createChannelOpts, link.createClientOpts); err != nil { return fmt.Errorf( "failed to link path %s on relayer %s between chains %s and %s: %w", - rp.Path, rp.Relayer, ic.chains[c0], ic.chains[c1], err, + rp.Path, rp.Relayer, ic.chains[c0.(ibc.Chain)], ic.chains[c1.(ibc.Chain)], err, ) } return nil @@ -548,6 +551,30 @@ func (ic *Interchain) configureRelayerKeys(ctx context.Context, rep *testreporte return nil } +func (ic *Interchain) configureRemoteRelayerKeys(ctx context.Context, rep *testreporter.RelayerExecReporter) error { + // Possible optimization: each relayer could be configured concurrently. + // But we are only testing with a single relayer so far, so we don't need this yet. + + for r, chains := range ic.relayerChains() { + for _, c := range chains { + rpcAddr, grpcAddr := c.GetRPCAddress(), c.GetGRPCAddress() + if !r.UseDockerNetwork() { + rpcAddr, grpcAddr = c.GetHostRPCAddress(), c.GetHostGRPCAddress() + } + chainName := ic.chains[c] + if err := r.AddChainConfiguration(ctx, + rep, + c.Config(), chainName, + rpcAddr, grpcAddr, + ); err != nil { + return fmt.Errorf("failed to configure relayer %s for chain %s: %w", ic.relayers[r], chainName, err) + } + } + } + + return nil +} + // relayerChain is a tuple of a Relayer and a Chain. type relayerChain struct { R ibc.Relayer @@ -564,10 +591,11 @@ func (ic *Interchain) relayerChains() map[ibc.Relayer][]ibc.Chain { for rp, link := range ic.links { r := rp.Relayer if uniq[r] == nil { - uniq[r] = make(map[ibc.Chain]struct{}, 2) // Adding at least 2 chains per relayer. + uniq[r] = make(map[ibc.Chain]struct{}, 4) // Adding at least 2 chains per relayer. + } + for _, chain := range link.chains { + uniq[r][chain.(ibc.Chain)] = struct{}{} } - uniq[r][link.chains[0]] = struct{}{} - uniq[r][link.chains[1]] = struct{}{} } // Then convert the sets to slices. diff --git a/test/relayer/data/config/config.yaml b/test/relayer/data/config/config.yaml new file mode 100644 index 000000000..c8950fa56 --- /dev/null +++ b/test/relayer/data/config/config.yaml @@ -0,0 +1,94 @@ +global: + api-listen-addr: :5183 + timeout: 10s + memo: "" + light-cache-size: 20 +chains: + ibc-icon: + type: icon + value: + key-directory: /home/relayer/.relayer/keys + chain-id: ibc-icon + rpc-addr: https://tt.net.solidwallet.io/jvm-rpc/api/v3/ + timeout: 10s + keystore: godwallet + password: gochain + icon-network-id: 3 + btp-network-id: 47 + btp-network-type-id: 1 + start-height: 0 + ibc-handler-address: cxc24599dcbbad2f95c5a6da83b163d94b7704544c + first-retry-block-after: 0 + block-interval: 2000 + revision-number: 0 + localnet-1: + type: cosmos + value: + key-directory: /home/relayer/.relayer/keys/localnet-1 + key: fd + chain-id: localnet-1 + rpc-addr: https://tt.net.solidwallet.io:443/archway-rpc + account-prefix: archway + keyring-backend: test + gas-adjustment: 1.3 + gas-prices: 0.00stake + min-gas-amount: 1000000 + max-gas-amount: 0 + debug: true + timeout: 10s + block-timeout: "" + output-format: json + sign-mode: direct + extra-codecs: [] + coin-type: 118 + signing-algorithm: "" + broadcast-mode: batch + min-loop-duration: 0s + test-1: + type: cosmos + value: + key-directory: /home/relayer/.relayer/keys/test-1 + key: default + chain-id: test-1 + rpc-addr: https://tt.net.solidwallet.io:443/centauri2-rpc/ + account-prefix: centauri + keyring-backend: test + gas-adjustment: 1.3 + gas-prices: 0.00stake + min-gas-amount: 1000000 + max-gas-amount: 0 + debug: true + timeout: 10s + block-timeout: "" + output-format: json + sign-mode: direct + extra-codecs: [] + coin-type: 118 + signing-algorithm: "" + broadcast-mode: batch + min-loop-duration: 0s +paths: + centauri-archway: + src: + chain-id: test-1 + client-id: 07-tendermint-46 + connection-id: connection-36 + dst: + chain-id: localnet-1 + client-id: 07-tendermint-7 + connection-id: connection-4 + src-channel-filter: + rule: "" + channel-list: [] + centauri-icon: + src: + chain-id: test-1 + client-id: 08-wasm-45 + connection-id: connection-35 + dst: + chain-id: ibc-icon + client-id: ics08-tendermint-0 + connection-id: connection-0 + src-channel-filter: + rule: "" + channel-list: [] diff --git a/test/relayer/data/keys/centauri-testnet-1/keyring-test/4506a66e61d7d7d2e0305d7e2c5604246d892bf2.address b/test/relayer/data/keys/centauri-testnet-1/keyring-test/4506a66e61d7d7d2e0305d7e2c5604246d892bf2.address new file mode 100644 index 000000000..d9b087577 --- /dev/null +++ b/test/relayer/data/keys/centauri-testnet-1/keyring-test/4506a66e61d7d7d2e0305d7e2c5604246d892bf2.address @@ -0,0 +1 @@ +eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJjcmVhdGVkIjoiMjAyNC0wMi0wNyAxNDo1Mjo0Ny40NTYyNTMgKzA1NDUgKzA1NDUgbT0rMC4xNjU5NjA2NjciLCJlbmMiOiJBMjU2R0NNIiwicDJjIjo4MTkyLCJwMnMiOiJUWW05d01vNnVZeW0zWVlfIn0.ac8Vv5F3BUQzGvincsu5qHc99n3LIPNJX1YbYmT85qS4fLCa0XqBng.44KA53phoq24xQml.zAIXlqghpWqcGGr9wD2XgqTPich7numUm_ZzToR2XVKpKmwuYPyOVApQ7swEN3CA56parvP2d5CTfPI2exy6QvX6vbl4vRjqzjaf0PtYgWe8FYAC2Uz1GC4mc3yK_fDUpzwexl-wdce0eLQ7JoRaHQHO09bxi2ZEA_uwb1NsIFlxyaZtv7bxyPyjQrXj9S4FG1f__dJ54-bcKHl319D8FuwcFFrLjGpXMbJiIqdjAbZUEb1FceE.jt7iRbKKmesJ1MiELxxUlA \ No newline at end of file diff --git a/test/relayer/data/keys/centauri-testnet-1/keyring-test/default.info b/test/relayer/data/keys/centauri-testnet-1/keyring-test/default.info new file mode 100644 index 000000000..86e63ef9d --- /dev/null +++ b/test/relayer/data/keys/centauri-testnet-1/keyring-test/default.info @@ -0,0 +1 @@ +eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJjcmVhdGVkIjoiMjAyNC0wMi0wNyAxNDo1Mjo0Ny40NTI4NTYgKzA1NDUgKzA1NDUgbT0rMC4xNjI1NjMyNTEiLCJlbmMiOiJBMjU2R0NNIiwicDJjIjo4MTkyLCJwMnMiOiJKSzlSZElqUjBJRGdwb0JJIn0.3fYNYfB58hyLugntSUGN1YSZSVk_JEidpRNLezaYxR76oZltQve_0w.RiaxpqNZ1YzZq3JW.BtY4S7hjK_SGP3uZm1kwPvfSfU5ppLT-uFsFOAnEIMK3Q0oLXa4p8EdQm8KDBEsdpShrbBsiwmd-2-dO8XiTcswIBWmZxD437r_MAfbkLRDWvT5sbjqPP_HY2CKnP8Q3gDrwKVBSGZl0FVmU0tWTiLjjf_pYfNhUSVNkr_Lq3PXu9aFxXgI3tehv4ih9TmCpYu-S0d3mEYa63hXrF7iSjW5XaPtauSElHob84DHExuazpeIx-i3vcpAmhzv4FEAH9dg9PZQ91sdIh4SF-GakkpOWxdnH6mdnhMzCuejMCsnUei_BamKtgzXkpa_EpFEq4UWGt7pwn2KuBvObbBQ1QSVUPhq_gitsXZRouuG3rcbK1OQ6dj4EMj88bW1urQ011AOLQVc4CNEUlTTuArv9os-l3OXonQXbNFK0xm1npkI2V9a5dvJt-NNL2RH9dyeDzYA.5vGJXsXLdwRUTUNmjFlIxQ \ No newline at end of file diff --git a/test/relayer/data/keys/ibc-icon/godwallet.json b/test/relayer/data/keys/ibc-icon/godwallet.json new file mode 100644 index 000000000..947265a07 --- /dev/null +++ b/test/relayer/data/keys/ibc-icon/godwallet.json @@ -0,0 +1,23 @@ +{ + "address": "hxb6b5791be0b5ef67063b3c10b840fb81514db2fd", + "id": "87323a66-289a-4ce2-88e4-00278deb5b84", + "version": 3, + "coinType": "icx", + "crypto": { + "cipher": "aes-128-ctr", + "cipherparams": { + "iv": "069e46aaefae8f1c1f840d6b09144999" + }, + "ciphertext": "f35ff7cf4f5759cb0878088d0887574a896f7f0fc2a73898d88be1fe52977dbd", + "kdf": "scrypt", + "kdfparams": { + "dklen": 32, + "n": 65536, + "r": 8, + "p": 1, + "salt": "0fc9c3b24cdb8175" + }, + "mac": "1ef4ff51fdee8d4de9cf59e160da049eb0099eb691510994f5eca492f56c817a" + } +} + diff --git a/test/relayer/data/keys/ibc-icon/minter.json b/test/relayer/data/keys/ibc-icon/minter.json new file mode 100644 index 000000000..947265a07 --- /dev/null +++ b/test/relayer/data/keys/ibc-icon/minter.json @@ -0,0 +1,23 @@ +{ + "address": "hxb6b5791be0b5ef67063b3c10b840fb81514db2fd", + "id": "87323a66-289a-4ce2-88e4-00278deb5b84", + "version": 3, + "coinType": "icx", + "crypto": { + "cipher": "aes-128-ctr", + "cipherparams": { + "iv": "069e46aaefae8f1c1f840d6b09144999" + }, + "ciphertext": "f35ff7cf4f5759cb0878088d0887574a896f7f0fc2a73898d88be1fe52977dbd", + "kdf": "scrypt", + "kdfparams": { + "dklen": 32, + "n": 65536, + "r": 8, + "p": 1, + "salt": "0fc9c3b24cdb8175" + }, + "mac": "1ef4ff51fdee8d4de9cf59e160da049eb0099eb691510994f5eca492f56c817a" + } +} + diff --git a/test/relayer/data/keys/localnet-1/keyring-test/4506a66e61d7d7d2e0305d7e2c5604246d892bf2.address b/test/relayer/data/keys/localnet-1/keyring-test/4506a66e61d7d7d2e0305d7e2c5604246d892bf2.address new file mode 100644 index 000000000..d9b087577 --- /dev/null +++ b/test/relayer/data/keys/localnet-1/keyring-test/4506a66e61d7d7d2e0305d7e2c5604246d892bf2.address @@ -0,0 +1 @@ +eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJjcmVhdGVkIjoiMjAyNC0wMi0wNyAxNDo1Mjo0Ny40NTYyNTMgKzA1NDUgKzA1NDUgbT0rMC4xNjU5NjA2NjciLCJlbmMiOiJBMjU2R0NNIiwicDJjIjo4MTkyLCJwMnMiOiJUWW05d01vNnVZeW0zWVlfIn0.ac8Vv5F3BUQzGvincsu5qHc99n3LIPNJX1YbYmT85qS4fLCa0XqBng.44KA53phoq24xQml.zAIXlqghpWqcGGr9wD2XgqTPich7numUm_ZzToR2XVKpKmwuYPyOVApQ7swEN3CA56parvP2d5CTfPI2exy6QvX6vbl4vRjqzjaf0PtYgWe8FYAC2Uz1GC4mc3yK_fDUpzwexl-wdce0eLQ7JoRaHQHO09bxi2ZEA_uwb1NsIFlxyaZtv7bxyPyjQrXj9S4FG1f__dJ54-bcKHl319D8FuwcFFrLjGpXMbJiIqdjAbZUEb1FceE.jt7iRbKKmesJ1MiELxxUlA \ No newline at end of file diff --git a/test/relayer/data/keys/localnet-1/keyring-test/5a97f90bb88ebbd0b77f30cba39e1e06447c2d2b.address b/test/relayer/data/keys/localnet-1/keyring-test/5a97f90bb88ebbd0b77f30cba39e1e06447c2d2b.address new file mode 100644 index 000000000..16bc68e4d --- /dev/null +++ b/test/relayer/data/keys/localnet-1/keyring-test/5a97f90bb88ebbd0b77f30cba39e1e06447c2d2b.address @@ -0,0 +1 @@ +eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJjcmVhdGVkIjoiMjAyNC0wMy0xOCAxODo0MjoxNS41MjU4MzUgKzA1NDUgKzA1NDUgbT0rMC4wMzQ0ODMxMjYiLCJlbmMiOiJBMjU2R0NNIiwicDJjIjo4MTkyLCJwMnMiOiJ6UFBKUl9UWjJMNnFZSVZjIn0.-BfnwZ_8Gq7DUpnbsWj7wsqYBn91fRqMMx7kHClV08fGncxjEH_ZDQ.Kabj8qQ7ZRSVAWVi.vSgM9IG9sCh-0T2gpnRD4H_XxHImsreuc4vcBDYujYF8-oCKfsGgU2-DfXjakJfVNJzAowfaCuoE8HdyVKUEXv4JEfQFOrHxBre5oah6enTTv1ig2mt2N8xqC_txCxJaGPscNSjOoe8HZn4BcrotbIjgibZ7-FDdzNSE0GqRcVYCobnJZyhk1ZqYRqmNwXqAT26xMA0tDDR-VAgEWSnpk24NBlbE6Kx_Rc4nqR-qCBrn1yT0WvQ.1Ks8qGTLm71qkvsw1v7YTg \ No newline at end of file diff --git a/test/relayer/data/keys/localnet-1/keyring-test/c5fa013a2b95427aa946e3f43d107d69ae084e01.address b/test/relayer/data/keys/localnet-1/keyring-test/c5fa013a2b95427aa946e3f43d107d69ae084e01.address new file mode 100644 index 000000000..dbcaa0c0f --- /dev/null +++ b/test/relayer/data/keys/localnet-1/keyring-test/c5fa013a2b95427aa946e3f43d107d69ae084e01.address @@ -0,0 +1 @@ +eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJjcmVhdGVkIjoiMjAyNC0wMS0yNiAwNDo0MDo1OC4yMTQzMjI3OTkgKzAwMDAgVVRDIG09KzAuMDk0MDgxMDkzIiwiZW5jIjoiQTI1NkdDTSIsInAyYyI6ODE5MiwicDJzIjoicVJjSnpNVmJVMHVxQWFQNyJ9.2gHol9WHYQY4sXnS8sQsGdO1hA4Y7aPAlP8ABxy34vN1HjOJdWBJcg.E1kyHRwKqHS5oLsi.K2H0qGGUcGVCHdqHOr_es-vntkd3wJsxjBmQrLIADUF9czxtTKVTht-wSMUBLoGSiA7-dCsXV6wjeJSygt80SOuoTOm2tOty2Sx9LEtNXmJwWoAv7bXxekxPHQ6AC1NVRAK2CA13AdB450R92CTMLhxismxQZnr5TvgorV6TGJcOd3jLbBvk5xTlq7kcrf8irhN-5rMLFazUGctZE6gBwrXB1sQuSxlKP92z4GCI9rjHraGcE1A.n1X4pY3ZGO6S12EF6fAfkA \ No newline at end of file diff --git a/test/relayer/data/keys/localnet-1/keyring-test/default.info b/test/relayer/data/keys/localnet-1/keyring-test/default.info new file mode 100644 index 000000000..86e63ef9d --- /dev/null +++ b/test/relayer/data/keys/localnet-1/keyring-test/default.info @@ -0,0 +1 @@ +eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJjcmVhdGVkIjoiMjAyNC0wMi0wNyAxNDo1Mjo0Ny40NTI4NTYgKzA1NDUgKzA1NDUgbT0rMC4xNjI1NjMyNTEiLCJlbmMiOiJBMjU2R0NNIiwicDJjIjo4MTkyLCJwMnMiOiJKSzlSZElqUjBJRGdwb0JJIn0.3fYNYfB58hyLugntSUGN1YSZSVk_JEidpRNLezaYxR76oZltQve_0w.RiaxpqNZ1YzZq3JW.BtY4S7hjK_SGP3uZm1kwPvfSfU5ppLT-uFsFOAnEIMK3Q0oLXa4p8EdQm8KDBEsdpShrbBsiwmd-2-dO8XiTcswIBWmZxD437r_MAfbkLRDWvT5sbjqPP_HY2CKnP8Q3gDrwKVBSGZl0FVmU0tWTiLjjf_pYfNhUSVNkr_Lq3PXu9aFxXgI3tehv4ih9TmCpYu-S0d3mEYa63hXrF7iSjW5XaPtauSElHob84DHExuazpeIx-i3vcpAmhzv4FEAH9dg9PZQ91sdIh4SF-GakkpOWxdnH6mdnhMzCuejMCsnUei_BamKtgzXkpa_EpFEq4UWGt7pwn2KuBvObbBQ1QSVUPhq_gitsXZRouuG3rcbK1OQ6dj4EMj88bW1urQ011AOLQVc4CNEUlTTuArv9os-l3OXonQXbNFK0xm1npkI2V9a5dvJt-NNL2RH9dyeDzYA.5vGJXsXLdwRUTUNmjFlIxQ \ No newline at end of file diff --git a/test/relayer/data/keys/localnet-1/keyring-test/fd.info b/test/relayer/data/keys/localnet-1/keyring-test/fd.info new file mode 100644 index 000000000..581993ac5 --- /dev/null +++ b/test/relayer/data/keys/localnet-1/keyring-test/fd.info @@ -0,0 +1 @@ +eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJjcmVhdGVkIjoiMjAyNC0wMy0wNyAxNDoxMjozMy4zNDc3NTQgKzA1NDUgKzA1NDUgbT0rMC4wMjcyMjExNjgiLCJlbmMiOiJBMjU2R0NNIiwicDJjIjo4MTkyLCJwMnMiOiJOZVh2UElidER5em5tZTRyIn0.X-0OBdBTamZ1Wqg-UsxR4OFdwqZtcTju7HQWFanLo644hfsA_eNsuA.afh7OPW4tKoORr5b.yZYjFogogHiSLQmgcreO8f6k4JR_66ezAwqxCIxgshiH65CGVm3zch-C6dUvWhxFNqXgPjcq67DSzzhOk_uCeF7oS1T_X0Q_hwGMngRy-CH0YtPtaQftJdnaVGNxCkC6CTWuhLyn6lu7_ecLOt-co881RgilCYxyz_2znvkj4oFbw94BLCQCsyRll4d1jDLzDPFR1uFu9CcYqU-9lSAjzav0FntsTZEAIvt2j2MR8zxXGiiZJg50XbesMsHEP4ZBlHCPaQzKGEo2Q-R3dImn-d4rSCDOWpDUekxObnUun5-S_3Bn1XuEiTUaTipiYtZHmQnRgMQDsH6hwWVaY5MHQN20BeV8uuw1qEJBuqgdddGX5SuD2yPfXQzVuxGz3MAVu306xczild9FPYMxLwH8fXlh-Yk93gSMmpMIWJRvGll6KwE-6pfX7_jB.910JYZPj8VS8HTyvw7mJ7A \ No newline at end of file diff --git a/test/relayer/data/keys/localnet-1/keyring-test/mykey.info b/test/relayer/data/keys/localnet-1/keyring-test/mykey.info new file mode 100644 index 000000000..20b6c49e6 --- /dev/null +++ b/test/relayer/data/keys/localnet-1/keyring-test/mykey.info @@ -0,0 +1 @@ +eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJjcmVhdGVkIjoiMjAyNC0wMS0yNiAwNDo0MDo1OC4yMDk2NjgxMzUgKzAwMDAgVVRDIG09KzAuMDg5NDI2NDQwIiwiZW5jIjoiQTI1NkdDTSIsInAyYyI6ODE5MiwicDJzIjoiS3FmTmNFMW1iWENBQTZpVyJ9.r-aJTCi-PHclMsmfu567bw2wrrPo0JKEQOmAOtJISg0_eftyJI8q0w.UDbKlG2Qq84f4g0B.CSi7X1zgaMlQFHsP3FjGIswPp60KHUOm6NM4fM9P0c8PGNdBubD7jTTxtCxYULxw3ju5zeqSbEFFW9zvlAHnzj61yXIKoL9Zc9n16CbpgMJh2WQyQ3hLEXBPWwTNNL38JrNaGY9wn0S_L1VXX3_8yf1P31hUeMzAlkjyVV3erHPIb2IbuyWkRHZxgeMmEzM6nMDTkTJj8Znem_k268WBPvC2SIEUk-_xukmgPA87hs30dFVhUnD_MkYEiW3_DiVqqmYNwzL210W59O52uBiOP08EjAlDBG-xgTfY3sjxPWh85AfJUNP3aE-kaV_1Uv37IdbPlOgB70rDbrhn8__4z6INT8GVoiTDuF9P8huk3BEjFJClFOig2dEJgYrwn2OBYRTJR3tTmhlNH7270Ol5GxbD-ZXjn_KHtN_PRay2UIBloTih7AXxXgChEdo.SXkKJLsWwudXLnOb5LmMCA \ No newline at end of file diff --git a/test/relayer/data/keys/localnet-1/keyring-test/relayer.info b/test/relayer/data/keys/localnet-1/keyring-test/relayer.info new file mode 100644 index 000000000..f1806ceb2 --- /dev/null +++ b/test/relayer/data/keys/localnet-1/keyring-test/relayer.info @@ -0,0 +1 @@ +eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJjcmVhdGVkIjoiMjAyNC0wMy0xOCAxODo0MjoxNS41MjQ1OSArMDU0NSArMDU0NSBtPSswLjAzMzIzODAwMSIsImVuYyI6IkEyNTZHQ00iLCJwMmMiOjgxOTIsInAycyI6IlNKYkNlWHljX0hYNGxRdWMifQ.CJj-kKnZrTwpIpCrIisK43SCtB59wkHnJyydrfae_gt6j1I5DX95qA.ACFcCdJGRWAjwzuC.p6Kh-LsJhORVRuzROdIc1LCT-VdhBYrxO_6UdH0aprJ7lTasYi4xgbox98WfXsbLWHUyzQPu8N3g_27OLvqdysQgiGdgryhkYCzM-fDPxgK84_vCecRxjjhmxzTaFW8_ViA-5Tc3omaJjuvMu34L4quv639TuehZlxdN9DYEkLxsCT9xlo39j7p08A2-G-ymJcJU-IKINbDrNQ0KFmhlME3l_Y8wZACjTmvTgJsVeLUwZfqHd2CvGnQwwQaydQheGTl2Q1OyQ5XGz99wzK7T0w8638u_MjOdu4DQAUfPruoNdHHgZ1_cQAu9VGmUtcoo5PnR5EpAtUwont0j4PYBjUCsH67tI-n99xOV6jq9UMCYBOb-rsNPSbfQTpUPPY7rVnIqBjiDzLPJWEBc5DcXr5vt59p4dU2yXcTddeZGW2Vg8ByBfBUOPF0kF_NQfDydq4Y._uDrDR7W6J3FAqDAGyffQg \ No newline at end of file diff --git a/test/relayer/data/keys/test-1/keyring-test/4506a66e61d7d7d2e0305d7e2c5604246d892bf2.address b/test/relayer/data/keys/test-1/keyring-test/4506a66e61d7d7d2e0305d7e2c5604246d892bf2.address new file mode 100644 index 000000000..d9b087577 --- /dev/null +++ b/test/relayer/data/keys/test-1/keyring-test/4506a66e61d7d7d2e0305d7e2c5604246d892bf2.address @@ -0,0 +1 @@ +eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJjcmVhdGVkIjoiMjAyNC0wMi0wNyAxNDo1Mjo0Ny40NTYyNTMgKzA1NDUgKzA1NDUgbT0rMC4xNjU5NjA2NjciLCJlbmMiOiJBMjU2R0NNIiwicDJjIjo4MTkyLCJwMnMiOiJUWW05d01vNnVZeW0zWVlfIn0.ac8Vv5F3BUQzGvincsu5qHc99n3LIPNJX1YbYmT85qS4fLCa0XqBng.44KA53phoq24xQml.zAIXlqghpWqcGGr9wD2XgqTPich7numUm_ZzToR2XVKpKmwuYPyOVApQ7swEN3CA56parvP2d5CTfPI2exy6QvX6vbl4vRjqzjaf0PtYgWe8FYAC2Uz1GC4mc3yK_fDUpzwexl-wdce0eLQ7JoRaHQHO09bxi2ZEA_uwb1NsIFlxyaZtv7bxyPyjQrXj9S4FG1f__dJ54-bcKHl319D8FuwcFFrLjGpXMbJiIqdjAbZUEb1FceE.jt7iRbKKmesJ1MiELxxUlA \ No newline at end of file diff --git a/test/relayer/data/keys/test-1/keyring-test/c5fa013a2b95427aa946e3f43d107d69ae084e01.address b/test/relayer/data/keys/test-1/keyring-test/c5fa013a2b95427aa946e3f43d107d69ae084e01.address new file mode 100644 index 000000000..dbcaa0c0f --- /dev/null +++ b/test/relayer/data/keys/test-1/keyring-test/c5fa013a2b95427aa946e3f43d107d69ae084e01.address @@ -0,0 +1 @@ +eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJjcmVhdGVkIjoiMjAyNC0wMS0yNiAwNDo0MDo1OC4yMTQzMjI3OTkgKzAwMDAgVVRDIG09KzAuMDk0MDgxMDkzIiwiZW5jIjoiQTI1NkdDTSIsInAyYyI6ODE5MiwicDJzIjoicVJjSnpNVmJVMHVxQWFQNyJ9.2gHol9WHYQY4sXnS8sQsGdO1hA4Y7aPAlP8ABxy34vN1HjOJdWBJcg.E1kyHRwKqHS5oLsi.K2H0qGGUcGVCHdqHOr_es-vntkd3wJsxjBmQrLIADUF9czxtTKVTht-wSMUBLoGSiA7-dCsXV6wjeJSygt80SOuoTOm2tOty2Sx9LEtNXmJwWoAv7bXxekxPHQ6AC1NVRAK2CA13AdB450R92CTMLhxismxQZnr5TvgorV6TGJcOd3jLbBvk5xTlq7kcrf8irhN-5rMLFazUGctZE6gBwrXB1sQuSxlKP92z4GCI9rjHraGcE1A.n1X4pY3ZGO6S12EF6fAfkA \ No newline at end of file diff --git a/test/relayer/data/keys/test-1/keyring-test/default.info b/test/relayer/data/keys/test-1/keyring-test/default.info new file mode 100644 index 000000000..86e63ef9d --- /dev/null +++ b/test/relayer/data/keys/test-1/keyring-test/default.info @@ -0,0 +1 @@ +eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJjcmVhdGVkIjoiMjAyNC0wMi0wNyAxNDo1Mjo0Ny40NTI4NTYgKzA1NDUgKzA1NDUgbT0rMC4xNjI1NjMyNTEiLCJlbmMiOiJBMjU2R0NNIiwicDJjIjo4MTkyLCJwMnMiOiJKSzlSZElqUjBJRGdwb0JJIn0.3fYNYfB58hyLugntSUGN1YSZSVk_JEidpRNLezaYxR76oZltQve_0w.RiaxpqNZ1YzZq3JW.BtY4S7hjK_SGP3uZm1kwPvfSfU5ppLT-uFsFOAnEIMK3Q0oLXa4p8EdQm8KDBEsdpShrbBsiwmd-2-dO8XiTcswIBWmZxD437r_MAfbkLRDWvT5sbjqPP_HY2CKnP8Q3gDrwKVBSGZl0FVmU0tWTiLjjf_pYfNhUSVNkr_Lq3PXu9aFxXgI3tehv4ih9TmCpYu-S0d3mEYa63hXrF7iSjW5XaPtauSElHob84DHExuazpeIx-i3vcpAmhzv4FEAH9dg9PZQ91sdIh4SF-GakkpOWxdnH6mdnhMzCuejMCsnUei_BamKtgzXkpa_EpFEq4UWGt7pwn2KuBvObbBQ1QSVUPhq_gitsXZRouuG3rcbK1OQ6dj4EMj88bW1urQ011AOLQVc4CNEUlTTuArv9os-l3OXonQXbNFK0xm1npkI2V9a5dvJt-NNL2RH9dyeDzYA.5vGJXsXLdwRUTUNmjFlIxQ \ No newline at end of file diff --git a/test/relayer/data/keys/test-1/keyring-test/mykey.info b/test/relayer/data/keys/test-1/keyring-test/mykey.info new file mode 100644 index 000000000..20b6c49e6 --- /dev/null +++ b/test/relayer/data/keys/test-1/keyring-test/mykey.info @@ -0,0 +1 @@ +eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJjcmVhdGVkIjoiMjAyNC0wMS0yNiAwNDo0MDo1OC4yMDk2NjgxMzUgKzAwMDAgVVRDIG09KzAuMDg5NDI2NDQwIiwiZW5jIjoiQTI1NkdDTSIsInAyYyI6ODE5MiwicDJzIjoiS3FmTmNFMW1iWENBQTZpVyJ9.r-aJTCi-PHclMsmfu567bw2wrrPo0JKEQOmAOtJISg0_eftyJI8q0w.UDbKlG2Qq84f4g0B.CSi7X1zgaMlQFHsP3FjGIswPp60KHUOm6NM4fM9P0c8PGNdBubD7jTTxtCxYULxw3ju5zeqSbEFFW9zvlAHnzj61yXIKoL9Zc9n16CbpgMJh2WQyQ3hLEXBPWwTNNL38JrNaGY9wn0S_L1VXX3_8yf1P31hUeMzAlkjyVV3erHPIb2IbuyWkRHZxgeMmEzM6nMDTkTJj8Znem_k268WBPvC2SIEUk-_xukmgPA87hs30dFVhUnD_MkYEiW3_DiVqqmYNwzL210W59O52uBiOP08EjAlDBG-xgTfY3sjxPWh85AfJUNP3aE-kaV_1Uv37IdbPlOgB70rDbrhn8__4z6INT8GVoiTDuF9P8huk3BEjFJClFOig2dEJgYrwn2OBYRTJR3tTmhlNH7270Ol5GxbD-ZXjn_KHtN_PRay2UIBloTih7AXxXgChEdo.SXkKJLsWwudXLnOb5LmMCA \ No newline at end of file diff --git a/test/relayer/docker.go b/test/relayer/docker.go index 6449ee54b..8771adf7d 100644 --- a/test/relayer/docker.go +++ b/test/relayer/docker.go @@ -5,6 +5,9 @@ import ( "context" "encoding/hex" "fmt" + "os" + "path/filepath" + iccrypto "github.com/icon-project/icon-bridge/common/crypto" "io" @@ -50,13 +53,14 @@ type DockerRelayer struct { // wallets contains a mapping of chainID to relayer wallet wallets map[string]ibc.Wallet - homeDir string + homeDir string + relayerAccounts map[string]string } var _ ibc.Relayer = (*DockerRelayer)(nil) // NewDockerRelayer returns a new DockerRelayer. -func NewDockerRelayer(ctx context.Context, log *zap.Logger, testName string, cli *client.Client, networkID string, c RelayerCommander, options ...RelayerOption) (*DockerRelayer, error) { +func NewDockerRelayer(ctx context.Context, log *zap.Logger, testName string, cli *client.Client, networkID string, c RelayerCommander, relayerAccounts map[string]string, useExistingConfig bool, options ...RelayerOption) (*DockerRelayer, error) { r := DockerRelayer{ log: log, @@ -70,8 +74,9 @@ func NewDockerRelayer(ctx context.Context, log *zap.Logger, testName string, cli testName: testName, - wallets: map[string]ibc.Wallet{}, - homeDir: defaultRlyHomeDirectory, + wallets: map[string]ibc.Wallet{}, + homeDir: defaultRlyHomeDirectory, + relayerAccounts: relayerAccounts, } for _, opt := range options { @@ -117,20 +122,21 @@ func NewDockerRelayer(ctx context.Context, log *zap.Logger, testName string, cli return nil, fmt.Errorf("set volume owner: %w", err) } - if init := r.c.Init(r.HomeDir()); len(init) > 0 { - // Initialization should complete immediately, - // but add a 1-minute timeout in case Docker hangs on a developer workstation. - ctx, cancel := context.WithTimeout(ctx, time.Minute) - defer cancel() + if !useExistingConfig { + if init := r.c.Init(r.HomeDir()); len(init) > 0 { + // Initialization should complete immediately, + // but add a 1-minute timeout in case Docker hangs on a developer workstation. + ctx, cancel := context.WithTimeout(ctx, time.Minute) + defer cancel() - // Using a nop reporter here because it keeps the API simpler, - // and the init command is typically not of high interest. - res := r.Exec(ctx, ibc.NopRelayerExecReporter{}, init, nil) - if res.Err != nil { - return nil, res.Err + // Using a nop reporter here because it keeps the API simpler, + // and the init command is typically not of high interest. + res := r.Exec(ctx, ibc.NopRelayerExecReporter{}, init, nil) + if res.Err != nil { + return nil, res.Err + } } } - return &r, nil } @@ -169,10 +175,8 @@ func (r *DockerRelayer) AddChainConfiguration(ctx context.Context, rep ibc.Relay // For rly this file is json, but the file extension should not matter. // Using .config to avoid implying any particular format. chainConfigFile := chainConfig.ChainID + ".config" - _ = path.Join(r.HomeDir(), chainConfigFile) - configContent, err := r.c.ConfigContent(ctx, chainConfig, keyName, rpcAddr, grpcAddr) - fmt.Println(string(configContent)) + configContent, err := r.c.ConfigContent(ctx, chainConfig, keyName, rpcAddr, grpcAddr, r.relayerAccounts) if err != nil { return fmt.Errorf("failed to generate config content: %w", err) @@ -184,7 +188,6 @@ func (r *DockerRelayer) AddChainConfiguration(ctx context.Context, rep ibc.Relay } cmd := r.c.AddChainConfiguration(chainConfigFile, r.HomeDir()) - fmt.Println(cmd) // Adding the chain configuration simply reads from a file on disk, // so this should also complete immediately. ctx, cancel := context.WithTimeout(ctx, time.Minute) @@ -537,7 +540,24 @@ func (r *DockerRelayer) Name() string { // Bind returns the home folder bind point for running the node. func (r *DockerRelayer) Bind() []string { - return []string{r.volumeName + ":" + r.HomeDir()} + if r.relayerAccounts == nil { + return []string{ + r.volumeName + ":" + r.HomeDir(), + } + } + path, _ := os.Getwd() + testfolder := filepath.Dir(path) + iconGodWalletKeyPath := testfolder + "/relayer/data" + _, err := os.Stat(path) + if err != nil { + return []string{ + r.volumeName + ":" + r.HomeDir(), + } + } + return []string{ + r.volumeName + ":" + r.HomeDir(), + iconGodWalletKeyPath + ":" + "/home/relayer/.relayer", + } } // HomeDir returns the home directory of the relayer on the underlying Docker container's filesystem. @@ -569,7 +589,7 @@ type RelayerCommander interface { DockerUser() string // ConfigContent generates the content of the config file that will be passed to AddChainConfiguration. - ConfigContent(ctx context.Context, cfg ibc.ChainConfig, keyName, rpcAddr, grpcAddr string) ([]byte, error) + ConfigContent(ctx context.Context, cfg ibc.ChainConfig, keyName, rpcAddr, grpcAddr string, relayerAccounts map[string]string) ([]byte, error) // ParseAddKeyOutput processes the output of AddKey // to produce the wallet that was created. diff --git a/test/relayer/icon/icon_relayer.go b/test/relayer/icon/icon_relayer.go index 893d65775..aa1ce43e5 100644 --- a/test/relayer/icon/icon_relayer.go +++ b/test/relayer/icon/icon_relayer.go @@ -35,7 +35,7 @@ func NewICONRelayer(log *zap.Logger, testName string, cli *client.Client, networ c.extraStartFlags = o.Flags } } - dr, err := relayer.NewDockerRelayer(context.TODO(), log, testName, cli, networkID, c, options...) + dr, err := relayer.NewDockerRelayer(context.TODO(), log, testName, cli, networkID, c, nil, false, options...) if err != nil { panic(err) // TODO: return } @@ -68,6 +68,15 @@ type ArchRelayerChainConfigValue struct { BlockInterval int `json:"block-interval"` } +type CosmosRelayerChainConfigValue struct { + rly.CosmosRelayerChainConfigValue + KeyDir string `json:"key-directory"` + Key string `json:"key"` + MinGasAmount int `json:"min-gas-amount"` + CoinType int `json:"coin-type"` + BlockInterval int `json:"block-interval"` +} + type ICONRelayerChainConfig struct { Type string `json:"type"` Value ICONRelayerChainConfigValue `json:"value"` @@ -78,6 +87,11 @@ type ArchRelayerChainConfig struct { Value ArchRelayerChainConfigValue `json:"value"` } +type CosmosRelayerChainConfig struct { + Type string `json:"type"` + Value CosmosRelayerChainConfigValue `json:"value"` +} + const ( DefaultContainerImage = "ghcr.io/cosmos/relayer" DefaultContainerVersion = "v2.3.1" @@ -94,7 +108,6 @@ func Capabilities() map[relayer.Capability]bool { func ChainConfigToICONRelayerChainConfig(chainConfig ibc.ChainConfig, keyName, rpcAddr, gprcAddr string) ICONRelayerChainConfig { chainType := chainConfig.Type - fmt.Println(chainConfig) return ICONRelayerChainConfig{ Type: chainType, Value: ICONRelayerChainConfigValue{ @@ -251,10 +264,10 @@ func (commander) UpdateClients(pathName, homeDir string) []string { } } -func (commander) ConfigContent(ctx context.Context, cfg ibc.ChainConfig, keyName, rpcAddr, grpcAddr string) ([]byte, error) { +func (commander) ConfigContent(ctx context.Context, cfg ibc.ChainConfig, keyName, rpcAddr, grpcAddr string, relayerAccounts map[string]string) ([]byte, error) { switch chainType := cfg.Type; chainType { - case "cosmos", "wasm": + case "wasm": cosmosRelayerChainConfig := rly.ChainConfigToCosmosRelayerChainConfig(cfg, keyName, rpcAddr, grpcAddr) coinType, err := strconv.Atoi(cfg.CoinType) archRelayerChainConfig := &ArchRelayerChainConfig{ @@ -269,7 +282,23 @@ func (commander) ConfigContent(ctx context.Context, cfg ibc.ChainConfig, keyName BlockInterval: cfg.ConfigFileOverrides["block-interval"].(int), }, } - + jsonBytes, err := json.Marshal(archRelayerChainConfig) + if err != nil { + return nil, err + } + return jsonBytes, nil + case "cosmos": + cosmosRelayerChainConfig := rly.ChainConfigToCosmosRelayerChainConfig(cfg, keyName, rpcAddr, grpcAddr) + coinType, err := strconv.Atoi(cfg.CoinType) + archRelayerChainConfig := &CosmosRelayerChainConfig{ + Type: "cosmos", + Value: CosmosRelayerChainConfigValue{ + CosmosRelayerChainConfigValue: cosmosRelayerChainConfig.Value, + KeyDir: "/home/relayer/.relayer/keys/" + cfg.ChainID, + MinGasAmount: 1000000, + CoinType: coinType, + }, + } jsonBytes, err := json.Marshal(archRelayerChainConfig) if err != nil { return nil, err diff --git a/test/relayer/icon/icon_relayer_remote.go b/test/relayer/icon/icon_relayer_remote.go new file mode 100644 index 000000000..5a72c7e33 --- /dev/null +++ b/test/relayer/icon/icon_relayer_remote.go @@ -0,0 +1,427 @@ +// Package rly provides an interface to the cosmos relayer running in a Docker container. +package rly + +import ( + "context" + "encoding/json" + "fmt" + "log" + "os" + "path/filepath" + "strconv" + "strings" + + // "github.com/cosmos/cosmos-sdk/crypto/keyring" + "github.com/docker/docker/client" + "github.com/icon-project/ibc-integration/test/relayer" + "github.com/strangelove-ventures/interchaintest/v7/ibc" + "github.com/strangelove-ventures/interchaintest/v7/relayer/rly" + "go.uber.org/zap" +) + +// ICONRemoteRelayer is the ibc.Relayer implementation for github.com/cosmos/relayer. +type ICONRemoteRelayer struct { + // Embedded DockerRelayer so commands just work. + *relayer.DockerRelayer +} + +func NewICONRemoteRelayer(log *zap.Logger, testName string, cli *client.Client, networkID string, relayerAccounts map[string]string, useExistingConfig bool, options ...relayer.RelayerOption) *ICONRemoteRelayer { + c := RemoteCommander{log: log} + for _, opt := range options { + switch o := opt.(type) { + case relayer.RelayerOptionExtraStartFlags: + c.extraStartFlags = o.Flags + } + } + dr, err := relayer.NewDockerRelayer(context.TODO(), log, testName, cli, networkID, c, relayerAccounts, useExistingConfig, options...) + if err != nil { + panic(err) // TODO: return + } + return &ICONRemoteRelayer{DockerRelayer: dr} +} + +type ICONRemoteRelayerChainConfigValue struct { + KeyDirectory string `json:"key-directory"` + Key string `json:"key"` + ChainID string `json:"chain-id"` + RPCAddr string `json:"rpc-addr"` + Timeout string `json:"timeout"` + Keystore string `json:"keystore"` + Password string `json:"password"` + IconNetworkID int `json:"icon-network-id"` + BtpNetworkID int `json:"btp-network-id"` + StartHeight int `json:"start-height"` + BTPNetworkTypeID int `json:"btp-network-type-id"` + IBCHandlerAddress string `json:"ibc-handler-address"` + BlockInterval int `json:"block-interval"` +} + +type ICONRemoteRelayerChainConfig struct { + Type string `json:"type"` + Value ICONRemoteRelayerChainConfigValue `json:"value"` +} + +func ChainConfigToICONRemoteRelayerRemoteChainConfig(chainConfig ibc.ChainConfig, keyName, rpcAddr, gprcAddr, keystorePwd string) ICONRemoteRelayerChainConfig { + chainType := chainConfig.Type + keystore := "godwallet" + pwd := "gochain" + if keystorePwd != "" { + parts := strings.Split(keystorePwd, ":") + keystore = parts[0] + pwd = parts[1] + } + return ICONRemoteRelayerChainConfig{ + Type: chainType, + Value: ICONRemoteRelayerChainConfigValue{ + Key: "icx", + ChainID: chainConfig.ChainID, + RPCAddr: rpcAddr, + Timeout: "10s", + Keystore: keystore, + KeyDirectory: "/home/relayer/.relayer/keys", + Password: pwd, + IconNetworkID: 3, + BtpNetworkID: chainConfig.ConfigFileOverrides["btp-network-id"].(int), + StartHeight: chainConfig.ConfigFileOverrides["start-height"].(int), + BTPNetworkTypeID: chainConfig.ConfigFileOverrides["btp-network-type-id"].(int), + IBCHandlerAddress: chainConfig.ConfigFileOverrides["ibc-handler-address"].(string), + BlockInterval: chainConfig.ConfigFileOverrides["block-interval"].(int), + }, + } +} + +type RemoteCommander struct { + log *zap.Logger + extraStartFlags []string +} + +func (RemoteCommander) Name() string { + return "rly" +} + +func (RemoteCommander) DockerUser() string { + return RlyDefaultUidGid // docker run -it --rm --entrypoint echo ghcr.io/cosmos/relayer "$(id -u):$(id -g)" +} + +func (RemoteCommander) AddChainConfiguration(containerFilePath, homeDir string) []string { + return []string{ + "rly", "chains", "add", "-f", containerFilePath, + } +} + +func (RemoteCommander) AddKey(chainID, keyName, coinType, homeDir string) []string { + return []string{ + "rly", "keys", "add", chainID, keyName, + "--coin-type", fmt.Sprint(coinType), + } +} + +func (RemoteCommander) CreateChannel(pathName string, opts ibc.CreateChannelOptions, homeDir string) []string { + cleanUpStoredHeight() + return []string{ + "rly", "tx", "channel", pathName, + "--src-port", opts.SourcePortName, + "--dst-port", opts.DestPortName, + } +} + +func (RemoteCommander) CreateClients(pathName string, opts ibc.CreateClientOptions, homeDir string) []string { + cleanUpStoredHeight() + if strings.Contains(pathName, "icon") { + return []string{ + "rly", "tx", "clients", pathName, "--client-tp", opts.TrustingPeriod, + "--src-wasm-code-id", "1cff60adf40895b5fccb1e9ce6305a65ae01400a02cc4ded2cf3669221905adc", "--override", "-d", + } + } + return []string{ + "rly", "tx", "clients", pathName, "--client-tp", opts.TrustingPeriod, + "--override", "-d", + } + +} + +// passing a value of 0 for customeClientTrustingPeriod will use default +func (RemoteCommander) CreateClient(pathName, homeDir, customeClientTrustingPeriod string) []string { + cleanUpStoredHeight() + return []string{ + "rly", "tx", "client", pathName, "--client-tp", customeClientTrustingPeriod, + } +} + +func (RemoteCommander) CreateConnections(pathName string, homeDir string) []string { + cleanUpStoredHeight() + return []string{ + "rly", "tx", "connection", pathName, + } +} + +func (RemoteCommander) Flush(pathName, channelID, homeDir string) []string { + cmd := []string{"rly", "tx", "flush"} + if pathName != "" { + cmd = append(cmd, pathName) + if channelID != "" { + cmd = append(cmd, channelID) + } + } + cmd = append(cmd, "--home", homeDir) + return cmd +} + +func (RemoteCommander) GeneratePath(srcChainID, dstChainID, pathName, homeDir string) []string { + return []string{ + "rly", "paths", "new", dstChainID, srcChainID, pathName, + } +} + +func (RemoteCommander) UpdatePath(pathName, homeDir string, filter ibc.ChannelFilter) []string { + return []string{ + "rly", "paths", "update", pathName, + + "--filter-rule", filter.Rule, + "--filter-channels", strings.Join(filter.ChannelList, ","), + } +} + +func (RemoteCommander) GetChannels(chainID, homeDir string) []string { + return []string{ + "rly", "q", "channels", chainID, + } +} + +func (RemoteCommander) GetConnections(chainID, homeDir string) []string { + return []string{ + "rly", "q", "connections", chainID, + } +} + +func (RemoteCommander) GetClients(chainID, homeDir string) []string { + return []string{ + "rly", "q", "clients", chainID, + } +} + +// TODO figure out values for commented parameters +func (RemoteCommander) LinkPath(pathName, homeDir string, channelOpts ibc.CreateChannelOptions, clientOpt ibc.CreateClientOptions) []string { + return []string{ + "rly", "tx", "link", pathName, + "--src-port", channelOpts.SourcePortName, + "--dst-port", channelOpts.DestPortName, + "--order", channelOpts.Order.String(), + // "--version", channelOpts.Version, + "--client-tp", clientOpt.TrustingPeriod, //should not be 0 set large integer in string e.g 1000m + "--debug", + } +} + +func (RemoteCommander) RestoreKey(chainID, keyName, coinType, mnemonic, homeDir string) []string { + return []string{ + "rly", "keys", "restore", chainID, keyName, mnemonic, + "--coin-type", fmt.Sprint(coinType), + } +} + +func (c RemoteCommander) StartRelayer(homeDir string, pathNames ...string) []string { + cmd := []string{ + "rly", "start", + } + return cmd +} + +func (RemoteCommander) UpdateClients(pathName, homeDir string) []string { + return []string{ + "rly", "tx", "update-clients", pathName, + } +} + +func (RemoteCommander) ConfigContent(ctx context.Context, cfg ibc.ChainConfig, keyName, rpcAddr, grpcAddr string, relayerAccounts map[string]string) ([]byte, error) { + + switch chainType := cfg.Type; chainType { + case "wasm": + cosmosRelayerChainConfig := rly.ChainConfigToCosmosRelayerChainConfig(cfg, keyName, rpcAddr, grpcAddr) + coinType, err := strconv.Atoi(cfg.CoinType) + archRelayerChainConfig := &ArchRelayerChainConfig{ + Type: cosmosRelayerChainConfig.Type, + Value: ArchRelayerChainConfigValue{ + CosmosRelayerChainConfigValue: cosmosRelayerChainConfig.Value, + KeyDir: "/home/relayer/.relayer/keys/" + cfg.ChainID, + MinGasAmount: 1000000, + CoinType: coinType, + StartHeight: cfg.ConfigFileOverrides["start-height"].(int), + IBCHandlerAddress: cfg.ConfigFileOverrides["ibc-handler-address"].(string), + BlockInterval: cfg.ConfigFileOverrides["block-interval"].(int), + }, + } + jsonBytes, err := json.Marshal(archRelayerChainConfig) + if err != nil { + return nil, err + } + return jsonBytes, nil + case "cosmos": + cosmosRelayerChainConfig := rly.ChainConfigToCosmosRelayerChainConfig(cfg, keyName, rpcAddr, grpcAddr) + coinType, err := strconv.Atoi(cfg.CoinType) + + archRelayerChainConfig := &CosmosRelayerChainConfig{ + Type: "cosmos", + Value: CosmosRelayerChainConfigValue{ + CosmosRelayerChainConfigValue: cosmosRelayerChainConfig.Value, + KeyDir: "/home/relayer/.relayer/keys/" + cfg.ChainID, + MinGasAmount: 1000000, + CoinType: coinType, + }, + } + if relayerAccounts != nil { + key := relayerAccounts[cfg.Name] + archRelayerChainConfig = &CosmosRelayerChainConfig{ + Type: "cosmos", + Value: CosmosRelayerChainConfigValue{ + CosmosRelayerChainConfigValue: cosmosRelayerChainConfig.Value, + KeyDir: "/home/relayer/.relayer/keys/" + cfg.ChainID, + MinGasAmount: 1000000, + CoinType: coinType, + Key: key, + }, + } + } + jsonBytes, err := json.Marshal(archRelayerChainConfig) + if err != nil { + return nil, err + } + return jsonBytes, nil + + default: + if relayerAccounts != nil { + ICONRelayerChainConfig := ChainConfigToICONRemoteRelayerRemoteChainConfig(cfg, keyName, rpcAddr, grpcAddr, relayerAccounts["icon"]) + jsonBytes, err := json.Marshal(ICONRelayerChainConfig) + if err != nil { + return nil, err + } + return jsonBytes, nil + } + ICONRelayerChainConfig := ChainConfigToICONRelayerChainConfig(cfg, keyName, rpcAddr, grpcAddr) + jsonBytes, err := json.Marshal(ICONRelayerChainConfig) + if err != nil { + return nil, err + } + return jsonBytes, nil + + } +} + +func (RemoteCommander) DefaultContainerImage() string { + return DefaultContainerImage +} + +func (RemoteCommander) DefaultContainerVersion() string { + return DefaultContainerVersion +} + +func (RemoteCommander) ParseAddKeyOutput(stdout, stderr string) (ibc.Wallet, error) { + var wallet WalletModel + err := json.Unmarshal([]byte(stdout), &wallet) + rlyWallet := NewWallet("", wallet.Address, wallet.Mnemonic) + return rlyWallet, err +} + +func (RemoteCommander) ParseRestoreKeyOutput(stdout, stderr string) string { + return strings.Replace(stdout, "\n", "", 1) +} + +func (c RemoteCommander) ParseGetChannelsOutput(stdout, stderr string) ([]ibc.ChannelOutput, error) { + var channels []ibc.ChannelOutput + channelSplit := strings.Split(stdout, "\n") + for _, channel := range channelSplit { + if strings.TrimSpace(channel) == "" { + continue + } + if strings.HasPrefix(channel, "{") { + var channelOutput ibc.ChannelOutput + err := json.Unmarshal([]byte(channel), &channelOutput) + if err != nil { + c.log.Error("Failed to parse channels json", zap.Error(err)) + continue + } + channels = append(channels, channelOutput) + } + } + + return channels, nil +} + +func (c RemoteCommander) ParseGetConnectionsOutput(stdout, stderr string) (ibc.ConnectionOutputs, error) { + var connections ibc.ConnectionOutputs + for _, connection := range strings.Split(stdout, "\n") { + if strings.TrimSpace(connection) == "" { + continue + } + + var connectionOutput ibc.ConnectionOutput + if err := json.Unmarshal([]byte(connection), &connectionOutput); err != nil { + c.log.Error( + "Error parsing connection json", + zap.Error(err), + ) + + continue + } + connections = append(connections, &connectionOutput) + } + + return connections, nil +} + +func (c RemoteCommander) ParseGetClientsOutput(stdout, stderr string) (ibc.ClientOutputs, error) { + var clients ibc.ClientOutputs + for _, client := range strings.Split(stdout, "\n") { + if strings.TrimSpace(client) == "" { + continue + } + + var clientOutput ibc.ClientOutput + if err := json.Unmarshal([]byte(client), &clientOutput); err != nil { + c.log.Error( + "Error parsing client json", + zap.Error(err), + ) + + continue + } + clients = append(clients, &clientOutput) + } + + return clients, nil +} + +func (RemoteCommander) Init(homeDir string) []string { + path, _ := os.Getwd() + baseTestDir := filepath.Dir(path) + if _, err := os.Stat(baseTestDir + "/relayer/data/config/config.yaml"); err == nil { + err := os.RemoveAll(baseTestDir + "/relayer/data/config") + if err != nil { + log.Fatal("failed to remove file:", err) + } + } + if _, err := os.Stat(baseTestDir + "/relayer/data/ibc-icon"); err == nil { + err = os.Truncate(baseTestDir+"/relayer/data/ibc-icon/latest_height", 0) + if err != nil { + fmt.Println("Failed to cleanup icon height", err) + } + } + return []string{ + "rly", "config", "init", + } +} + +func (c RemoteCommander) CreateWallet(keyName, address, mnemonic string) ibc.Wallet { + return NewWallet(keyName, address, mnemonic) +} + +func cleanUpStoredHeight() { + path, _ := os.Getwd() + baseTestDir := filepath.Dir(path) + if _, err := os.Stat(baseTestDir + "/relayer/data/ibc-icon"); err == nil { + err = os.Truncate(baseTestDir+"/relayer/data/ibc-icon/latest_height", 0) + if err != nil { + fmt.Println("Failed to cleanup icon height", err) + } + } +} diff --git a/test/relayerfactory.go b/test/relayerfactory.go index 5f4e2ae3e..7ff20ed3e 100644 --- a/test/relayerfactory.go +++ b/test/relayerfactory.go @@ -14,7 +14,7 @@ import ( // RelayerFactory describes how to start a Relayer. type RelayerFactory interface { // Build returns a Relayer associated with the given arguments. - Build(t *testing.T, cli *client.Client, networkID string) ibc.Relayer + Build(t *testing.T, cli *client.Client, networkID string, populateKeys bool, relayAccounts map[string]string, useExistingConfig bool) ibc.Relayer // Name returns a descriptive name of the factory, // indicating details of the Relayer that will be built. @@ -47,8 +47,11 @@ func NewICONRelayerFactory(logger *zap.Logger, options ...relayer.RelayerOption) } // Build returns a relayer chosen depending on f.impl. -func (f builtinRelayerFactory) Build(t *testing.T, cli *client.Client, networkID string) ibc.Relayer { - return iconRelayer.NewICONRelayer(f.log, t.Name(), cli, networkID, f.options...) +func (f builtinRelayerFactory) Build(t *testing.T, cli *client.Client, networkID string, useExistingKeys bool, relayAccounts map[string]string, useExistingConfig bool) ibc.Relayer { + if !useExistingKeys { + return iconRelayer.NewICONRelayer(f.log, t.Name(), cli, networkID, f.options...) + } + return iconRelayer.NewICONRemoteRelayer(f.log, t.Name(), cli, networkID, relayAccounts, useExistingConfig, f.options...) } func (f builtinRelayerFactory) Name() string { diff --git a/test/test_setup.go b/test/test_setup.go index 94c91874c..470c14ebf 100644 --- a/test/test_setup.go +++ b/test/test_setup.go @@ -8,6 +8,7 @@ import ( "time" "github.com/docker/docker/client" + "github.com/icon-project/ibc-integration/test/chains" "github.com/icon-project/ibc-integration/test/internal/dockerutil" "github.com/icon-project/ibc-integration/test/internal/version" it "github.com/strangelove-ventures/interchaintest/v7" @@ -76,8 +77,7 @@ func StartChainPair( AddChain(dstChain). AddRelayer(relayerImpl, "r"). AddLink(InterchainLink{ - Chain1: srcChain, - Chain2: dstChain, + Chains: []chains.Chain{srcChain.(chains.Chain), dstChain.(chains.Chain)}, Relayer: relayerImpl, Path: testPathName, }) diff --git a/test/testsuite/e2e_suite.go b/test/testsuite/e2e_suite.go index 9c540933b..51570e978 100644 --- a/test/testsuite/e2e_suite.go +++ b/test/testsuite/e2e_suite.go @@ -2,13 +2,26 @@ package testsuite import ( "context" + "fmt" + "strings" + "time" + interchaintest "github.com/icon-project/ibc-integration/test" "github.com/icon-project/ibc-integration/test/chains" "github.com/strangelove-ventures/interchaintest/v7/ibc" ) +const ( + IconChainName = "icon" + CentauriChainName = "centauri" + ArchwayChainName = "archway" + CentauriIconRelayPath = "centauri-icon" + CentauriArchwayRelayPath = "centauri-archway" +) + func (s *E2ETestSuite) SetupXCall(ctx context.Context, portId string, duration int) error { - chainA, chainB := s.GetChains() + createdChains := s.GetChains() + chainA, chainB := createdChains[0], createdChains[1] if err := chainA.SetupXCall(ctx, portId, interchaintest.XCallOwnerAccount); err != nil { return err } @@ -57,7 +70,8 @@ func (s *E2ETestSuite) SetupChainsAndRelayer(ctx context.Context, channelOpts .. eRep := s.GetRelayerExecReporter() pathName := s.GeneratePathName() - chainA, chainB := s.GetChains() + createdChains := s.GetChains() + chainA, chainB := createdChains[0], createdChains[1] s.Require().NoErrorf(relayer.GeneratePath(ctx, eRep, chainA.(ibc.Chain).Config().ChainID, chainB.(ibc.Chain).Config().ChainID, pathName), "Error on generating path, %v", err) err = relayer.CreateClients(ctx, eRep, pathName, ibc.CreateClientOptions{ @@ -69,3 +83,67 @@ func (s *E2ETestSuite) SetupChainsAndRelayer(ctx context.Context, channelOpts .. s.Require().NoError(s.StartRelayer(relayer, pathName)) return relayer } + +func getIconChain(chains []chains.Chain) chains.Chain { + for _, chain := range chains { + if chain.(ibc.Chain).Config().Name == IconChainName { + return chain + } + } + return nil +} + +func getCentauriChain(chains []chains.Chain) chains.Chain { + for _, chain := range chains { + if chain.(ibc.Chain).Config().Name == CentauriChainName { + return chain + } + } + return nil +} + +func getArchwayChain(chains []chains.Chain) chains.Chain { + for _, chain := range chains { + if chain.(ibc.Chain).Config().Name == ArchwayChainName { + return chain + } + } + return nil +} +func (s *E2ETestSuite) SetupICS20ChainsAndRelayer(ctx context.Context, channelOpts ...func(*ibc.CreateChannelOptions)) ibc.Relayer { + relayer, err := s.SetupICS20Relayer(ctx) + s.Require().NoErrorf(err, "Error while configuring relayer %v", err) + if !s.cfg.RelayerConfig.UseExistingConfig { + eRep := s.GetRelayerExecReporter() + relayChains := s.GetChains() + iconChain := getIconChain(relayChains) + archwayChain := getArchwayChain(relayChains) + centauriChain := getCentauriChain(relayChains) + s.Require().NoErrorf(relayer.GeneratePath(ctx, eRep, iconChain.(ibc.Chain).Config().ChainID, centauriChain.(ibc.Chain).Config().ChainID, CentauriIconRelayPath), "Error on generating path, %v", err) + s.Require().NoErrorf(relayer.GeneratePath(ctx, eRep, archwayChain.(ibc.Chain).Config().ChainID, centauriChain.(ibc.Chain).Config().ChainID, CentauriArchwayRelayPath), "Error on generating path, %v", err) + time.Sleep(4 * time.Second) + for _, pathName := range []string{CentauriIconRelayPath, CentauriArchwayRelayPath} { + trustingPeriod := "5040m" + if strings.Contains(pathName, "archway") { + trustingPeriod = "500h" + } + err = relayer.CreateClients(ctx, eRep, pathName, ibc.CreateClientOptions{ + TrustingPeriod: trustingPeriod, + }) + time.Sleep(30 * time.Second) + s.Require().NoErrorf(err, "Error while creating client relayer : %s, %v", pathName, err) + s.Require().NoError(relayer.CreateConnections(ctx, eRep, pathName)) + time.Sleep(60 * time.Second) + s.Require().NoError(relayer.CreateChannel(ctx, eRep, pathName, ibc.CreateChannelOptions{ + SourcePortName: "transfer", + DestPortName: "transfer", + })) + if err != nil { + fmt.Println(err) + } + } + } + + s.Require().NoError(s.StartRelayer(relayer, CentauriIconRelayPath)) + return relayer +} diff --git a/test/testsuite/integration_suite.go b/test/testsuite/integration_suite.go index dd8a27093..0ec41bc36 100644 --- a/test/testsuite/integration_suite.go +++ b/test/testsuite/integration_suite.go @@ -22,7 +22,8 @@ import ( ) func (s *E2ETestSuite) SetupMockDApp(ctx context.Context, portId string) error { - chainA, chainB := s.GetChains() + createdChains := s.GetChains() + chainA, chainB := createdChains[0], createdChains[1] ctx = context.WithValue(ctx, chains.ContractName{}, chains.ContractName{ContractName: "mockdapp"}) ibcHostChainA := chainA.GetIBCAddress("ibc") ctx = context.WithValue(ctx, chains.InitMessageKey("init-msg"), chains.InitMessage{ diff --git a/test/testsuite/relayer/relayer.go b/test/testsuite/relayer/relayer.go index 193c33122..cccafeb54 100644 --- a/test/testsuite/relayer/relayer.go +++ b/test/testsuite/relayer/relayer.go @@ -21,6 +21,10 @@ type Config struct { Tag string `mapstructure:"tag"` // Image is the image that should be used for the relayer. Image string `mapstructure:"image"` + + UseExistingKeys bool `mapstructure:"use_existing_keys"` + UseExistingConfig bool `mapstructure:"use_existing_config"` + RelayAccounts map[string]string `mapstructure:"keys"` } // New returns an implementation of ibc.Relayer depending on the provided RelayerType. @@ -28,9 +32,8 @@ func New(t *testing.T, cfg Config, logger *zap.Logger, dockerClient *dockerclien optionDocker := relayer.CustomDockerImage(cfg.Image, cfg.Tag, rlyRelayerUser) flagOptions := relayer.StartupFlags("-p", "events") // relayer processes via events imageOptions := relayer.ImagePull(false) - relayerFactory := interchaintest.NewICONRelayerFactory(logger, optionDocker, flagOptions, imageOptions) - return relayerFactory.Build(t, dockerClient, network) + return relayerFactory.Build(t, dockerClient, network, cfg.UseExistingKeys, cfg.RelayAccounts, cfg.UseExistingConfig) } // RelayerMap is a mapping from test names to a relayer set for that test. diff --git a/test/testsuite/sample-config-archway.yaml b/test/testsuite/sample-config-archway.yaml index 89194917f..e38e80aa6 100644 --- a/test/testsuite/sample-config-archway.yaml +++ b/test/testsuite/sample-config-archway.yaml @@ -30,7 +30,7 @@ chains: chain_id: archway-1 image: repository: archwaynetwork/archwayd - version: sha-8f53ac8 + version: v0.5.1 uid_gid: "" bin: archwayd bech32_prefix: archway diff --git a/test/testsuite/sample-config-ics20.yaml b/test/testsuite/sample-config-ics20.yaml new file mode 100644 index 000000000..b4614bdd3 --- /dev/null +++ b/test/testsuite/sample-config-ics20.yaml @@ -0,0 +1,117 @@ +chains: + - name: icon + version: "3" + environment: remote + nid: "3" + rpc_uri: https://tt.net.solidwallet.io/jvm-rpc/api/v3/ + keystore_file: godWallet.json + keystore_password: gochain + contracts_path: "$BASE_PATH/artifacts/icon" + # path containing cofig for the chains such as keys details + config_path: "$BASE_PATH/test/chains/icon/data" + # fund receiver, to get more accurate calculation in test cases + receiver: hxac1f0b75d2c05692fdea027fdd0d8475650c72d6 + # sender address + sender: hxb6b5791be0b5ef67063b3c10b840fb81514db2fd + chain_config: + type: icon + name: icon + chain_id: ibc-icon + bech32_prefix: hx + bin: "/goloop/bin/goloop" + denom: icx + image: + repository: iconloop/goloop-icon + version: latest + uid_gid: "" + contracts: + ibc: "$BASE_PATH/artifacts/icon/ibc-latest.jar" + client: "$BASE_PATH/artifacts/icon/tendermint-latest.jar" + xcall: "$BASE_PATH/artifacts/icon/xcall-latest.jar" + connection: "$BASE_PATH/artifacts/icon/xcall-connection-latest.jar" + dapp: "$BASE_PATH/artifacts/icon/dapp-multi-protocol-latest.jar" + mockdapp: "$BASE_PATH/artifacts/icon/mockapp-latest.jar" + ics20app: "$BASE_PATH/artifacts/icon/ics20-0.1.0-optimized.jar" + ibc_ics: "$BASE_PATH/artifacts/icon/ibc-0.1.0-optimized.jar" + ibc_ics_client: "$BASE_PATH/artifacts/icon/tendermint-0.1.0-optimized.jar" + ibc_ics20_client: "$BASE_PATH/artifacts/icon/ics-08-tendermint-0.1.0-optimized.jar" + # ics20 app deployed address, should be used along with use_existing_config to re-use the existing setup + ics20_app: "cx95e8df0b63b6f615e984894250f438730353de78" + - name: centauri + version: "3" + environment: remote + contracts_path: "$BASE_PATH/artifacts/centauri" + config_path: "$BASE_PATH/test/chains/cosmos/data" + keystore_file: relayer + keystore_password: test + rpc_uri: https://tt.net.solidwallet.io:443/centauri2-rpc/ + receiver: centauri16tv5rylr402xcu4yqvtk945q6mtzatf0p5hnet + chain_config: + type: cosmos + name: centauri + chain_id: test-1 + image: + repository: composable-centauri + version: latest + uid_gid: "" + bin: centaurid + bech32_prefix: centauri + denom: stake + coin_type: 118 + gas_prices: 0.00stake + gas_adjustment: 1.3 + trusting_period: 508h + no_host_mount: false + nid: "3" + contracts: + ibc: "$BASE_PATH/artifacts/archway/cw_ibc_core_latest.wasm" + client: "$BASE_PATH/artifacts/archway/cw_icon_light_client_latest.wasm" + xcall: "$BASE_PATH/artifacts/archway/cw_xcall_latest.wasm" + connection: "$BASE_PATH/artifacts/archway/cw_xcall_ibc_connection_latest.wasm" + dapp: "$BASE_PATH/artifacts/archway/cw_mock_dapp_multi.wasm" + mockdapp: "$BASE_PATH/artifacts/archway/cw_mock_ibc_dapp.wasm" + - name: archway + version: "3" + environment: remote + contracts_path: "$BASE_PATH/artifacts/archway" + config_path: "$BASE_PATH/test/chains/archway/data" + keystore_file: relayer + keystore_password: test + rpc_uri: https://tt.net.solidwallet.io:443/archway-rpc + receiver: archway1t2tljzac36aapdmlxr9688s7qez8ctft8ehwsm + chain_config: + type: cosmos + name: archway + chain_id: localnet-1 + image: + repository: ghcr.io/archway-network/archwayd-dev + version: v6.0.1-arm64v8 + uid_gid: "" + bin: archwayd + bech32_prefix: archway + denom: stake + coin_type: 118 + gas_prices: 0.00stake + gas_adjustment: 1.3 + trusting_period: 508h + no_host_mount: false + nid: "3" + contracts: + ibc: "$BASE_PATH/artifacts/archway/cw_ibc_core_latest.wasm" + client: "$BASE_PATH/artifacts/archway/cw_icon_light_client_latest.wasm" + xcall: "$BASE_PATH/artifacts/archway/cw_xcall_latest.wasm" + connection: "$BASE_PATH/artifacts/archway/cw_xcall_ibc_connection_latest.wasm" + dapp: "$BASE_PATH/artifacts/archway/cw_mock_dapp_multi.wasm" + mockdapp: "$BASE_PATH/artifacts/archway/cw_mock_ibc_dapp.wasm" + ibc_ics20_client: "$BASE_PATH/artifacts/centauri/cw_wasm_light_client_icon.wasm" +relayer: + image: relayer + tag: latest + use_existing_keys: true + # uses existing config in specified path /home/User/IBC-integration/test/relayer/data/config/config.yaml + use_existing_config: true + keys: + # keys to be used in relayer + icon: godwallet:gochain + centauri: default + archway: fd diff --git a/test/testsuite/testconfig/testconfig.go b/test/testsuite/testconfig/testconfig.go index 567585f4e..e15befd58 100644 --- a/test/testsuite/testconfig/testconfig.go +++ b/test/testsuite/testconfig/testconfig.go @@ -22,6 +22,11 @@ type Chain struct { Name string `mapstructure:"name"` version string `mapstructure:"version"` Environment string `mapstructure:"environment"` + RPCUri string `mapstructure:"rpc_uri"` + Sender string `mapstructure:"sender"` + Receiver string `mapstructure:"receiver"` + ContractsPath string `mapstructure:"contracts_path"` + ConfigPath string `mapstructure:"config_path"` ChainConfig chains.ChainConfig `mapstructure:"chain_config"` URL string `mapstructure:"url"` NID string `mapstructure:"nid"` @@ -45,8 +50,7 @@ type TestConfig struct { } type ChainOptions struct { - ChainAConfig *Chain - ChainBConfig *Chain + ChainConfig *[]Chain } // ChainOptionConfiguration enables arbitrary configuration of ChainOptions. @@ -60,8 +64,7 @@ func DefaultChainOptions() (*ChainOptions, error) { return nil, err } return &ChainOptions{ - ChainAConfig: &tc.ChainConfigs[0], - ChainBConfig: &tc.ChainConfigs[1], + ChainConfig: &tc.ChainConfigs, }, nil } diff --git a/test/testsuite/testsuite.go b/test/testsuite/testsuite.go index d3bedaf1c..36afb2762 100644 --- a/test/testsuite/testsuite.go +++ b/test/testsuite/testsuite.go @@ -3,8 +3,10 @@ package testsuite import ( "context" "fmt" - test "github.com/strangelove-ventures/interchaintest/v7/testutil" "strconv" + "time" + + test "github.com/strangelove-ventures/interchaintest/v7/testutil" interchaintest "github.com/icon-project/ibc-integration/test" "github.com/icon-project/ibc-integration/test/chains/cosmos" @@ -68,7 +70,8 @@ func newPath(chainA, chainB chains.Chain) path { // SetupRelayer sets up the relayer, creates interchain networks, builds chains, and starts the relayer. // It returns a Relayer interface and an error if any. func (s *E2ETestSuite) SetupRelayer(ctx context.Context) (ibc.Relayer, error) { - chainA, chainB := s.GetChains() + createdChains := s.GetChains() + chainA, chainB := createdChains[0], createdChains[1] r := relayer.New(s.T(), s.cfg.RelayerConfig, s.logger, s.DockerClient, s.network) //pathName := s.GeneratePathName() ic := interchaintest.NewInterchain(). @@ -76,8 +79,7 @@ func (s *E2ETestSuite) SetupRelayer(ctx context.Context) (ibc.Relayer, error) { AddChain(chainB.(ibc.Chain)). AddRelayer(r, "r"). AddLink(interchaintest.InterchainLink{ - Chain1: chainA.(ibc.Chain), - Chain2: chainB.(ibc.Chain), + Chains: createdChains, Relayer: r, //Path: pathName, }) @@ -122,6 +124,72 @@ func (s *E2ETestSuite) SetupRelayer(ctx context.Context) (ibc.Relayer, error) { return r, err } +func (s *E2ETestSuite) SetupICS20Relayer(ctx context.Context) (ibc.Relayer, error) { + createdChains := s.GetChains() + r := relayer.New(s.T(), s.cfg.RelayerConfig, s.logger, s.DockerClient, s.network) + ic := interchaintest.NewInterchain() + var iconChain, centauriChain, archwayChain chains.Chain + for _, chain := range createdChains { + if chain.(ibc.Chain).Config().Name == "icon" { + iconChain = chain + } else if chain.(ibc.Chain).Config().Name == "centauri" { + centauriChain = chain + } else if chain.(ibc.Chain).Config().Name == "archway" { + archwayChain = chain + } + ic.AddChain(chain.(ibc.Chain)) + } + ic.AddRelayer(r, "r"). + AddLink( + interchaintest.InterchainLink{ + Chains: []chains.Chain{iconChain, centauriChain}, + Relayer: r, + Path: CentauriIconRelayPath, + }, + ). + AddLink( + interchaintest.InterchainLink{ + Chains: []chains.Chain{centauriChain, archwayChain}, + Relayer: r, + Path: CentauriArchwayRelayPath, + }, + ) + eRep := s.GetRelayerExecReporter() + buildOptions := interchaintest.InterchainBuildOptions{ + TestName: s.T().Name(), + Client: s.DockerClient, + NetworkID: s.network, + BlockDatabaseFile: interchaintest.DefaultBlockDatabaseFilepath(), + SkipPathCreation: true, + } + if err := ic.BuildRemoteChains(ctx, eRep, buildOptions); err != nil { + return nil, err + } + + for _, chain := range createdChains { + if _, err := chain.SetupIBCICS20(ctx, interchaintest.IBCOwnerAccount); err != nil { + return nil, err + } + } + + if !s.cfg.RelayerConfig.UseExistingConfig { + if err := ic.BuildRemoteRelayer(ctx, eRep, buildOptions); err != nil { + return nil, err + } + } + s.startRelayerFn = func(relayer ibc.Relayer, pathName string) error { + if err := relayer.StartRelayer(ctx, eRep, pathName); err != nil { + return fmt.Errorf("failed to start relayer: %s", err) + } + // give some time to start the relayer + time.Sleep(2 * time.Second) + return nil + } + + s.relayer = r + return r, nil +} + func (s *E2ETestSuite) buildWallets(ctx context.Context, chainA chains.Chain, chainB chains.Chain) error { if _, err := chainA.BuildWallets(ctx, interchaintest.IBCOwnerAccount); err != nil { return err @@ -147,7 +215,8 @@ func (s *E2ETestSuite) buildWallets(ctx context.Context, chainA chains.Chain, ch func (s *E2ETestSuite) DeployXCallMockApp(ctx context.Context, port string) error { testcase := ctx.Value("testcase").(string) connectionKey := fmt.Sprintf("connection-%s", testcase) - chainA, chainB := s.GetChains() + createdChains := s.GetChains() + chainA, chainB := createdChains[0], createdChains[1] if err := chainA.DeployXCallMockApp(ctx, chains.XCallConnection{ KeyName: interchaintest.XCallOwnerAccount, CounterpartyNid: chainB.(ibc.Chain).Config().ChainID, @@ -193,7 +262,8 @@ func (s *E2ETestSuite) GetPathName(idx int64) string { // generatePath generates the path name using the test suites name func (s *E2ETestSuite) generatePath(ctx context.Context, relayer ibc.Relayer) string { - chainA, chainB := s.GetChains() + createdChains := s.GetChains() + chainA, chainB := createdChains[0], createdChains[1] chainAID := chainA.(ibc.Chain).Config().ChainID chainBID := chainB.(ibc.Chain).Config().ChainID @@ -213,31 +283,51 @@ func (s *E2ETestSuite) UpdateClients(ctx context.Context, relayer ibc.Relayer, p // GetChains returns two chains that can be used in a test. The pair returned // is unique to the current test being run. Note: this function does not create containers. -func (s *E2ETestSuite) GetChains(chainOpts ...testconfig.ChainOptionConfiguration) (chains.Chain, chains.Chain) { +func (s *E2ETestSuite) GetChains(chainOpts ...testconfig.ChainOptionConfiguration) []chains.Chain { if s.paths == nil { s.paths = map[string]path{} } - path, ok := s.paths[s.T().Name()] - if ok { - return path.chainA, path.chainB + preCreatedChains := []chains.Chain{} + for i := 0; i <= 10; i++ { + pathKey := fmt.Sprintf("%s-%d", s.T().Name(), i) + path, ok := s.paths[pathKey] + if ok { + if len(preCreatedChains) == 0 { + preCreatedChains = append(preCreatedChains, path.chainA, path.chainB) + } else { + preCreatedChains = append(preCreatedChains, path.chainB) + } + } else { + if len(preCreatedChains) != 0 { + return preCreatedChains + } + } } - chainOptions, err := testconfig.DefaultChainOptions() s.Require().NoError(err) for _, opt := range chainOpts { opt(chainOptions) } - chainA, chainB := s.createChains(chainOptions) - path = newPath(chainA, chainB) - s.paths[s.T().Name()] = path - return path.chainA, path.chainB + createdChains := s.createChains(chainOptions) + for index := range createdChains { + if index < len(createdChains)-1 { + path := newPath(createdChains[index], createdChains[index+1]) + pathKey := fmt.Sprintf("%s-%d", s.T().Name(), index) + s.paths[pathKey] = path + } + } + // chainA, chainB := createdChains[0], createdChains[1] + // path = newPath(chainA, chainB) + // s.paths[s.T().Name()] = path + return createdChains } // GetRelayerWallets returns the relayer wallets associated with the chains. func (s *E2ETestSuite) GetRelayerWallets(relayer ibc.Relayer) (ibc.Wallet, ibc.Wallet, error) { - chainA, chainB := s.GetChains() + createdChains := s.GetChains() + chainA, chainB := createdChains[0], createdChains[1] chainARelayerWallet, ok := relayer.GetWallet(chainA.(ibc.Chain).Config().ChainID) if !ok { return nil, nil, fmt.Errorf("unable to find chain A relayer wallet") @@ -266,7 +356,7 @@ func (s *E2ETestSuite) StopRelayer(ctx context.Context, relayer ibc.Relayer) err // createChains creates two separate chains in docker containers. // test and can be retrieved with GetChains. -func (s *E2ETestSuite) createChains(chainOptions *testconfig.ChainOptions) (chains.Chain, chains.Chain) { +func (s *E2ETestSuite) createChains(chainOptions *testconfig.ChainOptions) []chains.Chain { client, network := interchaintest.DockerSetup(s.T()) t := s.T() @@ -276,38 +366,65 @@ func (s *E2ETestSuite) createChains(chainOptions *testconfig.ChainOptions) (chai logger := zaptest.NewLogger(t) - chainA, _ := buildChain(logger, t.Name(), chainOptions.ChainAConfig) + chains := []chains.Chain{} + + for _, config := range *chainOptions.ChainConfig { + chain, _ := buildChain(logger, t.Name(), s, config) + chains = append(chains, + chain, + ) + } - chainB, _ := buildChain(logger, t.Name(), chainOptions.ChainBConfig) + // chainA, _ := buildChain(logger, t.Name(), s, chainOptions.ChainAConfig) - // this is intentionally called after the interchaintest.DockerSetup function. The above function registers a + // chainB, _ := buildChain(logger, t.Name(), s, chainOptions.ChainBConfig) + + // this is intentionally called after the setup.DockerSetup function. The above function registers a // cleanup task which deletes all containers. By registering a cleanup function afterwards, it is executed first // this allows us to process the logs before the containers are removed. //t.Cleanup(func() { // diagnostics.Collect(t, s.DockerClient, chainOptions) //}) - - return chainA, chainB + return chains } -func buildChain(log *zap.Logger, testName string, cfg *testconfig.Chain) (chains.Chain, error) { +func buildChain(log *zap.Logger, testName string, s *E2ETestSuite, cfg testconfig.Chain) (chains.Chain, error) { var ( chain chains.Chain err error ) ibcChainConfig := cfg.ChainConfig.GetIBCChainConfig(&chain) - switch cfg.ChainConfig.Type { - case "icon": - chain = icon.NewIconLocalnet(testName, log, ibcChainConfig, chains.DefaultNumValidators, chains.DefaultNumFullNodes, cfg.Contracts) - return chain, nil - case "cosmos", "wasm": - enc := cosmos.DefaultEncoding() - ibcChainConfig.EncodingConfig = &enc - chain, err = cosmos.NewCosmosLocalnet(testName, log, ibcChainConfig, chains.DefaultNumValidators, chains.DefaultNumFullNodes, cfg.KeystorePassword, cfg.Contracts) - return chain, err + switch cfg.Environment { + case "local": + switch cfg.ChainConfig.Type { + case "icon": + chain = icon.NewIconLocalnet(testName, log, ibcChainConfig, chains.DefaultNumValidators, chains.DefaultNumFullNodes, cfg.Contracts) + return chain, nil + case "wasm", "cosmos": + enc := cosmos.DefaultEncoding() + ibcChainConfig.EncodingConfig = &enc + chain, err = cosmos.NewCosmosLocalnet(testName, log, ibcChainConfig, chains.DefaultNumValidators, chains.DefaultNumFullNodes, cfg.KeystorePassword, cfg.Contracts) + return chain, err + default: + return nil, fmt.Errorf("unexpected error, unknown chain type: %s for chain: %s in environment : %s", cfg.ChainConfig.Type, cfg.Name, cfg.Environment) + } + case "remote": + switch cfg.ChainConfig.Type { + case "icon": + chain = icon.NewIconRemotenet(testName, log, ibcChainConfig, s.DockerClient, s.network, cfg) + return chain, nil + case "wasm", "cosmos": + enc := cosmos.DefaultEncoding() + ibcChainConfig.EncodingConfig = &enc + chain, err = cosmos.NewCosmosRemotenet(testName, log, ibcChainConfig, s.DockerClient, s.network, cfg.KeystorePassword, cfg) + return chain, err + default: + return nil, fmt.Errorf("unexpected error, unknown chain type: %s for chain: %s in environment : %s", cfg.ChainConfig.Type, cfg.Name, cfg.Environment) + } default: - return nil, fmt.Errorf("unexpected error, unknown chain type: %s for chain: %s", cfg.ChainConfig.Type, cfg.Name) + return nil, fmt.Errorf("unexpected error, unknown chain type: %s for chain: %s in environment : %s", cfg.ChainConfig.Type, cfg.Name, cfg.Environment) } + } // GetRelayerExecReporter returns a testreporter.RelayerExecReporter instances